Skip to content

Commit

Permalink
specify the maximum number of blobs for each payload
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Jun 12, 2024
1 parent 4c29b0b commit 71f2912
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
- [New `compute_consolidation_epoch_and_update_churn`](#new-compute_consolidation_epoch_and_update_churn)
- [Updated `slash_validator`](#updated-slash_validator)
- [Beacon chain state transition function](#beacon-chain-state-transition-function)
- [Execution engine](#execution-engine)
- [Request data](#request-data)
- [Engine APIs](#engine-apis)
- [Modified `notify_new_payload`](#modified-notify_new_payload)
- [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload)
- [Epoch processing](#epoch-processing)
- [Updated `process_epoch`](#updated-process_epoch)
- [Updated `process_registry_updates`](#updated--process_registry_updates)
Expand Down Expand Up @@ -758,6 +763,54 @@ def slash_validator(state: BeaconState,

## Beacon chain state transition function

### Execution engine

#### Request data

#### Engine APIs

##### Modified `notify_new_payload`

*Note*: The function `notify_new_payload` is modified to include the maximum number of blobs
allowed per block.

```python
def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
max_blobs_per_block: uint64) -> bool:
"""
Return ``True`` if and only if ``execution_payload`` is valid with respect to ``self.execution_state``.
"""
...
```

##### Modified `verify_and_notify_new_payload`

```python
def verify_and_notify_new_payload(self: ExecutionEngine,
new_payload_request: NewPayloadRequest) -> bool:
"""
Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``.
"""
execution_payload = new_payload_request.execution_payload
parent_beacon_block_root = new_payload_request.parent_beacon_block_root

if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root):
return False

if not self.is_valid_versioned_hashes(new_payload_request):
return False

# [Modified in Electra]
if not self.notify_new_payload(execution_payload,
parent_beacon_block_root,
MAX_BLOBS_PER_BLOCK):
return False

return True
```

### Epoch processing

#### Updated `process_epoch`
Expand Down

0 comments on commit 71f2912

Please sign in to comment.