Skip to content

Commit 8f5ef47

Browse files
committed
Do not check DAO fork on Ropsten
1 parent d39553a commit 8f5ef47

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

evm/vm/forks/tangerine_whistle/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ class TangerineWhistleVM(HomesteadVM):
1212

1313
# classes
1414
_state_class = TangerineWhistleState # type: Type[BaseState]
15+
16+
# Don't bother with any DAO logic in Tangerine VM or later
17+
# This is how we skip DAO logic on Ropsten, for example
18+
support_dao_fork = False

p2p/peer.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,11 @@ async def ensure_same_side_on_dao_fork(
199199
for start_block, vm_class in vm_configuration:
200200
if not issubclass(vm_class, HomesteadVM):
201201
continue
202+
elif not vm_class.support_dao_fork:
203+
break
202204
elif start_block > vm_class.dao_fork_block_number:
203-
continue
205+
# VM comes after the fork, so stop checking
206+
break
204207

205208
fork_block = vm_class.dao_fork_block_number
206209
try:
@@ -213,12 +216,12 @@ async def ensure_same_side_on_dao_fork(
213216
self.logger.info("Timed out waiting for DAO fork header from %s", self)
214217
raise
215218
except ValidationError as e:
216-
raise HandshakeFailure("Peer failed DAO fork check: {}".format(e))
219+
raise HandshakeFailure("Peer failed DAO fork check retrieval: {}".format(e))
217220

218221
try:
219222
vm_class.validate_header(header, parent)
220223
except ValidationError as e:
221-
raise HandshakeFailure("Peer failed DAO fork check: {}".format(e))
224+
raise HandshakeFailure("Peer failed DAO fork check validation: {}".format(e))
222225

223226
@abstractmethod
224227
async def _get_headers_at_chain_split(

0 commit comments

Comments
 (0)