Skip to content

Commit

Permalink
Better Error Messaging when failing to query the Block Height (#1189)
Browse files Browse the repository at this point in the history
* better block data errors

* remove redundant field
  • Loading branch information
keefertaylor committed May 18, 2023
1 parent af8d0f7 commit d5e3882
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ it will be helpful to provide the output from `http://localhost:7597/debug/pprof

---

**Error querying blockdata**

The relayer looks back in time at historical transactions and needs to have an index of them.

Specifically check `~/.<node_data_dir>/config/config.toml` has the following fields set:
```toml
indexer = "kv"
index_all_tags = true
```
---

**Error building or broadcasting transaction**

When preparing a transaction for relaying, the amount of gas that the transaction will consume is unknown. To compute how much gas the transaction will need, the transaction is prepared with 0 gas and delivered as a `/cosmos.tx.v1beta1.Service/Simulate` query to the RPC endpoint. Recently chains have been creating AnteHandlers in which 0 gas triggers an error case:
Expand Down
6 changes: 5 additions & 1 deletion relayer/chains/cosmos/cosmos_chain_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,11 @@ func (ccp *CosmosChainProcessor) queryCycle(ctx context.Context, persistence *qu
})

if err := eg.Wait(); err != nil {
ccp.log.Warn("Error querying block data", zap.Error(err))
ccp.log.Warn(
"Could not query block data. Consider checking if your RPC node is online, and that transaction indexing is enabled.",
zap.Int64("height", i),
)
ccp.log.Debug("Error querying block data", zap.Error(err))

persistence.retriesAtLatestQueriedBlock++
if persistence.retriesAtLatestQueriedBlock >= blockMaxRetries {
Expand Down

0 comments on commit d5e3882

Please sign in to comment.