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
218 changes: 215 additions & 3 deletions crates/common/types/fork_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,60 @@ mod tests {
time: 1740434112,
fork_id: ForkId {
fork_hash: H32::from_str("0xdfbd9bed").unwrap(),
fork_next: 1759308480,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1759308479,
fork_id: ForkId {
fork_hash: H32::from_str("0xdfbd9bed").unwrap(),
fork_next: 1759308480,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1759308480,
fork_id: ForkId {
fork_hash: H32::from_str("0x783def52").unwrap(),
fork_next: 1759800000,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1759799999,
fork_id: ForkId {
fork_hash: H32::from_str("0x783def52").unwrap(),
fork_next: 1759800000,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1759800000,
fork_id: ForkId {
fork_hash: H32::from_str("0xa280a45c").unwrap(),
fork_next: 1760389824,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1760389823,
fork_id: ForkId {
fork_hash: H32::from_str("0xa280a45c").unwrap(),
fork_next: 1760389824,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1760389824,
fork_id: ForkId {
fork_hash: H32::from_str("0x9bc6cb31").unwrap(),
fork_next: 0,
},
is_valid: true,
Expand All @@ -324,7 +378,111 @@ mod tests {
head: 123,
time: 2740434112,
fork_id: ForkId {
fork_hash: H32::from_str("0xdfbd9bed").unwrap(),
fork_hash: H32::from_str("0x9bc6cb31").unwrap(),
fork_next: 0,
},
is_valid: true,
},
];
assert_test_cases(test_cases, genesis.config, genesis_header);
}

#[test]
fn hoodi_test_cases() {
let genesis_file = std::fs::File::open("../../cmd/ethrex/networks/hoodi/genesis.json")
.expect("Failed to open genesis file");
let genesis_reader = BufReader::new(genesis_file);
let genesis: Genesis =
serde_json::from_reader(genesis_reader).expect("Failed to read genesis file");
let genesis_header = genesis.get_block().header;
// See https://github.com/ethereum/go-ethereum/blob/444a6d007a08bddcec0b68b60ab507ea8bc1d078/core/forkid/forkid_test.go#L100
let test_cases: Vec<TestCase> = vec![
TestCase {
head: 123,
time: 0,
fork_id: ForkId {
fork_hash: H32::from_str("0xbef71d30").unwrap(),
fork_next: 1742999832,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1742999831,
fork_id: ForkId {
fork_hash: H32::from_str("0xbef71d30").unwrap(),
fork_next: 1742999832,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1742999832,
fork_id: ForkId {
fork_hash: H32::from_str("0x0929e24e").unwrap(),
fork_next: 1761677592,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1761677591,
fork_id: ForkId {
fork_hash: H32::from_str("0x0929e24e").unwrap(),
fork_next: 1761677592,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1761677592,
fork_id: ForkId {
fork_hash: H32::from_str("0xe7e0e7ff").unwrap(),
fork_next: 1762365720,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1762365719,
fork_id: ForkId {
fork_hash: H32::from_str("0xe7e0e7ff").unwrap(),
fork_next: 1762365720,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1762365720,
fork_id: ForkId {
fork_hash: H32::from_str("0x3893353e").unwrap(),
fork_next: 1762955544,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1762955543,
fork_id: ForkId {
fork_hash: H32::from_str("0x3893353e").unwrap(),
fork_next: 1762955544,
},
is_valid: true,
},
TestCase {
head: 123,
time: 1762955544,
fork_id: ForkId {
fork_hash: H32::from_str("0x23aa1351").unwrap(),
fork_next: 0,
},
is_valid: true,
},
TestCase {
head: 123,
time: 2740434112,
fork_id: ForkId {
fork_hash: H32::from_str("0x23aa1351").unwrap(),
fork_next: 0,
},
is_valid: true,
Expand Down Expand Up @@ -424,6 +582,60 @@ mod tests {
time: 1741159776,
fork_id: ForkId {
fork_hash: H32::from_str("0xed88b5fd").unwrap(),
fork_next: 1760427360,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1760427359,
fork_id: ForkId {
fork_hash: H32::from_str("0xed88b5fd").unwrap(),
fork_next: 1760427360,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1760427360,
fork_id: ForkId {
fork_hash: H32::from_str("0xe2ae4999").unwrap(),
fork_next: 1761017184,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1761017183,
fork_id: ForkId {
fork_hash: H32::from_str("0xe2ae4999").unwrap(),
fork_next: 1761017184,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1761017184,
fork_id: ForkId {
fork_hash: H32::from_str("0x56078a1e").unwrap(),
fork_next: 1761607008,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1761607007,
fork_id: ForkId {
fork_hash: H32::from_str("0x56078a1e").unwrap(),
fork_next: 1761607008,
},
is_valid: true,
},
TestCase {
head: 1735372,
time: 1761607008,
fork_id: ForkId {
fork_hash: H32::from_str("0x268956b6").unwrap(),
fork_next: 0,
},
is_valid: true,
Expand All @@ -432,13 +644,13 @@ mod tests {
head: 1735372,
time: 2741159776,
fork_id: ForkId {
fork_hash: H32::from_str("0xed88b5fd").unwrap(),
fork_hash: H32::from_str("0x268956b6").unwrap(),
fork_next: 0,
},
is_valid: true,
},
];
assert_test_cases(test_cases, genesis.config, genesis_hash);
assert_test_cases(test_cases, genesis.config, genesis_hash.clone());
}

#[test]
Expand Down
Loading