Skip to content

Commit 937a4b0

Browse files
author
colinlyguo
committed
simplify rollup-relayer
1 parent 0d8b00c commit 937a4b0

32 files changed

+465
-1586
lines changed

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.9"
8+
var tag = "v4.5.10"
99

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

rollup/abi/bridge_abi_test.go

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,6 @@ import (
1010
"github.com/stretchr/testify/assert"
1111
)
1212

13-
func TestPackCommitBatch(t *testing.T) {
14-
scrollChainABI, err := ScrollChainMetaData.GetAbi()
15-
assert.NoError(t, err)
16-
17-
version := uint8(1)
18-
var parentBatchHeader []byte
19-
var chunks [][]byte
20-
var skippedL1MessageBitmap []byte
21-
22-
_, err = scrollChainABI.Pack("commitBatch", version, parentBatchHeader, chunks, skippedL1MessageBitmap)
23-
assert.NoError(t, err)
24-
}
25-
26-
func TestPackCommitBatchWithBlobProof(t *testing.T) {
27-
scrollChainABI, err := ScrollChainMetaData.GetAbi()
28-
assert.NoError(t, err)
29-
30-
version := uint8(1)
31-
var parentBatchHeader []byte
32-
var chunks [][]byte
33-
var skippedL1MessageBitmap []byte
34-
var blobDataProof []byte
35-
36-
_, err = scrollChainABI.Pack("commitBatchWithBlobProof", version, parentBatchHeader, chunks, skippedL1MessageBitmap, blobDataProof)
37-
assert.NoError(t, err)
38-
}
39-
4013
func TestPackCommitBatches(t *testing.T) {
4114
scrollChainABI, err := ScrollChainMetaData.GetAbi()
4215
assert.NoError(t, err)
@@ -49,58 +22,6 @@ func TestPackCommitBatches(t *testing.T) {
4922
assert.NoError(t, err)
5023
}
5124

52-
func TestPackFinalizeBatchWithProof(t *testing.T) {
53-
l1RollupABI, err := ScrollChainMetaData.GetAbi()
54-
assert.NoError(t, err)
55-
56-
var batchHeader []byte
57-
var prevStateRoot common.Hash
58-
var postStateRoot common.Hash
59-
var withdrawRoot common.Hash
60-
var aggrProof []byte
61-
62-
_, err = l1RollupABI.Pack("finalizeBatchWithProof", batchHeader, prevStateRoot, postStateRoot, withdrawRoot, aggrProof)
63-
assert.NoError(t, err)
64-
}
65-
66-
func TestPackFinalizeBatchWithProof4844(t *testing.T) {
67-
l1RollupABI, err := ScrollChainMetaData.GetAbi()
68-
assert.NoError(t, err)
69-
70-
var batchHeader []byte
71-
var prevStateRoot common.Hash
72-
var postStateRoot common.Hash
73-
var withdrawRoot common.Hash
74-
var blobDataProof []byte
75-
var aggrProof []byte
76-
77-
_, err = l1RollupABI.Pack("finalizeBatchWithProof4844", batchHeader, prevStateRoot, postStateRoot, withdrawRoot, blobDataProof, aggrProof)
78-
assert.NoError(t, err)
79-
}
80-
81-
func TestPackFinalizeBundleWithProof(t *testing.T) {
82-
l1RollupABI, err := ScrollChainMetaData.GetAbi()
83-
assert.NoError(t, err)
84-
85-
var batchHeader []byte
86-
var postStateRoot common.Hash
87-
var withdrawRoot common.Hash
88-
var aggrProof []byte
89-
90-
_, err = l1RollupABI.Pack("finalizeBundleWithProof", batchHeader, postStateRoot, withdrawRoot, aggrProof)
91-
assert.NoError(t, err)
92-
}
93-
94-
func TestPackFinalizeEuclidInitialBatch(t *testing.T) {
95-
l1RollupABI, err := ScrollChainMetaData.GetAbi()
96-
assert.NoError(t, err)
97-
98-
var postStateRoot common.Hash
99-
100-
_, err = l1RollupABI.Pack("finalizeEuclidInitialBatch", postStateRoot)
101-
assert.NoError(t, err)
102-
}
103-
10425
func TestPackFinalizeBundlePostEuclidV2(t *testing.T) {
10526
l1RollupABI, err := ScrollChainMetaData.GetAbi()
10627
assert.NoError(t, err)

rollup/cmd/proposer_tool/app/app.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ func action(ctx *cli.Context) error {
5454
}
5555

5656
minCodecVersion := encoding.CodecVersion(ctx.Uint(utils.MinCodecVersionFlag.Name))
57+
if minCodecVersion < encoding.CodecV7 {
58+
log.Crit("min codec version must be greater than or equal to CodecV7", "minCodecVersion", minCodecVersion)
59+
}
5760

5861
// sanity check config
5962
if cfg.L2Config.BatchProposerConfig.MaxChunksPerBatch <= 0 {

rollup/cmd/rollup_relayer/app/app.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ func action(ctx *cli.Context) error {
102102
}
103103

104104
minCodecVersion := encoding.CodecVersion(ctx.Uint(utils.MinCodecVersionFlag.Name))
105+
if minCodecVersion < encoding.CodecV7 {
106+
log.Crit("min codec version must be greater than or equal to CodecV7", "minCodecVersion", minCodecVersion)
107+
}
108+
105109
chunkProposer := watcher.NewChunkProposer(subCtx, cfg.L2Config.ChunkProposerConfig, minCodecVersion, genesis.Config, db, registry)
106110
batchProposer := watcher.NewBatchProposer(subCtx, cfg.L2Config.BatchProposerConfig, minCodecVersion, genesis.Config, db, registry)
107111
bundleProposer := watcher.NewBundleProposer(subCtx, cfg.L2Config.BundleProposerConfig, minCodecVersion, genesis.Config, db, registry)

rollup/conf/config.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,15 @@
9595
"max_block_num_per_chunk": 100,
9696
"max_tx_num_per_chunk": 100,
9797
"max_l2_gas_per_chunk": 20000000,
98-
"max_l1_commit_gas_per_chunk": 11234567,
99-
"max_l1_commit_calldata_size_per_chunk": 112345,
10098
"chunk_timeout_sec": 300,
101-
"max_row_consumption_per_chunk": 1048319,
102-
"gas_cost_increase_multiplier": 1.2,
103-
"max_uncompressed_batch_bytes_size": 634880
99+
"gas_cost_increase_multiplier": 1.2
104100
},
105101
"batch_proposer_config": {
106102
"propose_interval_milliseconds": 1000,
107103
"max_l1_commit_gas_per_batch": 11234567,
108-
"max_l1_commit_calldata_size_per_batch": 112345,
109104
"batch_timeout_sec": 300,
110105
"gas_cost_increase_multiplier": 1.2,
111-
"max_uncompressed_batch_bytes_size": 634880,
112-
"max_chunks_per_batch": 12
106+
"max_chunks_per_batch": 45
113107
},
114108
"bundle_proposer_config": {
115109
"max_batch_num_per_bundle": 20,

rollup/docker-compose-proposer-tool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
command: [
2828
"--config", "/app/conf/proposer-tool-config.json",
2929
"--genesis", "/app/conf/proposer-tool-genesis.json",
30-
"--min-codec-version", "4",
30+
"--min-codec-version", "7",
3131
"--start-l2-block", "10000",
3232
"--log.debug", "--verbosity", "3"
3333
]

rollup/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/holiman/uint256 v1.3.2
1212
github.com/mitchellh/mapstructure v1.5.0
1313
github.com/prometheus/client_golang v1.16.0
14-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493
14+
github.com/scroll-tech/da-codec v0.1.3-0.20250512054757-d0bc38e57a82
1515
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601
1616
github.com/smartystreets/goconvey v1.8.0
1717
github.com/spf13/viper v1.19.0

rollup/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke
249249
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
250250
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
251251
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
252-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493 h1:Ioc01J0WEMxuwFvEPGJeBKXdf2KY4Yc3XbFky/IxLlI=
253-
github.com/scroll-tech/da-codec v0.1.3-0.20250401062930-9f9f53898493/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
252+
github.com/scroll-tech/da-codec v0.1.3-0.20250512054757-d0bc38e57a82 h1:8mqkSusH9qz7Hzz7MtQ9uMXX0ej2c1NyeG14W1LTCQk=
253+
github.com/scroll-tech/da-codec v0.1.3-0.20250512054757-d0bc38e57a82/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
254254
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601 h1:NEsjCG6uSvLRBlsP3+x6PL1kM+Ojs3g8UGotIPgJSz8=
255255
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ=
256256
github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE=

rollup/internal/config/l2.go

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,18 @@ type L2Config struct {
2828

2929
// ChunkProposerConfig loads chunk_proposer configuration items.
3030
type ChunkProposerConfig struct {
31-
ProposeIntervalMilliseconds uint64 `json:"propose_interval_milliseconds"`
32-
MaxBlockNumPerChunk uint64 `json:"max_block_num_per_chunk"`
33-
MaxTxNumPerChunk uint64 `json:"max_tx_num_per_chunk"`
34-
MaxL2GasPerChunk uint64 `json:"max_l2_gas_per_chunk"`
35-
MaxL1CommitGasPerChunk uint64 `json:"max_l1_commit_gas_per_chunk"`
36-
MaxL1CommitCalldataSizePerChunk uint64 `json:"max_l1_commit_calldata_size_per_chunk"`
37-
ChunkTimeoutSec uint64 `json:"chunk_timeout_sec"`
38-
MaxRowConsumptionPerChunk uint64 `json:"max_row_consumption_per_chunk"`
39-
GasCostIncreaseMultiplier float64 `json:"gas_cost_increase_multiplier"`
40-
MaxUncompressedBatchBytesSize uint64 `json:"max_uncompressed_batch_bytes_size"`
31+
ProposeIntervalMilliseconds uint64 `json:"propose_interval_milliseconds"`
32+
MaxBlockNumPerChunk uint64 `json:"max_block_num_per_chunk"`
33+
MaxTxNumPerChunk uint64 `json:"max_tx_num_per_chunk"`
34+
MaxL2GasPerChunk uint64 `json:"max_l2_gas_per_chunk"`
35+
ChunkTimeoutSec uint64 `json:"chunk_timeout_sec"`
4136
}
4237

4338
// BatchProposerConfig loads batch_proposer configuration items.
4439
type BatchProposerConfig struct {
45-
ProposeIntervalMilliseconds uint64 `json:"propose_interval_milliseconds"`
46-
MaxL1CommitGasPerBatch uint64 `json:"max_l1_commit_gas_per_batch"`
47-
MaxL1CommitCalldataSizePerBatch uint64 `json:"max_l1_commit_calldata_size_per_batch"`
48-
BatchTimeoutSec uint64 `json:"batch_timeout_sec"`
49-
GasCostIncreaseMultiplier float64 `json:"gas_cost_increase_multiplier"`
50-
MaxUncompressedBatchBytesSize uint64 `json:"max_uncompressed_batch_bytes_size"`
51-
MaxChunksPerBatch int `json:"max_chunks_per_batch"`
40+
ProposeIntervalMilliseconds uint64 `json:"propose_interval_milliseconds"`
41+
BatchTimeoutSec uint64 `json:"batch_timeout_sec"`
42+
MaxChunksPerBatch int `json:"max_chunks_per_batch"`
5243
}
5344

5445
// BundleProposerConfig loads bundle_proposer configuration items.

rollup/internal/config/relayer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ type RelayerConfig struct {
7373

7474
// Indicates if bypass features specific to testing environments are enabled.
7575
EnableTestEnvBypassFeatures bool `json:"enable_test_env_bypass_features"`
76-
// Sets rollup-relayer to stop fake finalizing at the fork boundary
77-
TestEnvBypassOnlyUntilForkBoundary bool `json:"test_env_bypass_only_until_fork_boundary"`
7876
// The timeout in seconds for finalizing a batch without proof, only used when EnableTestEnvBypassFeatures is true.
7977
FinalizeBatchWithoutProofTimeoutSec uint64 `json:"finalize_batch_without_proof_timeout_sec"`
8078
// The timeout in seconds for finalizing a bundle without proof, only used when EnableTestEnvBypassFeatures is true.

0 commit comments

Comments
 (0)