Skip to content

Commit 377e8bb

Browse files
committed
feat(rollup-relayer): support codecv8
1 parent 5d6b5a8 commit 377e8bb

File tree

13 files changed

+44
-33
lines changed

13 files changed

+44
-33
lines changed

bridge-history-api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ require (
1010
github.com/go-redis/redis/v8 v8.11.5
1111
github.com/pressly/goose/v3 v3.16.0
1212
github.com/prometheus/client_golang v1.19.0
13-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54
14-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950
13+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd
14+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250616074821-cba908db071d
1515
github.com/stretchr/testify v1.9.0
1616
github.com/urfave/cli/v2 v2.25.7
1717
golang.org/x/sync v0.11.0
1818
gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde
1919
)
2020

21-
replace github.com/scroll-tech/go-ethereum => github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950 // It's a hotfix for the header hash incompatibility issue, pls change this with caution
21+
replace github.com/scroll-tech/go-ethereum => github.com/scroll-tech/go-ethereum v1.10.14-0.20250616074821-cba908db071d // It's a hotfix for the header hash incompatibility issue, pls change this with caution
2222

2323
require (
2424
dario.cat/mergo v1.0.0 // indirect

bridge-history-api/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,10 @@ github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
309309
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
310310
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
311311
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
312-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4=
313-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58=
314-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950 h1:qfOaRflvH1vtnFWloB7BveKlP/VqYgMqLJ6e9TlBJ/8=
315-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305084331-57148478e950/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ=
312+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd h1:VKVDPtKJZIaQNQvhXptVhS7O9GLKl1314egD1fln8SA=
313+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd/go.mod h1:T+370kLxwACnmWaq4rgtKGyLCd7QSE6iy0JLfCp1qj4=
314+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250616074821-cba908db071d h1:JoEtZN6aCV5MUBjacsrPd2S6fl8sDGZE9Xd4UUhg5Oo=
315+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250616074821-cba908db071d/go.mod h1:756YMENiSfx/5pCwKq3+uSTWjXuHTbiCB+TirJjsQT8=
316316
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
317317
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
318318
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=

common/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"runtime/debug"
66
)
77

8-
var tag = "v4.5.23"
8+
var tag = "v4.5.24"
99

1010
var commit = func() string {
1111
if info, ok := debug.ReadBuildInfo(); ok {

coordinator/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ require (
99
github.com/google/uuid v1.6.0
1010
github.com/mitchellh/mapstructure v1.5.0
1111
github.com/prometheus/client_golang v1.19.0
12-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493
13-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601
12+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd
13+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707
1414
github.com/shopspring/decimal v1.3.1
1515
github.com/stretchr/testify v1.10.0
1616
github.com/urfave/cli/v2 v2.25.7

coordinator/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU
177177
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
178178
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
179179
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
180-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493 h1:Ioc01J0WEMxuwFvEPGJeBKXdf2KY4Yc3XbFky/IxLlI=
181-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
182-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601 h1:NEsjCG6uSvLRBlsP3+x6PL1kM+Ojs3g8UGotIPgJSz8=
183-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ=
180+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd h1:VKVDPtKJZIaQNQvhXptVhS7O9GLKl1314egD1fln8SA=
181+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd/go.mod h1:T+370kLxwACnmWaq4rgtKGyLCd7QSE6iy0JLfCp1qj4=
182+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707 h1:rC6eEsAwSG1VzNT48fLM00rqwTGWPckiipmFC8D6D5o=
183+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707/go.mod h1:756YMENiSfx/5pCwKq3+uSTWjXuHTbiCB+TirJjsQT8=
184184
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
185185
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
186186
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=

coordinator/internal/logic/provertask/batch_prover_task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func (bp *BatchProverTask) getBatchTaskDetail(dbBatch *orm.Batch, chunkInfos []*
266266

267267
dbBatchCodecVersion := encoding.CodecVersion(dbBatch.CodecVersion)
268268
switch dbBatchCodecVersion {
269-
case encoding.CodecV3, encoding.CodecV4, encoding.CodecV6, encoding.CodecV7:
269+
case encoding.CodecV3, encoding.CodecV4, encoding.CodecV6, encoding.CodecV7, encoding.CodecV8:
270270
default:
271271
return taskDetail, nil
272272
}

go.work.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,14 @@ github.com/scroll-tech/da-codec v0.1.1-0.20241005172014-aca0bef21638 h1:2KIfClLB
14031403
github.com/scroll-tech/da-codec v0.1.1-0.20241005172014-aca0bef21638/go.mod h1:6jxEQvNc7GQKMSUi25PthAUY3WnZL8CN0yWivBgAXi0=
14041404
github.com/scroll-tech/da-codec v0.1.1-0.20241014152913-2703f226fb0b h1:5H6V6ybacXFJ2ti+eFwtf+12Otufod6goxK6/u7Nu1k=
14051405
github.com/scroll-tech/da-codec v0.1.1-0.20241014152913-2703f226fb0b/go.mod h1:48uxaqVgpD8ulH8p+nrBtfeLHZ9tX82bVVdPNkW3rPE=
1406+
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58=
14061407
github.com/scroll-tech/da-codec v0.1.3-0.20250227072756-a1482833595f h1:YYbhuUwjowqI4oyXtECRofck7Fyj18e1tcRjuQlZpJE=
14071408
github.com/scroll-tech/da-codec v0.1.3-0.20250227072756-a1482833595f/go.mod h1:xECEHZLVzbdUn+tNbRJhRIjLGTOTmnFQuTgUTeVLX58=
1409+
github.com/scroll-tech/da-codec v0.1.3-0.20250313120912-344f2d5e33e1/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
1410+
github.com/scroll-tech/da-codec v0.1.3-0.20250609113414-f33adf0904bd h1:NUol+dPtZ8LzLYrP7CPq9tRI0jAhxFxrYNmKYrTQgKE=
1411+
github.com/scroll-tech/da-codec v0.1.3-0.20250609113414-f33adf0904bd/go.mod h1:gz5x3CsLy5htNTbv4PWRPBU9nSAujfx1U2XtFcXoFuk=
1412+
github.com/scroll-tech/da-codec v0.1.3-0.20250609154559-8935de62c148 h1:cyK1ifU2fRoMl8YWR9LOsZK4RvJnlG3RODgakj5I8VY=
1413+
github.com/scroll-tech/da-codec v0.1.3-0.20250609154559-8935de62c148/go.mod h1:gz5x3CsLy5htNTbv4PWRPBU9nSAujfx1U2XtFcXoFuk=
14081414
github.com/scroll-tech/go-ethereum v1.10.14-0.20240607130425-e2becce6a1a4/go.mod h1:byf/mZ8jLYUCnUePTicjJWn+RvKdxDn7buS6glTnMwQ=
14091415
github.com/scroll-tech/go-ethereum v1.10.14-0.20240821074444-b3fa00861e5e/go.mod h1:swB5NSp8pKNDuYsTxfR08bHS6L56i119PBx8fxvV8Cs=
14101416
github.com/scroll-tech/go-ethereum v1.10.14-0.20241010064814-3d88e870ae22/go.mod h1:r9FwtxCtybMkTbWYCyBuevT9TW3zHmOTHqD082Uh+Oo=

rollup/docker-compose-proposer-tool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
"--config", "/app/conf/proposer-tool-config.json",
2929
"--genesis", "/app/conf/proposer-tool-genesis.json",
3030
"--min-codec-version", "7",
31-
"--start-l2-block", "10000",
31+
"--start-l2-block", "14907015",
3232
"--log.debug", "--verbosity", "3"
3333
]
3434
volumes:

rollup/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ require (
1515
github.com/holiman/uint256 v1.3.2
1616
github.com/mitchellh/mapstructure v1.5.0
1717
github.com/prometheus/client_golang v1.16.0
18-
github.com/scroll-tech/da-codec v0.1.3-0.20250519114140-bfa7133d4ad1
19-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250610090337-00c5c2bd3e65
18+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd
19+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707
2020
github.com/smartystreets/goconvey v1.8.0
2121
github.com/spf13/viper v1.19.0
2222
github.com/stretchr/testify v1.10.0

rollup/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke
285285
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
286286
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
287287
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
288-
github.com/scroll-tech/da-codec v0.1.3-0.20250519114140-bfa7133d4ad1 h1:6aKqJSal+QVdB5HMWMs0JTbAIZ6/iAHJx9qizz0w9dU=
289-
github.com/scroll-tech/da-codec v0.1.3-0.20250519114140-bfa7133d4ad1/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
290-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250610090337-00c5c2bd3e65 h1:idsnkl5rwVr7eNUB0HxdkKI0L3zbTm8XSGwMTB5ndws=
291-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250610090337-00c5c2bd3e65/go.mod h1:756YMENiSfx/5pCwKq3+uSTWjXuHTbiCB+TirJjsQT8=
288+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd h1:VKVDPtKJZIaQNQvhXptVhS7O9GLKl1314egD1fln8SA=
289+
github.com/scroll-tech/da-codec v0.1.3-0.20250616065246-17bf3e4990cd/go.mod h1:T+370kLxwACnmWaq4rgtKGyLCd7QSE6iy0JLfCp1qj4=
290+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707 h1:rC6eEsAwSG1VzNT48fLM00rqwTGWPckiipmFC8D6D5o=
291+
github.com/scroll-tech/go-ethereum v1.10.14-0.20250611141528-cf3d22ef8707/go.mod h1:756YMENiSfx/5pCwKq3+uSTWjXuHTbiCB+TirJjsQT8=
292292
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=
293293
github.com/scroll-tech/zktrie v0.8.4/go.mod h1:XvNo7vAk8yxNyTjBDj5WIiFzYW4bx/gJ78+NK6Zn6Uk=
294294
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=

rollup/internal/controller/relayer/l2_relayer.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
466466

467467
codecVersion := encoding.CodecVersion(firstBatch.CodecVersion)
468468
switch codecVersion {
469-
case encoding.CodecV7:
469+
case encoding.CodecV7, encoding.CodecV8:
470470
calldata, blobs, maxBlockHeight, totalGasUsed, err = r.constructCommitBatchPayloadCodecV7(batchesToSubmit, firstBatch, lastBatch)
471471
if err != nil {
472472
log.Error("failed to construct constructCommitBatchPayloadCodecV7 payload for V7", "codecVersion", codecVersion, "start index", firstBatch.Index, "end index", lastBatch.Index, "err", err)
@@ -477,7 +477,7 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
477477
return
478478
}
479479

480-
txHash, blobBaseFee, err := r.commitSender.SendTransaction(r.contextIDFromBatches(batchesToSubmit), &r.cfg.RollupContractAddress, calldata, blobs)
480+
txHash, blobBaseFee, err := r.commitSender.SendTransaction(r.contextIDFromBatches(codecVersion, batchesToSubmit), &r.cfg.RollupContractAddress, calldata, blobs)
481481
if err != nil {
482482
if errors.Is(err, sender.ErrTooManyPendingBlobTxs) {
483483
r.metrics.rollupL2RelayerProcessPendingBatchErrTooManyPendingBlobTxsTotal.Inc()
@@ -523,21 +523,25 @@ func (r *Layer2Relayer) ProcessPendingBatches() {
523523
log.Info("Sent the commitBatches tx to layer1", "batches count", len(batchesToSubmit), "start index", firstBatch.Index, "start hash", firstBatch.Hash, "end index", lastBatch.Index, "end hash", lastBatch.Hash, "tx hash", txHash.String())
524524
}
525525

526-
func (r *Layer2Relayer) contextIDFromBatches(batches []*dbBatchWithChunksAndParent) string {
527-
contextIDs := []string{"v7"}
526+
func (r *Layer2Relayer) contextIDFromBatches(codecVersion encoding.CodecVersion, batches []*dbBatchWithChunksAndParent) string {
527+
var prefix string
528+
if codecVersion == encoding.CodecV7 {
529+
prefix = "v7"
530+
} else {
531+
prefix = "v8"
532+
}
528533

534+
contextIDs := []string{prefix}
529535
for _, batch := range batches {
530536
contextIDs = append(contextIDs, batch.Batch.Hash)
531537
}
532-
533538
return strings.Join(contextIDs, "-")
534539
}
535540

536541
func (r *Layer2Relayer) batchHashesFromContextID(contextID string) []string {
537-
if strings.HasPrefix(contextID, "v7-") {
542+
if strings.HasPrefix(contextID, "v7-") || strings.HasPrefix(contextID, "v8-") {
538543
return strings.Split(contextID, "-")[1:]
539544
}
540-
541545
return []string{contextID}
542546
}
543547

@@ -693,7 +697,7 @@ func (r *Layer2Relayer) finalizeBundle(bundle *orm.Bundle, withProof bool) error
693697

694698
var calldata []byte
695699
switch encoding.CodecVersion(bundle.CodecVersion) {
696-
case encoding.CodecV7:
700+
case encoding.CodecV7, encoding.CodecV8:
697701
calldata, err = r.constructFinalizeBundlePayloadCodecV7(dbBatch, endChunk, aggProof)
698702
if err != nil {
699703
return fmt.Errorf("failed to construct finalizeBundle payload codecv7, bundle index: %v, last batch index: %v, err: %w", bundle.Index, dbBatch.Index, err)

rollup/proposer-tool-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"l2_config": {
33
"endpoint": "https://rpc.scroll.io",
44
"chunk_proposer_config": {
5-
"max_block_num_per_chunk": 100,
6-
"max_l2_gas_per_chunk": 20000000,
5+
"max_block_num_per_chunk": 1000,
6+
"max_l2_gas_per_chunk": 200000000000,
77
"chunk_timeout_sec": 72000000000
88
},
99
"batch_proposer_config": {

rollup/proposer-tool-genesis.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"darwinTime": 0,
77
"darwinV2Time": 0,
88
"euclidTime": 0,
9-
"euclidV2Time": 0
9+
"euclidV2Time": 0,
10+
"feynmanTime": 0
1011
},
1112
"nonce": "0x0000000000000033",
1213
"timestamp": "0x0",

0 commit comments

Comments
 (0)