Skip to content

Commit f2ca521

Browse files
authored
fix(taiko-client): use correct value for LastBlockIDByBatchID (#21121)
1 parent c6bdcb9 commit f2ca521

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ require (
308308
lukechampine.com/blake3 v1.3.0 // indirect
309309
)
310310

311-
replace github.com/ethereum/go-ethereum v1.15.5 => github.com/taikoxyz/taiko-geth v1.18.1-0.20260103011117-9602a0aa8936
311+
replace github.com/ethereum/go-ethereum v1.15.5 => github.com/taikoxyz/taiko-geth v1.18.1-0.20260107095638-6c3d362e5c02
312312

313313
replace github.com/ethereum-optimism/optimism v1.7.4 => github.com/taikoxyz/optimism v0.0.0-20251229030244-37aa83d15a8f
314314

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,8 @@ github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082 h1:ymZR+Y88LOnA8i3Ke
873873
github.com/taikoxyz/hive v0.0.0-20240827015317-405b241dd082/go.mod h1:RHnIu3EFehrWX3JhFAMQSXD5uz7l0xaNroTzXrap7EQ=
874874
github.com/taikoxyz/optimism v0.0.0-20251229030244-37aa83d15a8f h1:7lZFtV7wip0wmcTquvmtSH5LRp1djzSiDkOeGpIuEN4=
875875
github.com/taikoxyz/optimism v0.0.0-20251229030244-37aa83d15a8f/go.mod h1:V0VCkKtCzuaJH6qcL75SRcbdlakM9LhurMEJUhO6VXA=
876-
github.com/taikoxyz/taiko-geth v1.18.1-0.20260103011117-9602a0aa8936 h1:zGuxCtdtHAIoIv7eNTAB9DedsruELa+DSq1sveLTEwc=
877-
github.com/taikoxyz/taiko-geth v1.18.1-0.20260103011117-9602a0aa8936/go.mod h1:1LG2LnMOx2yPRHR/S+xuipXH29vPr6BIH6GElD8N/fo=
876+
github.com/taikoxyz/taiko-geth v1.18.1-0.20260107095638-6c3d362e5c02 h1:IEOZjDg1zoUsbvZQ8C5GvicLcO3Bwwtojtvy0TQBxZE=
877+
github.com/taikoxyz/taiko-geth v1.18.1-0.20260107095638-6c3d362e5c02/go.mod h1:1LG2LnMOx2yPRHR/S+xuipXH29vPr6BIH6GElD8N/fo=
878878
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
879879
github.com/testcontainers/testcontainers-go v0.40.0 h1:pSdJYLOVgLE8YdUY2FHQ1Fxu+aMnb6JfVz1mxk7OeMU=
880880
github.com/testcontainers/testcontainers-go v0.40.0/go.mod h1:FSXV5KQtX2HAMlm7U3APNyLkkap35zNLxukw9oBi/MY=

packages/eventindexer/pkg/http/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ func LogSkipper(c echo.Context) bool {
123123
func (srv *Server) configureMiddleware(corsOrigins []string) {
124124
srv.echo.Use(middleware.RequestID())
125125

126+
// nolint:staticcheck
127+
// Keep legacy logger format for now to avoid changing log consumers.
126128
srv.echo.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
127129
Skipper: LogSkipper,
128130
Format: `{"time":"${time_rfc3339_nano}","level":"INFO","message":{"id":"${id}","remote_ip":"${remote_ip}",` + //nolint:lll

packages/relayer/pkg/http/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ func LogSkipper(c echo.Context) bool {
163163
func (srv *Server) configureMiddleware(corsOrigins []string) {
164164
srv.echo.Use(middleware.RequestID())
165165

166+
// nolint:staticcheck
167+
// Keep legacy logger format for now to avoid changing log consumers.
166168
srv.echo.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
167169
Skipper: LogSkipper,
168170
Format: `{"time":"${time_rfc3339_nano}","level":"INFO","message":{"id":"${id}","remote_ip":"${remote_ip}",` + //nolint:lll

packages/taiko-client/driver/chain_syncer/event/blocks_inserter/shasta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ func (i *Shasta) InsertBlocksWithManifest(
9494
if coreState.LastFinalizedProposalId.Cmp(meta.GetEventData().Id) >= 0 {
9595
blockID, err := i.rpc.L2.LastBlockIDByBatchID(ctx, coreState.LastFinalizedProposalId)
9696
if err == nil {
97-
if lastFinalizedHeader, err = i.rpc.L2.HeaderByNumber(ctx, blockID); err != nil {
98-
return nil, fmt.Errorf("failed to fetch last finalized block header (%d): %w", blockID, err)
97+
if lastFinalizedHeader, err = i.rpc.L2.HeaderByNumber(ctx, blockID.ToInt()); err != nil {
98+
return nil, fmt.Errorf("failed to fetch last finalized block header (%d): %w", blockID.ToInt(), err)
9999
}
100100
} else {
101101
log.Warn(

packages/taiko-client/driver/preconf_blocks/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ func (s *PreconfBlockAPIServer) handleShastaProposalReorg(ctx context.Context, l
11851185
header.Time,
11861186
),
11871187
PreconfChainReorged: true,
1188-
LastBlockID: blockID.Uint64(),
1188+
LastBlockID: blockID.ToInt().Uint64(),
11891189
})
11901190
}
11911191

packages/taiko-client/pkg/rpc/methods.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,9 +1520,9 @@ func (c *Client) GetProposalByIDShasta(
15201520
return nil, nil, fmt.Errorf("failed to get last block ID by batch ID %d: %w", proposalID, err)
15211521
}
15221522

1523-
block, err := c.L2.BlockByNumber(ctxWithTimeout, blockID)
1523+
block, err := c.L2.BlockByNumber(ctxWithTimeout, blockID.ToInt())
15241524
if err != nil {
1525-
return nil, nil, fmt.Errorf("failed to get L2 block by ID %d: %w", blockID, err)
1525+
return nil, nil, fmt.Errorf("failed to get L2 block by ID %d: %w", blockID.ToInt(), err)
15261526
}
15271527

15281528
_, anchorNumber, _, err := c.GetSyncedL1SnippetFromAnchor(block.Transactions()[0])

0 commit comments

Comments
 (0)