Skip to content

Add EIP-7762 to Osaka (WIP) #4072

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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions packages/block/src/header/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@
* Calculates the excess blob gas for next (hopefully) post EIP 4844 block.
*/
public calcNextExcessBlobGas(childCommon: Common): bigint {
const osakaForkBlock = this.common.hardforkBlock(Hardfork.Osaka)
if (osakaForkBlock !== null && this.number === osakaForkBlock - BIGINT_1) {
// at the fork, set excess_blob_gas to 0
return BIGINT_0
}

Check warning on line 567 in packages/block/src/header/header.ts

View check run for this annotation

Codecov / codecov/patch

packages/block/src/header/header.ts#L566-L567

Added lines #L566 - L567 were not covered by tests
// The validation of the fields and 4844 activation is already taken care in BlockHeader constructor
const targetGasConsumed = (this.excessBlobGas ?? BIGINT_0) + (this.blobGasUsed ?? BIGINT_0)
const targetBlobGasPerBlock = childCommon.param('targetBlobGasPerBlock')
Expand Down
7 changes: 7 additions & 0 deletions packages/block/src/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,11 @@ export const paramsBlock: ParamsDict = {
maxBlobGasPerBlock: 1179648, // The max blob gas allowable per block
blobGasPriceUpdateFraction: 5007716, // The denominator used in the exponential when calculating a blob gas price
},
/**
* Increase MIN_BASE_FEE_PER_BLOB_GAS to speed up price discovery on blob space
*/
7762: {
// gasConfig
minBlobGas: 2 ** 25, // Minimum base fee per blob gas
},
}
9 changes: 9 additions & 0 deletions packages/common/src/eips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,15 @@ export const eipsDict: EIPsDict = {
minimumHardfork: Hardfork.Chainstart,
requiredEIPs: [2935],
},
/**
* Description : Increase MIN_BASE_FEE_PER_BLOB_GAS to speed up price discovery on blob space
* URL : https://eips.ethereum.org/EIPS/eip-7762
* Status : Review
*/
7762: {
minimumHardfork: Hardfork.Osaka,
requiredEIPs: [4844],
},
/**
* Description : Ethereum state using a unified binary tree (experimental)
* URL : hhttps://eips.ethereum.org/EIPS/eip-7864
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/hardforks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const hardforksDict: HardforksDict = {
* Status : Final
*/
osaka: {
eips: [663, 3540, 3670, 4200, 4750, 5450, 6206, 7069, 7480, 7620, 7692, 7698],
eips: [663, 3540, 3670, 4200, 4750, 5450, 6206, 7069, 7480, 7620, 7692, 7698, 7762],
},
/**
* Description: Next feature hardfork after osaka, internally used for verkle testing/implementation (incomplete/experimental)
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/src/evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export class EVM implements EVMInterface {
const supportedEIPs = [
663, 1153, 1559, 2537, 2565, 2718, 2929, 2930, 2935, 3198, 3529, 3540, 3541, 3607, 3651, 3670,
3855, 3860, 4200, 4399, 4750, 4788, 4844, 4895, 5133, 5450, 5656, 6110, 6206, 6780, 6800,
7002, 7069, 7251, 7480, 7516, 7620, 7685, 7691, 7692, 7698, 7702, 7709,
7002, 7069, 7251, 7480, 7516, 7620, 7685, 7691, 7692, 7698, 7702, 7709, 7762,
]

for (const eip of this.common.eips()) {
Expand Down
7 changes: 7 additions & 0 deletions packages/vm/src/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,11 @@ export const paramsVM: ParamsDict = {
maxBlobGasPerBlock: 1179648, // The max blob gas allowable per block
blobGasPriceUpdateFraction: 5007716, // The denominator used in the exponential when calculating a blob gas price
},
/**
* Increase MIN_BASE_FEE_PER_BLOB_GAS to speed up price discovery on blob space
*/
7762: {
// gasConfig
minBlobGas: 2 ** 25, // Minimum base fee per blob gas
},
}
Loading