-
Notifications
You must be signed in to change notification settings - Fork 191
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
[encodingstreamer] Validate quorums #109
[encodingstreamer] Validate quorums #109
Conversation
@@ -184,7 +184,7 @@ func (c *churner) getOperatorsToChurn(ctx context.Context, quorumIDs []uint8, op | |||
return nil, errors.New("maxOperatorCount is 0") | |||
} | |||
|
|||
if uint32(len(operatorStakes[i])) < operatorSetParams.MaxOperatorCount { |
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.
possibly a bug in previous implementation.
operatorStakes
should be indexed by quorum ID instead of index of quorumIDs
@@ -26,6 +26,8 @@ type OperatorSetParam struct { | |||
ChurnBIPsOfTotalStake uint16 | |||
} | |||
|
|||
type OperatorStakes map[QuorumID]map[OperatorIndex]OperatorStake |
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.
Replaced existing use of [][]OperatorStake
with this new type as it's more clear how OperaterStake
are indexed
4bd4da3
to
e785104
Compare
e785104
to
c109d78
Compare
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 their may be a couple of small issues, but looks good overall!
c109d78
to
5b597f3
Compare
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.
Looks good
Why are these changes needed?
Currently, quorum validation is delegated to the disperser server.
Encoding streamer does not handle invalid quorums, and if there's a request with invalid quorum, the entire iteration fails and encoding loop halts.
This PR addresses this by identifying invalid quorums and filtering out those blobs.
Checks