-
Notifications
You must be signed in to change notification settings - Fork 996
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
specially mark EIP4844 changes #3406
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,16 +41,15 @@ | |
|
||
## Introduction | ||
|
||
This upgrade adds blobs to the beacon chain as part of Deneb. This is an extension of the Capella upgrade. | ||
|
||
The blob transactions are packed into the execution payload by the EL/builder with their corresponding blobs being independently transmitted and are limited by `MAX_DATA_GAS_PER_BLOCK // DATA_GAS_PER_BLOB`. However the CL limit is independently defined by `MAX_BLOBS_PER_BLOCK`. | ||
Deneb is a consensus-layer upgrade containing a number of features. Including: | ||
* [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844): Shard Blob Transactions scale data-availability of Ethereum in a simple, forwards-compatible manner. | ||
Comment on lines
+44
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. other features will join this list later |
||
|
||
## Custom types | ||
|
||
| Name | SSZ equivalent | Description | | ||
| - | - | - | | ||
| `VersionedHash` | `Bytes32` | | | ||
| `BlobIndex` | `uint64` | | | ||
| `VersionedHash` | `Bytes32` | *[New in Deneb:EIP4844]* | | ||
| `BlobIndex` | `uint64` | *[New in Deneb:EIP4844]* | | ||
|
||
## Constants | ||
|
||
|
@@ -73,8 +72,11 @@ The blob transactions are packed into the execution payload by the EL/builder wi | |
|
||
| Name | Value | Description | | ||
| - | - | - | | ||
| `MAX_BLOB_COMMITMENTS_PER_BLOCK` | `uint64(2**12)` (= 4096) | hardfork independent fixed theoretical limit same as `LIMIT_BLOBS_PER_TX` (see EIP 4844) | | ||
| `MAX_BLOBS_PER_BLOCK` | `uint64(2**2)` (= 4) | Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | | ||
| `MAX_BLOB_COMMITMENTS_PER_BLOCK` | `uint64(2**12)` (= 4096) | *[New in Deneb:EIP4844]* hardfork independent fixed theoretical limit same as `LIMIT_BLOBS_PER_TX` (see EIP 4844) | | ||
| `MAX_BLOBS_PER_BLOCK` | `uint64(2**2)` (= 4) | *[New in Deneb:EIP4844]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | | ||
|
||
*Note*: The blob transactions are packed into the execution payload by the EL/builder with their corresponding blobs being independently transmitted | ||
and are limited by `MAX_DATA_GAS_PER_BLOCK // DATA_GAS_PER_BLOB`. However the CL limit is independently defined by `MAX_BLOBS_PER_BLOCK`. | ||
|
||
## Configuration | ||
|
||
|
@@ -100,9 +102,9 @@ class BeaconBlockBody(Container): | |
voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] | ||
sync_aggregate: SyncAggregate | ||
# Execution | ||
execution_payload: ExecutionPayload # [Modified in Deneb] | ||
execution_payload: ExecutionPayload # [Modified in Deneb:EIP4844] | ||
bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] | ||
blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] # [New in Deneb] | ||
blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] # [New in Deneb:EIP4844] | ||
``` | ||
|
||
#### `ExecutionPayload` | ||
|
@@ -126,8 +128,8 @@ class ExecutionPayload(Container): | |
block_hash: Hash32 # Hash of execution block | ||
transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] | ||
withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] | ||
data_gas_used: uint64 # [New in Deneb] | ||
excess_data_gas: uint64 # [New in Deneb] | ||
data_gas_used: uint64 # [New in Deneb:EIP4844] | ||
excess_data_gas: uint64 # [New in Deneb:EIP4844] | ||
``` | ||
|
||
#### `ExecutionPayloadHeader` | ||
|
@@ -151,8 +153,8 @@ class ExecutionPayloadHeader(Container): | |
block_hash: Hash32 # Hash of execution block | ||
transactions_root: Root | ||
withdrawals_root: Root | ||
data_gas_used: uint64 # [New in Deneb] | ||
excess_data_gas: uint64 # [New in Deneb] | ||
data_gas_used: uint64 # [New in Deneb:EIP4844] | ||
excess_data_gas: uint64 # [New in Deneb:EIP4844] | ||
``` | ||
|
||
## Helper functions | ||
|
@@ -205,7 +207,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine, | |
if not self.is_valid_block_hash(new_payload_request.execution_payload): | ||
return False | ||
|
||
# [New in Deneb] | ||
# [New in Deneb:EIP4844] | ||
if not self.is_valid_versioned_hashes(new_payload_request): | ||
return False | ||
|
||
|
@@ -232,11 +234,11 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi | |
# Verify timestamp | ||
assert payload.timestamp == compute_timestamp_at_slot(state, state.slot) | ||
|
||
# [New in Deneb] Verify commitments are under limit | ||
# [New in Deneb:EIP4844] Verify commitments are under limit | ||
assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK | ||
|
||
# Verify the execution payload is valid | ||
# [Modified in Deneb] Pass `versioned_hashes` to Execution Engine | ||
# [Modified in Deneb:EIP4844] Pass `versioned_hashes` to Execution Engine | ||
versioned_hashes = [kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments] | ||
assert execution_engine.verify_and_notify_new_payload( | ||
NewPayloadRequest(execution_payload=payload, versioned_hashes=versioned_hashes) | ||
|
@@ -259,8 +261,8 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi | |
block_hash=payload.block_hash, | ||
transactions_root=hash_tree_root(payload.transactions), | ||
withdrawals_root=hash_tree_root(payload.withdrawals), | ||
data_gas_used=payload.data_gas_used, # [New in Deneb] | ||
excess_data_gas=payload.excess_data_gas, # [New in Deneb] | ||
data_gas_used=payload.data_gas_used, # [New in Deneb:EIP4844] | ||
excess_data_gas=payload.excess_data_gas, # [New in Deneb:EIP4844] | ||
) | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this note to next to
MAX_BLOBS_PER_BLOCK
preset definition.