From b8d96cd7ab3264e9f41eb99545ac53d1edef0f79 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Tue, 29 Oct 2024 16:11:38 -0500 Subject: [PATCH] fix: handle weird missing earliest block --- src/ape_ethereum/provider.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index 740703f833..715597defb 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -22,6 +22,7 @@ from web3 import HTTPProvider, IPCProvider, Web3 from web3 import WebsocketProvider as WebSocketProvider from web3._utils.http import construct_user_agent +from web3.exceptions import BlockNotFound from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ( ExtraDataLengthError, @@ -1527,6 +1528,10 @@ def _complete_connect(self): except ExtraDataLengthError: is_likely_poa = True break + except BlockNotFound: + # Weird node implementation. + is_likely_poa = False + break else: is_likely_poa = ( "proofOfAuthorityData" in block