resolve_hyperevm_consensus_failover

Documentation for eth_defi.event_reader.multicall_batcher.resolve_hyperevm_consensus_failover function.

resolve_hyperevm_consensus_failover(chain_id, provider, exception)

Decide whether a failed HyperEVM multicall should fail over to a single node.

On HyperEVM (chain 999) the scan’s primary provider is goldsky’s eRPC endpoint running in consensus mode: it fans each eth_call to several upstream nodes and only returns a result when enough of them agree byte-for-byte. For some vaults the upstreams intermittently disagree and eRPC returns ERPC_CONSENSUS_DISAGREEMENT_CLUE. Retrying or randomly cycling back onto the same consensus endpoint is futile; a single (non-consensus) node such as Alchemy returns a usable answer immediately.

This helper detects that exact situation — HyperEVM chain id, a consensus disagreement error, and a provider mix that contains both a goldsky and an Alchemy endpoint — and returns the provider host substring to pin retries to.

See docs/README-hyperevm-goldsky-failure.md for the full failure analysis, the nodes involved, and the on-chain evidence.

Parameters
  • chain_id (int) – Chain id of the multicall being retried.

  • provider (Any) – The active web3 provider. Only FallbackProvider mixes are eligible (we need an alternative single node to fail over to).

  • exception (Exception) – The MulticallRetryable (or its cause) raised by the failed call.

Returns

Lower-case provider host substring ("alchemy") to pin retries to, or None if this is not the HyperEVM goldsky consensus failure mode.

Return type

Optional[str]