Page MenuHomePhabricator

[avalanche] Introduce StakeContenderId
ClosedPublic

Authored by roqqit on Aug 12 2024, 22:17.

Details

Reviewers
Fabien
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Commits
rABC5ad50cf4eb85: [avalanche] Introduce StakeContenderId
Summary

StakeContenderId will enable the node to poll for potential stake winners (as a new CInv type). This will further enable pre-consensus on staking rewards to ensure that nodes validate the same winner set even if some proofs are missing from some nodes' proof sets.

Test Plan
ninja check-avalanche

Event Timeline

Owners added a reviewer: Restricted Owners Package.Aug 12 2024, 22:17
roqqit requested review of this revision.Aug 12 2024, 22:17
Fabien requested changes to this revision.Aug 13 2024, 06:58
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/stakecontender.h
8

remove

9

remove

10

remove

23

Prefer strong typing so we don't do implicit conversions

26

Why using the payout script here instead of the proofid ? proofid is the source of uniqueness

This revision now requires changes to proceed.Aug 13 2024, 06:58
  • cleanups
  • strongly type StakeContenderId
  • switch to blockhash + proofid instead of blockhash + payoutscript since this could be more versatile down the road
  • streamlined implementation a bit, which eliminated stakecontender.cpp
Fabien added inline comments.
src/avalanche/stakecontender.h
25 ↗(On Diff #49191)

needs to include hash.h for the Hash function

This revision is now accepted and ready to land.Aug 13 2024, 19:52
This revision was automatically updated to reflect the committed changes.