From 0707b91205216d13dcdfa28a5c2fcc9463146a3b Mon Sep 17 00:00:00 2001 From: jonastheis <4181434+jonastheis@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:10:59 +0800 Subject: [PATCH 1/4] update to latest da-codec --- rollup/go.mod | 2 +- rollup/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rollup/go.mod b/rollup/go.mod index 1f5960ed29..71741a3aa1 100644 --- a/rollup/go.mod +++ b/rollup/go.mod @@ -13,7 +13,7 @@ require ( github.com/holiman/uint256 v1.3.2 github.com/mitchellh/mapstructure v1.5.0 github.com/prometheus/client_golang v1.16.0 - github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435 + github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601 github.com/smartystreets/goconvey v1.8.0 github.com/spf13/viper v1.19.0 diff --git a/rollup/go.sum b/rollup/go.sum index 49fe7e6a1d..48d64262fb 100644 --- a/rollup/go.sum +++ b/rollup/go.sum @@ -251,6 +251,8 @@ github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6g github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435 h1:X9fkvjrYBY79lGgKEPpUhuiJ4vWpWwzOVw4H8CU8L54= github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY= +github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e h1:0IkSVltsMrKCprOOfQyJsLeqhPEuA0sTp41pZBpDeDk= +github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY= github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601 h1:NEsjCG6uSvLRBlsP3+x6PL1kM+Ojs3g8UGotIPgJSz8= github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ= github.com/scroll-tech/zktrie v0.8.4 h1:UagmnZ4Z3ITCk+aUq9NQZJNAwnWl4gSxsLb2Nl7IgRE= From 46318b507206be961ea03b3710bedc6d0dfe4998 Mon Sep 17 00:00:00 2001 From: jonastheis <4181434+jonastheis@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:11:10 +0800 Subject: [PATCH 2/4] remove duplicated code txsToTxsData with encoding.TxsToTxsData --- .../internal/controller/watcher/l2_watcher.go | 41 +------------------ 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/rollup/internal/controller/watcher/l2_watcher.go b/rollup/internal/controller/watcher/l2_watcher.go index 259ea55dba..7c75a31981 100644 --- a/rollup/internal/controller/watcher/l2_watcher.go +++ b/rollup/internal/controller/watcher/l2_watcher.go @@ -8,8 +8,6 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/scroll-tech/da-codec/encoding" "github.com/scroll-tech/go-ethereum/common" - "github.com/scroll-tech/go-ethereum/common/hexutil" - gethTypes "github.com/scroll-tech/go-ethereum/core/types" "github.com/scroll-tech/go-ethereum/ethclient" "github.com/scroll-tech/go-ethereum/event" "github.com/scroll-tech/go-ethereum/log" @@ -86,43 +84,6 @@ func (w *L2WatcherClient) TryFetchRunningMissingBlocks(blockHeight uint64) { } } -func txsToTxsData(txs gethTypes.Transactions) []*gethTypes.TransactionData { - txsData := make([]*gethTypes.TransactionData, len(txs)) - for i, tx := range txs { - v, r, s := tx.RawSignatureValues() - - nonce := tx.Nonce() - - // We need QueueIndex in `NewBatchHeader`. However, `TransactionData` - // does not have this field. Since `L1MessageTx` do not have a nonce, - // we reuse this field for storing the queue index. - if msg := tx.AsL1MessageTx(); msg != nil { - nonce = msg.QueueIndex - } - - txsData[i] = &gethTypes.TransactionData{ - Type: tx.Type(), - TxHash: tx.Hash().String(), - Nonce: nonce, - ChainId: (*hexutil.Big)(tx.ChainId()), - Gas: tx.Gas(), - GasPrice: (*hexutil.Big)(tx.GasPrice()), - GasTipCap: (*hexutil.Big)(tx.GasTipCap()), - GasFeeCap: (*hexutil.Big)(tx.GasFeeCap()), - To: tx.To(), - Value: (*hexutil.Big)(tx.Value()), - Data: hexutil.Encode(tx.Data()), - IsCreate: tx.To() == nil, - AccessList: tx.AccessList(), - AuthorizationList: tx.SetCodeAuthorizations(), - V: (*hexutil.Big)(v), - R: (*hexutil.Big)(r), - S: (*hexutil.Big)(s), - } - } - return txsData -} - func (w *L2WatcherClient) getAndStoreBlocks(ctx context.Context, from, to uint64) error { var blocks []*encoding.Block for number := from; number <= to; number++ { @@ -150,7 +111,7 @@ func (w *L2WatcherClient) getAndStoreBlocks(ctx context.Context, from, to uint64 } blocks = append(blocks, &encoding.Block{ Header: block.Header(), - Transactions: txsToTxsData(block.Transactions()), + Transactions: encoding.TxsToTxsData(block.Transactions()), WithdrawRoot: common.BytesToHash(withdrawRoot), RowConsumption: block.RowConsumption, }) From 69f2196c094ec6ab0dce3010b5b2e6662e4e8975 Mon Sep 17 00:00:00 2001 From: jonastheis <4181434+jonastheis@users.noreply.github.com> Date: Thu, 13 Mar 2025 11:14:23 +0800 Subject: [PATCH 3/4] go mod tidy --- rollup/go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/rollup/go.sum b/rollup/go.sum index 48d64262fb..5ea8461cbd 100644 --- a/rollup/go.sum +++ b/rollup/go.sum @@ -249,8 +249,6 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435 h1:X9fkvjrYBY79lGgKEPpUhuiJ4vWpWwzOVw4H8CU8L54= -github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY= github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e h1:0IkSVltsMrKCprOOfQyJsLeqhPEuA0sTp41pZBpDeDk= github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY= github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601 h1:NEsjCG6uSvLRBlsP3+x6PL1kM+Ojs3g8UGotIPgJSz8= From 3a981c999e5e723a00259b888e134dfa04dafb1a Mon Sep 17 00:00:00 2001 From: jonastheis Date: Thu, 13 Mar 2025 03:26:22 +0000 Subject: [PATCH 4/4] =?UTF-8?q?chore:=20auto=20version=20bump=E2=80=89[bot?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/version/version.go b/common/version/version.go index db847f7e86..fa3f8f67dc 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.4.97" +var tag = "v4.4.98" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {