Ensure `verify_and_notify_new_payload` returns bool

This commit is contained in:
Hsiao-Wei Wang 2023-05-24 12:55:49 +08:00
parent ec1ee74edb
commit 7a827638e6
No known key found for this signature in database
GPG Key ID: AE3D6B174F971DE4
2 changed files with 14 additions and 7 deletions

View File

@ -355,9 +355,10 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
"""
Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``.
"""
assert self.is_valid_block_hash(new_payload_request.execution_payload)
assert self.notify_new_payload(new_payload_request.execution_payload)
...
if not self.is_valid_block_hash(new_payload_request.execution_payload):
return False
if not self.notify_new_payload(new_payload_request.execution_payload):
return False
return True
```

View File

@ -197,10 +197,16 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
"""
Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``.
"""
assert self.is_valid_block_hash(new_payload_request.execution_payload)
assert self.is_valid_versioned_hashes(new_payload_request) # [New in Deneb]
assert self.notify_new_payload(new_payload_request.execution_payload)
...
if not self.is_valid_block_hash(new_payload_request.execution_payload):
return False
# [New in Deneb]
if not self.is_valid_versioned_hashes(new_payload_request):
return False
if not self.notify_new_payload(new_payload_request.execution_payload):
return False
return True
```