Skip to content

Conversation

@fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Dec 1, 2025

Motivation
Restores #5233 by reverting #5464 + changes get_fork behaviour to default to Paris if the network is pre-merge (This is the change that broke Hive Daily Report tests). Also changes method fork_activation_time_or_block to fork_activation_time

Description

  • Restore refactor(l1): refactor chainconfig #5233
  • Change method fork_activation_time_or_block to fork_activation_time which returns None for pre-merge forks so we default to Paris on get_fork method if the network is pre-merge

Resolves #4720

@github-actions github-actions bot added the L1 Ethereum client label Dec 1, 2025
@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Lines of code report

Total lines added: 8
Total lines removed: 101
Total lines changed: 109

Detailed view
+--------------------------------------------------------------+-------+------+
| File                                                         | Lines | Diff |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/blockchain.rs                       | 1578  | +1   |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/constants.rs                        | 13    | -1   |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/mempool.rs                          | 710   | -26  |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/blockchain/payload.rs                          | 672   | -4   |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/block.rs                          | 932   | +4   |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/common/types/genesis.rs                        | 899   | -63  |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sequencer/block_producer/payload_builder.rs | 220   | -7   |
+--------------------------------------------------------------+-------+------+
| ethrex/crates/networking/rpc/engine/blobs.rs                 | 139   | +2   |
+--------------------------------------------------------------+-------+------+
| ethrex/tooling/ef_tests/state/deserialize.rs                 | 417   | +1   |
+--------------------------------------------------------------+-------+------+

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Benchmark Results Comparison

No significant difference was registered for any benchmark run.

Detailed Results

Benchmark Results: BubbleSort

Command Mean [s] Min [s] Max [s] Relative
main_revm_BubbleSort 2.958 ± 0.026 2.938 3.030 1.00
main_levm_BubbleSort 3.094 ± 0.025 3.065 3.145 1.05 ± 0.01
pr_revm_BubbleSort 2.978 ± 0.024 2.960 3.041 1.01 ± 0.01
pr_levm_BubbleSort 3.083 ± 0.041 3.042 3.188 1.04 ± 0.02

Benchmark Results: ERC20Approval

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Approval 975.5 ± 11.3 963.1 997.3 1.00
main_levm_ERC20Approval 1095.6 ± 6.7 1083.8 1106.0 1.12 ± 0.01
pr_revm_ERC20Approval 988.1 ± 15.4 974.1 1026.2 1.01 ± 0.02
pr_levm_ERC20Approval 1077.1 ± 7.2 1068.4 1086.8 1.10 ± 0.01

Benchmark Results: ERC20Mint

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Mint 133.5 ± 0.9 132.3 134.9 1.00
main_levm_ERC20Mint 161.9 ± 0.8 160.8 163.4 1.21 ± 0.01
pr_revm_ERC20Mint 134.6 ± 1.1 133.4 137.2 1.01 ± 0.01
pr_levm_ERC20Mint 160.0 ± 0.6 159.2 161.1 1.20 ± 0.01

Benchmark Results: ERC20Transfer

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ERC20Transfer 230.1 ± 2.0 228.2 233.0 1.00
main_levm_ERC20Transfer 275.4 ± 3.6 272.2 283.8 1.20 ± 0.02
pr_revm_ERC20Transfer 232.9 ± 3.2 230.4 240.6 1.01 ± 0.02
pr_levm_ERC20Transfer 272.0 ± 1.0 270.4 273.9 1.18 ± 0.01

Benchmark Results: Factorial

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Factorial 224.9 ± 1.6 222.4 227.1 1.00
main_levm_Factorial 266.3 ± 4.6 262.8 278.2 1.18 ± 0.02
pr_revm_Factorial 229.8 ± 2.3 227.4 234.5 1.02 ± 0.01
pr_levm_Factorial 265.9 ± 3.1 262.5 272.8 1.18 ± 0.02

Benchmark Results: FactorialRecursive

Command Mean [s] Min [s] Max [s] Relative
main_revm_FactorialRecursive 1.637 ± 0.034 1.579 1.675 1.00
main_levm_FactorialRecursive 8.448 ± 0.043 8.396 8.556 5.16 ± 0.11
pr_revm_FactorialRecursive 1.647 ± 0.028 1.598 1.689 1.01 ± 0.03
pr_levm_FactorialRecursive 8.374 ± 0.036 8.323 8.422 5.11 ± 0.11

Benchmark Results: Fibonacci

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Fibonacci 199.5 ± 1.0 198.0 201.5 1.00
main_levm_Fibonacci 258.2 ± 4.4 248.4 263.2 1.29 ± 0.02
pr_revm_Fibonacci 203.0 ± 1.4 201.9 206.1 1.02 ± 0.01
pr_levm_Fibonacci 259.0 ± 7.4 249.3 278.0 1.30 ± 0.04

Benchmark Results: FibonacciRecursive

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_FibonacciRecursive 856.9 ± 13.2 842.5 881.0 1.15 ± 0.02
main_levm_FibonacciRecursive 744.0 ± 5.2 738.0 756.7 1.00
pr_revm_FibonacciRecursive 851.3 ± 8.5 837.8 863.7 1.14 ± 0.01
pr_levm_FibonacciRecursive 748.3 ± 17.3 702.2 761.2 1.01 ± 0.02

Benchmark Results: ManyHashes

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_ManyHashes 8.5 ± 0.1 8.4 8.6 1.00
main_levm_ManyHashes 9.0 ± 0.1 8.8 9.3 1.07 ± 0.02
pr_revm_ManyHashes 8.5 ± 0.3 8.3 9.4 1.01 ± 0.04
pr_levm_ManyHashes 9.0 ± 0.1 8.8 9.1 1.06 ± 0.01

Benchmark Results: MstoreBench

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_MstoreBench 257.8 ± 1.3 255.9 259.8 1.08 ± 0.01
main_levm_MstoreBench 239.3 ± 1.9 237.2 243.0 1.00
pr_revm_MstoreBench 260.6 ± 5.7 255.5 275.0 1.09 ± 0.03
pr_levm_MstoreBench 239.8 ± 1.0 238.1 241.2 1.00 ± 0.01

Benchmark Results: Push

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_Push 288.4 ± 2.4 285.4 293.2 1.00 ± 0.01
main_levm_Push 313.0 ± 14.5 306.3 354.0 1.09 ± 0.05
pr_revm_Push 288.2 ± 1.2 286.8 290.4 1.00
pr_levm_Push 308.3 ± 1.2 306.7 311.2 1.07 ± 0.01

Benchmark Results: SstoreBench_no_opt

Command Mean [ms] Min [ms] Max [ms] Relative
main_revm_SstoreBench_no_opt 171.8 ± 5.6 166.6 184.9 1.88 ± 0.08
main_levm_SstoreBench_no_opt 91.2 ± 2.8 88.6 98.1 1.00
pr_revm_SstoreBench_no_opt 170.9 ± 2.8 166.7 173.7 1.87 ± 0.07
pr_levm_SstoreBench_no_opt 91.8 ± 2.8 88.4 98.3 1.01 ± 0.04

@fmoletta fmoletta marked this pull request as ready for review December 3, 2025 14:12
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Dec 3, 2025
Comment on lines -180 to -199
// Check whether the tx is replay-protected
if head_tx.tx.protected() && !chain_config.is_eip155_activated(context.block_number()) {
// Ignore replay protected tx & all txs from the sender
// Pull transaction from the mempool
debug!("Ignoring replay-protected transaction: {}", tx_hash);
txs.pop();
blockchain.remove_transaction_from_pool(&tx_hash)?;
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this refactor have anything to do with removing this piece of code?

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking into account the refactor, the correct thing to do here is to find another way to replace the !chain_config.is_eip155_activated(context.block_number()) part of this code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the reasoning is that we don't support running pre-merge blocks so this code should be unreachable

Copy link
Contributor

Choose a reason for hiding this comment

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

Given we already broke main by changing behavior during a chain config refactor, wouldn't it be better to leave this part out and reintroduce it later separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part didn't break main


#[repr(u8)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Default, Hash, Clone, Copy, Serialize, Deserialize)]
pub enum Fork {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should move the fork type and list to another file. wdyt?

@MegaRedHand MegaRedHand removed the status in ethrex_l1 Dec 4, 2025
@MegaRedHand MegaRedHand moved this to In Review in ethrex_l1 Dec 4, 2025
Copy link
Contributor

@JereSalo JereSalo left a comment

Choose a reason for hiding this comment

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

Defaulting to Paris if none of the forks is activated may work if we suppose that there's a previous check that doesn't let anybody initialize with a pre-Merge config but I still find it kinda weird. Doesn't need any change though, just saying. It may be the best thing to do anyway

Comment on lines +479 to 488
pub fn get_blob_schedule_for_time(&self, block_timestamp: u64) -> Option<ForkBlobSchedule> {
if let Some(fork_with_current_blob_schedule) = FORKS.into_iter().rfind(|fork| {
self.get_blob_schedule_for_fork(*fork).is_some()
&& self.is_fork_activated(*fork, block_timestamp)
}) {
self.get_blob_schedule_for_fork(fork_with_current_blob_schedule)
} else {
None
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be simpler?
Like can we just do let fork = self.get_fork(block_timestamp) and then self.get_blob_schedule_for_for(fork) or there may be a problem with that? I'm assuming that every new fork will have a blob schedule set to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linking discussion from reverted PR as I made the same comment there: #5233 (comment)

@fmoletta fmoletta requested a review from JereSalo December 5, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Improve the way we obtain the next and last forks

6 participants