Page MenuHomePhabricator

[avalanche] Add an API to accept or reject a proof
AbandonedPublic

Authored by Fabien on Dec 2 2021, 15:05.

Details

Reviewers
None
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Summary

This attempts to turn a proof into a peer even if there are conflicts, or remove it completely from all the pools. This will be used to flip our position in case of a vote due to conflicting proofs.

Ref T1854.

Depends on D10525.

Test Plan
ninja all check-avalanche

Diff Detail

Repository
rABC Bitcoin ABC
Branch
avalanche_peermanager_accept_reject_proof
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17511
Build 34848: Build Diffbuild-without-wallet · lint-circular-dependencies · build-debug · build-diff · build-clang-tidy · build-clang
Build 34847: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Dec 2 2021, 15:05
Fabien planned changes to this revision.Dec 3 2021, 08:18

Rebase on top of D10615.
The accept/reject are now unaffected by the cooldown as expected, and the test plan is updated accordingly.

Fabien planned changes to this revision.Dec 3 2021, 15:04
Fabien edited the summary of this revision. (Show Details)

Stop moving the rejected conflicting proofs into orphans; this is a non-sense to remind of rejected proofs because they are not expected to become valid anymore.
This allows for dramatic simplification of the diff and the test, and will also makes it much easier when bound to the network layer.

tyler-smith added inline comments.
src/avalanche/peermanager.cpp
185 ↗(On Diff #31257)

It's not clear to me why the cooldown here is 0 instead of the configured or default cooldown.

Fabien planned changes to this revision.Dec 8 2021, 11:26
src/avalanche/peermanager.cpp
185 ↗(On Diff #31257)

That's a good point point. The conflicting proofs are removed just above so there is no possible conflict remaining, and indeed the cooldown can be kept to the default value.

Rebase, removed unecessary cooldown override

Fabien planned changes to this revision.Dec 8 2021, 19:27

Rebase, improve the test a bit

Tail of the build log:

[396/455] Running utility command for check-bitcoin-finalization_tests
[397/455] Running utility command for check-bitcoin-blockfilter_index_tests
[398/455] bitcoin: testing merkleblock_tests
[399/455] bitcoin: testing bip32_tests
[400/455] Running utility command for check-bitcoin-merkleblock_tests
[401/455] Running utility command for check-bitcoin-bip32_tests
[402/455] bitcoin: testing sync_tests
[403/455] bitcoin: testing scheduler_tests
[404/455] bitcoin: testing txvalidationcache_tests
[405/455] Running utility command for check-bitcoin-sync_tests
[406/455] Running utility command for check-bitcoin-scheduler_tests
[407/455] Running utility command for check-bitcoin-txvalidationcache_tests
[408/455] bitcoin: testing torcontrol_tests
[409/455] Running utility command for check-bitcoin-torcontrol_tests
[410/455] bitcoin: testing cuckoocache_tests
[411/455] Running utility command for check-bitcoin-cuckoocache_tests
[412/455] bitcoin: testing settings_tests
[413/455] bitcoin: testing validation_flush_tests
[414/455] Running utility command for check-bitcoin-settings_tests
[415/455] Running utility command for check-bitcoin-validation_flush_tests
[416/455] bitcoin: testing timedata_tests
[417/455] bitcoin: testing streams_tests
[418/455] bitcoin: testing op_reversebytes_tests
[419/455] Running utility command for check-bitcoin-timedata_tests
[420/455] Running utility command for check-bitcoin-streams_tests
[421/455] Running utility command for check-bitcoin-op_reversebytes_tests
[422/455] bitcoin: testing compilerbug_tests
[423/455] bitcoin: testing blockcheck_tests
[424/455] Running utility command for check-bitcoin-compilerbug_tests
[425/455] bitcoin: testing serialize_tests
[426/455] bitcoin: testing checkpoints_tests
[427/455] Running utility command for check-bitcoin-blockcheck_tests
[428/455] Running utility command for check-bitcoin-serialize_tests
[429/455] Running utility command for check-bitcoin-checkpoints_tests
[430/455] bitcoin: testing schnorr_tests
[431/455] Running utility command for check-bitcoin-schnorr_tests
[432/455] bitcoin: testing script_standard_tests
[433/455] bitcoin: testing validationinterface_tests
[434/455] Running utility command for check-bitcoin-script_standard_tests
[435/455] Running utility command for check-bitcoin-validationinterface_tests
[436/455] bitcoin: testing cashaddr_tests
[437/455] Running utility command for check-bitcoin-cashaddr_tests
[438/455] bitcoin: testing versionbits_tests
[439/455] Running utility command for check-bitcoin-versionbits_tests
[440/455] bitcoin: testing transaction_tests
[441/455] bitcoin: testing script_tests
[442/455] Running utility command for check-bitcoin-transaction_tests
[443/455] Running utility command for check-bitcoin-script_tests
[444/455] bitcoin: testing monolith_opcodes_tests
[445/455] bitcoin: testing crypto_tests
[446/455] Running utility command for check-bitcoin-monolith_opcodes_tests
[447/455] Running utility command for check-bitcoin-crypto_tests
[448/455] bitcoin: testing intmath_tests
[449/455] Running utility command for check-bitcoin-intmath_tests
[450/455] bitcoin: testing coinselector_tests
[451/455] Running utility command for check-bitcoin-coinselector_tests
[452/455] bitcoin: testing coins_tests
[453/455] Running utility command for check-bitcoin-coins_tests
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang failed with exit code 1

Unrelated failure, restarting the build

Fabien planned changes to this revision.Dec 14 2021, 16:11

Need rebase

Fabien planned changes to this revision.Dec 15 2021, 16:22