Skip to content

Commit 7179549

Browse files
committed
fix: increased offset
1 parent b13b1e0 commit 7179549

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

relayer/chains/wasm/wasm_chain_processor.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ func (ccp *WasmChainProcessor) Run(ctx context.Context, initialBlockHistory uint
286286

287287
ccp.log.Debug("Entering Wasm main query loop")
288288
if ccp.chainProvider.rangeSupport {
289-
inSyncNumBlocksThreshold = 15
289+
numOffsetBlocks = 7
290+
inSyncNumBlocksThreshold = 20
290291
defaultQueryLoopTime := 7
291292
if ccp.chainProvider.PCfg.BlockRPCRefreshTime > 0 {
292293
defaultQueryLoopTime = ccp.chainProvider.PCfg.BlockRPCRefreshTime
@@ -489,6 +490,12 @@ func (ccp *WasmChainProcessor) queryCycle(ctx context.Context, persistence *quer
489490
persistence.latestQueriedBlock = status.SyncInfo.LatestBlockHeight
490491
return nil
491492
}
493+
if status.SyncInfo.CatchingUp {
494+
ccp.log.Debug("chain is still catching up",
495+
zap.Int64("last_height", persistence.latestQueriedBlock),
496+
zap.Int64("latest_height", status.SyncInfo.LatestBlockHeight))
497+
return nil
498+
}
492499
if (persistence.latestQueriedBlock + 1) >= persistence.latestHeight {
493500
return nil
494501
}
@@ -516,8 +523,7 @@ func (ccp *WasmChainProcessor) queryCycle(ctx context.Context, persistence *quer
516523
if ccp.shouldSkipProcessBlock(blocks, i) {
517524
newLatestQueriedBlock = i
518525
ccp.log.Debug("Skipping block", zap.Any("height", i),
519-
zap.Any("last_height", persistence.latestQueriedBlock),
520-
zap.Any("blocks", blocks))
526+
zap.Any("last_height", persistence.latestQueriedBlock))
521527
continue
522528
}
523529
eg.Go(func() (err error) {

0 commit comments

Comments
 (0)