Merge branch 'dev' into execution-requests-list
This commit is contained in:
commit
b671a1c031
|
@ -29,8 +29,8 @@ class NoopExecutionEngine(ExecutionEngine):
|
||||||
|
|
||||||
def notify_new_payload(self: ExecutionEngine,
|
def notify_new_payload(self: ExecutionEngine,
|
||||||
execution_payload: ExecutionPayload,
|
execution_payload: ExecutionPayload,
|
||||||
execution_requests_list: list[bytes],
|
parent_beacon_block_root: Root,
|
||||||
parent_beacon_block_root: Root) -> bool:
|
execution_requests_list: list[bytes]) -> bool:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def notify_forkchoice_updated(self: ExecutionEngine,
|
def notify_forkchoice_updated(self: ExecutionEngine,
|
||||||
|
|
|
@ -991,8 +991,8 @@ class NewPayloadRequest(object):
|
||||||
```python
|
```python
|
||||||
def notify_new_payload(self: ExecutionEngine,
|
def notify_new_payload(self: ExecutionEngine,
|
||||||
execution_payload: ExecutionPayload,
|
execution_payload: ExecutionPayload,
|
||||||
execution_requests_list: list[bytes],
|
parent_beacon_block_root: Root,
|
||||||
parent_beacon_block_root: Root) -> bool:
|
execution_requests_list: list[bytes]) -> bool:
|
||||||
"""
|
"""
|
||||||
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
|
Return ``True`` if and only if ``execution_payload`` and ``execution_requests``
|
||||||
are valid with respect to ``self.execution_state``.
|
are valid with respect to ``self.execution_state``.
|
||||||
|
@ -1012,8 +1012,8 @@ 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``.
|
Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``.
|
||||||
"""
|
"""
|
||||||
execution_payload = new_payload_request.execution_payload
|
execution_payload = new_payload_request.execution_payload
|
||||||
execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra]
|
|
||||||
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
|
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
|
||||||
|
execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra]
|
||||||
|
|
||||||
if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
|
if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
|
||||||
return False
|
return False
|
||||||
|
@ -1024,8 +1024,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
|
||||||
# [Modified in Electra]
|
# [Modified in Electra]
|
||||||
if not self.notify_new_payload(
|
if not self.notify_new_payload(
|
||||||
execution_payload,
|
execution_payload,
|
||||||
execution_requests_list,
|
parent_beacon_block_root,
|
||||||
parent_beacon_block_root):
|
execution_requests_list):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -1174,9 +1174,9 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
|
||||||
assert execution_engine.verify_and_notify_new_payload(
|
assert execution_engine.verify_and_notify_new_payload(
|
||||||
NewPayloadRequest(
|
NewPayloadRequest(
|
||||||
execution_payload=payload,
|
execution_payload=payload,
|
||||||
execution_requests=body.execution_requests, # [New in Electra]
|
|
||||||
versioned_hashes=versioned_hashes,
|
versioned_hashes=versioned_hashes,
|
||||||
parent_beacon_block_root=state.latest_block_header.parent_root,
|
parent_beacon_block_root=state.latest_block_header.parent_root,
|
||||||
|
execution_requests=body.execution_requests, # [New in Electra]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# Cache execution payload header
|
# Cache execution payload header
|
||||||
|
|
Loading…
Reference in New Issue