Skip to content

Commit

Permalink
fix(relayer): return consensus block height
Browse files Browse the repository at this point in the history
  • Loading branch information
devbugging committed Nov 5, 2024
1 parent 8d05a64 commit 26b7019
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cchain/provider/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func newABCIFetchFunc(attCl atypes.QueryClient, cmtCl cmtservice.ServiceClient,
// Caller has to wait and retry in both cases
if !ok || earliestAttestationAtLatestHeight.AttestOffset < fromOffset {
// First attestation hasn't happened yet, return empty and set cursor to latest height
return []xchain.Attestation{}, earliestAttestationAtLatestHeight.BlockHeight, nil
return []xchain.Attestation{}, cursor, nil
}

latestBlockResp, err := cmtCl.GetLatestBlock(ctx, &cmtservice.GetLatestBlockRequest{})
Expand Down
2 changes: 1 addition & 1 deletion lib/cchain/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ func (p Provider) stream(
deps := stream.Deps[xchain.Attestation]{
FetchBatch: func(ctx context.Context, offset uint64) ([]xchain.Attestation, error) {
atts, cursor, err := p.fetch(ctx, chainVer, offset, fetchCursor)
fetchCursor = cursor // always set cursor, in case of an error is set to 0, safer for retry
if err != nil {
return nil, err
}
fetchCursor = cursor

return atts, nil
},
Expand Down

0 comments on commit 26b7019

Please sign in to comment.