Page MenuHomePhabricator

[avalanche] Allow for yes-voting several winners
ClosedPublic

Authored by Fabien on Mar 12 2024, 16:14.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCd3589efd09b0: [avalanche] Allow for yes-voting several winners
Summary

This updates the getstakingreward and setstakingreward RPC so that an array of winners can be manually set. This makes it possible to allow 2 winners manually if there is a doubt about which is the correct one (e.g. if 2 nodes disagree).

Also use this to allow for more winners if we are missing connection to the selected proof, and leverage the remote proofs to determine if a proof looks abnormal.
Mining remains unchanged, only the node vote is affected.

Depends on D15685.

Test Plan
ninja all check-all

Event Timeline

Bug fix + more unit tests

Tail of the build log:

[439/496] bitcoin: testing script_tests
[440/496] Running utility command for check-bitcoin-ismine_tests
[441/496] Running utility command for check-bitcoin-key_io_tests
[442/496] Running utility command for check-bitcoin-scheduler_tests
[443/496] Running utility command for check-bitcoin-script_tests
[444/496] bitcoin: testing transaction_tests
[445/496] Running utility command for check-bitcoin-transaction_tests
[446/496] bitcoin: testing sigencoding_tests
[447/496] bitcoin: testing txvalidationcache_tests
[448/496] Running utility command for check-bitcoin-sigencoding_tests
[449/496] bitcoin: testing scriptpubkeyman_tests
[450/496] Running utility command for check-bitcoin-txvalidationcache_tests
[451/496] Running utility command for check-bitcoin-scriptpubkeyman_tests
[452/496] bitcoin: testing walletdb_tests
[453/496] Running utility command for check-bitcoin-walletdb_tests
[454/496] bitcoin: testing psbt_wallet_tests
[455/496] bitcoin: testing multisig_tests
[456/496] bitcoin: testing merkle_tests
[457/496] Running utility command for check-bitcoin-merkle_tests
[458/496] bitcoin: testing result_tests
[459/496] Running utility command for check-bitcoin-multisig_tests
[460/496] Running utility command for check-bitcoin-psbt_wallet_tests
[461/496] bitcoin: testing mempool_tests
[462/496] Running utility command for check-bitcoin-result_tests
[463/496] Running utility command for check-bitcoin-mempool_tests
[464/496] Running utility command for check-avalanche-processor_tests
[465/496] bitcoin: testing blockmanager_tests
[466/496] bitcoin: testing uint256_tests
[467/496] bitcoin: testing init_tests
[468/496] bitcoin: testing rcu_tests
[469/496] Running utility command for check-bitcoin-blockmanager_tests
[470/496] Running utility command for check-bitcoin-uint256_tests
[471/496] bitcoin: testing denialofservice_tests
[472/496] Running utility command for check-bitcoin-init_tests
[473/496] Running utility command for check-bitcoin-rcu_tests
[474/496] Running utility command for check-bitcoin-denialofservice_tests
[475/496] bitcoin: testing cuckoocache_tests
[476/496] Running utility command for check-bitcoin-cuckoocache_tests
[477/496] Linking CXX executable src/qt/test/test_bitcoin-qt
[478/496] bitcoin: testing coinstatsindex_tests
[479/496] Running utility command for check-bitcoin-coinstatsindex_tests
[480/496] bitcoin: testing blockcheck_tests
[481/496] Running utility command for check-bitcoin-blockcheck_tests
[482/496] bitcoin: testing wallet_crypto_tests
[483/496] Running utility command for check-bitcoin-wallet_crypto_tests
[484/496] bitcoin: testing radix_tests
[485/496] Running utility command for check-bitcoin-radix_tests
[486/496] bitcoin-qt: testing test_bitcoin-qt
[487/496] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
[488/496] bitcoin: testing coinselector_tests
[489/496] Running utility command for check-bitcoin-coinselector_tests
[490/496] bitcoin: testing wallet_tests
[491/496] Running utility command for check-bitcoin-wallet_tests
[492/496] bitcoin: testing coins_tests
[493/496] Running utility command for check-bitcoin-coins_tests
[494/496] 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:

[434/489] Running utility command for check-bitcoin-result_tests
[435/489] bitcoin: testing init_tests
[436/489] bitcoin: testing mempool_tests
[437/489] bitcoin: testing uint256_tests
[438/489] Running utility command for check-bitcoin-init_tests
[439/489] bitcoin: testing coinstatsindex_tests
[440/489] bitcoin: testing denialofservice_tests
[441/489] Running utility command for check-bitcoin-mempool_tests
[442/489] Running utility command for check-bitcoin-uint256_tests
[443/489] Running utility command for check-pow-aserti32d_tests
[444/489] bitcoin: testing merkle_tests
[445/489] Running utility command for check-bitcoin-coinstatsindex_tests
[446/489] Running utility command for check-bitcoin-denialofservice_tests
[447/489] bitcoin: testing blockmanager_tests
[448/489] Running utility command for check-bitcoin-merkle_tests
[449/489] Running utility command for check-bitcoin-blockmanager_tests
[450/489] pow: testing eda_tests
[451/489] Running utility command for check-pow-eda_tests
[452/489] pow: testing grasberg_tests
[453/489] bitcoin: testing rcu_tests
[454/489] bitcoin: testing wallet_crypto_tests
[455/489] Running utility command for check-pow-grasberg_tests
[456/489] Running utility command for check-bitcoin-rcu_tests
[457/489] Running pow test suite
PASSED: pow test suite
[458/489] Running utility command for check-bitcoin-wallet_crypto_tests
[459/489] bitcoin: testing blockcheck_tests
[460/489] Running utility command for check-bitcoin-blockcheck_tests
[461/489] bitcoin: testing coinselector_tests
[462/489] Running utility command for check-bitcoin-coinselector_tests
[463/489] bitcoin: testing wallet_tests
[464/489] Running utility command for check-bitcoin-wallet_tests
[465/489] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/fixture.cpp.o
[466/489] Linking CXX executable src/seeder/test/test-seeder
[467/489] seeder: testing p2p_messaging_tests
[468/489] seeder: testing options_tests
[469/489] seeder: testing message_writer_tests
[470/489] seeder: testing parse_name_tests
[471/489] seeder: testing write_name_tests
[472/489] Running utility command for check-seeder-message_writer_tests
[473/489] Running utility command for check-seeder-options_tests
[474/489] Running utility command for check-seeder-p2p_messaging_tests
[475/489] Running utility command for check-seeder-parse_name_tests
[476/489] Running utility command for check-seeder-write_name_tests
[477/489] Running seeder test suite
PASSED: seeder test suite
[478/489] bitcoin: testing coins_tests
[479/489] Running utility command for check-bitcoin-coins_tests
[480/489] Running bitcoin test suite
PASSED: bitcoin test suite
[481/489] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/__/__/wallet/test/wallet_test_fixture.cpp.o
[482/489] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/paymentservertests.cpp.o
[483/489] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/addressbooktests.cpp.o
[484/489] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/wallettests.cpp.o
[485/489] Linking CXX executable src/qt/test/test_bitcoin-qt
[486/489] bitcoin-qt: testing test_bitcoin-qt
[487/489] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Use our local connection state to bypass the heuristic if possible

in processor.h, in struct StakingReward, maybe add a brief comment to winners mentioning that any of these winners is acceptable but only one of them (make it clear that the reward is not expected to be split between the winners)

src/avalanche/peermanager.h
515 ↗(On Diff #46221)

no longer "unique"

src/rpc/avalanche.cpp
1029 ↗(On Diff #46221)

Update the RPCs, add a deprecation notice, tests and a release note for the changes

doc/release-notes.md
12 ↗(On Diff #46294)
Fabien published this revision for review.Mar 20 2024, 09:08
Fabien retitled this revision from [avalanche] Detect flaky (not well connected) proofs on the network to [avalanche] Make it possible to accept several winners.
Fabien edited the summary of this revision. (Show Details)
Fabien edited the test plan for this revision. (Show Details)
Fabien retitled this revision from [avalanche] Make it possible to accept several winners to [avalanche] Allow for yes-voting several winners.
This revision is now accepted and ready to land.Mar 20 2024, 09:12