Skip to content
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

[BatchConfirmer] Apply state transitions for full batches #691

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

ian-shim
Copy link
Contributor

@ian-shim ian-shim commented Aug 8, 2024

Why are these changes needed?

This PR makes BatchConfirmer transition full batch state to Failed or Attested.
It also improves the test coverage for batch confirmer.

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@ian-shim ian-shim marked this pull request as ready for review August 8, 2024 06:59
Comment on lines -173 to -181
blobHeader := batchData.blobHeaders[blobIndex]

blobHeaderHash, err := blobHeader.GetBlobHeaderHash()
if err != nil {
b.logger.Error("failed to get blob header hash", "err", err)
blobsToRetry = append(blobsToRetry, batchData.blobs[blobIndex])
continue
}
merkleProof, err := batchData.merkleTree.GenerateProof(blobHeaderHash[:], 0)
Copy link
Contributor Author

@ian-shim ian-shim Aug 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proof should be generated based on leaf index, not the leaf data

Comment on lines +187 to +194
BatchHeaderHash: headerHash,
BlobIndex: uint32(blobIndex),
SignatoryRecordHash: core.ComputeSignatoryRecordHash(uint32(batchData.batchHeader.ReferenceBlockNumber), batchData.aggSig.NonSigners),
ReferenceBlockNumber: uint32(batchData.batchHeader.ReferenceBlockNumber),
BatchRoot: batchData.batchHeader.BatchRoot[:],
BlobInclusionProof: proof,
BlobCommitment: &batchData.blobHeaders[blobIndex].BlobCommitments,
// This is onchain, external batch ID, which is different from the internal representation of batch UUID
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change in this block. Just adding comment in L194

Copy link
Collaborator

@mooselumph mooselumph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one concern

@ian-shim ian-shim merged commit 8094491 into Layr-Labs:master Aug 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants