@@ -222,7 +222,8 @@ func (w *Watcher) FetchContractEvent(blockHeight uint64) error {
222
222
query .Topics [0 ][1 ] = common .HexToHash (bridge_abi .RelayedMessageEventSignature )
223
223
query .Topics [0 ][2 ] = common .HexToHash (bridge_abi .FailedRelayedMessageEventSignature )
224
224
query .Topics [0 ][3 ] = common .HexToHash (bridge_abi .CommitBatchEventSignature )
225
- query .Topics [0 ][4 ] = common .HexToHash (bridge_abi .FinalizedBatchEventSignature )
225
+ query .Topics [0 ][4 ] = common .HexToHash (bridge_abi .CommitBatchesEventSignature )
226
+ query .Topics [0 ][5 ] = common .HexToHash (bridge_abi .FinalizedBatchEventSignature )
226
227
227
228
logs , err := w .client .FilterLogs (w .ctx , query )
228
229
if err != nil {
@@ -365,10 +366,8 @@ func (w *Watcher) parseBridgeEventLogs(logs []geth_types.Log) ([]*types.L1Messag
365
366
})
366
367
case common .HexToHash (bridge_abi .CommitBatchEventSignature ):
367
368
event := struct {
368
- BatchID common.Hash
369
- BatchHash common.Hash
370
- BatchIndex * big.Int
371
- ParentHash common.Hash
369
+ BatchID common.Hash
370
+ BatchHash common.Hash
372
371
}{}
373
372
// BatchID is in topics[1]
374
373
event .BatchID = common .HexToHash (vLog .Topics [1 ].String ())
@@ -378,17 +377,33 @@ func (w *Watcher) parseBridgeEventLogs(logs []geth_types.Log) ([]*types.L1Messag
378
377
return l1Messages , relayedMessages , rollupEvents , err
379
378
}
380
379
380
+ rollupEvents = append (rollupEvents , rollupEvent {
381
+ batchID : event .BatchID ,
382
+ txHash : vLog .TxHash ,
383
+ status : types .RollupCommitted ,
384
+ })
385
+ case common .HexToHash (bridge_abi .CommitBatchesEventSignature ):
386
+ event := struct {
387
+ BatchID common.Hash
388
+ BatchHash common.Hash
389
+ }{}
390
+ // BatchID is in topics[1]
391
+ event .BatchID = common .HexToHash (vLog .Topics [1 ].String ())
392
+ err := w .scrollchainABI .UnpackIntoInterface (& event , "CommitBatches" , vLog .Data )
393
+ if err != nil {
394
+ log .Warn ("Failed to unpack layer1 CommitBatches event" , "err" , err )
395
+ return l1Messages , relayedMessages , rollupEvents , err
396
+ }
397
+
381
398
rollupEvents = append (rollupEvents , rollupEvent {
382
399
batchID : event .BatchID ,
383
400
txHash : vLog .TxHash ,
384
401
status : types .RollupCommitted ,
385
402
})
386
403
case common .HexToHash (bridge_abi .FinalizedBatchEventSignature ):
387
404
event := struct {
388
- BatchID common.Hash
389
- BatchHash common.Hash
390
- BatchIndex * big.Int
391
- ParentHash common.Hash
405
+ BatchID common.Hash
406
+ BatchHash common.Hash
392
407
}{}
393
408
// BatchID is in topics[1]
394
409
event .BatchID = common .HexToHash (vLog .Topics [1 ].String ())
0 commit comments