Page MenuHomePhabricator

[avalanche] Poll for stake contenders
ClosedPublic

Authored by roqqit on Wed, Jan 29, 23:51.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC0ab1dbf3adcc: [avalanche] Poll for stake contenders
Summary

Poll for stake contenders after they have been promoted to a new chain tip.

Responses to polls will be handled in a follow up diff.

Depends on D17615

Test Plan
ninja check-functional

Event Timeline

roqqit published this revision for review.Thu, Jan 30, 17:03
roqqit edited the summary of this revision. (Show Details)
roqqit edited the test plan for this revision. (Show Details)
Fabien requested changes to this revision.Thu, Jan 30, 20:45
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/avalanche/processor.cpp
1069 ↗(On Diff #52453)

This function is no longer doing this but much more. Either change the name or split the function (probably better as it makes unit testing possible).

It also causes the addToReconcile to happen twice per block because this function is called upon updatedBlockTip as well as when staking reward winners are computed.

This revision now requires changes to proceed.Thu, Jan 30, 20:45

Rebase on D17660 to address the feedback about splitting up setContenderStatusForLocalWinners(). It should be more clear now that addToReconcile() is only called once per block.

src/avalanche/processor.cpp
1080

Can you remind me why you need it in 2 places ?

Fabien added inline comments.
src/avalanche/processor.cpp
1080

Answer to self: the staking rewards computation also happens at the time the quorum is established, so the contenders might not be promoted to the tip yet.

This revision is now accepted and ready to land.Fri, Feb 21, 08:41
This revision was automatically updated to reflect the committed changes.