pin_fallback_provider_by_host

Documentation for eth_defi.event_reader.multicall_batcher.pin_fallback_provider_by_host function.

pin_fallback_provider_by_host(fallback_provider, host_substring)

Pin a FallbackProvider to the provider whose host matches a substring.

Unlike FallbackProvider.switch_provider() (which cycles or randomises), this deterministically selects a specific upstream — used to force HyperEVM multicall retries onto the Alchemy single node, bypassing goldsky’s eRPC consensus endpoint. See docs/README-hyperevm-goldsky-failure.md.

The switch goes through FallbackProvider.switch_to_provider_index(), so the pinned provider is chain-id verified and rolled back if it is misconfigured or routing to the wrong chain — we never silently read from a bad endpoint.

Parameters
Returns

True if a matching provider was found and successfully selected, False if no provider matched or the match failed chain-id verification (in which case the caller should resume normal provider switching).

Return type

bool