Skip to content

Commit 2a46a48

Browse files
committed
extend the context in ScrollBundleState conversion
Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>
1 parent 18990d8 commit 2a46a48

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/primitives-traits/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ alloy-genesis.workspace = true
2020
alloy-primitives.workspace = true
2121
alloy-rlp.workspace = true
2222

23-
revm-primitives = { workspace = true, features = ["serde"] }
23+
# revm-primitives scroll re-export
24+
revm-primitives = { package = "reth-scroll-revm", path = "../scroll/revm", features = ["serde"] }
25+
reth-scroll-primitives = { workspace = true, optional = true }
2426

2527
# misc
2628
byteorder = "1"
@@ -81,3 +83,4 @@ serde-bincode-compat = [
8183
"alloy-consensus/serde-bincode-compat",
8284
"alloy-eips/serde-bincode-compat"
8385
]
86+
scroll = ["reth-scroll-primitives"]

crates/scroll/revm/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ default = ["std"]
2323

2424
arbitrary = ["revm/arbitrary"]
2525

26-
scroll = []
27-
2826
serde = ["revm/serde"]
2927

30-
std = ["revm/std"]
28+
std = ["revm/std"]

crates/scroll/revm/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ pub mod states;
55

66
pub mod primitives;
77

8-
#[cfg(feature = "scroll")]
98
pub use primitives::ScrollAccountInfo;
109
pub use revm::primitives::*;

crates/scroll/storage/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Scroll storage implementation.
22
3-
use alloy_primitives::{map::Entry, Address, B256, U256};
3+
use alloy_primitives::{Address, B256, U256};
44
use reth_revm::{
55
database::EvmStateProvider,
66
primitives::{AccountInfo, Bytecode},
@@ -44,11 +44,9 @@ impl<DB: EvmStateProvider> Database for ScrollStateProviderDatabase<DB> {
4444
let Some(account) = self.db.basic_account(address)? else { return Ok(None) };
4545
let Some(code_hash) = account.bytecode_hash else { return Ok(Some(account.into())) };
4646

47-
let bytecode_context = (account.code_size, account.poseidon_code_hash);
48-
if let Entry::Vacant(entry) = self.post_execution_context.entry(code_hash) {
49-
entry.insert(bytecode_context);
50-
}
51-
47+
self.post_execution_context
48+
.entry(code_hash)
49+
.or_insert_with(|| (account.code_size, account.poseidon_code_hash));
5250
Ok(Some(account.into()))
5351
}
5452

0 commit comments

Comments
 (0)