get_safe_cached_latest_block_number
Documentation for eth_defi.provider.broken_provider.get_safe_cached_latest_block_number function.
- get_safe_cached_latest_block_number(web3, chain_id, blocks=1000, cache_duration=3600)
Get almost “latest” block to work around broken JSON-RPC providers.
Not for high frequency usage, as it caches the block for delay seconds
No RPC call are made to
Disabled in Anvil configs
Work around the error on Monad/Arbitrum/dRPC/shitty RPCs:
{'message': 'upstream does not have the requested block yet', 'code': -32603}Their internal routing is likely broken and when calling eth_call with latest the request fails for no reason.