Skip to content
30 changes: 30 additions & 0 deletions cmd/ethrex/networks/holesky/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"shanghaiTime": 1696000704,
"pragueTime": 1740434112,
"cancunTime": 1707305664,
"osakaTime": 1759308480,
"bpo1Time": 1759800000,
"bpo2Time": 1760389824,
"blobSchedule": {
"cancun": {
"target": 3,
"max": 6,
"baseFeeUpdateFraction": 3338477
},
"prague": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"osaka": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"bpo1": {
"target": 10,
"max": 15,
"baseFeeUpdateFraction": 8346193
},
"bpo2": {
"target": 14,
"max": 21,
"baseFeeUpdateFraction": 11684671
}
},
"depositContractAddress": "0x4242424242424242424242424242424242424242"
},
"alloc": {
Expand Down
22 changes: 20 additions & 2 deletions cmd/ethrex/networks/hoodi/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 0,
"cancunTime": 0,
"pragueTime": 1742999832,
"osakaTime": 1761677592,
"bpo1Time": 1762365720,
"bpo2Time": 1762955544,
"blobSchedule": {
"cancun": {
"target": 3,
Expand All @@ -26,10 +30,24 @@
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"osaka": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"bpo1": {
"target": 10,
"max": 15,
"baseFeeUpdateFraction": 8346193
},
"bpo2": {
"target": 14,
"max": 21,
"baseFeeUpdateFraction": 11684671
}
},
"depositContractAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
"pragueTime": 1742999832
"depositContractAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa"
},
"alloc": {
"0x0000000000000000000000000000000000000000": {
Expand Down
18 changes: 18 additions & 0 deletions cmd/ethrex/networks/mainnet/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"shanghaiTime": 1681338455,
"cancunTime": 1710338135,
"pragueTime": 1746612311,
"osakaTime": 1764798551,
Comment thread
SDartayet marked this conversation as resolved.
"bpo1Time": 1765978199,
"bpo2Time": 1767747671,
"ethash": {},
"depositContractAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
"blobSchedule": {
Expand All @@ -34,6 +37,21 @@
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"osaka": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"bpo1": {
"target": 10,
"max": 15,
"baseFeeUpdateFraction": 8346193
},
"bpo2": {
"target": 14,
"max": 21,
"baseFeeUpdateFraction": 11684671
}
}
},
Expand Down
30 changes: 30 additions & 0 deletions cmd/ethrex/networks/sepolia/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,36 @@
"shanghaiTime": 1677557088,
"cancunTime": 1706655072,
"pragueTime": 1741159776,
"osakaTime": 1760427360,
"bpo1Time": 1761017184,
"bpo2Time": 1761607008,
"blobSchedule": {
"cancun": {
"target": 3,
"max": 6,
"baseFeeUpdateFraction": 3338477
},
"prague": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"osaka": {
"target": 6,
"max": 9,
"baseFeeUpdateFraction": 5007716
},
"bpo1": {
"target": 10,
"max": 15,
"baseFeeUpdateFraction": 8346193
},
"bpo2": {
"target": 14,
"max": 21,
"baseFeeUpdateFraction": 11684671
}
},
"depositContractAddress": "0x7f02C3E3c98b133055B8B348B2Ac625669Ed295D"
},
"alloc": {
Expand Down
51 changes: 40 additions & 11 deletions crates/common/types/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ impl TryFrom<&Path> for Genesis {
warn!("Invalid fork, only post-merge networks are supported.");
}

if genesis.config.bpo1_time.is_some() && genesis.config.blob_schedule.bpo1.is_none()
|| genesis.config.bpo2_time.is_some() && genesis.config.blob_schedule.bpo2.is_none()
|| genesis.config.bpo3_time.is_some() && genesis.config.blob_schedule.bpo3.is_none()
if genesis.config.bpo3_time.is_some() && genesis.config.blob_schedule.bpo3.is_none()
|| genesis.config.bpo4_time.is_some() && genesis.config.blob_schedule.bpo4.is_none()
|| genesis.config.bpo5_time.is_some() && genesis.config.blob_schedule.bpo5.is_none()
{
Expand Down Expand Up @@ -130,10 +128,10 @@ pub struct BlobSchedule {
pub prague: ForkBlobSchedule,
#[serde(default = "default_osaka_schedule")]
pub osaka: ForkBlobSchedule,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bpo1: Option<ForkBlobSchedule>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bpo2: Option<ForkBlobSchedule>,
#[serde(default = "default_bpo1_schedule")]
pub bpo1: ForkBlobSchedule,
#[serde(default = "default_bpo2_schedule")]
pub bpo2: ForkBlobSchedule,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bpo3: Option<ForkBlobSchedule>,
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand All @@ -148,8 +146,8 @@ impl Default for BlobSchedule {
cancun: default_cancun_schedule(),
prague: default_prague_schedule(),
osaka: default_osaka_schedule(),
bpo1: None,
bpo2: None,
bpo1: default_bpo1_schedule(),
bpo2: default_bpo2_schedule(),
bpo3: None,
bpo4: None,
bpo5: None,
Expand Down Expand Up @@ -181,6 +179,21 @@ fn default_osaka_schedule() -> ForkBlobSchedule {
}
}

fn default_bpo1_schedule() -> ForkBlobSchedule {
ForkBlobSchedule {
target: 10,
max: 15,
base_fee_update_fraction: 8346193,
}
}

fn default_bpo2_schedule() -> ForkBlobSchedule {
ForkBlobSchedule {
target: 14,
max: 21,
base_fee_update_fraction: 11684671,
}
}
/// Blockchain settings defined per block
#[allow(unused)]
#[derive(
Expand Down Expand Up @@ -290,6 +303,11 @@ pub enum Fork {
Cancun = 17,
Prague = 18,
Osaka = 19,
BPO1 = 20,
BPO2 = 21,
BPO3 = 22,
BPO4 = 23,
BPO5 = 24,
}

impl From<Fork> for &str {
Expand All @@ -315,6 +333,11 @@ impl From<Fork> for &str {
Fork::Cancun => "Cancun",
Fork::Prague => "Prague",
Fork::Osaka => "Osaka",
Fork::BPO1 => "BPO1",
Fork::BPO2 => "BPO2",
Fork::BPO3 => "BPO3",
Fork::BPO4 => "BPO4",
Fork::BPO5 => "BPO5",
}
}
}
Expand Down Expand Up @@ -419,9 +442,9 @@ impl ChainConfig {
} else if self.is_bpo3_activated(block_timestamp) {
Some(self.blob_schedule.bpo3.unwrap_or_default())
} else if self.is_bpo2_activated(block_timestamp) {
Some(self.blob_schedule.bpo2.unwrap_or_default())
Some(self.blob_schedule.bpo2)
} else if self.is_bpo1_activated(block_timestamp) {
Some(self.blob_schedule.bpo1.unwrap_or_default())
Some(self.blob_schedule.bpo1)
} else if self.is_osaka_activated(block_timestamp) {
Some(self.blob_schedule.osaka)
} else if self.is_prague_activated(block_timestamp) {
Expand Down Expand Up @@ -471,6 +494,12 @@ impl ChainConfig {
self.shanghai_time,
self.cancun_time,
self.prague_time,
self.osaka_time,
self.bpo1_time,
self.bpo2_time,
self.bpo3_time,
self.bpo4_time,
self.bpo5_time,
self.verkle_time,
]
.into_iter()
Expand Down
1 change: 1 addition & 0 deletions crates/vm/backends/revm/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,6 @@ pub fn fork_to_spec_id(fork: Fork) -> SpecId {
Fork::Cancun => SpecId::CANCUN,
Fork::Prague => SpecId::PRAGUE,
Fork::Osaka => SpecId::OSAKA,
_ => SpecId::LATEST,
Copy link
Copy Markdown
Contributor Author

@SDartayet SDartayet Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure what to do with the BPO forks given this version of REVM doesn't account for them, so I included this as a placeholder. If anyone has a better idea please let me know

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. As far as I know, they receive the blob schedule parameters as part of the configuration (env?), so BPOs should just be the current fork (i.e. Osaka).

}
}
Loading