Skip to content

Commit 0a1868c

Browse files
authored
fix(relayer): fix rolling hash computation (#1628)
Co-authored-by: jonastheis <jonastheis@users.noreply.github.com>
1 parent fcfbc53 commit 0a1868c

File tree

4 files changed

+5
-44
lines changed

4 files changed

+5
-44
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.4.97"
8+
var tag = "v4.4.98"
99

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

rollup/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/holiman/uint256 v1.3.2
1414
github.com/mitchellh/mapstructure v1.5.0
1515
github.com/prometheus/client_golang v1.16.0
16-
github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435
16+
github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e
1717
github.com/scroll-tech/go-ethereum v1.10.14-0.20250305151038-478940e79601
1818
github.com/smartystreets/goconvey v1.8.0
1919
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.20250310095435-012aaee6b435 h1:X9fkvjrYBY79lGgKEPpUhuiJ4vWpWwzOVw4H8CU8L54=
253-
github.com/scroll-tech/da-codec v0.1.3-0.20250310095435-012aaee6b435/go.mod h1:yhTS9OVC0xQGhg7DN5iV5KZJvnSIlFWAxDdp+6jxQtY=
252+
github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e h1:0IkSVltsMrKCprOOfQyJsLeqhPEuA0sTp41pZBpDeDk=
253+
github.com/scroll-tech/da-codec v0.1.3-0.20250313030021-a8341d04bc4e/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/controller/watcher/l2_watcher.go

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"github.com/prometheus/client_golang/prometheus"
99
"github.com/scroll-tech/da-codec/encoding"
1010
"github.com/scroll-tech/go-ethereum/common"
11-
"github.com/scroll-tech/go-ethereum/common/hexutil"
12-
gethTypes "github.com/scroll-tech/go-ethereum/core/types"
1311
"github.com/scroll-tech/go-ethereum/ethclient"
1412
"github.com/scroll-tech/go-ethereum/event"
1513
"github.com/scroll-tech/go-ethereum/log"
@@ -86,43 +84,6 @@ func (w *L2WatcherClient) TryFetchRunningMissingBlocks(blockHeight uint64) {
8684
}
8785
}
8886

89-
func txsToTxsData(txs gethTypes.Transactions) []*gethTypes.TransactionData {
90-
txsData := make([]*gethTypes.TransactionData, len(txs))
91-
for i, tx := range txs {
92-
v, r, s := tx.RawSignatureValues()
93-
94-
nonce := tx.Nonce()
95-
96-
// We need QueueIndex in `NewBatchHeader`. However, `TransactionData`
97-
// does not have this field. Since `L1MessageTx` do not have a nonce,
98-
// we reuse this field for storing the queue index.
99-
if msg := tx.AsL1MessageTx(); msg != nil {
100-
nonce = msg.QueueIndex
101-
}
102-
103-
txsData[i] = &gethTypes.TransactionData{
104-
Type: tx.Type(),
105-
TxHash: tx.Hash().String(),
106-
Nonce: nonce,
107-
ChainId: (*hexutil.Big)(tx.ChainId()),
108-
Gas: tx.Gas(),
109-
GasPrice: (*hexutil.Big)(tx.GasPrice()),
110-
GasTipCap: (*hexutil.Big)(tx.GasTipCap()),
111-
GasFeeCap: (*hexutil.Big)(tx.GasFeeCap()),
112-
To: tx.To(),
113-
Value: (*hexutil.Big)(tx.Value()),
114-
Data: hexutil.Encode(tx.Data()),
115-
IsCreate: tx.To() == nil,
116-
AccessList: tx.AccessList(),
117-
AuthorizationList: tx.SetCodeAuthorizations(),
118-
V: (*hexutil.Big)(v),
119-
R: (*hexutil.Big)(r),
120-
S: (*hexutil.Big)(s),
121-
}
122-
}
123-
return txsData
124-
}
125-
12687
func (w *L2WatcherClient) getAndStoreBlocks(ctx context.Context, from, to uint64) error {
12788
var blocks []*encoding.Block
12889
for number := from; number <= to; number++ {
@@ -150,7 +111,7 @@ func (w *L2WatcherClient) getAndStoreBlocks(ctx context.Context, from, to uint64
150111
}
151112
blocks = append(blocks, &encoding.Block{
152113
Header: block.Header(),
153-
Transactions: txsToTxsData(block.Transactions()),
114+
Transactions: encoding.TxsToTxsData(block.Transactions()),
154115
WithdrawRoot: common.BytesToHash(withdrawRoot),
155116
RowConsumption: block.RowConsumption,
156117
})

0 commit comments

Comments
 (0)