Skip to content

Commit aec0089

Browse files
authored
fix(verifier,l1follower): update da-codec to latest version (#1143)
* update da-codec to latest version * fix nodes db * chore: auto version bump [bot] * fix comment * fix L1 block number * fix comment * fix error trigger * adjust comment --------- Co-authored-by: jonastheis <jonastheis@users.noreply.github.com>
1 parent 974cfcd commit aec0089

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ require (
5151
github.com/prometheus/tsdb v0.7.1
5252
github.com/rjeczalik/notify v0.9.1
5353
github.com/rs/cors v1.7.0
54-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54
54+
github.com/scroll-tech/da-codec v0.1.3-0.20250313120912-344f2d5e33e1
5555
github.com/scroll-tech/zktrie v0.8.4
5656
github.com/shirou/gopsutil v3.21.11+incompatible
5757
github.com/sourcegraph/conc v0.3.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj
396396
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
397397
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
398398
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
399-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4=
400-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58=
399+
github.com/scroll-tech/da-codec v0.1.3-0.20250313120912-344f2d5e33e1 h1:Dhd58LE1D+dnoxpgLVeQBMF9uweL/fhQfZHWtWSiOlE=
400+
github.com/scroll-tech/da-codec v0.1.3-0.20250313120912-344f2d5e33e1/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
401401
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
402402
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
403403
github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo=

params/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 8 // Minor version component of the current release
27-
VersionPatch = 24 // Patch version component of the current release
27+
VersionPatch = 25 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

rollup/rollup_sync_service/rollup_sync_service.go

+19
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

@@ -42,6 +43,8 @@ const (
4243
defaultLogInterval = 5 * time.Minute
4344
)
4445

46+
var ErrShouldResetSyncHeight = errors.New("ErrShouldResetSyncHeight")
47+
4548
// RollupSyncService collects ScrollChain batch commit/revert/finalize events and stores metadata into db.
4649
type RollupSyncService struct {
4750
ctx context.Context
@@ -205,6 +208,12 @@ func (s *RollupSyncService) fetchRollupEvents() error {
205208
}
206209

207210
if err = s.updateRollupEvents(daEntries); err != nil {
211+
if errors.Is(err, ErrShouldResetSyncHeight) {
212+
log.Warn("Resetting sync height to L1 block 7892668 to fix L1 message queue hash calculation")
213+
s.callDataBlobSource.SetL1Height(7892668)
214+
215+
return nil
216+
}
208217
// Reset the L1 height to the previous value to retry fetching the same data.
209218
s.callDataBlobSource.SetL1Height(prevL1Height)
210219
return fmt.Errorf("failed to parse and update rollup event logs: %w", err)
@@ -535,6 +544,16 @@ func validateBatch(batchIndex uint64, event *l1.FinalizeBatchEvent, parentFinali
535544

536545
daBatch, err := codec.NewDABatch(batch)
537546
if err != nil {
547+
// This is hotfix for the L1 message hash mismatch issue which lead to wrong committedBatchMeta.PostL1MessageQueueHash hashes.
548+
// These in turn lead to a wrongly computed batch hash locally. This happened after upgrading to EuclidV2
549+
// where da-codec was not updated to the latest version in l2geth.
550+
// If the error message due to mismatching PostL1MessageQueueHash contains the same hash as the hardcoded one,
551+
// this means the node ran into this issue.
552+
// We need to reset the sync height to 1 block before the L1 block in which the last batch in CodecV6 was committed.
553+
// The node will overwrite the wrongly computed message queue hashes.
554+
if strings.Contains(err.Error(), "0xaa16faf2a1685fe1d7e0f2810b1a0e98c2841aef96596d10456a6d0f00000000") {
555+
return 0, nil, ErrShouldResetSyncHeight
556+
}
538557
return 0, nil, fmt.Errorf("failed to create DA batch, batch index: %v, codec version: %v, err: %w", batchIndex, codecVersion, err)
539558
}
540559
localBatchHash := daBatch.Hash()

0 commit comments

Comments
 (0)