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

Moving requests out of execution_payload into beacon_block.body #3875

Merged
merged 25 commits into from
Sep 12, 2024
Merged
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
355a9a3
Introducing ExecutionPayloadEnvelope
lucassaldanha Aug 9, 2024
ed9b061
Comments
lucassaldanha Aug 9, 2024
f26c9be
Removing EL requests from ExecutionPayload
lucassaldanha Aug 11, 2024
f9ac902
Updated light-client block -> header function
lucassaldanha Aug 11, 2024
e26a3e0
New execution payload global index
lucassaldanha Aug 11, 2024
9a2e088
requests_root
lucassaldanha Aug 12, 2024
858402f
Updated with requests on block body
lucassaldanha Aug 13, 2024
794b942
Undo execution_payload gsync change
lucassaldanha Aug 13, 2024
5c88de8
Remove requests in execution_payload from full-node lightclient spec
lucassaldanha Aug 13, 2024
6669675
Test updates
lucassaldanha Aug 13, 2024
4185c00
Fork fix and tests
lucassaldanha Aug 13, 2024
fa78e0d
PR comments
lucassaldanha Aug 13, 2024
e3ec53f
Fix lint
lucassaldanha Aug 13, 2024
3527a9b
Cleaning unchanged ExecutionPayload
lucassaldanha Aug 14, 2024
b84316d
PR Comments
lucassaldanha Aug 16, 2024
98dd188
Rename requests to execution_requests
lucassaldanha Aug 16, 2024
dc1892e
Updated NewPayloadRequest
lucassaldanha Aug 22, 2024
b8ca7cc
PR comments
lucassaldanha Aug 22, 2024
e445cdf
Merge branch 'dev' into 3865
lucassaldanha Sep 1, 2024
38baa57
Rename ExecutionLayerRequests to ExecutionRequests
lucassaldanha Sep 1, 2024
31225f1
Temp fix for linter on eip-7732 beacon chain spec
lucassaldanha Sep 2, 2024
abf382a
Fix 7732
potuz Sep 4, 2024
beff03d
Updated verify_and_notify_new_payload and notify_new_payload
lucassaldanha Sep 5, 2024
c8dd790
Fix linter
lucassaldanha Sep 5, 2024
622ccd1
Updated ElectraSpecBuilder (NoopExecutionEngine#notify_new_payload)
lucassaldanha Sep 5, 2024
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
83 changes: 53 additions & 30 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
- [`WithdrawalRequest`](#withdrawalrequest)
- [`ConsolidationRequest`](#consolidationrequest)
- [`PendingConsolidation`](#pendingconsolidation)
- [`ValidatorRequests`](#validatorrequests)
- [`ExecutionPayloadEnvelope`](#executionpayloadenvelope)
- [Modified Containers](#modified-containers)
- [`AttesterSlashing`](#attesterslashing)
- [`BeaconBlockBody`](#beaconblockbody)
- [Extended Containers](#extended-containers)
- [`Attestation`](#attestation)
- [`IndexedAttestation`](#indexedattestation)
- [`BeaconBlockBody`](#beaconblockbody)
- [`ExecutionPayload`](#executionpayload)
- [`ExecutionPayloadHeader`](#executionpayloadheader)
- [`BeaconState`](#beaconstate)
Expand Down Expand Up @@ -258,36 +260,35 @@ class PendingConsolidation(Container):
target_index: ValidatorIndex
```

### Modified Containers
#### `ValidatorRequests`

#### `AttesterSlashing`
*Note*: The container is new in EIP????.

```python
class AttesterSlashing(Container):
attestation_1: IndexedAttestation # [Modified in Electra:EIP7549]
attestation_2: IndexedAttestation # [Modified in Electra:EIP7549]
class ValidatorRequests(Container):
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved
deposit_requests: List[DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD] # [New in Electra:EIP6110]
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved
withdrawal_requests: List[WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD] # [New in Electra:EIP7002:EIP7251]
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved
consolidation_requests: List[ConsolidationRequest, MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD] # [New in Electra:EIP7251]
```

### Extended Containers
#### `ExecutionPayloadEnvelope`

#### `Attestation`
*Note*: The container is new in EIP????.

```python
class Attestation(Container):
aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] # [Modified in Electra:EIP7549]
data: AttestationData
signature: BLSSignature
committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT] # [New in Electra:EIP7549]
class ExecutionPayloadEnvelope(Container):
execution_payload: ExecutionPayload # [Modified in Electra:EIP6110:EIP7002]
requests: ValidatorRequests
```

#### `IndexedAttestation`
### Modified Containers

#### `AttesterSlashing`

```python
class IndexedAttestation(Container):
# [Modified in Electra:EIP7549]
attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
data: AttestationData
signature: BLSSignature
class AttesterSlashing(Container):
attestation_1: IndexedAttestation # [Modified in Electra:EIP7549]
attestation_2: IndexedAttestation # [Modified in Electra:EIP7549]
```

#### `BeaconBlockBody`
Expand All @@ -305,11 +306,33 @@ class BeaconBlockBody(Container):
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS]
sync_aggregate: SyncAggregate
# Execution
execution_payload: ExecutionPayload # [Modified in Electra:EIP6110:EIP7002]
execution_payload_envelope: ExecutionPayloadEnvelope # [Modified in Electra:EIP????]
bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES]
blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK]
```

### Extended Containers

#### `Attestation`

```python
class Attestation(Container):
aggregation_bits: Bitlist[MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT] # [Modified in Electra:EIP7549]
data: AttestationData
signature: BLSSignature
committee_bits: Bitvector[MAX_COMMITTEES_PER_SLOT] # [New in Electra:EIP7549]
```

#### `IndexedAttestation`

```python
class IndexedAttestation(Container):
# [Modified in Electra:EIP7549]
attesting_indices: List[ValidatorIndex, MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT]
data: AttestationData
signature: BLSSignature
```

#### `ExecutionPayload`
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved

```python
Expand Down Expand Up @@ -875,7 +898,7 @@ def process_pending_balance_deposits(state: BeaconState) -> None:
if processed_amount + deposit.amount > available_for_processing:
break
# Deposit fits in the churn, process it. Increase balance and consume churn.
else:
else:
increase_balance(state, deposit.index, deposit.amount)
processed_amount += deposit.amount
# Regardless of how the deposit was handled, we move on in the queue.
Expand Down Expand Up @@ -946,8 +969,8 @@ def process_effective_balance_updates(state: BeaconState) -> None:
```python
def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_block_header(state, block)
process_withdrawals(state, block.body.execution_payload) # [Modified in Electra:EIP7251]
process_execution_payload(state, block.body, EXECUTION_ENGINE) # [Modified in Electra:EIP6110]
process_withdrawals(state, block.body.execution_payload_envelope.execution_payload) # [Modified in Electra:EIP7251:EIP????]
process_execution_payload(state, block.body, EXECUTION_ENGINE) # [Modified in Electra:EIP6110:EIP????]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
process_execution_payload(state, block.body, EXECUTION_ENGINE) # [Modified in Electra:EIP6110:EIP????]
process_execution_payload(state, block.body, EXECUTION_ENGINE)

process_randao(state, block.body)
process_eth1_data(state, block.body)
process_operations(state, block.body) # [Modified in Electra:EIP6110:EIP7002:EIP7549:EIP7251]
Expand Down Expand Up @@ -1052,11 +1075,11 @@ def process_withdrawals(state: BeaconState, payload: ExecutionPayload) -> None:

##### Modified `process_execution_payload`

*Note*: The function `process_execution_payload` is modified to use the new `ExecutionPayloadHeader` type.
*Note*: The function `process_execution_payload` is modified to use the new `ExecutionPayloadHeader` and `ExecutionPayloadEnveloped` types.
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved

```python
def process_execution_payload(state: BeaconState, body: BeaconBlockBody, execution_engine: ExecutionEngine) -> None:
payload = body.execution_payload
payload = body.execution_payload_envelope.execution_payload # [Modified in EIP????]

# Verify consistency of the parent hash with respect to the previous execution payload header
assert payload.parent_hash == state.latest_execution_payload_header.block_hash
Expand Down Expand Up @@ -1126,11 +1149,11 @@ def process_operations(state: BeaconState, body: BeaconBlockBody) -> None:
for_ops(body.deposits, process_deposit) # [Modified in Electra:EIP7251]
for_ops(body.voluntary_exits, process_voluntary_exit) # [Modified in Electra:EIP7251]
for_ops(body.bls_to_execution_changes, process_bls_to_execution_change)
for_ops(body.execution_payload.deposit_requests, process_deposit_request) # [New in Electra:EIP6110]
# [New in Electra:EIP7002:EIP7251]
for_ops(body.execution_payload.withdrawal_requests, process_withdrawal_request)
# [New in Electra:EIP7251]
for_ops(body.execution_payload.consolidation_requests, process_consolidation_request)
for_ops(body.execution_payload_envelope.requests.deposit_requests, process_deposit_request) # [New in Electra:EIP6110:EIP????]
# [New in Electra:EIP7002:EIP7251:EIP????]
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved
for_ops(body.execution_payload_envelope.requests.withdrawal_requests, process_withdrawal_request)
# [New in Electra:EIP7251:EIP????]
lucassaldanha marked this conversation as resolved.
Show resolved Hide resolved
for_ops(body.execution_payload_envelope.requests.consolidation_requests, process_consolidation_request)
```

##### Attestations
Expand Down