Skip to content

Commit

Permalink
chore: add todos & minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
viveksharmapoudel committed Jul 12, 2023
1 parent 5f46ecb commit ca1d8cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions relayer/chains/archway/archway_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ const (
latestHeightQueryRetryDelay = 1 * time.Second
latestHeightQueryRetries = 5

// TODO: review transfer to providerConfig
defaultMinQueryLoopDuration = 1 * time.Second
defaultBalanceUpdateWaitDuration = 60 * time.Second
inSyncNumBlocksThreshold = 2
Expand Down Expand Up @@ -305,6 +306,7 @@ func (ccp *ArchwayChainProcessor) initializeChannelState(ctx context.Context) er
}

func (ccp *ArchwayChainProcessor) queryCycle(ctx context.Context, persistence *queryCyclePersistence) error {
// TODO : review if redundent remove

Check warning on line 309 in relayer/chains/archway/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/archway/archway_chain_processor.go#L309

Added line #L309 was not covered by tests
status, err := ccp.nodeStatusWithRetry(ctx)
if err != nil {
// don't want to cause ArchwayChainProcessor to quit here, can retry again next cycle.
Expand Down Expand Up @@ -355,6 +357,8 @@ func (ccp *ArchwayChainProcessor) queryCycle(ctx context.Context, persistence *q

chainID := ccp.chainProvider.ChainId()

// TODO review: max block sync
//

Check warning on line 361 in relayer/chains/archway/archway_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/archway/archway_chain_processor.go#L360-L361

Added lines #L360 - L361 were not covered by tests
for i := persistence.latestQueriedBlock + 1; i <= persistence.latestHeight; i++ {
var eg errgroup.Group
var blockRes *ctypes.ResultBlockResults
Expand Down Expand Up @@ -451,6 +455,8 @@ func (ccp *ArchwayChainProcessor) queryCycle(ctx context.Context, persistence *q
return nil
}

// TODO: review add verifier

func (ccp *ArchwayChainProcessor) CollectMetrics(ctx context.Context, persistence *queryCyclePersistence) {
ccp.CurrentBlockHeight(ctx, persistence)

Expand Down
6 changes: 3 additions & 3 deletions relayer/chains/icon/icon_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,9 +641,9 @@ func (icp *IconChainProcessor) handlePathProcessorUpdate(ctx context.Context,
// clientState will return the most recent client state if client messages
// have already been observed for the clientID, otherwise it will query for it.
func (icp *IconChainProcessor) clientState(ctx context.Context, clientID string) (provider.ClientState, error) {
// if state, ok := icp.latestClientState[clientID]; ok {
// return state, nil
// }
if state, ok := icp.latestClientState[clientID]; ok {
return state, nil
}

Check warning on line 646 in relayer/chains/icon/icon_chain_processor.go

View check run for this annotation

Codecov / codecov/patch

relayer/chains/icon/icon_chain_processor.go#L644-L646

Added lines #L644 - L646 were not covered by tests
cs, err := icp.chainProvider.QueryClientStateWithoutProof(ctx, int64(icp.latestBlock.Height), clientID)
if err != nil {
return provider.ClientState{}, err
Expand Down
4 changes: 4 additions & 0 deletions relayer/chains/icon/module/app_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func (AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry)
(*MerkleProofState)(nil),
&icon.MerkleProofs{},
)
registry.RegisterImplementations(
(*exported.ClientMessage)(nil),
&icon.SignedHeader{},
)

}

Expand Down

0 comments on commit ca1d8cb

Please sign in to comment.