Skip to content

Commit a39f89d

Browse files
committed
feat(bridge-history): support codecv7
1 parent 6936a4e commit a39f89d

File tree

15 files changed

+230
-57
lines changed

15 files changed

+230
-57
lines changed

bridge-history-api/abi/backend_abi.go

+11-4
Large diffs are not rendered by default.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package backendabi
2+
3+
import (
4+
"testing"
5+
6+
"github.com/scroll-tech/go-ethereum/crypto"
7+
"github.com/stretchr/testify/assert"
8+
)
9+
10+
func TestEventSignatures(t *testing.T) {
11+
assert.Equal(t, crypto.Keccak256Hash([]byte("RevertBatch(uint256,bytes32)")), L1RevertBatchV0EventSig)
12+
assert.Equal(t, crypto.Keccak256Hash([]byte("RevertBatch(uint256,uint256)")), L1RevertBatchV7EventSig)
13+
}

bridge-history-api/cmd/fetcher/app/app.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ func action(ctx *cli.Context) error {
6868

6969
observability.Server(ctx, db)
7070

71-
l1MessageFetcher := fetcher.NewL1MessageFetcher(subCtx, cfg.L1, db, l1Client)
71+
l1MessageFetcher, err := fetcher.NewL1MessageFetcher(subCtx, cfg.L1, db, l1Client)
72+
if err != nil {
73+
log.Crit("failed to create L1MessageFetcher", "err", err)
74+
}
7275
go l1MessageFetcher.Start()
7376

7477
l2MessageFetcher := fetcher.NewL2MessageFetcher(subCtx, cfg.L2, db, l2Client)

bridge-history-api/conf/config.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919
"ScrollChainAddr": "0xa13BAF47339d63B743e7Da8741db5456DAc1E556",
2020
"GatewayRouterAddr": "0xF8B1378579659D8F7EE5f3C929c2f3E332E41Fd6",
2121
"MessageQueueAddr": "0x0d7E906BD9cAFa154b048cFa766Cc1E54E39AF9B",
22+
"MessageQueueV2Addr": "0x0000000000000000000000000000000000000000",
2223
"BatchBridgeGatewayAddr": "0x5Bcfd99c34cf7E06fc756f6f5aE7400504852bc4",
2324
"GasTokenGatewayAddr": "0x0000000000000000000000000000000000000000",
24-
"WrappedTokenGatewayAddr": "0x0000000000000000000000000000000000000000"
25+
"WrappedTokenGatewayAddr": "0x0000000000000000000000000000000000000000",
26+
"BlobScanAPIEndpoint": "https://api.blobscan.com/blobs/"
2527
},
2628
"L2": {
2729
"confirmation": 0,

bridge-history-api/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ 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/go-ethereum v1.10.14-0.20250304112538-3c454e7101a3
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 // It's a hotfix for the header hash compatibility issue, pls change this with caution
1415
github.com/stretchr/testify v1.9.0
1516
github.com/urfave/cli/v2 v2.25.7
1617
golang.org/x/sync v0.11.0
@@ -90,7 +91,6 @@ require (
9091
github.com/rjeczalik/notify v0.9.1 // indirect
9192
github.com/rs/cors v1.7.0 // indirect
9293
github.com/russross/blackfriday/v2 v2.1.0 // indirect
93-
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 // indirect
9494
github.com/scroll-tech/zktrie v0.8.4 // indirect
9595
github.com/sethvargo/go-retry v0.2.4 // indirect
9696
github.com/shirou/gopsutil v3.21.11+incompatible // indirect

bridge-history-api/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
311311
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
312312
github.com/scroll-tech/da-codec v0.1.3-0.20250226072559-f8a8d3898f54 h1:qVpsVu1J91opTn6HYeuzWcBRVhQmPR8g05i+PlOjlI4=
313313
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.20250304112538-3c454e7101a3 h1:y0L8+O3anBJIpboVWhNlUx3VC59he+0fd4b8PnDR16w=
315-
github.com/scroll-tech/go-ethereum v1.10.14-0.20250304112538-3c454e7101a3/go.mod h1:OblWe1+QrZwdpwO0j/LY3BSGuKT3YPUFBDQQgvvfStQ=
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=
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=

bridge-history-api/internal/config/config.go

+5
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ type FetcherConfig struct {
3030
ScrollChainAddr string `json:"ScrollChainAddr"`
3131
GatewayRouterAddr string `json:"GatewayRouterAddr"`
3232
MessageQueueAddr string `json:"MessageQueueAddr"`
33+
MessageQueueV2Addr string `json:"MessageQueueV2Addr"`
3334
BatchBridgeGatewayAddr string `json:"BatchBridgeGatewayAddr"`
3435
GasTokenGatewayAddr string `json:"GasTokenGatewayAddr"`
3536
WrappedTokenGatewayAddr string `json:"WrappedTokenGatewayAddr"`
37+
38+
BeaconNodeAPIEndpoint string `json:"BeaconNodeAPIEndpoint"`
39+
BlobScanAPIEndpoint string `json:"BlobScanAPIEndpoint"`
40+
BlockNativeAPIEndpoint string `json:"BlockNativeAPIEndpoint"`
3641
}
3742

3843
// RedisConfig redis config

bridge-history-api/internal/controller/fetcher/l1_fetcher.go

+24-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package fetcher
22

33
import (
44
"context"
5+
"fmt"
56
"math/big"
67
"time"
78

@@ -10,6 +11,7 @@ import (
1011
"github.com/scroll-tech/go-ethereum/common"
1112
"github.com/scroll-tech/go-ethereum/ethclient"
1213
"github.com/scroll-tech/go-ethereum/log"
14+
"github.com/scroll-tech/go-ethereum/rollup/da_syncer/blob_client"
1315
"gorm.io/gorm"
1416

1517
"scroll-tech/bridge-history-api/internal/config"
@@ -35,13 +37,32 @@ type L1MessageFetcher struct {
3537
}
3638

3739
// NewL1MessageFetcher creates a new L1MessageFetcher instance.
38-
func NewL1MessageFetcher(ctx context.Context, cfg *config.FetcherConfig, db *gorm.DB, client *ethclient.Client) *L1MessageFetcher {
40+
func NewL1MessageFetcher(ctx context.Context, cfg *config.FetcherConfig, db *gorm.DB, client *ethclient.Client) (*L1MessageFetcher, error) {
41+
blobClient := blob_client.NewBlobClients()
42+
if cfg.BeaconNodeAPIEndpoint != "" {
43+
beaconNodeClient, err := blob_client.NewBeaconNodeClient(cfg.BeaconNodeAPIEndpoint)
44+
if err != nil {
45+
log.Warn("failed to create BeaconNodeClient", "err", err)
46+
} else {
47+
blobClient.AddBlobClient(beaconNodeClient)
48+
}
49+
}
50+
if cfg.BlobScanAPIEndpoint != "" {
51+
blobClient.AddBlobClient(blob_client.NewBlobScanClient(cfg.BlobScanAPIEndpoint))
52+
}
53+
if cfg.BlockNativeAPIEndpoint != "" {
54+
blobClient.AddBlobClient(blob_client.NewBlockNativeClient(cfg.BlockNativeAPIEndpoint))
55+
}
56+
if blobClient.Size() == 0 {
57+
return nil, fmt.Errorf("no blob client is configured")
58+
}
59+
3960
c := &L1MessageFetcher{
4061
ctx: ctx,
4162
cfg: cfg,
4263
client: client,
4364
eventUpdateLogic: logic.NewEventUpdateLogic(db, true),
44-
l1FetcherLogic: logic.NewL1FetcherLogic(cfg, db, client),
65+
l1FetcherLogic: logic.NewL1FetcherLogic(cfg, db, client, blobClient),
4566
}
4667

4768
reg := prometheus.DefaultRegisterer
@@ -58,7 +79,7 @@ func NewL1MessageFetcher(ctx context.Context, cfg *config.FetcherConfig, db *gor
5879
Help: "Latest blockchain height the L1 message fetcher has synced with.",
5980
})
6081

61-
return c
82+
return c, nil
6283
}
6384

6485
// Start starts the L1 message fetching process.

bridge-history-api/internal/logic/l1_event_parser.go

+94-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ package logic
22

33
import (
44
"context"
5+
"fmt"
56
"math/big"
67

8+
"github.com/scroll-tech/da-codec/encoding"
79
"github.com/scroll-tech/go-ethereum/common"
810
"github.com/scroll-tech/go-ethereum/core/types"
911
"github.com/scroll-tech/go-ethereum/crypto"
1012
"github.com/scroll-tech/go-ethereum/ethclient"
1113
"github.com/scroll-tech/go-ethereum/log"
14+
"github.com/scroll-tech/go-ethereum/rollup/da_syncer/blob_client"
1215

1316
backendabi "scroll-tech/bridge-history-api/abi"
1417
"scroll-tech/bridge-history-api/internal/config"
@@ -19,15 +22,17 @@ import (
1922

2023
// L1EventParser the l1 event parser
2124
type L1EventParser struct {
22-
cfg *config.FetcherConfig
23-
client *ethclient.Client
25+
cfg *config.FetcherConfig
26+
client *ethclient.Client
27+
blobClient blob_client.BlobClient
2428
}
2529

2630
// NewL1EventParser creates l1 event parser
27-
func NewL1EventParser(cfg *config.FetcherConfig, client *ethclient.Client) *L1EventParser {
31+
func NewL1EventParser(cfg *config.FetcherConfig, client *ethclient.Client, blobClient blob_client.BlobClient) *L1EventParser {
2832
return &L1EventParser{
29-
cfg: cfg,
30-
client: client,
33+
cfg: cfg,
34+
client: client,
35+
blobClient: blobClient,
3136
}
3237
}
3338

@@ -233,6 +238,19 @@ func (e *L1EventParser) ParseL1SingleCrossChainEventLogs(ctx context.Context, lo
233238

234239
// ParseL1BatchEventLogs parses L1 watched batch events.
235240
func (e *L1EventParser) ParseL1BatchEventLogs(ctx context.Context, logs []types.Log, client *ethclient.Client) ([]*orm.BatchEvent, error) {
241+
// Since codecv7 introduced multiple CommitBatch events per transaction,
242+
// each CommitBatch event corresponds to an individual blob containing block range data.
243+
// To correctly process these events, we need to:
244+
// 1. Parse the associated blob data to extract the block range for each event
245+
// 2. Maintain a per-transaction index counter to track processing position in the blob sequence
246+
//
247+
// The index map serves this purpose with:
248+
// Key: commit transaction hash (identifies the transaction containing multiple CommitBatches)
249+
// Value: current blob index pointer (indicates next blob to process for this transaction)
250+
//
251+
// Each processed CommitBatch event will increment the index by 1,
252+
// ensuring sequential processing of blobs within the same transaction.
253+
txBlobIndexMap := make(map[common.Hash]int)
236254
var l1BatchEvents []*orm.BatchEvent
237255
for _, vlog := range logs {
238256
switch vlog.Topics[0] {
@@ -247,11 +265,37 @@ func (e *L1EventParser) ParseL1BatchEventLogs(ctx context.Context, logs []types.
247265
log.Error("Failed to get commit batch tx or the tx is still pending", "err", err, "isPending", isPending)
248266
return nil, err
249267
}
250-
startBlock, endBlock, err := utils.GetBatchRangeFromCalldata(commitTx.Data())
268+
version, startBlock, endBlock, err := utils.GetBatchVersionAndBlockRangeFromCalldata(commitTx.Data())
251269
if err != nil {
252270
log.Error("Failed to get batch range from calldata", "hash", commitTx.Hash().String(), "height", vlog.BlockNumber)
253271
return nil, err
254272
}
273+
if version >= 7 { // It's a batch with version >= 7.
274+
currentIndex := txBlobIndexMap[vlog.TxHash]
275+
276+
if currentIndex >= len(commitTx.BlobHashes()) {
277+
return nil, fmt.Errorf("commit transaction %s has %d blobs, but trying to access index %d (batch index %d)",
278+
vlog.TxHash.String(), len(commitTx.BlobHashes()), currentIndex, event.BatchIndex.Uint64())
279+
}
280+
header, err := client.HeaderByHash(ctx, vlog.BlockHash)
281+
if err != nil {
282+
return nil, fmt.Errorf("failed to get L1 block header for blob context, blockHash: %s, err: %w", vlog.BlockHash.Hex(), err)
283+
}
284+
blobVersionedHash := commitTx.BlobHashes()[currentIndex]
285+
blocks, err := e.getBatchBlockRangeFromBlob(ctx, version, blobVersionedHash, header.Time)
286+
if err != nil {
287+
return nil, fmt.Errorf("failed to process versioned blob, blobVersionedHash: %s, block number: %d, blob index: %d, err: %w",
288+
blobVersionedHash.String(), vlog.BlockNumber, currentIndex, err)
289+
}
290+
if len(blocks) == 0 {
291+
return nil, fmt.Errorf("no blocks found in the blob, blobVersionedHash: %s, block number: %d, blob index: %d",
292+
blobVersionedHash.String(), vlog.BlockNumber, currentIndex)
293+
}
294+
startBlock = blocks[0].Number()
295+
endBlock = blocks[len(blocks)-1].Number()
296+
297+
txBlobIndexMap[vlog.TxHash] = currentIndex + 1
298+
}
255299
l1BatchEvents = append(l1BatchEvents, &orm.BatchEvent{
256300
BatchStatus: int(btypes.BatchStatusTypeCommitted),
257301
BatchIndex: event.BatchIndex.Uint64(),
@@ -260,8 +304,8 @@ func (e *L1EventParser) ParseL1BatchEventLogs(ctx context.Context, logs []types.
260304
EndBlockNumber: endBlock,
261305
L1BlockNumber: vlog.BlockNumber,
262306
})
263-
case backendabi.L1RevertBatchEventSig:
264-
event := backendabi.L1RevertBatchEvent{}
307+
case backendabi.L1RevertBatchV0EventSig:
308+
event := backendabi.L1RevertBatchV0Event{}
265309
if err := utils.UnpackLog(backendabi.IScrollChainABI, &event, "RevertBatch", vlog); err != nil {
266310
log.Error("Failed to unpack RevertBatch event", "err", err)
267311
return nil, err
@@ -272,6 +316,19 @@ func (e *L1EventParser) ParseL1BatchEventLogs(ctx context.Context, logs []types.
272316
BatchHash: event.BatchHash.String(),
273317
L1BlockNumber: vlog.BlockNumber,
274318
})
319+
case backendabi.L1RevertBatchV7EventSig:
320+
event := backendabi.L1RevertBatchV7Event{}
321+
if err := utils.UnpackLog(backendabi.IScrollChainABI, &event, "RevertBatch0", vlog); err != nil {
322+
log.Error("Failed to unpack RevertBatch event", "err", err)
323+
return nil, err
324+
}
325+
for i := event.StartBatchIndex.Uint64(); i <= event.FinishBatchIndex.Uint64(); i++ {
326+
l1BatchEvents = append(l1BatchEvents, &orm.BatchEvent{
327+
BatchStatus: int(btypes.BatchStatusTypeReverted),
328+
BatchIndex: i,
329+
L1BlockNumber: vlog.BlockNumber,
330+
})
331+
}
275332
case backendabi.L1FinalizeBatchEventSig:
276333
event := backendabi.L1FinalizeBatchEvent{}
277334
if err := utils.UnpackLog(backendabi.IScrollChainABI, &event, "FinalizeBatch", vlog); err != nil {
@@ -389,3 +446,32 @@ func getRealFromAddress(ctx context.Context, eventSender common.Address, eventMe
389446
}
390447
return sender.String(), nil
391448
}
449+
450+
func (e *L1EventParser) getBatchBlockRangeFromBlob(ctx context.Context, version uint8, versionedHash common.Hash, l1BlockTime uint64) ([]encoding.DABlock, error) {
451+
blob, err := e.blobClient.GetBlobByVersionedHashAndBlockTime(ctx, versionedHash, l1BlockTime)
452+
if err != nil {
453+
return nil, fmt.Errorf("failed to get blob %s: %w", versionedHash.Hex(), err)
454+
}
455+
if blob == nil {
456+
return nil, fmt.Errorf("blob %s not found", versionedHash.Hex())
457+
}
458+
459+
codec, err := encoding.CodecFromVersion(encoding.CodecVersion(version))
460+
if err != nil {
461+
return nil, fmt.Errorf("unsupported codec version: %v, err: %w", version, err)
462+
}
463+
464+
blobPayload, err := codec.DecodeBlob(blob)
465+
if err != nil {
466+
return nil, fmt.Errorf("blob %s decode error: %w", versionedHash.Hex(), err)
467+
}
468+
469+
blocks := blobPayload.Blocks()
470+
if len(blocks) == 0 {
471+
return nil, fmt.Errorf("empty blocks in blob %s", versionedHash.Hex())
472+
}
473+
474+
log.Debug("Successfully processed blob", "versionedHash", versionedHash.Hex(), "blocksCount", len(blocks))
475+
476+
return blocks, nil
477+
}

bridge-history-api/internal/logic/l1_fetcher.go

+17-11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/scroll-tech/go-ethereum/core/types"
1212
"github.com/scroll-tech/go-ethereum/ethclient"
1313
"github.com/scroll-tech/go-ethereum/log"
14+
"github.com/scroll-tech/go-ethereum/rollup/da_syncer/blob_client"
1415
"gorm.io/gorm"
1516

1617
backendabi "scroll-tech/bridge-history-api/abi"
@@ -49,7 +50,7 @@ type L1FetcherLogic struct {
4950
}
5051

5152
// NewL1FetcherLogic creates L1 fetcher logic
52-
func NewL1FetcherLogic(cfg *config.FetcherConfig, db *gorm.DB, client *ethclient.Client) *L1FetcherLogic {
53+
func NewL1FetcherLogic(cfg *config.FetcherConfig, db *gorm.DB, client *ethclient.Client, blobClient blob_client.BlobClient) *L1FetcherLogic {
5354
addressList := []common.Address{
5455
common.HexToAddress(cfg.StandardERC20GatewayAddr),
5556
common.HexToAddress(cfg.CustomERC20GatewayAddr),
@@ -119,6 +120,10 @@ func NewL1FetcherLogic(cfg *config.FetcherConfig, db *gorm.DB, client *ethclient
119120
gatewayList = append(gatewayList, common.HexToAddress(cfg.WrappedTokenGatewayAddr))
120121
}
121122

123+
if common.HexToAddress(cfg.MessageQueueV2Addr) != (common.Address{}) {
124+
addressList = append(addressList, common.HexToAddress(cfg.MessageQueueV2Addr))
125+
}
126+
122127
log.Info("L1 Fetcher configured with the following address list", "addresses", addressList, "gateways", gatewayList)
123128

124129
f := &L1FetcherLogic{
@@ -129,7 +134,7 @@ func NewL1FetcherLogic(cfg *config.FetcherConfig, db *gorm.DB, client *ethclient
129134
client: client,
130135
addressList: addressList,
131136
gatewayList: gatewayList,
132-
parser: NewL1EventParser(cfg, client),
137+
parser: NewL1EventParser(cfg, client, blobClient),
133138
}
134139

135140
reg := prometheus.DefaultRegisterer
@@ -224,7 +229,7 @@ func (f *L1FetcherLogic) l1FetcherLogs(ctx context.Context, from, to uint64) ([]
224229
Topics: make([][]common.Hash, 1),
225230
}
226231

227-
query.Topics[0] = make([]common.Hash, 16)
232+
query.Topics[0] = make([]common.Hash, 17)
228233
query.Topics[0][0] = backendabi.L1DepositETHSig
229234
query.Topics[0][1] = backendabi.L1DepositERC20Sig
230235
query.Topics[0][2] = backendabi.L1DepositERC721Sig
@@ -233,14 +238,15 @@ func (f *L1FetcherLogic) l1FetcherLogs(ctx context.Context, from, to uint64) ([]
233238
query.Topics[0][5] = backendabi.L1RelayedMessageEventSig
234239
query.Topics[0][6] = backendabi.L1FailedRelayedMessageEventSig
235240
query.Topics[0][7] = backendabi.L1CommitBatchEventSig
236-
query.Topics[0][8] = backendabi.L1RevertBatchEventSig
237-
query.Topics[0][9] = backendabi.L1FinalizeBatchEventSig
238-
query.Topics[0][10] = backendabi.L1QueueTransactionEventSig
239-
query.Topics[0][11] = backendabi.L1DequeueTransactionEventSig
240-
query.Topics[0][12] = backendabi.L1DropTransactionEventSig
241-
query.Topics[0][13] = backendabi.L1ResetDequeuedTransactionEventSig
242-
query.Topics[0][14] = backendabi.L1BridgeBatchDepositSig
243-
query.Topics[0][15] = backendabi.L1DepositWrappedTokenSig
241+
query.Topics[0][8] = backendabi.L1RevertBatchV0EventSig
242+
query.Topics[0][9] = backendabi.L1RevertBatchV7EventSig
243+
query.Topics[0][10] = backendabi.L1FinalizeBatchEventSig
244+
query.Topics[0][11] = backendabi.L1QueueTransactionEventSig
245+
query.Topics[0][12] = backendabi.L1DequeueTransactionEventSig
246+
query.Topics[0][13] = backendabi.L1DropTransactionEventSig
247+
query.Topics[0][14] = backendabi.L1ResetDequeuedTransactionEventSig
248+
query.Topics[0][15] = backendabi.L1BridgeBatchDepositSig
249+
query.Topics[0][16] = backendabi.L1DepositWrappedTokenSig
244250

245251
eventLogs, err := f.client.FilterLogs(ctx, query)
246252
if err != nil {

bridge-history-api/internal/orm/batch_event.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (c *BatchEvent) InsertOrUpdateBatchEvents(ctx context.Context, l1BatchEvent
117117
}
118118
case btypes.BatchStatusTypeReverted:
119119
db = db.Where("batch_index = ?", l1BatchEvent.BatchIndex)
120-
db = db.Where("batch_hash = ?", l1BatchEvent.BatchHash)
120+
db = db.Where("batch_status != ?", btypes.BatchStatusTypeFinalized)
121121
updateFields["batch_status"] = btypes.BatchStatusTypeReverted
122122
if err := db.Updates(updateFields).Error; err != nil {
123123
return fmt.Errorf("failed to update batch event, error: %w", err)

0 commit comments

Comments
 (0)