You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Neutron Validator Indexing for TxSearch with block-by-block indexing
Problem
We need to design a sustainable method for Cosmos indexing, TxSearch is unreliable.
it can give back junk responses depending on the timeout of the RPC server
we require an archive node to index older messages
sometimes TxSearch isn’t public because it’s such an expensive RPC
Results in neutron validators getting stuck or not being able to index older messages, so we have gaps in checkpoints
Solution
We'll go with block-by-block indexing
The original get_event_log function from Mitosis can serve as an example. Might need some prettier logic
It doesn't appear a single RPC will give us both tx hashes and the events from those txs
Following Mitosis's work, we need to use the /block endpoint to get tx hashes, and then the /block_results endpoint to get the events for txs. The latter endpoint just returns an array where each element contains the events of the tx in the corresponding element in the array of txs from /block, but no tx hash. Also /block doesn't actually return the TX hash - it returns the raw tx that you then need to hash to get the tx hash.
There may be an alternative approach to avoid two RPCs where we'd still use TxSearch but request just a specific height. There's logic in the TxSearch server if only a specific height is requested and not a block range to be more efficient, but because TxSearch tends to be blocked by many RPC providers and iiuc it's still pretty inefficient even in this case, I think it's best to just opt for the /block and /block_results approach and move away from TxSearch entirely.
### Description
Implements cosmos block-by-block indexing, parallelizing where possible:
the `block` and `block_results` calls, and the individual block queries
within a range. Also reuses the existing `handle_txs` logic, to improve
readability.
### Drive-by changes
Adds `tokio::task::JoinError` to the `hyperlane-core` error enum
### Related issues
- Fixes#3234
- Added some hacky retrying logic to `get_logs_in_block`, since we were
seeing lots of `503` http errors. In
#3264 we
should make sure to remove this and propagate the error instead, to
retry via the cursor / indexer logic. I edited the description of 3264
to reflect this
### Backward compatibility
Yes
### Testing
e2e
---------
Co-authored-by: Trevor Porter <[email protected]>
Fix Neutron Validator Indexing for
TxSearch
with block-by-block indexingProblem
We need to design a sustainable method for Cosmos indexing,
TxSearch
is unreliable.Solution
/block
endpoint to get tx hashes, and then the/block_results
endpoint to get the events for txs. The latter endpoint just returns an array where each element contains the events of the tx in the corresponding element in the array of txs from/block
, but no tx hash. Also/block
doesn't actually return the TX hash - it returns the raw tx that you then need to hash to get the tx hash./block
and/block_results
are the same Is the order of tx in block and blockResults the same? tendermint/tendermint#3866/block
https://rpc-magnetix.neutron-1.neutron.org/block?height=6162253/block_results
https://rpc-magnetix.neutron-1.neutron.org/block_results?height=6162253/block
and/block_results
approach and move away from TxSearch entirely.Additional context
Related issues
Tasks
The text was updated successfully, but these errors were encountered: