-
Notifications
You must be signed in to change notification settings - Fork 186
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
[v2] Dispatcher Implementation #871
Conversation
To be rebased on top of #870 |
c78de00
to
469b084
Compare
core/v2/serialization.go
Outdated
Y: [2]*big.Int{ | ||
b.BlobCommitments.LengthCommitment.Y.A0.BigInt(new(big.Int)), | ||
b.BlobCommitments.LengthCommitment.Y.A1.BigInt(new(big.Int)), | ||
}, |
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 in the form of A1, A0 for G2 points ?
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.
Each extension in G2Point is represented as uint256[2]
onchain
disperser/controller/dispatcher.go
Outdated
if err != nil { | ||
return fmt.Errorf("failed to receive and validate signatures: %w", err) | ||
} | ||
numPassed, passedQuorums := numBlobsAttestedByQuorum(quorumAttestation.QuorumResults, batchData.Batch.BlobCertificates) |
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.
Is deduplication of certs already handled upstream ?
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.
There is no deduplication. New batch should be constructed by blobs that haven't been processed yet. GetBlobMetadataByStatus
takes lastUpdatedAt
which gets updated as we pull new blobs and acts as a cursor. It only takes blobs that are updated after this value.
numBlobsAttestedByQuorum
is added to 1) early terminate if no blobs received sufficient amount of signatures, or 2) remove unsuccessful quorums (to help reduce gas costs for bridging). However, this optimization seems pretty minor, and I think I'll remove this check to simplify.
469b084
to
2128649
Compare
4fe4eaf
to
0042d91
Compare
0042d91
to
66f61fd
Compare
@@ -302,7 +302,7 @@ func (b *Batcher) updateConfirmationInfo( | |||
blobsToRetry = append(blobsToRetry, batchData.blobs[blobIndex]) | |||
continue | |||
} | |||
proof = serializeProof(merkleProof) |
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.
Does the serializeProof
implementation need to be deleted? I don't see a delta.
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.
It's deleted in the same file L566
}, nil | ||
} | ||
|
||
func (m *nodeClientManager) GetClient(operatorID core.OperatorID, socket string) (clients.NodeClientV2, 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.
What happens if there is a socket update? Since this is only using the operatorID as the key, if there is a new socket it won't get reflected. Wouldn't it make more sense to use the socket as the key?
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.
Thanks for catching this! That's a good idea
66f61fd
to
d6ae0af
Compare
d6ae0af
to
0779c4a
Compare
0779c4a
to
e877619
Compare
e877619
to
c3033aa
Compare
Why are these changes needed?
Dispatcher implementation which takes encoded blobs, forms a batch, distributes the data across DA nodes, then gathers, validates, and aggregates the attestation.
Checks