refactor(monitor): avoid dependency on archive EVM nodes
corverroos opened this issue · comments
Currently, our internal RPC nodes must be partial archive nodes.
This is because we need to query historical (>128 blocks) state for monitoring purposes.
Operators should however be able to only run fullnodes, since they don’t need to query state at all. TODO: We should confirm this.
One option is to build a monitoring cache that queries and stores cursors per blockheight. We then query the cache for monitoring purposes (if actual query fails). We can then revert to using normal fullnodes.
- Move relayer
startMonitoring
tomonitor
service. Along with all required config and metrics. Update grafana to use new metrics. - Implement
emitcursorcache
package in monitor binary- For each evm chain, stream xblocks, using
ConfLatest
. - For each xblock with
ShouldAttest==true
, fetch all emit cursors. - Store emit cursors locally on disk, index by height.
- Trim the cache after 90k blocks.
- For each evm chain, stream xblocks, using
- In
monitorAttestedForever
ifGetEmittedCursor
errors, fetch the emit cursor from theemitcursorcache
usingatt.BlockHeight