Skip to content

Commit

Permalink
feat: add mpt feature flag for correct genesis header computation in …
Browse files Browse the repository at this point in the history
…mpt mode

Signed-off-by: Gregory Edison <[email protected]>
  • Loading branch information
greged93 committed Dec 27, 2024
1 parent dba9746 commit 5d911a8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/scroll/bin/scroll-reth-mpt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ reth-node-builder.workspace = true
reth-provider.workspace = true

# scroll
reth-scroll-cli.workspace = true
reth-scroll-node.workspace = true
reth-scroll-cli = { workspace = true, features = ["mpt"]}
reth-scroll-node = { workspace = true, features = ["mpt"] }

# misc
clap = { workspace = true, features = ["derive", "env"] }
Expand Down
4 changes: 3 additions & 1 deletion crates/scroll/chainspec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-ethereum-forks.workspace = true
reth-primitives-traits.workspace = true
reth-network-peers.workspace = true
reth-primitives-traits.workspace = true
reth-trie-common = { workspace = true, optional = true }

# scroll
reth-scroll-forks.workspace = true
Expand Down Expand Up @@ -60,3 +61,4 @@ std = [
"derive_more/std",
"reth-network-peers/std"
]
mpt = ["reth-trie-common"]
3 changes: 3 additions & 0 deletions crates/scroll/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ impl ScrollChainSpec {
difficulty: self.genesis.difficulty,
nonce: self.genesis.nonce.into(),
extra_data: self.genesis.extra_data.clone(),
#[cfg(not(feature = "mpt"))]
state_root: reth_scroll_state_commitment::state_root_ref_unhashed(&self.genesis.alloc),
#[cfg(feature = "mpt")]
state_root: reth_trie_common::root::state_root_ref_unhashed(&self.genesis.alloc),
timestamp: self.genesis.timestamp,
mix_hash: self.genesis.mix_hash,
beneficiary: self.genesis.coinbase,
Expand Down
3 changes: 2 additions & 1 deletion crates/scroll/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ scroll = [
"reth-node-core/scroll",
"reth-scroll-evm/scroll",
"reth-scroll-node/scroll"
]
]
mpt = ["reth-scroll-chainspec/mpt"]
1 change: 1 addition & 0 deletions crates/scroll/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ scroll = [
"reth-scroll-evm/scroll",
"reth-scroll-engine/scroll"
]
mpt = ["reth-scroll-chainspec/mpt"]
skip-state-root-validation = []

0 comments on commit 5d911a8

Please sign in to comment.