Page MenuHomePhabricator

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

Authored by Fabien on Dec 21 2021, 21:20.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABC78be97a4e3f0: [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

Diff Detail

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