Skip to content

Commit d916c05

Browse files
committed
feat: add logs
1 parent 7f287e9 commit d916c05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/indexer.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,12 @@ func (i *Indexer) Start(ctx context.Context, l2ScannedBlock *L2ScannedBlockV2) {
119119
}
120120

121121
if fromBlockNumber.Uint64() > toBlockNumber.Uint64() {
122+
log.Info("scan block process fromBlockNumber > toBlockNumber", "fromBlockNumber", fromBlockNumber.Uint64(), "toBlockNumber", toBlockNumber.Uint64())
122123
timer.Reset(5 * time.Second)
123124
continue
124125
}
125126

127+
log.Info("get withdrawal initiated logs", "fromBlockNumber", fromBlockNumber.Uint64(), "toBlockNumber", toBlockNumber.Uint64())
126128
logs, err := i.getWithdrawalInitiatedLogs(ctx, fromBlockNumber, toBlockNumber)
127129
if err != nil {
128130
log.Error("eth_getLogs", "error", err)
@@ -139,6 +141,8 @@ func (i *Indexer) Start(ctx context.Context, l2ScannedBlock *L2ScannedBlockV2) {
139141
log.Error("storeLogs", "error", err)
140142
continue
141143
}
144+
} else {
145+
log.Info("no withdrawal initiated logs", "fromBlockNumber", fromBlockNumber.Uint64(), "toBlockNumber", toBlockNumber.Uint64())
142146
}
143147

144148
if lastTimeL2ScannedBlock.Before(time.Now().Add(-10 * time.Minute)) {
@@ -147,7 +151,7 @@ func (i *Indexer) Start(ctx context.Context, l2ScannedBlock *L2ScannedBlockV2) {
147151
if result.Error != nil {
148152
log.Error("update l2_scanned_blocks", "error", result.Error)
149153
}
150-
154+
log.Info("save l2ScannedBlock", "l2ScannedBlock", toBlockNumber.Int64())
151155
lastTimeL2ScannedBlock = time.Now()
152156
}
153157

0 commit comments

Comments
 (0)