-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Dynamic Protocol State] Replace dynamic weight and ejection flag with 'epoch participation status' #5039
[Dynamic Protocol State] Replace dynamic weight and ejection flag with 'epoch participation status' #5039
Conversation
…tps://github.com/onflow/flow-go into yurii/4649-remove-dynamic-weight
…tps://github.com/onflow/flow-go into yurii/4649-remove-dynamic-weight
…nflow/flow-go into yurii/4649-remove-dynamic-weight
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feature/dynamic-protocol-state #5039 +/- ##
===================================================================
- Coverage 79.71% 56.06% -23.65%
===================================================================
Files 1 955 +954
Lines 69 88552 +88483
===================================================================
+ Hits 55 49650 +49595
- Misses 13 35196 +35183
- Partials 1 3706 +3705
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have some ambiguity currently how we handle the degenerate case of the EpochSetup
event containing nodes with InitialWeight=0
. I think we allow that, don't we? Previously, those nodes would be filtered out in most cases, due to the requirement to have a positive dynamic weight. But that dynamic weight was replaced by the EpochParticipationStatus
. So no, EpochParticipationStatus=EpochParticipationStatusActive
with InitialWeight=0
is something to consider.
We could either categorically exclude those nodes from the consensus committees. After all, their InitialWeight is fixed for the epoch and a zero-weighted node cannot contribute to protocol progress. If we included them in the committee, we would essentially add dead weight to the signatures. So conceptually, I think it would be more intuitive to not consider InitialWeight=0
nodes as part of the committee.
But that also introduces extra edge cases. All implementations need to be consistent about filtering out zero-weighted nodes. If we mess that up, we might halt the network. Therefore, I would consider it an acceptable alternative to allow zero-weighted nodes as part of the consensus committee. They would receive an index where their signature could be included in QCs and TCs, despite it being completely useless.
please see my last two comments for further details
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
…f zero-staked nodes
• renamed function `constructInitialClusterIdentities` to `constructContributingClusterParticipants` • moved documentation about zero weight and canonical ordering into the functions main goDoc for better visibility.
…r` I renamed the function that lists the voting cluster participants to `votingClusterParticipants`
• updated documentation • minor broadening of test coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This revision had a large blast radius. Very clean changes. Great work.
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
Co-authored-by: Alexander Hentschel <alex.hentschel@axiomzen.co>
…ing and active with 0 weight
Context
This PR is part of initiate of addressing TODOs in #4649.
Specifically it removes dynamic weight and re-introduces concept of
Ejected
flag. Instead of using dynamic weight andEjected
flag we introduce a enumepoch participation status
which could be one of the next values:active
,joining
,leaving
,ejected
.💡
One interesting details is how we store
ActiveIdentities
inEpochStateContainer
, previouslyDynamicIdentityEntry
was encoding the dynamic part offlow.Identity
, specificallyflow.DynamicIdentity
. I have taken another approach and instead of storingflow.DynamicIdentity
andflow.EpochParticipantStatus
subsequently I am storing only theEjected
flag. Reasoning for that is from point of view ofActiveIdentities
we only care about ejection, not about the 'joining', 'leaving', 'active' states which are derived on the epoch itself not the identity.