Since we can now store proofs as orphans, it is possible to register the local proof before IBD is finished. When the blocks containing the stakes are known, the proof will be unorphaned.
Add a test for a node started with an orphan proof.
Differential D9742
[avalanche] register local proof at first tip update PiRK on Jul 6 2021, 14:21. Authored by
Details
Since we can now store proofs as orphans, it is possible to register the local proof before IBD is finished. When the blocks containing the stakes are known, the proof will be unorphaned. Add a test for a node started with an orphan proof. ninja all check-all
Diff Detail
Event TimelineComment Actions @bot build-tsan build-win64 build-without-cli build-without-bip70 build-without-wallet build-without-zmq build-debug build-linux32 Comment Actions rebase, no changes. Yesterday I had rare intermittent failures in various non-avalanche functional tests, but today, after starting from a fresh build folder, I can't reproduce the issue. Comment Actions nevermind. I insisted and managed to reproduce the issue: for i in {1..10}; do ninja && ninja check-functional; done 5 tests failing out of 10 runs. Never the same one. The failure seems happen when the node is started, which makes sense as we add code at the end of Init. FailedToStartError stdout: 2021-07-07T12:30:32.209000Z TestFramework (INFO): Initializing test directory /home/pierre/dev/bitcoin-abc/build/test/tmp/test_runner_₿₵_🏃_20210707_142847/rpc_deriveaddresses_526 2021-07-07T12:30:32.471000Z TestFramework (ERROR): Unexpected exception caught during testing Traceback (most recent call last): File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 482, in start_nodes node.wait_for_rpc_connection() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 296, in wait_for_rpc_connection raise FailedToStartError(self._node_msg( test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 126, in main self.setup() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 258, in setup self.setup_network() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 359, in setup_network self.setup_nodes() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 384, in setup_nodes self.start_nodes() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 485, in start_nodes self.stop_nodes() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 501, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 413, in stop_node self.stop(wait=wait) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 727, in __call__ return self.cli.send_cli(self.command, *args, **kwargs) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 799, in send_cli raise subprocess.CalledProcessError( subprocess.CalledProcessError: Command '/home/pierre/dev/bitcoin-abc/build/src/bitcoin-cli' returned non-zero exit status 1. 2021-07-07T12:30:32.521000Z TestFramework (INFO): Stopping nodes [node 0] Cleaning up leftover process stderr: Traceback (most recent call last): File "/home/pierre/dev/bitcoin-abc/test/functional/rpc_deriveaddresses.py", line 109, in <module> DeriveaddressesTest().main() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 147, in main exit_code = self.shutdown() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 273, in shutdown self.stop_nodes() File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_framework.py", line 501, in stop_nodes node.stop_node(wait=wait, wait_until_stopped=False) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 413, in stop_node self.stop(wait=wait) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 727, in __call__ return self.cli.send_cli(self.command, *args, **kwargs) File "/home/pierre/dev/bitcoin-abc/test/functional/test_framework/test_node.py", line 799, in send_cli raise subprocess.CalledProcessError( subprocess.CalledProcessError: Command '/home/pierre/dev/bitcoin-abc/build/src/bitcoin-cli' returned non-zero exit status 1. Comment Actions We have established that the failures I'm seeing are unrelated to this diff, as I can reproduce them on master.
Comment Actions Need to work on the error message and if possible figure out how to not duplicate all the stateless proof verification tests again (already done in Processor::MakeProcessor) Comment Actions register the proof at tip update rather than init, like before. We just no longer to need to wait for IBD to finish. And we don't need a flag, as we can just call registerProof which returns immediateley if the proof exists.
|