|
6 | 6 | "errors" |
7 | 7 | "fmt" |
8 | 8 | "os" |
| 9 | + "strings" |
9 | 10 | "sync" |
10 | 11 | "time" |
11 | 12 |
|
@@ -543,6 +544,15 @@ func validateBatch(batchIndex uint64, event *l1.FinalizeBatchEvent, parentFinali |
543 | 544 |
|
544 | 545 | daBatch, err := codec.NewDABatch(batch) |
545 | 546 | 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 | + } |
546 | 556 | return 0, nil, fmt.Errorf("failed to create DA batch, batch index: %v, codec version: %v, err: %w", batchIndex, codecVersion, err) |
547 | 557 | } |
548 | 558 | localBatchHash := daBatch.Hash() |
@@ -573,16 +583,6 @@ func validateBatch(batchIndex uint64, event *l1.FinalizeBatchEvent, parentFinali |
573 | 583 | // This check ensures the correctness of all batch hashes in the bundle |
574 | 584 | // due to the parent-child relationship between batch hashes |
575 | 585 | 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 | | - |
586 | 586 | 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()) |
587 | 587 | chunksJson, err := json.Marshal(chunks) |
588 | 588 | if err != nil { |
|
0 commit comments