HomePhabricator

[avalanche] Store the next possible conflict time for each peer

Description

[avalanche] Store the next possible conflict time for each peer

Summary:
This time will make it possible to implement cooldown features on proofs with utxos that conflict with an existing peer's proof.
This diff only adds the container and a method to update the time for a given peerid, which will be called in 2 places to set the cooldown:

  • during a proof registration, to limit the conflict for the peer using a low value cooldown
  • after a vote is finalized, to limit the peer replacement rate upon acceptation by the network.

Note that this time uses std::chrono::seconds and not TimePoint so it can be mocked in the tests.

Ref T1854.

Test Plan:

ninja check-avalanche

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Maniphest Tasks: T1854

Differential Revision: https://reviews.bitcoinabc.org/D10717

Details

Provenance
FabienAuthored on Dec 21 2021, 14:51
FabienPushed on Jan 5 2022, 20:03
Reviewer
Restricted Project
Differential Revision
D10717: [avalanche] Store the next possible conflict time for each peer
Parents
rABC23b58fa14d82: [avalanche] Return if a proof is bound to a peer in getrawavalancheproof
Branches
Unknown
Tags
Unknown
Tasks
Restricted Maniphest Task