Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0"

[dependencies]
# revm
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v74", default-features = false, features = ["secp256r1", "enable_eip7702"] }
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v74", default-features = false, features = ["secp256r1", "enable_eip7702", "enable_eip7623"] }
revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v74", default-features = false }
revm-inspector = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v74", default-features = false }

Expand All @@ -23,6 +23,8 @@ hashbrown = ["revm/hashbrown"]
serde = ["dep:serde", "revm/serde"]
portable = ["revm/portable"]

test-utils = []

# See comments in `revm-precompile`
secp256k1 = ["revm/secp256k1"]
c-kzg = ["revm/c-kzg"]
Expand Down
22 changes: 18 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ impl DefaultScrollContext for ScrollContext<EmptyDB> {
let spec = ScrollSpecId::default();
let mut cfg = CfgEnv::new_with_spec(spec);
cfg.enable_eip7702 = spec >= ScrollSpecId::EUCLID;
cfg.enable_eip7623 = spec >= ScrollSpecId::FEYNMAN;

Context::mainnet()
.with_tx(ScrollTransaction::default())
Expand All @@ -67,18 +68,31 @@ impl DefaultScrollContext for ScrollContext<EmptyDB> {
}
}

/// Activates EIP-7702 if necessary for the context.
pub trait MaybeWithEip7702 {
/// Activates EIP-7702 if necessary.
/// Activates specific EIP's for Euclid.
pub trait EuclidEipActivations {
/// Activates EIP-7702 if the spec is at least at Euclid.
fn maybe_with_eip_7702(self) -> Self;
}

impl<DB: Database> MaybeWithEip7702 for ScrollContext<DB> {
/// Activates specific EIP's for Feynman.
pub trait FeynmanEipActivations: EuclidEipActivations {
/// Activates EIP-7623 if the spec is at least at Feynman.
fn maybe_with_eip_7623(self) -> Self;
}

impl<DB: Database> EuclidEipActivations for ScrollContext<DB> {
fn maybe_with_eip_7702(mut self) -> Self {
self.cfg.enable_eip7702 = self.cfg.spec >= ScrollSpecId::EUCLID;
self
}
}

impl<DB: Database> FeynmanEipActivations for ScrollContext<DB> {
fn maybe_with_eip_7623(mut self) -> Self {
Comment thread
Thegaram marked this conversation as resolved.
self.cfg.enable_eip7623 = self.cfg.spec >= ScrollSpecId::FEYNMAN;
self
}
}

pub type ScrollContext<DB> =
Context<BlockEnv, ScrollTransaction<TxEnv>, CfgEnv<ScrollSpecId>, DB, Journal<DB>, L1BlockInfo>;
Loading
Loading