Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle execution requests on CL side #3972

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pysetup/spec_builders/electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadRespo

def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root) -> bool:
parent_beacon_block_root: Root,
execution_requests: ExecutionRequests) -> bool:
return True

def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool:
Expand All @@ -56,4 +57,4 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
return True


EXECUTION_ENGINE = NoopExecutionEngine()"""
EXECUTION_ENGINE = NoopExecutionEngine()"""
23 changes: 21 additions & 2 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
- [Request data](#request-data)
- [Modified `NewPayloadRequest`](#modified-newpayloadrequest)
- [Engine APIs](#engine-apis)
- [Modified `is_valid_block_hash`](#modified-is_valid_block_hash)
- [Modified `notify_new_payload`](#modified-notify_new_payload)
- [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload)
- [Block processing](#block-processing)
Expand Down Expand Up @@ -983,6 +984,21 @@ class NewPayloadRequest(object):

#### Engine APIs

##### Modified `is_valid_block_hash`

*Note*: The function `is_valid_block_hash` is modified to include the additional `execution_requests` parameter in Electra.

```python
def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests: ExecutionRequests) -> bool:
"""
Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly.
"""
...
```

##### Modified `notify_new_payload`

*Note*: The function `notify_new_payload` is modified to include the additional `execution_requests` parameter in Electra.
Expand All @@ -993,7 +1009,7 @@ def notify_new_payload(self: ExecutionEngine,
parent_beacon_block_root: Root,
execution_requests: ExecutionRequests) -> 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``.
"""
...
Expand All @@ -1014,7 +1030,10 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
execution_requests = 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,
execution_requests):
return False

if not self.is_valid_versioned_hashes(new_payload_request):
Expand Down