Skip to content

Commit

Permalink
fix: handle weird missing earliest block
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Oct 29, 2024
1 parent c57d952 commit b8d96cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ape_ethereum/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b8d96cd

Please sign in to comment.