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
5,070 changes: 2,644 additions & 2,426 deletions Cargo.lock

Large diffs are not rendered by default.

101 changes: 50 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -278,75 +278,75 @@ foundry-compilers = { version = "0.21.0", default-features = false, features = [
"rustls",
"svm-solc",
] }
foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-core", rev = "ba6246789fc12cf8fe78aa74aadf31d663f08c1f", features = ["zstd"] }
foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-core", rev = "8b3ea9453789ba0d9d8ebf0fc4ee0fed9e4add8f", features = ["zstd"] }
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
solar = { package = "solar-compiler", version = "=0.1.8", default-features = false }
svm = { package = "svm-rs", version = "0.5", default-features = false, features = [
"rustls",
] }

## alloy
alloy-consensus = { version = "2.0.5", default-features = false }
alloy-contract = { version = "2.0.5", default-features = false }
alloy-eips = { version = "2.0.5", default-features = false }
alloy-eip5792 = { version = "2.0.5", default-features = false }
alloy-ens = { version = "2.0.5", default-features = false }
alloy-genesis = { version = "2.0.5", default-features = false }
alloy-json-rpc = { version = "2.0.5", default-features = false }
alloy-network = { version = "2.0.5", default-features = false }
alloy-provider = { version = "2.0.5", default-features = false }
alloy-pubsub = { version = "2.0.5", default-features = false }
alloy-rpc-client = { version = "2.0.5", default-features = false }
alloy-rpc-types = { version = "2.0.5", default-features = true }
alloy-rpc-types-beacon = { version = "2.0.5", default-features = true }
alloy-rpc-types-engine = { version = "2.0.5", default-features = false }
alloy-rpc-types-eth = { version = "2.0.5", default-features = false }
alloy-serde = { version = "2.0.5", default-features = false }
alloy-signer = { version = "2.0.5", default-features = false }
alloy-signer-aws = { version = "2.0.5", default-features = false }
alloy-signer-gcp = { version = "2.0.5", default-features = false }
alloy-signer-ledger = { version = "2.0.5", default-features = false }
alloy-signer-local = { version = "2.0.5", default-features = false }
alloy-signer-trezor = { version = "2.0.5", default-features = false }
alloy-signer-turnkey = { version = "2.0.5", default-features = false }
alloy-transport = { version = "2.0.5", default-features = false }
alloy-transport-http = { version = "2.0.5", default-features = false }
alloy-transport-ipc = { version = "2.0.5", default-features = false }
alloy-transport-ws = { version = "2.0.5", default-features = false }
alloy-hardforks = { version = "0.4.7", default-features = false }
alloy-op-hardforks = { version = "0.4.7", default-features = false }
alloy-consensus = { version = "2.4.0", default-features = false }
alloy-contract = { version = "2.4.0", default-features = false }
alloy-eips = { version = "2.4.0", default-features = false }
alloy-eip5792 = { version = "2.4.0", default-features = false }
alloy-ens = { version = "2.4.0", default-features = false }
alloy-genesis = { version = "2.4.0", default-features = false }
alloy-json-rpc = { version = "2.4.0", default-features = false }
alloy-network = { version = "2.4.0", default-features = false }
alloy-provider = { version = "2.4.0", default-features = false }
alloy-pubsub = { version = "2.4.0", default-features = false }
alloy-rpc-client = { version = "2.4.0", default-features = false }
alloy-rpc-types = { version = "2.4.0", default-features = true }
alloy-rpc-types-beacon = { version = "2.4.0", default-features = true }
alloy-rpc-types-engine = { version = "2.4.0", default-features = false }
alloy-rpc-types-eth = { version = "2.4.0", default-features = false }
alloy-serde = { version = "2.4.0", default-features = false }
alloy-signer = { version = "2.4.0", default-features = false }
alloy-signer-aws = { version = "2.4.0", default-features = false }
alloy-signer-gcp = { version = "2.4.0", default-features = false }
alloy-signer-ledger = { version = "2.4.0", default-features = false }
alloy-signer-local = { version = "2.4.0", default-features = false }
alloy-signer-trezor = { version = "2.4.0", default-features = false }
alloy-signer-turnkey = { version = "2.4.0", default-features = false }
alloy-transport = { version = "2.4.0", default-features = false }
alloy-transport-http = { version = "2.4.0", default-features = false }
alloy-transport-ipc = { version = "2.4.0", default-features = false }
alloy-transport-ws = { version = "2.4.0", default-features = false }
alloy-hardforks = { version = "0.4.8", default-features = false }
alloy-op-hardforks = { version = "0.5.0", default-features = false }

## alloy-core
alloy-dyn-abi = "1.6.0"
alloy-json-abi = "1.6.0"
alloy-primitives = { version = "1.6.0", features = [
alloy-dyn-abi = "1.6.1"
alloy-json-abi = "1.6.1"
alloy-primitives = { version = "1.6.1", features = [
"getrandom",
"rand",
"map-fxhash",
"map-foldhash",
] }
alloy-sol-macro-expander = "1.6.0"
alloy-sol-macro-input = "1.6.0"
alloy-sol-types = "1.6.0"
alloy-sol-macro-expander = "1.6.1"
alloy-sol-macro-input = "1.6.1"
alloy-sol-types = "1.6.1"

alloy-chains = "0.2"
alloy-rlp = "0.3"
alloy-trie = "0.9"

## op-alloy
op-alloy-consensus = "0.24.0"
op-alloy-network = "0.24.0"
op-alloy-rpc-types = "0.24.0"
op-alloy-consensus = "2.0.0"
op-alloy-network = "2.0.0"
op-alloy-rpc-types = "2.0.0"
op-alloy-flz = "0.13.1"

## alloy-evm
alloy-evm = "0.37.0"
alloy-evm = "0.38.0"
alloy-op-evm = "0.32.0"

# revm
revm = { version = "41.0.0", default-features = false }
revm-inspectors = { version = "0.41.1", features = ["serde"] }
op-revm = { version = "20.0.0", default-features = false }
revm = { version = "42.0.1", default-features = false }
revm-inspectors = { version = "0.42.2", features = ["serde"] }
op-revm = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753", default-features = false }

## cli
anstream = "0.6"
Expand Down Expand Up @@ -439,7 +439,7 @@ flate2 = "1.1"
ethereum_ssz = "0.10"

# Tempo
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", tag = "tempo-primitives@1.7.2", default-features = false, features = ["serde"] }
tempo-primitives = { git = "https://github.com/tempoxyz/tempo", rev = "0f87fa6b42c86665142432337865d1adc04238e7", default-features = false, features = ["serde"] }

## Pinned dependencies. Enabled for the workspace in crates/test-utils.

Expand Down Expand Up @@ -511,13 +511,12 @@ rexpect = { git = "https://github.com/rust-cli/rexpect", rev = "2ed0b1898d7edaf6
# op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "7e59936" }
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", branch = "staging-revm" }

## Pinned to Foundry forks until upstream optimism bumps to revm 41.
op-revm = { git = "https://github.com/foundry-rs/op-revm", rev = "c10fd76e66fd46cebc08ba370aa58bde72b94140" }
alloy-op-evm = { git = "https://github.com/foundry-rs/optimism", branch = "bump-alloy-evm-0-36-tempo" }
op-alloy-consensus = { git = "https://github.com/foundry-rs/optimism", branch = "bump-alloy-evm-0-36-tempo" }
op-alloy-network = { git = "https://github.com/foundry-rs/optimism", branch = "bump-alloy-evm-0-36-tempo" }
op-alloy-rpc-types = { git = "https://github.com/foundry-rs/optimism", branch = "bump-alloy-evm-0-36-tempo" }
alloy-op-hardforks = { git = "https://github.com/foundry-rs/optimism", branch = "bump-alloy-evm-0-36-tempo" }
## Pinned to foundry-rs forks for the revm 42 stack.
alloy-op-evm = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753" }
op-alloy-consensus = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753" }
op-alloy-network = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753" }
op-alloy-rpc-types = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753" }
alloy-op-hardforks = { git = "https://github.com/foundry-rs/optimism", rev = "566d19ee21aef0b1235c028bd1a4a98eacb95753" }

## foundry
# foundry-block-explorers = { git = "https://github.com/foundry-rs/block-explorers.git", rev = "f5b46b2" }
Expand Down
6 changes: 4 additions & 2 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,8 @@ impl Backend {
GethDebugBuiltInTracerType::FourByteTracer
| GethDebugBuiltInTracerType::MuxTracer
| GethDebugBuiltInTracerType::FlatCallTracer
| GethDebugBuiltInTracerType::Erc7562Tracer => {
| GethDebugBuiltInTracerType::Erc7562Tracer
| GethDebugBuiltInTracerType::StateGasTracer => {
Err(RpcError::invalid_params("unsupported tracer type").into())
}
},
Expand Down Expand Up @@ -2977,7 +2978,8 @@ impl Backend {
GethDebugBuiltInTracerType::NoopTracer
| GethDebugBuiltInTracerType::MuxTracer
| GethDebugBuiltInTracerType::Erc7562Tracer
| GethDebugBuiltInTracerType::FlatCallTracer => {}
| GethDebugBuiltInTracerType::FlatCallTracer
| GethDebugBuiltInTracerType::StateGasTracer => {}
},
GethDebugTracerType::JsTracer(_code) => {}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cast/tests/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Options:
-j, --threads <THREADS>
Number of threads to use. Specifying 0 defaults to the number of logical cores
...
[aliases: --jobs]
[alias: --jobs]

-V, --version
Print version
Expand Down
16 changes: 8 additions & 8 deletions crates/cheatcodes/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,10 +1659,10 @@ impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for Cheatcodes {
let output = input.init_code();

// Return a revert with the initcode as error data
return Some(CreateOutcome {
result: InterpreterResult { result: InstructionResult::Revert, output, gas },
address: None,
});
return Some(CreateOutcome::new(
InterpreterResult { result: InstructionResult::Revert, output, gas },
None,
));
}

let curr_depth = ecx.journaled_state.depth();
Expand Down Expand Up @@ -1704,14 +1704,14 @@ impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for Cheatcodes {
{
let (db, journal, _) = ecx.as_db_env_and_journal();
if let Err(err) = journal.load_account(db, broadcast.new_origin) {
return Some(CreateOutcome {
result: InterpreterResult {
return Some(CreateOutcome::new(
InterpreterResult {
result: InstructionResult::Revert,
output: Error::encode(err),
gas,
},
address: None,
});
None,
));
}

ecx.tx.caller = broadcast.new_origin;
Expand Down
2 changes: 1 addition & 1 deletion crates/chisel/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,5 +241,5 @@ fn systemtime_strftime<T>(dt: T, format: &str) -> Result<String>
where
T: Into<OffsetDateTime>,
{
Ok(dt.into().format(&format_description::parse(format)?)?)
Ok(dt.into().format(&format_description::parse_borrowed::<1>(format)?)?)
}
1 change: 0 additions & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ regex = { workspace = true, default-features = false }
serde_json.workspace = true
serde.workspace = true
strsim = "0.11"
strum = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["macros"] }
tracing-subscriber = { workspace = true, features = ["registry", "env-filter"] }
tracing.workspace = true
Expand Down
11 changes: 5 additions & 6 deletions crates/cli/src/opts/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use clap::builder::{PossibleValuesParser, TypedValueParser};
use eyre::Result;
use foundry_config::{Chain, NamedChain};
use std::ffi::OsStr;
use strum::VariantNames;

/// Custom Clap value parser for [`Chain`]s.
///
Expand All @@ -14,7 +13,7 @@ pub struct ChainValueParser {

impl Default for ChainValueParser {
fn default() -> Self {
Self { inner: PossibleValuesParser::from(NamedChain::VARIANTS) }
Self { inner: PossibleValuesParser::from(NamedChain::VARIANT_NAMES) }
}
}

Expand All @@ -32,11 +31,11 @@ impl TypedValueParser for ChainValueParser {
if let Ok(id) = s.parse() {
Ok(Chain::from_id(id))
} else {
// NamedChain::VARIANTS is a subset of all possible variants, since there are aliases:
// amoy instead of polygon-amoy etc
// NamedChain::VARIANT_NAMES is a subset of all possible variants, since there are
// aliases: amoy instead of polygon-amoy etc
//
// Parse first as NamedChain, if it fails parse with NamedChain::VARIANTS for displaying
// the error to the user
// Parse first as NamedChain, if it fails parse with NamedChain::VARIANT_NAMES for
// displaying the error to the user
s.parse()
.map_err(|_| self.inner.parse_ref(cmd, arg, value).unwrap_err())
.map(Chain::from_named)
Expand Down
12 changes: 8 additions & 4 deletions crates/evm/core/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use revm::{
inspector::{InspectorEvmTr, InspectorHandler},
interpreter::{
CallInput, CallInputs, CallOutcome, CallScheme, CallValue, CreateInputs, CreateOutcome,
FrameInput, Gas, InstructionResult, InterpreterResult, SharedMemory,
FrameInput, Gas, GasTracker, InstructionResult, InterpreterResult, SharedMemory,
interpreter::EthInterpreter, interpreter_action::FrameInit, return_ok,
},
precompile::{PrecompileSpecId, Precompiles},
Expand Down Expand Up @@ -175,7 +175,6 @@ impl<'db, I: InspectorExt> FoundryEvm<'db, I> {
frame: FrameInput,
) -> Result<FrameResult, EVMError<DatabaseError>> {
let mut handler = FoundryHandler::<I>::default();
let original_reservoir = frame.reservoir();

// Create first frame
let memory =
Expand All @@ -186,7 +185,12 @@ impl<'db, I: InspectorExt> FoundryEvm<'db, I> {
let mut frame_result = handler.inspect_run_exec_loop(&mut self.inner, first_frame_input)?;

// Handle last frame result
handler.last_frame_result(&mut self.inner, original_reservoir, &mut frame_result)?;
let mut parent_gas = GasTracker::new(
frame_result.gas().limit(),
frame_result.gas().remaining(),
frame_result.gas().reservoir(),
);
handler.last_frame_result(&mut self.inner, &mut frame_result, &mut parent_gas)?;

Ok(frame_result)
}
Expand Down Expand Up @@ -409,7 +413,7 @@ impl<'db, I: InspectorExt> FoundryHandler<'db, I> {
_ => None,
};

FrameResult::Create(CreateOutcome { result: call.result, address })
FrameResult::Create(CreateOutcome::new(call.result, address))
} else {
result
}
Expand Down
6 changes: 4 additions & 2 deletions crates/evm/core/src/hardfork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ pub fn spec_id_from_optimism_hardfork(hardfork: OpHardfork) -> OpSpecId {
OpHardfork::Granite => OpSpecId::GRANITE,
OpHardfork::Holocene => OpSpecId::HOLOCENE,
OpHardfork::Isthmus => OpSpecId::ISTHMUS,
OpHardfork::Interop => OpSpecId::INTEROP,
OpHardfork::Jovian => OpSpecId::JOVIAN,
OpHardfork::Karst => OpSpecId::KARST,
OpHardfork::Lagoon => OpSpecId::LAGOON,
f => unreachable!("unimplemented {}", f),
}
}
Expand Down Expand Up @@ -123,7 +124,8 @@ mod tests {

// Test latest hardforks
assert_eq!(spec_id_from_optimism_hardfork(OpHardfork::Holocene), OpSpecId::HOLOCENE);
assert_eq!(spec_id_from_optimism_hardfork(OpHardfork::Interop), OpSpecId::INTEROP);
assert_eq!(spec_id_from_optimism_hardfork(OpHardfork::Jovian), OpSpecId::JOVIAN);
assert_eq!(spec_id_from_optimism_hardfork(OpHardfork::Lagoon), OpSpecId::LAGOON);
}

#[test]
Expand Down
1 change: 1 addition & 0 deletions crates/evm/evm/src/executors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ fn convert_executed_result(
env.tx.access_list.len().try_into()?,
0,
0,
None,
);

let result = match &out {
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/evm/src/inspectors/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ impl Inspector<EthEvmContext<&mut dyn DatabaseExt>> for InspectorStackRefMut<'_>
create.gas_limit(),
create.value(),
);
return Some(CreateOutcome { result, address });
return Some(CreateOutcome::new(result, address));
}

None
Expand Down
4 changes: 2 additions & 2 deletions crates/evm/networks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ alloy-primitives = { workspace = true, features = [
# github.com/base/base; bump via ./script/bump-base.sh. To iterate against a
# local base/base checkout instead, uncomment the [patch] block at the bottom
# of the workspace root Cargo.toml.
base-common-precompiles = { git = "https://github.com/base/base.git", rev = "dab0d0a275ea88f598001c6c6b99933df9f6d208" }
base-common-chains = { git = "https://github.com/base/base.git", rev = "dab0d0a275ea88f598001c6c6b99933df9f6d208" }
base-common-precompiles = { git = "https://github.com/base/base.git", rev = "cea79451170a576cd9fd7d8189b660daceb45001" }
base-common-chains = { git = "https://github.com/base/base.git", rev = "cea79451170a576cd9fd7d8189b660daceb45001" }

revm = { workspace = true, features = [
"std",
Expand Down
1 change: 0 additions & 1 deletion crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ semver.workspace = true
serde_json.workspace = true
similar = { version = "2", features = ["inline"] }
solar.workspace = true
strum = { workspace = true, features = ["derive"] }
thiserror.workspace = true
tokio = { workspace = true, features = ["time"] }
toml_edit.workspace = true
Expand Down
3 changes: 1 addition & 2 deletions crates/forge/src/cmd/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use clap::{
use eyre::Result;
use foundry_config::{Chain, Config, NamedChain, cache};
use std::{ffi::OsStr, str::FromStr};
use strum::VariantNames;

/// CLI arguments for `forge cache`.
#[derive(Debug, Parser)]
Expand Down Expand Up @@ -173,7 +172,7 @@ impl TypedValueParser for ChainOrAllValueParser {
}

fn possible_chains() -> PossibleValuesParser {
Some(&"all").into_iter().chain(NamedChain::VARIANTS).into()
Some(&"all").into_iter().chain(NamedChain::VARIANT_NAMES).into()
}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Options:
-j, --threads <THREADS>
Number of threads to use. Specifying 0 defaults to the number of logical cores

[aliases: --jobs]
[alias: --jobs]

-V, --version
Print version
Expand Down
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ allow = [
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"BlueOak-1.0.0",
"BSL-1.0",
"CC0-1.0",
"CDDL-1.0",
Expand Down
Loading