Page MenuHomePhabricator

[avalanche] register our proof after IBD
ClosedPublic

Authored by PiRK on Mar 16 2021, 10:20.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCa3903ab998e7: [avalanche] register our proof after IBD
Summary

Use the updatedBlockTip signal to schedule the proof registration at first new block after IBD is finished.
Add a boolean flag to Processor to indicate that this should be done.

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mar 16 2021, 10:20

if proof validation fails due to missing UTXO, don't give up. Maybe the UTXO will be in a future block.

If we define a minimum coin age for a proof, we can probably stop doing this.

Tail of the build log:

[377/443] Running utility command for check-bitcoin-wallet_crypto_tests
[378/443] Running utility command for check-bitcoin-sync_tests
[379/443] bitcoin: testing sigencoding_tests
[380/443] Running utility command for check-bitcoin-sigencoding_tests
[381/443] bitcoin: testing torcontrol_tests
[382/443] Running utility command for check-bitcoin-torcontrol_tests
[383/443] bitcoin: testing scriptpubkeyman_tests
[384/443] bitcoin: testing timedata_tests
[385/443] Running utility command for check-bitcoin-scriptpubkeyman_tests
[386/443] bitcoin: testing streams_tests
[387/443] Running utility command for check-bitcoin-timedata_tests
[388/443] Running utility command for check-bitcoin-streams_tests
[389/443] bitcoin: testing undo_tests
[390/443] bitcoin: testing uint256_tests
[391/443] Running utility command for check-bitcoin-undo_tests
[392/443] Running utility command for check-bitcoin-uint256_tests
[393/443] bitcoin: testing radix_tests
[394/443] bitcoin: testing script_standard_tests
[395/443] Running utility command for check-bitcoin-radix_tests
[396/443] Running utility command for check-bitcoin-script_standard_tests
[397/443] bitcoin: testing schnorr_tests
[398/443] Running utility command for check-bitcoin-schnorr_tests
[399/443] bitcoin: testing blockstatus_tests
[400/443] Running utility command for check-bitcoin-blockstatus_tests
[401/443] bitcoin: testing versionbits_tests
[402/443] Running utility command for check-bitcoin-versionbits_tests
[403/443] bitcoin: testing script_tests
[404/443] bitcoin: testing wallet_tests
[405/443] bitcoin: testing cashaddr_tests
[406/443] Running utility command for check-bitcoin-script_tests
[407/443] Running utility command for check-bitcoin-wallet_tests
[408/443] Running utility command for check-bitcoin-cashaddr_tests
[409/443] bitcoin: testing validation_tests
[410/443] bitcoin: testing crypto_tests
[411/443] bitcoin: testing getarg_tests
[412/443] bitcoin: testing cuckoocache_tests
[413/443] Running utility command for check-bitcoin-getarg_tests
[414/443] bitcoin: testing validation_block_tests
[415/443] Running utility command for check-bitcoin-crypto_tests
[416/443] Running utility command for check-bitcoin-validation_tests
[417/443] Running utility command for check-bitcoin-cuckoocache_tests
[418/443] Running utility command for check-bitcoin-validation_block_tests
[419/443] bitcoin: testing blockcheck_tests
[420/443] Running utility command for check-bitcoin-blockcheck_tests
[421/443] bitcoin: testing monolith_opcodes_tests
[422/443] Running utility command for check-bitcoin-monolith_opcodes_tests
[423/443] bitcoin: testing skiplist_tests
[424/443] Running utility command for check-bitcoin-skiplist_tests
[425/443] bitcoin: testing op_reversebytes_tests
[426/443] Running utility command for check-bitcoin-op_reversebytes_tests
[427/443] bitcoin: testing transaction_tests
[428/443] Running utility command for check-bitcoin-transaction_tests
[429/443] bitcoin: testing coinselector_tests
[430/443] Running utility command for check-bitcoin-coinselector_tests
[431/443] bitcoin: testing coins_tests
[432/443] Running utility command for check-bitcoin-coins_tests
[433/443] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Tail of the build log:

wallet_import_rescan.py                          | ○ Skipped | 0 s
wallet_import_with_label.py                      | ○ Skipped | 0 s
wallet_importdescriptors.py                      | ○ Skipped | 0 s
wallet_importmulti.py                            | ○ Skipped | 0 s
wallet_importprunedfunds.py                      | ○ Skipped | 0 s
wallet_keypool.py                                | ○ Skipped | 0 s
wallet_keypool_topup.py                          | ○ Skipped | 0 s
wallet_labels.py                                 | ○ Skipped | 0 s
wallet_listreceivedby.py                         | ○ Skipped | 0 s
wallet_listsinceblock.py                         | ○ Skipped | 0 s
wallet_listtransactions.py                       | ○ Skipped | 0 s
wallet_multiwallet.py                            | ○ Skipped | 0 s
wallet_multiwallet.py --usecli                   | ○ Skipped | 0 s
wallet_reorgsrestore.py                          | ○ Skipped | 0 s
wallet_resendwallettransactions.py               | ○ Skipped | 0 s
wallet_txn_clone.py                              | ○ Skipped | 0 s
wallet_txn_clone.py --mineblock                  | ○ Skipped | 0 s
wallet_txn_doublespend.py                        | ○ Skipped | 0 s
wallet_txn_doublespend.py --mineblock            | ○ Skipped | 0 s
wallet_watchonly.py                              | ○ Skipped | 0 s
wallet_watchonly.py --usecli                     | ○ Skipped | 0 s
wallet_zapwallettxes.py                          | ○ Skipped | 0 s

ALL                                              | ✓ Passed  | 354 s (accumulated) 
Runtime: 75 s

----------------------------------------------------------------------
Ran 4 tests in 0.014s

OK

[147/404] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK
[148/404] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[162/404] Running seeder test suite
PASSED: seeder test suite
[166/404] Running pow test suite
PASSED: pow test suite
[173/404] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[174/404] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
In file included from /usr/include/boost/test/unit_test.hpp:19,
                 from ../../src/test/script_tests.cpp:30:
../../src/test/script_tests.cpp: In member function ‘void script_tests::script_build::test_method()’:
../../src/test/script_tests.cpp:540:22: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 BOOST_AUTO_TEST_CASE(script_build) {
                      ^~~~~~~~~~~~
[393/404] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-without-wallet failed with exit code 1

Tail of the build log:

[370/436] Running utility command for check-bitcoin-bip32_tests
[371/436] bitcoin: testing sync_tests
[372/436] Running utility command for check-bitcoin-addrman_tests
[373/436] Running utility command for check-bitcoin-sync_tests
[374/436] bitcoin: testing torcontrol_tests
[375/436] Running utility command for check-bitcoin-torcontrol_tests
[376/436] bitcoin: testing scriptpubkeyman_tests
[377/436] bitcoin: testing timedata_tests
[378/436] bitcoin: testing wallet_crypto_tests
[379/436] bitcoin: testing streams_tests
[380/436] Running utility command for check-bitcoin-scriptpubkeyman_tests
[381/436] Running utility command for check-bitcoin-wallet_crypto_tests
[382/436] Running utility command for check-bitcoin-timedata_tests
[383/436] Running utility command for check-bitcoin-streams_tests
[384/436] bitcoin: testing undo_tests
[385/436] bitcoin: testing cuckoocache_tests
[386/436] bitcoin: testing uint256_tests
[387/436] Running utility command for check-bitcoin-undo_tests
[388/436] Running utility command for check-bitcoin-cuckoocache_tests
[389/436] Running utility command for check-bitcoin-uint256_tests
[390/436] bitcoin: testing radix_tests
[391/436] Running utility command for check-bitcoin-radix_tests
[392/436] bitcoin: testing script_standard_tests
[393/436] bitcoin: testing blockcheck_tests
[394/436] Running utility command for check-bitcoin-script_standard_tests
[395/436] bitcoin: testing schnorr_tests
[396/436] Running utility command for check-bitcoin-blockcheck_tests
[397/436] bitcoin: testing blockstatus_tests
[398/436] Running utility command for check-bitcoin-schnorr_tests
[399/436] Running utility command for check-bitcoin-blockstatus_tests
[400/436] bitcoin: testing cashaddr_tests
[401/436] bitcoin: testing getarg_tests
[402/436] Running utility command for check-bitcoin-cashaddr_tests
[403/436] bitcoin: testing versionbits_tests
[404/436] Running utility command for check-bitcoin-getarg_tests
[405/436] Running utility command for check-bitcoin-versionbits_tests
[406/436] bitcoin: testing wallet_tests
[407/436] Running utility command for check-bitcoin-wallet_tests
[408/436] bitcoin: testing crypto_tests
[409/436] bitcoin: testing script_tests
[410/436] Running utility command for check-bitcoin-script_tests
[411/436] Running utility command for check-bitcoin-crypto_tests
[412/436] bitcoin: testing validation_tests
[413/436] Running utility command for check-bitcoin-validation_tests
[414/436] bitcoin: testing skiplist_tests
[415/436] Running utility command for check-bitcoin-skiplist_tests
[416/436] bitcoin: testing validation_block_tests
[417/436] Running utility command for check-bitcoin-validation_block_tests
[418/436] bitcoin: testing op_reversebytes_tests
[419/436] Running utility command for check-bitcoin-op_reversebytes_tests
[420/436] bitcoin: testing transaction_tests
[421/436] Running utility command for check-bitcoin-transaction_tests
[422/436] bitcoin: testing coinselector_tests
[423/436] Running utility command for check-bitcoin-coinselector_tests
[424/436] bitcoin: testing coins_tests
[425/436] Running utility command for check-bitcoin-coins_tests
[426/436] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

wallet_createwallet.py --usecli                  | ✓ Passed  | 3 s
wallet_descriptor.py                             | ✓ Passed  | 11 s
wallet_disable.py                                | ✓ Passed  | 1 s
wallet_dump.py                                   | ✓ Passed  | 5 s
wallet_encryption.py                             | ✓ Passed  | 6 s
wallet_groups.py                                 | ✓ Passed  | 41 s
wallet_hd.py                                     | ✓ Passed  | 7 s
wallet_import_rescan.py                          | ✓ Passed  | 9 s
wallet_import_with_label.py                      | ✓ Passed  | 1 s
wallet_importdescriptors.py                      | ✓ Passed  | 5 s
wallet_importmulti.py                            | ✓ Passed  | 5 s
wallet_importprunedfunds.py                      | ✓ Passed  | 2 s
wallet_keypool.py                                | ✓ Passed  | 3 s
wallet_keypool_topup.py                          | ✓ Passed  | 3 s
wallet_labels.py                                 | ✓ Passed  | 2 s
wallet_listreceivedby.py                         | ✓ Passed  | 19 s
wallet_listsinceblock.py                         | ✓ Passed  | 5 s
wallet_listtransactions.py                       | ✓ Passed  | 29 s
wallet_multiwallet.py                            | ✓ Passed  | 11 s
wallet_multiwallet.py --usecli                   | ✓ Passed  | 12 s
wallet_reorgsrestore.py                          | ✓ Passed  | 3 s
wallet_resendwallettransactions.py               | ✓ Passed  | 6 s
wallet_txn_clone.py                              | ✓ Passed  | 2 s
wallet_txn_clone.py --mineblock                  | ✓ Passed  | 3 s
wallet_txn_doublespend.py                        | ✓ Passed  | 3 s
wallet_txn_doublespend.py --mineblock            | ✓ Passed  | 4 s
wallet_watchonly.py                              | ✓ Passed  | 1 s
wallet_watchonly.py --usecli                     | ✓ Passed  | 1 s
wallet_zapwallettxes.py                          | ✓ Passed  | 5 s

ALL                                              | ✓ Passed  | 1142 s (accumulated) 
Runtime: 229 s

----------------------------------------------------------------------
Ran 4 tests in 0.006s

OK

[179/444] Running seeder test suite
PASSED: seeder test suite
[180/444] Test Bitcoin RPC authentication...
...
----------------------------------------------------------------------
Ran 3 tests in 0.004s

OK
[181/444] cd /work/contrib/devtools/chainparams && /usr/bin/python3.7 ./test_make_chainparams.py
.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[405/444] Running pow test suite
PASSED: pow test suite
[426/444] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[433/444] Running bitcoin test suite
PASSED: bitcoin test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-debug failed with exit code 1

Tail of the build log:

rpc_psbt.py                                      | ✓ Passed  | 25 s
rpc_rawtransaction.py                            | ✓ Passed  | 34 s
rpc_scantxoutset.py                              | ✓ Passed  | 3 s
rpc_setban.py                                    | ✓ Passed  | 2 s
rpc_signmessage.py                               | ✓ Passed  | 1 s
rpc_signrawtransaction.py                        | ✓ Passed  | 1 s
rpc_txoutproof.py                                | ✓ Passed  | 2 s
rpc_uptime.py                                    | ✓ Passed  | 1 s
rpc_users.py                                     | ✓ Passed  | 5 s
rpc_whitelist.py                                 | ✓ Passed  | 1 s
tool_wallet.py                                   | ✓ Passed  | 4 s
wallet_abandonconflict.py                        | ✓ Passed  | 9 s
wallet_address_types.py                          | ✓ Passed  | 14 s
wallet_avoidreuse.py                             | ✓ Passed  | 4 s
wallet_backup.py                                 | ✓ Passed  | 25 s
wallet_balance.py                                | ✓ Passed  | 22 s
wallet_basic.py                                  | ✓ Passed  | 19 s
wallet_coinbase_category.py                      | ✓ Passed  | 1 s
wallet_create_tx.py                              | ✓ Passed  | 5 s
wallet_createwallet.py                           | ✓ Passed  | 2 s
wallet_createwallet.py --usecli                  | ✓ Passed  | 2 s
wallet_descriptor.py                             | ✓ Passed  | 6 s
wallet_disable.py                                | ✓ Passed  | 0 s
wallet_dump.py                                   | ✓ Passed  | 5 s
wallet_encryption.py                             | ✓ Passed  | 5 s
wallet_groups.py                                 | ✓ Passed  | 27 s
wallet_hd.py                                     | ✓ Passed  | 6 s
wallet_import_rescan.py                          | ✓ Passed  | 5 s
wallet_import_with_label.py                      | ✓ Passed  | 1 s
wallet_importdescriptors.py                      | ✓ Passed  | 4 s
wallet_importmulti.py                            | ✓ Passed  | 3 s
wallet_importprunedfunds.py                      | ✓ Passed  | 2 s
wallet_keypool.py                                | ✓ Passed  | 3 s
wallet_keypool_topup.py                          | ✓ Passed  | 2 s
wallet_labels.py                                 | ✓ Passed  | 1 s
wallet_listreceivedby.py                         | ✓ Passed  | 8 s
wallet_listsinceblock.py                         | ✓ Passed  | 4 s
wallet_listtransactions.py                       | ✓ Passed  | 17 s
wallet_multiwallet.py                            | ✓ Passed  | 12 s
wallet_multiwallet.py --usecli                   | ✓ Passed  | 42 s
wallet_reorgsrestore.py                          | ✓ Passed  | 3 s
wallet_resendwallettransactions.py               | ✓ Passed  | 14 s
wallet_txn_clone.py                              | ✓ Passed  | 2 s
wallet_txn_clone.py --mineblock                  | ✓ Passed  | 3 s
wallet_txn_doublespend.py                        | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock            | ✓ Passed  | 3 s
wallet_watchonly.py                              | ✓ Passed  | 1 s
wallet_watchonly.py --usecli                     | ✓ Passed  | 1 s
wallet_zapwallettxes.py                          | ✓ Passed  | 4 s

ALL                                              | ✓ Passed  | 917 s (accumulated) 
Runtime: 186 s

----------------------------------------------------------------------
Ran 4 tests in 0.001s

OK

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1

fix build failure

The tests used the old signature for getPeerId. Just add an alias to call the new function with a dummy validation state.

PiRK planned changes to this revision.Mar 18 2021, 07:56
PiRK requested review of this revision.Mar 18 2021, 07:58
PiRK added a subscriber: Fabien.

add a test (contributed by @Fabien)

rebase on master after landing D9342

Revert some changes (checking for the validation state to keep verifying the proof until there is no longer a missing utxo). The rationale for this check was that there is a risk of the node checking the proof immediately after finishing IBD when some utxos are not yet known, but this means that the node would keep checking the proof at each new block even if the UTXO never exists. If/when there will be a minimum coin age limit for the stakes, it is unlikely that this limit will be less than 26 hours, so we will already know if the proof is valid after IBD.

PiRK planned changes to this revision.EditedMar 22 2021, 20:17

Based on D9342, we can potentially register the proof earlier depending on the proofs ValidationState at init.

We still need to be reasonably sure that no UTXO was spent since last time the node was up to date.

PiRK requested review of this revision.Mar 23 2021, 09:54
This revision is now accepted and ready to land.Mar 23 2021, 16:24
This revision was automatically updated to reflect the committed changes.