diff --git a/.github/scripts/test-external-projects.sh b/.github/scripts/test-external-projects.sh index 53b25cfe3cea2..b25738b22c5bd 100755 --- a/.github/scripts/test-external-projects.sh +++ b/.github/scripts/test-external-projects.sh @@ -11,6 +11,7 @@ echo "$PROJECTS" | jq -c '.[]' | while read -r project; do WORKING_DIR=$(echo "$project" | jq -r '.working_dir // ""') WORKING_DIRS=$(echo "$project" | jq -r '.working_dirs // ""') SETUP=$(echo "$project" | jq -r '.setup // ""') + EXTRA_ARGS=$(echo "$project" | jq -r '.extraArgs // ""') echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "Testing: $PROJECT_NAME" @@ -40,7 +41,7 @@ echo "$PROJECTS" | jq -c '.[]' | while read -r project; do if [ -n "$WORKING_DIR" ]; then cd "$WORKING_DIR" fi - forge test --polkadot 2>&1 | tee "${GITHUB_WORKSPACE}/test-output-${PROJECT_NAME}.log" + forge test --polkadot $EXTRA_ARGS 2>&1 | tee "${GITHUB_WORKSPACE}/test-output-${PROJECT_NAME}.log" fi cd "$GITHUB_WORKSPACE" diff --git a/.github/workflows/nextest.yml b/.github/workflows/nextest.yml index a8af04f6de76e..c584bf2b50ec9 100644 --- a/.github/workflows/nextest.yml +++ b/.github/workflows/nextest.yml @@ -14,7 +14,7 @@ concurrency: env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full - RESOLC_VERSION: 0.3.0 + RESOLC_VERSION: 0.6.0 DLRP_API_KEY: ${{ secrets.DLRP_API_KEY }} ETHERSCAN_API_KEYS: ${{ secrets.ETHERSCAN_API_KEYS }} SNAPSHOTS: overwrite diff --git a/.github/workflows/test-external-projects.yml b/.github/workflows/test-external-projects.yml index 9ad3d3709f9f4..ef30a1b6ae382 100644 --- a/.github/workflows/test-external-projects.yml +++ b/.github/workflows/test-external-projects.yml @@ -19,28 +19,33 @@ env: "name": "layerzero-protocol", "repo": "LayerZero-Labs/LayerZero-v2", "working_dir": "packages/layerzero-v2/evm/protocol", - "setup": "yarn install\n(cd packages/layerzero-v2/evm/protocol && forge install)" + "setup": "yarn install\n(cd packages/layerzero-v2/evm/protocol && forge install)", + "extraArgs": "" }, { "name": "wormhole", "repo": "wormhole-foundation/wormhole", "working_dir": "ethereum", - "setup": "(cd ethereum && npm install && forge install foundry-rs/forge-std@v1.5.5)" + "setup": "(cd ethereum && make dependencies)", + "extraArgs": "--no-match-test .*_KEVM" }, { "name": "aave-v3", "repo": "aave-dao/aave-v3-origin", - "setup": "cp .env.example .env || true\nforge install" + "setup": "cp .env.example .env || true\nforge install", + "extraArgs": "" }, { "name": "dragonswap", "repo": "dragonswap-app/dragonswap-airdrop-and-staker", - "setup": "cp .env.example .env || true" + "setup": "cp .env.example .env || true", + "extraArgs": "" }, { "name": "morpho-blue", "repo": "morpho-org/morpho-blue", - "setup": "forge install" + "setup": "forge install", + "extraArgs": "" } ] diff --git a/Cargo.lock b/Cargo.lock index 2690ed6450e34..e8625b3c92962 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -648,7 +648,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "alloy-sol-types", - "itertools 0.14.0", + "itertools 0.13.0", "serde", "serde_json", "serde_with", @@ -3969,7 +3969,7 @@ checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ "serde", "termcolor", - "unicode-width 0.2.0", + "unicode-width 0.1.14", ] [[package]] @@ -4086,7 +4086,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -6778,7 +6778,7 @@ dependencies = [ [[package]] name = "foundry-compilers" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -6791,7 +6791,7 @@ dependencies = [ "fs_extra", "futures-util", "home", - "itertools 0.14.0", + "itertools 0.13.0", "path-slash", "rand 0.8.5", "rayon", @@ -6816,7 +6816,7 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "foundry-compilers-artifacts-resolc", "foundry-compilers-artifacts-solc", @@ -6826,7 +6826,7 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-resolc" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -6846,7 +6846,7 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-solc" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -6868,7 +6868,7 @@ dependencies = [ [[package]] name = "foundry-compilers-artifacts-vyper" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "alloy-json-abi", "alloy-primitives", @@ -6882,7 +6882,7 @@ dependencies = [ [[package]] name = "foundry-compilers-core" version = "0.18.2" -source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#a2ec29833a1672839a78ed96e1c126949db1373d" +source = "git+https://github.com/paritytech/foundry-compilers-polkadot.git?branch=main#27bca34036bbd558e6e9f24a1f89e1a1b7799d32" dependencies = [ "alloy-primitives", "cfg-if", @@ -9525,7 +9525,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.53.2", + "windows-targets 0.48.5", ] [[package]] @@ -11229,7 +11229,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" dependencies = [ - "proc-macro-crate 3.3.0", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 2.0.104", @@ -15032,8 +15032,8 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" dependencies = [ - "heck 0.5.0", - "itertools 0.14.0", + "heck 0.4.1", + "itertools 0.13.0", "log", "multimap", "once_cell", @@ -15052,8 +15052,8 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1" dependencies = [ - "heck 0.5.0", - "itertools 0.14.0", + "heck 0.4.1", + "itertools 0.13.0", "log", "multimap", "once_cell", @@ -15086,7 +15086,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.13.0", "proc-macro2", "quote", "syn 2.0.104", @@ -15099,7 +15099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" dependencies = [ "anyhow", - "itertools 0.14.0", + "itertools 0.13.0", "proc-macro2", "quote", "syn 2.0.104", @@ -15704,14 +15704,16 @@ checksum = "95325155c684b1c89f7765e30bc1c42e4a6da51ca513615660cb8a62ef9a88e3" [[package]] name = "revive-common" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2840de13ec1e2d541d1041009f755c4aaf3c9d1500a1378016d7f7b4d0bb3c" +checksum = "b6b6cd01322fcb8d8c7a1a73afc2420632160d740ce82cda0b44c07f40051e1b" dependencies = [ "anyhow", + "hex", "serde", "serde_json", "serde_stacker", + "sha3", ] [[package]] @@ -15738,11 +15740,12 @@ dependencies = [ [[package]] name = "revive-solc-json-interface" -version = "0.1.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f145f4208ac7729ffc1dda7ffced056ac0d772ba9b40d9be3fa8abb350d82ef3" +checksum = "e5ee74bcfe1bad4e66a583772926f0b7a15bd98ddbe57994e382c752afa33c5c" dependencies = [ "anyhow", + "hex", "revive-common", "semver 1.0.26", "serde", @@ -18150,11 +18153,12 @@ dependencies = [ [[package]] name = "serde_stacker" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69c8defe6c780725cce4ec6ad3bd91e321baf6fa4e255df1f31e345d507ef01a" +checksum = "d4936375d50c4be7eff22293a9344f8e46f323ed2b3c243e52f89138d9bb0f4a" dependencies = [ "serde", + "serde_core", "stacker", ] @@ -18743,7 +18747,7 @@ dependencies = [ "derive_more 2.0.1", "dunce", "inturn", - "itertools 0.14.0", + "itertools 0.13.0", "itoa", "match_cfg", "normalize-path", @@ -18754,7 +18758,7 @@ dependencies = [ "solar-config", "solar-data-structures", "solar-macros", - "thiserror 2.0.12", + "thiserror 1.0.69", "tracing", "unicode-width 0.2.0", ] @@ -18777,7 +18781,7 @@ dependencies = [ "alloy-primitives", "bitflags 2.9.1", "bumpalo", - "itertools 0.14.0", + "itertools 0.13.0", "memchr", "num-bigint", "num-rational", @@ -20606,7 +20610,7 @@ dependencies = [ "serde_json", "sha2 0.10.9", "tempfile", - "thiserror 2.0.12", + "thiserror 1.0.69", "url", "zip", ] @@ -21426,7 +21430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "319c70195101a93f56db4c74733e272d720768e13471f400c78406a326b172b0" dependencies = [ "cc", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -22775,7 +22779,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/forge/tests/cli/revive_build.rs b/crates/forge/tests/cli/revive_build.rs index 7f1f1559913aa..c37277bc94ed6 100644 --- a/crates/forge/tests/cli/revive_build.rs +++ b/crates/forge/tests/cli/revive_build.rs @@ -4,8 +4,8 @@ use foundry_test_utils::snapbox::IntoData; use semver::Version; use crate::utils::generate_large_init_contract; -pub const OTHER_RESOLC_VERSION: &str = "0.1.0-dev.13"; -pub const NEWEST_RESOLC_VERSION: &str = "0.1.0-dev.16"; +pub const OTHER_RESOLC_VERSION: &str = "0.6.0"; +pub const NEWEST_RESOLC_VERSION: &str = "0.6.0"; forgetest_init!(can_build_with_resolc, |prj, cmd| { cmd.args(["build", "--resolc-compile"]).assert_success().stdout_eq(str![[r#" @@ -49,7 +49,7 @@ Compiler run successful! ╭---------------+------------------+-------------------+--------------------+---------------------╮ | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) | +=================================================================================================+ -| LargeContract | 527,706 | 527,706 | -277,706 | -277,706 | +| LargeContract | 258,026 | 258,026 | -8,026 | -8,026 | ╰---------------+------------------+-------------------+--------------------+---------------------╯ @@ -69,10 +69,10 @@ Compiler run successful! str![[r#" { "LargeContract": { - "runtime_size": 527706, - "init_size": 527706, - "runtime_margin": -277706, - "init_margin": -277706 + "runtime_size": 258026, + "init_size": 258026, + "runtime_margin": -8026, + "init_margin": -8026 } } "#]] @@ -93,7 +93,7 @@ forgetest_init!(build_contracts_with_optimization, |prj, cmd| { ]) .assert_success() .stdout_eq(str![[r#" -{"Counter":{"runtime_size":11175,"init_size":11175,"runtime_margin":238825,"init_margin":238825}} +{"Counter":{"runtime_size":11267,"init_size":11267,"runtime_margin":238733,"init_margin":238733}} "#]]); @@ -111,7 +111,7 @@ forgetest_init!(build_contracts_with_optimization, |prj, cmd| { ]) .assert_success() .stdout_eq(str![[r#" -{"Counter":{"runtime_size":4994,"init_size":4994,"runtime_margin":245006,"init_margin":245006}} +{"Counter":{"runtime_size":2628,"init_size":2628,"runtime_margin":247372,"init_margin":247372}} "#]]); diff --git a/crates/forge/tests/cli/revive_cmd.rs b/crates/forge/tests/cli/revive_cmd.rs index 8a928ff2c13a8..4f7d3999b424f 100644 --- a/crates/forge/tests/cli/revive_cmd.rs +++ b/crates/forge/tests/cli/revive_cmd.rs @@ -71,12 +71,12 @@ Compiler run successful! }); // checks that extra output works -// TODO: Failing with resolc 0.4.0. Works with resolc 0.3.0. +// TODO: Failing with resolc 0.4.0. Works with resolc 0.6.0. forgetest!(can_emit_extra_output_for_resolc, |prj, cmd| { prj.clear(); init_prj(&prj); - cmd.args(["build", "--resolc", "--use-resolc", "0.3.0", "--extra-output", "metadata"]) + cmd.args(["build", "--resolc", "--use-resolc", "0.6.0", "--extra-output", "metadata"]) .assert_success() .stdout_eq(str![[r#" [COMPILING_FILES] with [RESOLC_VERSION] @@ -95,7 +95,7 @@ Compiler run successful! "build", "--resolc", "--use-resolc", - "0.3.0", + "0.6.0", "--extra-output-files", "metadata", "--force", @@ -114,14 +114,14 @@ Compiler run successful! }); // checks that extra output works -// TODO: Failing with resolc 0.4.0. Works with resolc 0.3.0. +// TODO: Failing with resolc 0.4.0. Works with resolc 0.6.0. forgetest!(can_emit_multiple_extra_output_for_resolc, |prj, cmd| { init_prj(&prj); cmd.args([ "build", "--resolc", "--use-resolc", - "0.3.0", + "0.6.0", "--extra-output", "metadata", "ir-optimized", @@ -148,7 +148,7 @@ Compiler run successful! "build", "--resolc", "--use-resolc", - "0.3.0", + "0.6.0", "--extra-output-files", "metadata", "ir-optimized", @@ -625,30 +625,30 @@ Error: No source files found in specified build paths. forgetest!(can_build_sizes_repeatedly_for_resolc, |prj, cmd| { init_prj(&prj); - cmd.args(["build", "--resolc", "--sizes", "--use-resolc", "resolc:0.1.0-dev.16"]) + cmd.args(["build", "--resolc", "--sizes", "--use-resolc", "resolc:0.6.0"]) .assert_success() .stdout_eq(str![[r#" ... ╭----------+------------------+-------------------+--------------------+---------------------╮ | Contract | Runtime Size (B) | Initcode Size (B) | Runtime Margin (B) | Initcode Margin (B) | +============================================================================================+ -| Foo | 1,288 | 1,288 | 248,712 | 248,712 | +| Foo | 1,226 | 1,226 | 248,774 | 248,774 | ╰----------+------------------+-------------------+--------------------+---------------------╯ "#]]); cmd.forge_fuse() - .args(["build", "--resolc", "--sizes", "--json", "--use-resolc", "resolc:0.1.0-dev.16"]) + .args(["build", "--resolc", "--sizes", "--json", "--use-resolc", "resolc:0.6.0"]) .assert_success() .stdout_eq( str![[r#" { "Foo": { - "runtime_size": 1288, - "init_size": 1288, - "runtime_margin": 248712, - "init_margin": 248712 + "runtime_size": 1226, + "init_size": 1226, + "runtime_margin": 248774, + "init_margin": 248774 } } "#]] @@ -874,11 +874,10 @@ Error: Multiple contracts found in the same file, please specify the target ` works forgetest!(can_use_resolc, |prj, cmd| { @@ -112,7 +112,7 @@ contract Greeter {} ) .unwrap(); - cmd.args(["build", "--resolc", "--use-resolc", "resolc:0.5.0", "--force"]).assert_success(); + cmd.args(["build", "--resolc", "--use-resolc", "resolc:0.6.0", "--force"]).assert_success(); let artifact_path = prj.artifacts().join("Greeter.sol/Greeter.json"); let artifact_no_debug = std::fs::read_to_string(&artifact_path).unwrap(); @@ -120,7 +120,7 @@ contract Greeter {} let bytecode_no_debug = json_no_debug["bytecode"]["object"].as_str().unwrap(); cmd.forge_fuse() - .args(["build", "--resolc", "--use-resolc", "resolc:0.5.0", "--debug-info", "--force"]) + .args(["build", "--resolc", "--use-resolc", "resolc:0.6.0", "--debug-info", "--force"]) .assert_success(); let artifact_with_debug = std::fs::read_to_string(&artifact_path).unwrap(); diff --git a/crates/forge/tests/it/test_helpers.rs b/crates/forge/tests/it/test_helpers.rs index f5ae26eb5e82f..e1d369c61f0c5 100644 --- a/crates/forge/tests/it/test_helpers.rs +++ b/crates/forge/tests/it/test_helpers.rs @@ -21,6 +21,7 @@ use foundry_test_utils::{ }; use revive_strategy::{ReviveExecutorStrategyBuilder, ReviveRuntimeMode}; use revm::primitives::hardfork::SpecId; +use semver::Version; use std::{ env, fmt, io::Write, @@ -212,7 +213,7 @@ impl ForgeTestData { let mut resolc_config = (*config).clone(); resolc_config.polkadot.resolc_compile = true; resolc_config.polkadot.resolc = - Some(foundry_config::SolcReq::Version("0.4.1".parse().unwrap())); + Some(foundry_config::SolcReq::Version(Version::new(0, 6, 0))); let mut resolc_project = resolc_config.project().unwrap(); // Filter files compatible with resolc diff --git a/crates/revive-strategy/src/cheatcodes/mod.rs b/crates/revive-strategy/src/cheatcodes/mod.rs index 274ae7f072935..5132f1fdaa81d 100644 --- a/crates/revive-strategy/src/cheatcodes/mod.rs +++ b/crates/revive-strategy/src/cheatcodes/mod.rs @@ -1270,7 +1270,7 @@ impl foundry_cheatcodes::CheatcodeInspectorStrategyExt for PvmCheatcodeInspector Some(outcome) } Err(e) => { - tracing::error!("Contract call failed: {e:#?}"); + tracing::info!("Contract call failed: {e:#?}"); Some(CallOutcome { result: InterpreterResult { result: InstructionResult::Revert, @@ -1318,7 +1318,7 @@ impl foundry_cheatcodes::CheatcodeInspectorStrategyExt for PvmCheatcodeInspector .journaled_state .database .get_test_contract_address() - .map(|addr| call.bytecode_address != addr || call.target_address == addr) + .map(|addr| call.bytecode_address != addr || call.target_address != addr) .unwrap_or(true) { return;