mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(isthmus): include storage updates in l2 withdrawals root computation (#14307)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8600,6 +8600,7 @@ dependencies = [
|
|||||||
"reth-provider",
|
"reth-provider",
|
||||||
"reth-revm",
|
"reth-revm",
|
||||||
"reth-transaction-pool",
|
"reth-transaction-pool",
|
||||||
|
"reth-trie",
|
||||||
"revm",
|
"revm",
|
||||||
"sha2 0.10.8",
|
"sha2 0.10.8",
|
||||||
"thiserror 2.0.11",
|
"thiserror 2.0.11",
|
||||||
|
|||||||
@ -27,6 +27,7 @@ reth-payload-util.workspace = true
|
|||||||
reth-payload-primitives = { workspace = true, features = ["op"] }
|
reth-payload-primitives = { workspace = true, features = ["op"] }
|
||||||
reth-basic-payload-builder.workspace = true
|
reth-basic-payload-builder.workspace = true
|
||||||
reth-chain-state.workspace = true
|
reth-chain-state.workspace = true
|
||||||
|
reth-trie.workspace = true
|
||||||
|
|
||||||
# op-reth
|
# op-reth
|
||||||
reth-optimism-consensus.workspace = true
|
reth-optimism-consensus.workspace = true
|
||||||
|
|||||||
@ -46,6 +46,7 @@ use reth_revm::{
|
|||||||
cancelled::CancelOnDrop, database::StateProviderDatabase, witness::ExecutionWitnessRecord,
|
cancelled::CancelOnDrop, database::StateProviderDatabase, witness::ExecutionWitnessRecord,
|
||||||
};
|
};
|
||||||
use reth_transaction_pool::{BestTransactionsAttributes, PoolTransaction, TransactionPool};
|
use reth_transaction_pool::{BestTransactionsAttributes, PoolTransaction, TransactionPool};
|
||||||
|
use reth_trie::HashedStorage;
|
||||||
use revm::{
|
use revm::{
|
||||||
db::{states::bundle_state::BundleRetention, State},
|
db::{states::bundle_state::BundleRetention, State},
|
||||||
primitives::{ExecutionResult, ResultAndState},
|
primitives::{ExecutionResult, ResultAndState},
|
||||||
@ -377,14 +378,22 @@ impl<Txs> OpBuilder<'_, Txs> {
|
|||||||
state.merge_transitions(BundleRetention::Reverts);
|
state.merge_transitions(BundleRetention::Reverts);
|
||||||
|
|
||||||
let withdrawals_root = if ctx.is_isthmus_active() {
|
let withdrawals_root = if ctx.is_isthmus_active() {
|
||||||
|
let hashed_storage_updates =
|
||||||
|
state.bundle_state.state().get(&ADDRESS_L2_TO_L1_MESSAGE_PASSER).map(|account| {
|
||||||
|
// block contained withdrawals transactions, use predeploy storage updates from
|
||||||
|
// execution
|
||||||
|
HashedStorage::from_plain_storage(
|
||||||
|
account.status,
|
||||||
|
account.storage.iter().map(|(slot, value)| (slot, &value.present_value)),
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
// withdrawals root field in block header is used for storage root of L2 predeploy
|
// withdrawals root field in block header is used for storage root of L2 predeploy
|
||||||
// `l2tol1-message-passer`
|
// `l2tol1-message-passer`
|
||||||
Some(
|
Some(state.database.as_ref().storage_root(
|
||||||
state
|
ADDRESS_L2_TO_L1_MESSAGE_PASSER,
|
||||||
.database
|
hashed_storage_updates.unwrap_or_default(),
|
||||||
.as_ref()
|
)?)
|
||||||
.storage_root(ADDRESS_L2_TO_L1_MESSAGE_PASSER, Default::default())?,
|
|
||||||
)
|
|
||||||
} else if ctx.is_canyon_active() {
|
} else if ctx.is_canyon_active() {
|
||||||
Some(EMPTY_WITHDRAWALS)
|
Some(EMPTY_WITHDRAWALS)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user