Page MenuHomePhabricator

[avalanche] Store the next possible conflict time for each proof
AbandonedPublic

Authored by Fabien on Dec 21 2021, 14:57.

Details

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

This time will make it possible to implement cooldown features on conflicting proofs.
This diff only adds the container and a method to update the time for a given proofid, which will be called in 2 places to set the cooldown:

  • during a proof registration, to limit the conflicting proof rate
  • 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
Branch
avalanche_update_next_conflict_time
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17713
Build 35252: Build Difflint-circular-dependencies · build-debug · build-without-wallet · build-clang-tidy · build-diff · build-clang
Build 35251: arc lint + arc unit

Event Timeline

Fabien requested review of this revision.Dec 21 2021, 14:57
Fabien planned changes to this revision.Dec 21 2021, 15:06

I created a new diff by mistake instead of updating (see D10717)