Skip to content

Commit

Permalink
docs(verifier): expand explanation for reorg edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed Oct 28, 2024
1 parent 6a25446 commit 55edfae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions verify/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error) {
func (cv *CertVerifier) verifyBatchConfirmedOnChain(
ctx context.Context, batchID uint32, batchMetadata *disperser.BatchMetadata,
) error {
// 1. verify batch is actually onchain at the batchMetadata's state confirmedBlockNumber
// This assert is technically not necessary, but it's a good sanity check.
// It could technically happen that a confirmed batch's block gets reorged out,
// yet the tx is included in an earlier or later block, making this check fail...
// 1. Verify batch is actually onchain at the batchMetadata's state confirmedBlockNumber.
// This is super unlikely if the disperser is honest, but it could technically happen that a confirmed batch's block gets reorged out,
// yet the tx is included in an earlier or later block, making the batchMetadata received from the disperser
// no longer valid. The eigenda batcher does check for these reorgs and updates the batch's confirmation block number:
// https://github.com/Layr-Labs/eigenda/blob/bee55ed9207f16153c3fd8ebf73c219e68685def/disperser/batcher/finalizer.go#L198
// TODO: We could require the disperser for the new batch, or try to reconstruct it ourselves by querying the chain,
// but for now we opt to simply fail the verification, which will force teh batcher to resubmit the batch to eigenda.
confirmationBlockNumber := batchMetadata.GetConfirmationBlockNumber()
confirmationBlockNumberBigInt := big.NewInt(0).SetInt64(int64(confirmationBlockNumber))
_, err := cv.retrieveBatchMetadataHash(ctx, batchID, confirmationBlockNumberBigInt)
Expand Down

0 comments on commit 55edfae

Please sign in to comment.