Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Oct 29, 2024
1 parent b865e7c commit 678300f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions EIPS/eip-7742.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requires: 4844

## Abstract

Update blob maximum, target and blob gas fee computes from [EIP-4844](./eip-4844.md).
Update blob maximum, target and blob gas fee computation from [EIP-4844](./eip-4844.md).

The execution layer no longer verifies the blob maximum and receives the target dynamically from the consensus layer.

Expand Down Expand Up @@ -44,13 +44,13 @@ and deployment of changes to the blob count easier.

#### Maximum blobs per block

The max blob count is now provided and controlled by the CL during block production and a corresponding `max_blob_count` uint64 field is added to the header for purposes of optimistic sync validation of the maxmium versioned hashes a block can contain as well as for `excess_blob_gas` validations. This will supersed the [EIP-4844](./eip-4844.md) max blob gas validations.
The max blob count is now provided and controlled by the CL during block production and a corresponding `max_blob_count` uint64 field is added to the header for purposes of optimistic sync validation of the maxmium versioned hashes a block can contain as well as for `excess_blob_gas` validations. This will supersede the [EIP-4844](./eip-4844.md) max blob gas validations.

#### Target blobs per block

The target is currently specified as a fixed value in relation to the blob count. The Ethereum community intends to increase the blob parameters as part of its scaling strategy and the ability to have a more flexible target value in relation to the blob max is desirable to reduce rigidity in this protocol parameter.

To this end similar to `max_blob_count`, CL now provides a blob count target as well during block production and the EL block header is extended with this `target_blob_count` value to preserve the security of optimistic sync for the purposes validations of `excess_blob_gas`.
To this end similar to `max_blob_count`, CL now provides a blob count target as well during block production and the EL block header is extended with this `target_blob_count` value to preserve the security of optimistic sync for the purpose of `excess_blob_gas` validation.

#### Normalized excess blob gas

Expand Down Expand Up @@ -84,26 +84,26 @@ At the fork block (where parent.timestamp < FORK_TIMESTAMP), we convert parent's
```python
def calc_excess_blob_gas(parent: Header) -> int:
if(parent.timestamp < FORK_TIMESTAMP)
normalizedParentExcessBlobGas = parent.excess_blob_gas * EXCESS_BLOB_GAS_NORMALIZATION_FACTOR // OLD_TARGET_BLOB_GAS_PER_BLOCK
targetBlobGas = OLD_TARGET_BLOB_GAS_PER_BLOCK
maxExcessGasDiffPossible = OLD_TARGET_BLOB_GAS_PER_BLOCK
normalized_parent_excess_blob_gas = parent.excess_blob_gas * EXCESS_BLOB_GAS_NORMALIZATION_FACTOR // OLD_TARGET_BLOB_GAS_PER_BLOCK
target_blob_gas = OLD_TARGET_BLOB_GAS_PER_BLOCK
max_excess_gas_diff_possible = OLD_TARGET_BLOB_GAS_PER_BLOCK
else
normalizedParentExcessBlobGas = parent.excess_blob_gas
targetBlobGas = parent.target_blob_count * GAS_PER_BLOB
maxExcessGasDiffPossible = max(parent.max_blob_count - parent.target_blob_count, parent.target_blob_count) * GAS_PER_BLOB
normalized_parent_excess_blob_gas = parent.excess_blob_gas
target_blob_gas = parent.target_blob_count * GAS_PER_BLOB
max_excess_gas_diff_possible = max(parent.max_blob_count - parent.target_blob_count, parent.target_blob_count) * GAS_PER_BLOB

return (normalizedParentExcessBlobGas + (parent.blob_gas_used - targetBlobGas) * EXCESS_BLOB_GAS_NORMALIZATION_FACTOR // maxExcessGasDiffPossible)
return (normalized_parent_excess_blob_gas + (parent.blob_gas_used - target_blob_gas) * EXCESS_BLOB_GAS_NORMALIZATION_FACTOR // max_excess_gas_diff_possible)

def get_base_fee_per_blob_gas(header: Header) -> int:
if header.timestamp < FORK_TIMESTAMP
updateFraction = BLOB_BASE_FEE_UPDATE_FRACTION
update_fraction = BLOB_BASE_FEE_UPDATE_FRACTION
else
updateFraction = NORMALIZED_BLOB_BASE_FEE_UPDATE_FRACTION
update_fraction = NORMALIZED_BLOB_BASE_FEE_UPDATE_FRACTION

return fake_exponential(
MIN_BASE_FEE_PER_BLOB_GAS,
header.excess_blob_gas,
updateFraction
update_fraction
)
```

Expand Down

0 comments on commit 678300f

Please sign in to comment.