Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d309ece
test: add stress test script
panos-xyz Mar 5, 2026
ecd5b2c
fix: pre-audit security fixes across multiple crates
panos-xyz Mar 6, 2026
1a00546
fix: additional pre-audit security hardening
panos-xyz Mar 6, 2026
42b0bcf
fix: pre-audit fixes for security review
panos-xyz Mar 6, 2026
67d6773
fix: pre-audit security hardening (block size, MorphTx version, fee r…
panos-xyz Mar 6, 2026
bae9aa4
refactor: load precompile contracts once
panos-xyz Mar 6, 2026
71aba4c
fix: align token transfer check with go-eth and clean up txpool removal
panos-xyz Mar 7, 2026
fe6c146
perf: tune reth persistence threshold to reduce disk I/O contention
panos-xyz Mar 7, 2026
64aa68a
refactor: add geth url
panos-xyz Mar 7, 2026
397c0ff
fix: use evm_call for ERC20 token fee to preserve Transfer logs in re…
panos-xyz Mar 8, 2026
8b04fea
fix: decouple token fee logs from handler pipeline to survive tx revert
panos-xyz Mar 8, 2026
58b3770
fix: discard logs from balanceOf evm_call to match go-eth StaticCall …
panos-xyz Mar 8, 2026
ff5bda5
refactor: minor efficiency improvements in token fee log handling
panos-xyz Mar 8, 2026
14f962b
refactor: deduplicate MorphTx validation in consensus layer
panos-xyz Mar 8, 2026
afdcd4c
style: fmt all
panos-xyz Mar 8, 2026
6031236
fix: override SLOAD to restore original_value after token fee deduction
panos-xyz Mar 8, 2026
572e6ca
fix: scope SLOAD original_value fix to token fee txs and use save-res…
panos-xyz Mar 9, 2026
c6d18f2
fix: rewrite TxMorph Compact codec using derive helper struct pattern
panos-xyz Mar 9, 2026
4bf7b9d
chore: bump reth fork to f137577 (unwind state root warning)
panos-xyz Mar 9, 2026
1a089ee
chore: add local-test-hoodi scripts for Hoodi testnet sync
panos-xyz Mar 9, 2026
515db5c
fix: read L1BlockInfo per-tx instead of per-block cache
panos-xyz Mar 9, 2026
68a1bdc
fix: remove PR#39 fee_slot_saves residual code after rebase
panos-xyz Mar 9, 2026
aba9c71
style: fmt all
panos-xyz Mar 9, 2026
96eb175
fix: allow skipped L1 messages in block validation
panos-xyz Mar 10, 2026
6c6a33b
docs: fix stale comments, remove redundant annotations
panos-xyz Mar 10, 2026
b66c890
fix: set finalized_block_hash in FCU to prevent unbounded memory growth
panos-xyz Mar 11, 2026
a4c395a
fix: limit FCU tag fallback to historical sync
panos-xyz Mar 11, 2026
1df0cd0
fix: seed finalized tag in new_safe_l2_block for validator memory cle…
panos-xyz Mar 11, 2026
a24e7ff
fix: use journal checkpoint/revert for EVM internal calls
panos-xyz Mar 11, 2026
2cb667b
refactor: remove should_compute_state_root override and export fetch_…
panos-xyz Mar 11, 2026
22dd220
feat: add state-root-check CLI tool for MPT root comparison
panos-xyz Mar 11, 2026
90bb800
chore: remove legacy-state-root flag and fix geth RPC URL default
panos-xyz Mar 11, 2026
b3e63e9
chore: add sync speed benchmark scripts
panos-xyz Mar 11, 2026
79dc941
refactor: remove geth RPC cross-validation from sync path
panos-xyz Mar 11, 2026
b887c7d
chore: add state-root-check wrapper scripts
panos-xyz Mar 11, 2026
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
229 changes: 121 additions & 108 deletions Cargo.lock

Large diffs are not rendered by default.

106 changes: 54 additions & 52 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ publish = false
resolver = "3"
members = [
"bin/morph-reth",
"bin/state-root-check",
"crates/chainspec",
"crates/consensus",
"crates/engine-api",
Expand Down Expand Up @@ -54,59 +55,60 @@ morph-rpc = { path = "crates/rpc" }
morph-revm = { path = "crates/revm", default-features = false }
morph-txpool = { path = "crates/txpool", default-features = false }

reth-basic-payload-builder = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-chain-state = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-chainspec = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-cli = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-cli-commands = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-cli-util = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-codecs = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-codecs-derive = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-consensus = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-consensus-common = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-db = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-db-api = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-e2e-test-utils = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-engine-local = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-engine-primitives = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-engine-tree = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-errors = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-eth-wire-types = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-ethereum = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-ethereum-cli = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-ethereum-consensus = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-ethereum-engine-primitives = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-ethereum-primitives = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1", default-features = false }
reth-evm = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-evm-ethereum = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-execution-types = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-metrics = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-network-peers = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-node-api = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-node-builder = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-node-core = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-node-ethereum = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-node-metrics = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-payload-builder = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-payload-primitives = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-payload-util = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-primitives-traits = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1", default-features = false }
reth-provider = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-api = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-builder = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-convert = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-eth-api = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-eth-types = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-rpc-server-types = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-storage-api = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-tasks = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-tracing = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-trie = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-transaction-pool = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1" }
reth-zstd-compressors = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1", default-features = false }
reth-basic-payload-builder = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-chain-state = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-chainspec = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-cli = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-cli-commands = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-cli-util = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-codecs = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-codecs-derive = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-consensus = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-consensus-common = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-db = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-db-api = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-e2e-test-utils = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-engine-local = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-engine-primitives = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-engine-tree = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-errors = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-eth-wire-types = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-ethereum = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-ethereum-cli = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-ethereum-consensus = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-ethereum-engine-primitives = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-ethereum-primitives = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e", default-features = false }
reth-evm = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-evm-ethereum = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-execution-types = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-metrics = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-network-peers = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-node-api = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-node-builder = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-node-core = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-node-ethereum = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-node-metrics = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-payload-builder = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-payload-primitives = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-payload-util = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-primitives-traits = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e", default-features = false }
reth-provider = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-api = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-builder = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-convert = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-eth-api = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-eth-types = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-rpc-server-types = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-storage-api = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-tasks = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-tracing = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-trie = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-trie-db = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-transaction-pool = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e" }
reth-zstd-compressors = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e", default-features = false }

reth-revm = { git = "https://github.com/morph-l2/reth", rev = "8057627ac9f169a0da4de44b616006a9e30382c1", features = [
reth-revm = { git = "https://github.com/morph-l2/reth", rev = "f13757781d2f6b0c1ec1c3e38f3ac32004bff24e", features = [
"std",
"optional-checks",
] }
Expand Down
4 changes: 3 additions & 1 deletion bin/morph-reth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ fn main() {
// Install signal handler for segmentation faults
sigsegv_handler::install();

// Enable backtraces by default
// Enable backtraces by default.
// SAFETY: Called at process startup before any other threads are spawned,
// so there are no concurrent readers of the environment.
if std::env::var_os("RUST_BACKTRACE").is_none() {
unsafe { std::env::set_var("RUST_BACKTRACE", "1") };
}
Expand Down
24 changes: 24 additions & 0 deletions bin/state-root-check/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "state-root-check"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
publish.workspace = true

[lints]
workspace = true

[dependencies]
alloy-primitives.workspace = true
clap.workspace = true
eyre.workspace = true
morph-chainspec.workspace = true
morph-node.workspace = true
reth-provider.workspace = true
reth-storage-api.workspace = true
reth-trie.workspace = true

[[bin]]
name = "state-root-check"
path = "src/main.rs"
76 changes: 76 additions & 0 deletions bin/state-root-check/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
use alloy_primitives::B256;
use eyre::{Result, ensure};

#[cfg(test)]
mod tests {
use super::find_first_mismatch;
use eyre::Result;

#[test]
fn returns_first_divergent_block_for_monotonic_range() -> Result<()> {
let mismatch_from = 103_u64;

let got = find_first_mismatch(100, 105, |block| Ok(block < mismatch_from))?;

assert_eq!(got, Some(mismatch_from));
Ok(())
}

#[test]
fn returns_none_when_everything_matches() -> Result<()> {
let got = find_first_mismatch(100, 105, |_block| Ok(true))?;

assert_eq!(got, None);
Ok(())
}
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct BlockRootComparison {
pub block_number: u64,
pub reth_root: B256,
pub geth_disk_root: B256,
}

impl BlockRootComparison {
pub fn is_match(&self) -> bool {
self.reth_root == self.geth_disk_root
}
}

pub fn find_first_mismatch<F>(from: u64, to: u64, mut matches: F) -> Result<Option<u64>>
where
F: FnMut(u64) -> Result<bool>,
{
ensure!(
from <= to,
"invalid range: from-block {from} is greater than to-block {to}"
);

if !matches(from)? {
return Ok(Some(from));
}

if matches(to)? {
return Ok(None);
}

let mut low = from.saturating_add(1);
let mut high = to;
let mut first = to;

while low <= high {
let mid = low + (high - low) / 2;
if matches(mid)? {
low = mid.saturating_add(1);
} else {
first = mid;
if mid == 0 {
break;
}
high = mid - 1;
}
}

Ok(Some(first))
}
Loading
Loading