-
Notifications
You must be signed in to change notification settings - Fork 193
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
[5/N][multi quorum ejection] Compute num batches per quorum and block range #327
Conversation
disperser/dataapi/nonsigner_utils.go
Outdated
|
||
// Representing an interval [StartBlock, EndBlock] (inclusive). | ||
// NumBatchesAtBlock represents the number of batches at current block, as well as | ||
// accumulated number of batches from a start block to the current block. |
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.
How is the start block represented in this struct?
Is it always the very beginning (ever since operator joined) or can it start at any given block?
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.
The user can decide the beginning per use case
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.
Actually, I have an idea to restructure it with more clarity
assert.Equal(t, 4, dataapi.ComputeNumBatches(intervals, 5, 10)) | ||
assert.Equal(t, 2, dataapi.ComputeNumBatches(intervals, 6, 10)) |
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.
so ComputeNumBatches(intervals, 6, 10))
returns 2 because that's the number of batches produced between 6 and 10.
Then should ComputeNumBatches(intervals, 5, 10))
be also 2? The first interval doesn't have the NumBatches
field which implies that the 2 batches were produced earlier than block 5. Am i misunderstanding this?
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.
The block 5 is the first block in this list, so its NumBatches and AccuBatches are the same. The AccuBatches is computed with the first element as starting point.
} | ||
|
||
func TestCreatQuorumBatches(t *testing.T) { | ||
batchNonSigningInfo := []*dataapi.BatchNonSigningInfo{ |
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.
Can we comment that each element represents a batch?
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.
added
Why are these changes needed?
This is part of the work to compute operator nonsigning rate for ejection in multi quorum.
Roughly, this is the first 50% of step 4 in https://docs.google.com/document/d/13nxDXTAxRhT18qZrEkTtS2F7CxjlM0qA-2EGim1bu1k/edit (compute num batches a <operator, quorum> is responsible for)
Checks