-
Notifications
You must be signed in to change notification settings - Fork 239
feat: periodically return attestation with updated signatures #1497
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
Conversation
litt3
commented
Apr 24, 2025
- closes EGDA-1008
- link
Signed-off-by: litt3 <[email protected]>
The latest Buf updates on your PR. Results from workflow Buf Proto / buf (pull_request).
|
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
disperser/controller/dispatcher.go
Outdated
// this error isn't fatal: a subsequent PutAttestation attempt might succeed | ||
// TODO: this used to cause the HandleSignatures method to fail entirely. Is it ok to continue trying here? |
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.
reminder to resolve this TODO
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'm not sure the answer here yet. Let's leave this conversation open until I can get to the bottom it it
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.
removed
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
disperser/controller/dispatcher.go
Outdated
"err", err, | ||
"batchHeaderHash", batchHeaderHash) | ||
} | ||
// TODO: I removed the initial empty attestation update. Is that ok? |
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.
reminder to resolve TODO
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.
removed
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 to me! few questions
attestation := blobStatusReply.GetSignedBatch().GetAttestation() | ||
for index, quorumNumber := range attestation.GetQuorumNumbers() { | ||
quorumPercentagesBuilder.WriteString( | ||
fmt.Sprintf("quorum_%d: %d%%, ", quorumNumber, attestation.GetQuorumSignedPercentages()[index])) |
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.
should we check len(attestation.GetQuorumSignedPercentages())
before taking the index?
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.
We've asserted that the quorum count and signed percentage have the same length in pollBlobStatusUntilSigned
, so currently it would be safe to assume the length here.
I added an additional length check in 7639906, though, just in case
disperser/controller/dispatcher.go
Outdated
} | ||
|
||
// TODO(ian-shim): periodically update the attestation with intermediate quorum results | ||
// TODO: I removed the initial empty attestation update. Is that ok? |
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 empty attestation is created here so that an attestation is available for query "immediately" after the blob is marked as GatheringSignatures
considering that GetSignedBatch
will return an attestation for the signed batch.
If we remove this empty attestation, we should update GetSignedBatch
and behavior in get_blob_status_v2.go
to make sure it returns empty attestation upon GetBlobStatus
call
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 updated the GetSignedBatch
in dynamo_metadata_store.go
to return an empty attestation if none is found
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.
After struggling with CI for a while, I decided to just keep the empty attestation put
for now, to unblock this PR.
} | ||
|
||
if seen := sr.signatureMessageReceived[signingMessage.Operator]; seen { | ||
sr.logger.Warn("duplicate message from operator", |
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.
should this be Error?
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.
Done 4aa8441
|
||
indexedOperatorInfo, found := sr.indexedOperatorState.IndexedOperators[signingMessage.Operator] | ||
if !found { | ||
sr.logger.Warn("operator not found in state", |
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.
should this be Error?
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.
Done 4aa8441
|
||
operatorPubkey := indexedOperatorInfo.PubkeyG2 | ||
if !signingMessage.Signature.Verify(operatorPubkey, sr.batchHeaderHash) { | ||
return fmt.Errorf("signature verification with pubkey %s", hex.EncodeToString(operatorPubkey.Serialize())) |
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.
nit: signature verification "failed" with pubkey...?
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.
@samlaf has been driving an effort to shorten error messages by omitting prefixed like "failed to". See this conversation above
|
||
ok, err := aggregateSignersG1PubKey.VerifyEquivalence(sr.aggregateSignersG2PubKeys[quorumID]) | ||
if err != nil { | ||
return nil, fmt.Errorf("verify aggregate G1 and G2 pubkey equivalence: %w", err) |
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.
nit: failed to verify...
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.
See above
// attestation is yielded. This is used to track how long it takes to yield each attestation. | ||
attestationUpdateStart time.Time | ||
|
||
// significantSigningThresholdPercentage is a configurable "important" signing threshold. Right now, it's being |
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.
what does "important" and "special handling" mean?
looks like its there to record time at which the threshold is met. how is that timestamp used?
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.
"Important" for now means "whatever the default signing threshold is", so the current default is 55
.
Special handling in the future could be something like immediately emitting an attestation once quorums have reached the configured threshold. This is an optimization that isn't necessary now, but could shave off a couple hundred milliseconds of dispersal latency in the future, once we've improved performance enough for this delta to be significant.
Right now, this value is only being used to understand the profile of the signature gathering phase. i.e. how long after crossing the 'standard' signing threshold do we keep on gathering signatures?
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
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.
lgtm, please resolve the ci failures
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>
Signed-off-by: litt3 <[email protected]>