From 01c358c87321fbba419962ff59ccdaa0b1a534f8 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 25 Jul 2023 13:28:34 +0800 Subject: [PATCH] Rename "data gas" to "blob gas" --- specs/_features/eip6110/beacon-chain.md | 12 ++++++------ specs/_features/eip6110/fork.md | 4 ++-- specs/deneb/beacon-chain.md | 14 +++++++------- specs/deneb/fork.md | 4 ++-- specs/deneb/light-client/fork.md | 4 ++-- specs/deneb/light-client/full-node.md | 4 ++-- specs/deneb/light-client/sync-protocol.md | 2 +- .../eth2spec/test/deneb/sanity/test_blocks.py | 6 +++--- .../eth2spec/test/helpers/execution_payload.py | 14 +++++++------- .../core/pyspec/eth2spec/test/helpers/sharding.py | 2 +- 10 files changed, 33 insertions(+), 33 deletions(-) diff --git a/specs/_features/eip6110/beacon-chain.md b/specs/_features/eip6110/beacon-chain.md index 44980685c..e2964267d 100644 --- a/specs/_features/eip6110/beacon-chain.md +++ b/specs/_features/eip6110/beacon-chain.md @@ -91,8 +91,8 @@ class ExecutionPayload(Container): block_hash: Hash32 transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] - data_gas_used: uint64 - excess_data_gas: uint64 + blob_gas_used: uint64 + excess_blob_gas: uint64 deposit_receipts: List[DepositReceipt, MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD] # [New in EIP6110] ``` @@ -117,8 +117,8 @@ class ExecutionPayloadHeader(Container): block_hash: Hash32 transactions_root: Root withdrawals_root: Root - data_gas_used: uint64 - excess_data_gas: uint64 + blob_gas_used: uint64 + excess_blob_gas: uint64 deposit_receipts_root: Root # [New in EIP6110] ``` @@ -274,8 +274,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, - excess_data_gas=payload.excess_data_gas, + blob_gas_used=payload.blob_gas_used, + excess_blob_gas=payload.excess_blob_gas, deposit_receipts_root=hash_tree_root(payload.deposit_receipts), # [New in EIP6110] ) ``` diff --git a/specs/_features/eip6110/fork.md b/specs/_features/eip6110/fork.md index b3b14a3f8..6b5ab0431 100644 --- a/specs/_features/eip6110/fork.md +++ b/specs/_features/eip6110/fork.md @@ -88,8 +88,8 @@ def upgrade_to_eip6110(pre: deneb.BeaconState) -> BeaconState: block_hash=pre.latest_execution_payload_header.block_hash, transactions_root=pre.latest_execution_payload_header.transactions_root, withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, - data_gas_used=uint64(0), - excess_data_gas=uint64(0), + blob_gas_used=uint64(0), + excess_blob_gas=uint64(0), deposit_receipts_root=Root(), # [New in EIP-6110] ) post = BeaconState( diff --git a/specs/deneb/beacon-chain.md b/specs/deneb/beacon-chain.md index 321dfb25e..2328b20e0 100644 --- a/specs/deneb/beacon-chain.md +++ b/specs/deneb/beacon-chain.md @@ -85,7 +85,7 @@ Deneb is a consensus-layer upgrade containing a number of features. Including: | `MAX_BLOBS_PER_BLOCK` | `uint64(6)` | *[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`. +and are limited by `MAX_BLOB_GAS_PER_BLOCK // GAS_PER_BLOB`. However the CL limit is independently defined by `MAX_BLOBS_PER_BLOCK`. ## Configuration @@ -136,8 +136,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:EIP4844] - excess_data_gas: uint64 # [New in Deneb:EIP4844] + blob_gas_used: uint64 # [New in Deneb:EIP4844] + excess_blob_gas: uint64 # [New in Deneb:EIP4844] ``` #### `ExecutionPayloadHeader` @@ -161,8 +161,8 @@ class ExecutionPayloadHeader(Container): block_hash: Hash32 # Hash of execution block transactions_root: Root withdrawals_root: Root - data_gas_used: uint64 # [New in Deneb:EIP4844] - excess_data_gas: uint64 # [New in Deneb:EIP4844] + blob_gas_used: uint64 # [New in Deneb:EIP4844] + excess_blob_gas: uint64 # [New in Deneb:EIP4844] ``` ## Helper functions @@ -385,8 +385,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:EIP4844] - excess_data_gas=payload.excess_data_gas, # [New in Deneb:EIP4844] + blob_gas_used=payload.blob_gas_used, # [New in Deneb:EIP4844] + excess_blob_gas=payload.excess_blob_gas, # [New in Deneb:EIP4844] ) ``` diff --git a/specs/deneb/fork.md b/specs/deneb/fork.md index 08af2fd35..9c314052b 100644 --- a/specs/deneb/fork.md +++ b/specs/deneb/fork.md @@ -83,8 +83,8 @@ def upgrade_to_deneb(pre: capella.BeaconState) -> BeaconState: block_hash=pre.latest_execution_payload_header.block_hash, transactions_root=pre.latest_execution_payload_header.transactions_root, withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, - data_gas_used=uint64(0), # [New in Deneb:EIP4844] - excess_data_gas=uint64(0), # [New in Deneb:EIP4844] + blob_gas_used=uint64(0), # [New in Deneb:EIP4844] + excess_blob_gas=uint64(0), # [New in Deneb:EIP4844] ) post = BeaconState( # Versioning diff --git a/specs/deneb/light-client/fork.md b/specs/deneb/light-client/fork.md index f4fd1b396..2dce4778e 100644 --- a/specs/deneb/light-client/fork.md +++ b/specs/deneb/light-client/fork.md @@ -41,8 +41,8 @@ def upgrade_lc_header_to_deneb(pre: capella.LightClientHeader) -> LightClientHea block_hash=pre.execution.block_hash, transactions_root=pre.execution.transactions_root, withdrawals_root=pre.execution.withdrawals_root, - data_gas_used=uint64(0), # [New in Deneb:EIP4844] - excess_data_gas=uint64(0), # [New in Deneb:EIP4844] + blob_gas_used=uint64(0), # [New in Deneb:EIP4844] + excess_blob_gas=uint64(0), # [New in Deneb:EIP4844] ), execution_branch=pre.execution_branch, ) diff --git a/specs/deneb/light-client/full-node.md b/specs/deneb/light-client/full-node.md index 876a6c258..281348167 100644 --- a/specs/deneb/light-client/full-node.md +++ b/specs/deneb/light-client/full-node.md @@ -49,8 +49,8 @@ def block_to_light_client_header(block: SignedBeaconBlock) -> LightClientHeader: # [New in Deneb:EIP4844] if epoch >= DENEB_FORK_EPOCH: - execution_header.data_gas_used = payload.data_gas_used - execution_header.excess_data_gas = payload.excess_data_gas + execution_header.blob_gas_used = payload.blob_gas_used + execution_header.excess_blob_gas = payload.excess_blob_gas execution_branch = compute_merkle_proof_for_block_body(block.message.body, EXECUTION_PAYLOAD_INDEX) else: diff --git a/specs/deneb/light-client/sync-protocol.md b/specs/deneb/light-client/sync-protocol.md index 38909ddbf..3b5663fa5 100644 --- a/specs/deneb/light-client/sync-protocol.md +++ b/specs/deneb/light-client/sync-protocol.md @@ -68,7 +68,7 @@ def is_valid_light_client_header(header: LightClientHeader) -> bool: # [New in Deneb:EIP4844] if epoch < DENEB_FORK_EPOCH: - if header.execution.data_gas_used != uint64(0) or header.execution.excess_data_gas != uint64(0): + if header.execution.blob_gas_used != uint64(0) or header.execution.excess_blob_gas != uint64(0): return False if epoch < CAPELLA_FORK_EPOCH: diff --git a/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py b/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py index a6dcc7e9a..562eec9e2 100644 --- a/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py +++ b/tests/core/pyspec/eth2spec/test/deneb/sanity/test_blocks.py @@ -27,7 +27,7 @@ from eth2spec.test.helpers.sharding import ( ) -def run_block_with_blobs(spec, state, blob_count, tx_count=1, data_gas_used=1, excess_data_gas=1, +def run_block_with_blobs(spec, state, blob_count, tx_count=1, blob_gas_used=1, excess_blob_gas=1, non_blob_tx_count=0, rng=random.Random(7777), valid=True): yield 'pre', state @@ -46,8 +46,8 @@ def run_block_with_blobs(spec, state, blob_count, tx_count=1, data_gas_used=1, e block.body.blob_kzg_commitments = blob_kzg_commitments block.body.execution_payload.transactions = txs - block.body.execution_payload.data_gas_used = data_gas_used - block.body.execution_payload.excess_data_gas = excess_data_gas + block.body.execution_payload.blob_gas_used = blob_gas_used + block.body.execution_payload.excess_blob_gas = excess_blob_gas block.body.execution_payload.block_hash = compute_el_block_hash(spec, block.body.execution_payload) if valid: diff --git a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py index 00f7a4bb7..adec1d781 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py +++ b/tests/core/pyspec/eth2spec/test/helpers/execution_payload.py @@ -32,8 +32,8 @@ def get_execution_payload_header(spec, execution_payload): if is_post_capella(spec): payload_header.withdrawals_root = spec.hash_tree_root(execution_payload.withdrawals) if is_post_deneb(spec): - payload_header.data_gas_used = execution_payload.data_gas_used - payload_header.excess_data_gas = execution_payload.excess_data_gas + payload_header.blob_gas_used = execution_payload.blob_gas_used + payload_header.excess_blob_gas = execution_payload.excess_blob_gas if is_post_eip6110(spec): payload_header.deposit_receipts_root = spec.hash_tree_root(execution_payload.deposit_receipts) if is_post_eip7002(spec): @@ -102,9 +102,9 @@ def compute_el_header_block_hash(spec, # withdrawals_root execution_payload_header_rlp.append((Binary(32, 32), withdrawals_trie_root)) if is_post_deneb(spec): - # excess_data_gas - execution_payload_header_rlp.append((big_endian_int, payload_header.data_gas_used)) - execution_payload_header_rlp.append((big_endian_int, payload_header.excess_data_gas)) + # excess_blob_gas + execution_payload_header_rlp.append((big_endian_int, payload_header.blob_gas_used)) + execution_payload_header_rlp.append((big_endian_int, payload_header.excess_blob_gas)) if is_post_eip6110(spec): # deposit_receipts_root assert deposit_receipts_trie_root is not None @@ -229,8 +229,8 @@ def build_empty_execution_payload(spec, state, randao_mix=None): if is_post_capella(spec): payload.withdrawals = spec.get_expected_withdrawals(state) if is_post_deneb(spec): - payload.data_gas_used = 0 - payload.excess_data_gas = 0 + payload.blob_gas_used = 0 + payload.excess_blob_gas = 0 if is_post_eip6110(spec): # just to be clear payload.deposit_receipts = [] diff --git a/tests/core/pyspec/eth2spec/test/helpers/sharding.py b/tests/core/pyspec/eth2spec/test/helpers/sharding.py index 32e1d4021..9393f40c5 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/sharding.py +++ b/tests/core/pyspec/eth2spec/test/helpers/sharding.py @@ -41,7 +41,7 @@ class BlobTransaction(Container): value: uint256 data: ByteList[MAX_CALLDATA_SIZE] access_list: List[AccessTuple, MAX_ACCESS_LIST_SIZE] - max_fee_per_data_gas: uint256 + max_fee_per_blob_gas: uint256 blob_versioned_hashes: List[Bytes32, MAX_VERSIONED_HASHES_LIST_SIZE]