29
29
BLANK_ROOT_HASH , EMPTY_UNCLE_HASH , GENESIS_BLOCK_NUMBER , GENESIS_PARENT_HASH )
30
30
from eth .chains import AsyncChain
31
31
from eth .db .trie import make_trie_root_and_nodes
32
- from eth .exceptions import HeaderNotFound , ValidationError
32
+ from eth .exceptions import (
33
+ HeaderNotFound ,
34
+ ValidationError as EthValidationError ,
35
+ )
33
36
from eth .rlp .headers import BlockHeader
34
37
from eth .rlp .receipts import Receipt
35
38
from eth .rlp .transactions import BaseTransaction , BaseTransactionFields
@@ -204,7 +207,7 @@ async def _sync(self, peer: HeaderRequestingPeer) -> None:
204
207
self .logger .warn ("Timeout waiting for header batch from %s, aborting sync" , peer )
205
208
await peer .disconnect (DisconnectReason .timeout )
206
209
break
207
- except ValidationError as err :
210
+ except ValueError as err :
208
211
self .logger .warn (
209
212
"Invalid header response sent by peer %s disconnecting: %s" ,
210
213
peer , err ,
@@ -226,7 +229,7 @@ async def _sync(self, peer: HeaderRequestingPeer) -> None:
226
229
self .logger .debug ("Got new header chain starting at #%d" , first .block_number )
227
230
try :
228
231
await self .chain .coro_validate_chain (headers , self ._seal_check_random_sample_rate )
229
- except ValidationError as e :
232
+ except EthValidationError as e :
230
233
self .logger .warn ("Received invalid headers from %s, aborting sync: %s" , peer , e )
231
234
break
232
235
try :
0 commit comments