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

Pass max_blobs_per_block into Engine API methods #4042

Closed
Closed
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
6 changes: 4 additions & 2 deletions pysetup/spec_builders/electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
target_blobs_per_block: uint64,
max_blobs_per_block: uint64) -> bool:
return True

def notify_forkchoice_updated(self: ExecutionEngine,
Expand All @@ -49,7 +50,8 @@ def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
target_blobs_per_block: uint64,
max_blobs_per_block: uint64) -> bool:
return True

def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool:
Expand Down
1 change: 1 addition & 0 deletions specs/_features/eip7594/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594]
)
)
# Cache execution payload header
Expand Down
1 change: 1 addition & 0 deletions specs/_features/eip7732/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ def process_execution_payload(state: BeaconState,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA,
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_ELECTRA,
)
)

Expand Down
15 changes: 11 additions & 4 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ class NewPayloadRequest(object):
parent_beacon_block_root: Root
execution_requests: ExecutionRequests # [New in Electra]
target_blobs_per_block: uint64 # [New in Electra:EIP7742]
max_blobs_per_block: uint64 # [New in Electra:EIP7742]
```

#### Engine APIs
Expand All @@ -1028,7 +1029,8 @@ def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
target_blobs_per_block: uint64,
max_blobs_per_block: uint64) -> bool:
"""
Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly.
"""
Expand All @@ -1045,7 +1047,8 @@ def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
target_blobs_per_block: uint64,
max_blobs_per_block: uint64) -> bool:
"""
Return ``True`` if and only if ``execution_payload`` and ``execution_requests_list``
are valid with respect to ``self.execution_state``.
Expand All @@ -1069,6 +1072,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
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]
target_blobs_per_block = new_payload_request.target_blobs_per_block # [New in Electra:EIP7742]
max_blobs_per_block = new_payload_request.max_blobs_per_block # [New in Electra:EIP7742]

if b'' in execution_payload.transactions:
return False
Expand All @@ -1078,7 +1082,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
execution_payload,
parent_beacon_block_root,
execution_requests_list,
target_blobs_per_block):
target_blobs_per_block,
max_blobs_per_block):
return False

if not self.is_valid_versioned_hashes(new_payload_request):
Expand All @@ -1089,7 +1094,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
execution_payload,
parent_beacon_block_root,
execution_requests_list,
target_blobs_per_block):
target_blobs_per_block,
max_blobs_per_block):
return False

return True
Expand Down Expand Up @@ -1252,6 +1258,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests, # [New in Electra]
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7691:EIP7742]
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7691:EIP7742]
)
)
# Cache execution payload header
Expand Down