@@ -71,6 +71,7 @@ func NewCosmosChainProcessor(log *zap.Logger, provider *CosmosProvider, metrics
71
71
72
72
const (
73
73
queryTimeout = 5 * time .Second
74
+ queryStateTimeout = 60 * time .Second
74
75
blockResultsQueryTimeout = 2 * time .Minute
75
76
latestHeightQueryRetryDelay = 1 * time .Second
76
77
latestHeightQueryRetries = 5
@@ -279,7 +280,7 @@ func (ccp *CosmosChainProcessor) Run(ctx context.Context, initialBlockHistory ui
279
280
280
281
// initializeConnectionState will bootstrap the connectionStateCache with the open connection state.
281
282
func (ccp * CosmosChainProcessor ) initializeConnectionState (ctx context.Context ) error {
282
- ctx , cancel := context .WithTimeout (ctx , queryTimeout )
283
+ ctx , cancel := context .WithTimeout (ctx , queryStateTimeout )
283
284
defer cancel ()
284
285
connections , err := ccp .chainProvider .QueryConnections (ctx )
285
286
if err != nil {
@@ -299,7 +300,7 @@ func (ccp *CosmosChainProcessor) initializeConnectionState(ctx context.Context)
299
300
300
301
// initializeChannelState will bootstrap the channelStateCache with the open channel state.
301
302
func (ccp * CosmosChainProcessor ) initializeChannelState (ctx context.Context ) error {
302
- ctx , cancel := context .WithTimeout (ctx , queryTimeout )
303
+ ctx , cancel := context .WithTimeout (ctx , queryStateTimeout )
303
304
defer cancel ()
304
305
channels , err := ccp .chainProvider .QueryChannels (ctx )
305
306
if err != nil {
@@ -315,12 +316,13 @@ func (ccp *CosmosChainProcessor) initializeChannelState(ctx context.Context) err
315
316
continue
316
317
}
317
318
ccp .channelConnections [ch .ChannelId ] = ch .ConnectionHops [0 ]
318
- ccp . channelStateCache [ processor.ChannelKey {
319
+ k := processor.ChannelKey {
319
320
ChannelID : ch .ChannelId ,
320
321
PortID : ch .PortId ,
321
322
CounterpartyChannelID : ch .Counterparty .ChannelId ,
322
323
CounterpartyPortID : ch .Counterparty .PortId ,
323
- }] = ch .State == chantypes .OPEN
324
+ }
325
+ ccp .channelStateCache .SetOpen (k , ch .State == chantypes .OPEN , ch .Ordering )
324
326
}
325
327
return nil
326
328
}
@@ -402,11 +404,11 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu
402
404
})
403
405
404
406
if err := eg .Wait (); err != nil {
405
- ccp .log .Warn (
406
- "Could not query block data. Consider checking if your RPC node is online, and that transaction indexing is enabled. " ,
407
+ ccp .log .Debug (
408
+ "Error querying block data" ,
407
409
zap .Int64 ("height" , i ),
410
+ zap .Error (err ),
408
411
)
409
- ccp .log .Debug ("Error querying block data" , zap .Error (err ))
410
412
411
413
persistence .retriesAtLatestQueriedBlock ++
412
414
if persistence .retriesAtLatestQueriedBlock >= blockMaxRetries {
0 commit comments