hirosystems / chainhook

Extract transactions from Stacks and Bitcoin and build event driven re-org resistant indexers and databases.
GNU General Public License v3.0
143 stars 57 forks source link

Errors when making request to bitcoind node are swallowed by chainhook #375

Closed MicaiahReid closed 3 months ago

MicaiahReid commented 1 year ago

Describe the bug When running a scan of a bitcoin predicate, if there is any error from the bitcoin node, the user never sees it. They just get this in their logs: WARN unable to retrieve block hash #801220: will retry in a few seconds (attempt #4).

In my specific case, I was getting htis error from the bitcoind node: unable to parse response (RPC error response: RpcError { code: -8, message: "Block height out of range", data: None }). Seeing this error made it easy to see that I was requesting invalid values, but to see this error I had to make custom changes to chainhook.

Adding the error to this log line could help: https://github.com/hirosystems/chainhook/blob/0fbfc763774061e6fe97c00b07e1633217592280/components/chainhook-sdk/src/indexer/bitcoin/mod.rs#L192

To Reproduce Steps to reproduce the behavior:

  1. Make a bitcoin predicate to that has a start/end block that is outside of the local node's range.
  2. Run the predicate
  3. See that there is no RPC error
MicaiahReid commented 3 months ago

Closed by #503