Skip to content

Commit 0132e81

Browse files
committed
removing redundant blob prefix from versioned hashes in BlobTransaction container
1 parent 656cb21 commit 0132e81

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

EIPS/eip-4844.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class BlobTransaction(Container):
121121
data: ByteList[MAX_CALLDATA_SIZE]
122122
access_list: List[AccessTuple, MAX_ACCESS_LIST_SIZE]
123123
max_fee_per_data_gas: uint256
124-
blob_versioned_hashes: List[VersionedHash, MAX_VERSIONED_HASHES_LIST_SIZE]
124+
versioned_hashes: List[VersionedHash, MAX_VERSIONED_HASHES_LIST_SIZE]
125125

126126
class AccessTuple(Container):
127127
address: Address # Bytes20
@@ -153,8 +153,8 @@ When a blob transaction is passed through the network (see the [Networking](#net
153153
the `TransactionNetworkPayload` version of the transaction also includes `blobs`, `commitments` and `proofs`.
154154
The execution layer verifies the wrapper validity against the inner `TransactionPayload` after signature verification as:
155155

156-
- `blob_versioned_hashes` must not be empty
157-
- All hashes in `blob_versioned_hashes` must start with the byte `BLOB_COMMITMENT_VERSION_KZG`
156+
- `versioned_hashes` must not be empty
157+
- All hashes in `versioned_hashes` must start with the byte `BLOB_COMMITMENT_VERSION_KZG`
158158
- There may be at most `MAX_DATA_GAS_PER_BLOCK // DATA_GAS_PER_BLOB` total blob commitments in a valid block.
159159
- There is an equal amount of versioned hashes, commitments, blobs and proofs.
160160
- The commitments hash to the versioned hashes, i.e. `kzg_to_versioned_hash(commitment[i]) == versioned_hash[i]`
@@ -182,7 +182,7 @@ def signed_tx_hash(tx: SignedBlobTransaction) -> Bytes32:
182182
return keccak256(BLOB_TX_TYPE + ssz.serialize(tx))
183183
```
184184

185-
Blob transactions with empty `blob_versioned_hashes` are also considered invalid during execution block verification, and must not be included in a valid block.
185+
Blob transactions with empty `versioned_hashes` are also considered invalid during execution block verification, and must not be included in a valid block.
186186

187187
### Header extension
188188

@@ -247,8 +247,8 @@ The `ethereum/consensus-specs` repository defines the following beacon-node chan
247247
### Opcode to get versioned hashes
248248

249249
We add an opcode `DATAHASH` (with byte value `HASH_OPCODE_BYTE`) which reads `index` from the top of the stack
250-
as big-endian `uint256`, and replaces it on the stack with `tx.message.blob_versioned_hashes[index]`
251-
if `index < len(tx.message.blob_versioned_hashes)`, and otherwise with a zeroed `bytes32` value.
250+
as big-endian `uint256`, and replaces it on the stack with `tx.message.versioned_hashes[index]`
251+
if `index < len(tx.message.versioned_hashes)`, and otherwise with a zeroed `bytes32` value.
252252
The opcode has a gas cost of `HASH_OPCODE_GAS`.
253253

254254
### Point evaluation precompile
@@ -294,7 +294,7 @@ def calc_data_fee(tx: SignedBlobTransaction, parent: Header) -> int:
294294
return get_total_data_gas(tx) * get_data_gasprice(parent)
295295

296296
def get_total_data_gas(tx: SignedBlobTransaction) -> int:
297-
return DATA_GAS_PER_BLOB * len(tx.message.blob_versioned_hashes)
297+
return DATA_GAS_PER_BLOB * len(tx.message.versioned_hashes)
298298

299299
def get_data_gasprice(header: Header) -> int:
300300
return fake_exponential(
@@ -320,7 +320,7 @@ def validate_block(block: Block) -> None:
320320
# ensure that the user was willing to at least pay the current data gasprice
321321
assert tx.message.max_fee_per_data_gas >= get_data_gasprice(parent(block).header)
322322

323-
num_blobs += len(tx.message.blob_versioned_hashes)
323+
num_blobs += len(tx.message.versioned_hashes)
324324

325325
# check that the excess data gas is correct
326326
expected_edg = calc_excess_data_gas(parent(block).header, num_blobs)
@@ -352,7 +352,7 @@ We do network-level validation of `BlobTransactionNetworkWrapper` objects as fol
352352

353353
```python
354354
def validate_blob_transaction_wrapper(wrapper: BlobTransactionNetworkWrapper):
355-
versioned_hashes = wrapper.tx.message.blob_versioned_hashes
355+
versioned_hashes = wrapper.tx.message.versioned_hashes
356356
commitments = wrapper.commitments
357357
blobs = wrapper.blobs
358358
proofs = wrapper.proofs

0 commit comments

Comments
 (0)