Skip to content

Commit 1b45967

Browse files
committed
fix error trigger
1 parent 5fe1ed2 commit 1b45967

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

rollup/rollup_sync_service/rollup_sync_service.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"errors"
77
"fmt"
88
"os"
9+
"strings"
910
"sync"
1011
"time"
1112

@@ -543,6 +544,15 @@ func validateBatch(batchIndex uint64, event *l1.FinalizeBatchEvent, parentFinali
543544

544545
daBatch, err := codec.NewDABatch(batch)
545546
if err != nil {
547+
// This is hotfix for the L1 message hash mismatch issue which lead to wrong committedBatchMeta.PostL1MessageQueueHash
548+
// hashes. These in turn lead to a wrongly computed batch hash locally.
549+
// This happened after upgrading to EuclidV2 where da-codec was not updated in l2geth.
550+
// If the batch hash is the same as the hardcoded one, this means the node ran into this issue.
551+
// We need to reset the sync height to 1 block before the L1 block in which the last batch in CodecV6 was committed.
552+
// The node will overwrite the wrongly computed message queue hashes.
553+
if strings.Contains(err.Error(), "0xaa16faf2a1685fe1d7e0f2810b1a0e98c2841aef96596d10456a6d0f00000000") {
554+
return 0, nil, ErrShouldResetSyncHeight
555+
}
546556
return 0, nil, fmt.Errorf("failed to create DA batch, batch index: %v, codec version: %v, err: %w", batchIndex, codecVersion, err)
547557
}
548558
localBatchHash := daBatch.Hash()
@@ -573,16 +583,6 @@ func validateBatch(batchIndex uint64, event *l1.FinalizeBatchEvent, parentFinali
573583
// This check ensures the correctness of all batch hashes in the bundle
574584
// due to the parent-child relationship between batch hashes
575585
if localBatchHash != event.BatchHash() {
576-
// This is hotfix for the L1 message hash mismatch issue which lead to wrong committedBatchMeta.PostL1MessageQueueHash
577-
// hashes. These in turn lead to a wrongly computed batch hash locally.
578-
// This happened after upgrading to EuclidV2 where da-codec was not updated in l2geth.
579-
// If the batch hash is the same as the hardcoded one, this means the node ran into this issue.
580-
// We need to reset the sync height to 1 block before the L1 block in which the last batch in CodecV6 was committed.
581-
// The node will overwrite the wrongly computed message queue hashes.
582-
if localBatchHash == common.HexToHash("0x0b671dc4155c589ffa13dd481271c7b944a778f5ce23d5100546e2b45da61ba6") {
583-
return 0, nil, ErrShouldResetSyncHeight
584-
}
585-
586586
log.Error("Batch hash mismatch", "batch index", event.BatchIndex().Uint64(), "start block", startBlock.Header.Number.Uint64(), "end block", endBlock.Header.Number.Uint64(), "parent batch hash", parentFinalizedBatchMeta.BatchHash.Hex(), "parent TotalL1MessagePopped", parentFinalizedBatchMeta.TotalL1MessagePopped, "l1 finalized batch hash", event.BatchHash().Hex(), "l2 batch hash", localBatchHash.Hex())
587587
chunksJson, err := json.Marshal(chunks)
588588
if err != nil {

0 commit comments

Comments
 (0)