-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add replacement cycling #372
add replacement cycling #372
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mplsgrant are you able to get this scenario running in warnet? I got a connect_nodes error at first then rebased on main, now I get a sync_all error:
│ 2024-06-07T14:32:33+0000 - INFO - Traceback (most recent call last): │
│ 2024-06-07T14:32:33+0000 - INFO - File "/root/warnet/src/test_framework/test_framework.py", line 131, in main │
│ 2024-06-07T14:32:33+0000 - INFO - self.run_test() │
│ 2024-06-07T14:32:33+0000 - INFO - File "/root/warnet/src/scenarios/replacement_cycling.py", line 430, in run_test │
│ 2024-06-07T14:32:33+0000 - INFO - self.generatetoaddress(self.nodes[0], nblocks=101, │
│ 2024-06-07T14:32:33+0000 - INFO - File "/root/warnet/src/test_framework/test_framework.py", line 692, in generatetoaddress │
│ 2024-06-07T14:32:33+0000 - INFO - sync_fun() if sync_fun else self.sync_all() │
│ 2024-06-07T14:32:33+0000 - INFO - ^^^^^^^^^^^^^^^ │
│ 2024-06-07T14:32:33+0000 - INFO - File "/root/warnet/src/test_framework/test_framework.py", line 746, in sync_all │
│ 2024-06-07T14:32:33+0000 - INFO - self.sync_blocks(nodes) │
│ 2024-06-07T14:32:33+0000 - INFO - File "/root/warnet/src/test_framework/test_framework.py", line 715, in sync_blocks │
│ 2024-06-07T14:32:33+0000 - INFO - assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
src/scenarios/replacement-cycling.py
Outdated
@@ -0,0 +1,439 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file needs to be named with underscore not hyphen. rpc_test.py fails locally for me without that fix, dunno why CI is ok with it 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the scenarios test would have caught that.
Yes, we got a version of it working just fine on this branch. There shouldn't be any differences that |
f19a1d6
to
7bfe435
Compare
I rebased this. |
b62cda2
to
43a2d72
Compare
Rebased on main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a CI test for this? I suspect it may fail, as I find locally:
2024-06-21T10:29:59+0000 - INFO - Started server
* Serving Flask app 'warnet.server'
* Debug mode: on
2024-06-21T10:30:00+0000 - INFO - Logging started
2024-06-21T10:30:00+0000 - INFO - Started server
2024-06-21T10:30:00+0000 - WARNING - * Debugger is active!
2024-06-21T10:30:06+0000 - DEBUG - {'jsonrpc': '2.0', 'method': 'scenarios_run', 'params': {'scenario': 'replacement_cycling', 'additional_args': [], 'network': 'warnet'}, 'id': 1}
2024-06-21T10:30:06+0000 - DEBUG - Running ['/usr/local/bin/python3', '/root/warnet/src/scenarios/replacement_cycling.py', '--network=warnet']
2024-06-21T10:30:06+0000 - INFO - Unexpected exception caught during testing
2024-06-21T10:30:06+0000 - INFO - Traceback (most recent call last):
2024-06-21T10:30:06+0000 - INFO - File "/root/warnet/src/test_framework/test_framework.py", line 130, in main
2024-06-21T10:30:06+0000 - INFO - self.setup()
2024-06-21T10:30:06+0000 - INFO - File "/root/warnet/src/warnet/test_framework_bridge.py", line 60, in setup
2024-06-21T10:30:06+0000 - INFO - self.warnet = Warnet.from_network(self.options.network)
2024-06-21T10:30:06+0000 - INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-21T10:30:06+0000 - INFO - File "/root/warnet/src/warnet/warnet.py", line 137, in from_network
2024-06-21T10:30:06+0000 - INFO - self.graph = networkx.read_graphml(
2024-06-21T10:30:06+0000 - INFO - ^^^^^^^^^^^^^^^^^^^^^^
2024-06-21T10:30:06+0000 - INFO - File "/usr/local/lib/python3.12/site-packages/networkx/utils/decorators.py", line 770, in func
2024-06-21T10:30:06+0000 - INFO - return argmap._lazy_compile(__wrapper)(*args, **kwargs)
2024-06-21T10:30:06+0000 - INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-21T10:30:06+0000 - INFO - File "<class 'networkx.utils.decorators.argmap'> compilation 5", line 3, in argmap_read_graphml_1
2024-06-21T10:30:06+0000 - INFO - import gzip
2024-06-21T10:30:06+0000 - INFO -
2024-06-21T10:30:06+0000 - INFO - File "/usr/local/lib/python3.12/site-packages/networkx/utils/decorators.py", line 193, in _open_file
2024-06-21T10:30:06+0000 - INFO - fobj = _dispatch_dict[ext](path, mode=mode)
2024-06-21T10:30:06+0000 - INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-06-21T10:30:06+0000 - INFO - FileNotFoundError: [Errno 2] No such file or directory: '/root/.warnet/warnet/warnet/graph.graphml'
I can get it to run, but only if I run a manual warnet first. This I presume creates the config dir and copies the graph into it which this test is looking for.
Perhaps this test should be explicit about which graph it is using as is done in the other tests which would load and copy the graph correctly?
@willcl-ark Happy to add a CI for this. When the scenario failed locally, were these the steps you took? just start
just p &
warcli scenarios run replacement_cycling |
4a370b3
to
3754708
Compare
Author: Greg Sanders <[email protected]> Date: Wed May 29 11:30:39 2024 -0400
delint fix spelling slightly modify some log entries
3754708
to
4325583
Compare
Closing in favor of #422 |
Draft
Want to make a CI test for this; waiting on #384
Issue
I can not run ariard's replacement cycling test in Warnet.
Cause
A number of the test framework components available in Bitcoin Core have not been ported into Warnet.
Solution
Add the replacement cycling test as a scenario.
Wins
The test runs without meaningful augmentation. This is great because it points us in a direction of copy/pasting tests that run today in Core's functional test framework. We can then augment the tests to work in realistic environments with lightning nodes and other future tank types.
Depends on
#371