Skip to content

Commit 827ce3c

Browse files
committed
tweak
1 parent 15e7f33 commit 827ce3c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rollup/rollup_sync_service/rollup_sync_service.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ func (s *RollupSyncService) decodeChunkBlockRanges(txData []byte) ([]*rawdb.Chun
422422
return nil, fmt.Errorf("unexpected method name: %v", method.Name)
423423
}
424424

425-
// validateBatch verifies the consistency between L1 contract and L2 node data.
425+
// validateBatch verifies the consistency between the L1 contract and L2 node data.
426426
// It performs the following checks:
427427
// 1. Recalculates the batch hash locally
428-
// 2. Compares local state root, withdraw root, and batch hash with L1 data (for the last batch only when "finalize by bundle")
428+
// 2. Compares local state root, local withdraw root, and locally calculated batch hash with L1 data (for the last batch only when "finalize by bundle")
429429
//
430430
// The function will terminate the node and exit if any consistency check fails.
431431
//
@@ -444,6 +444,7 @@ func (s *RollupSyncService) decodeChunkBlockRanges(txData []byte) ([]*rawdb.Chun
444444
//
445445
// Note: This function is compatible with both "finalize by batch" and "finalize by bundle" methods.
446446
// In "finalize by bundle", only the last batch of each bundle is fully verified.
447+
// This check still ensures the correctness of all batch hashes in the bundle due to the parent-child relationship between batch hashes.
447448
func validateBatch(batchIndex uint64, event *L1FinalizeBatchEvent, parentBatchMeta *rawdb.FinalizedBatchMeta, chunks []*encoding.Chunk, chainCfg *params.ChainConfig, stack *node.Node) (uint64, *rawdb.FinalizedBatchMeta, error) {
448449
if len(chunks) == 0 {
449450
return 0, nil, fmt.Errorf("invalid argument: length of chunks is 0, batch index: %v", batchIndex)

0 commit comments

Comments
 (0)