From c822793c2b5fb3d53f90c77dbf737366e9fe8acb Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:49:13 +0000 Subject: [PATCH 1/7] fix: use different rust toolchain for foundry builds --- build-images/Earthfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build-images/Earthfile b/build-images/Earthfile index 0caa85228e0b..4ecd1dae4e60 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -88,10 +88,16 @@ osxcross: foundry-build: LET FOUNDRY_TAG = 25f24e677a6a32a62512ad4f561995589ac2c7dc FROM +base-build + # This will not be run often, so we use rustup to manage the cargo version via a tool-chain file + # It is done this way to avoid conflicting with noir builds + # This image should only be rebuilt when our foundry tag changes, so it should be extremely infrequent + RUN apt remove -y cargo + RUN apt update && apt install -y rustup RUN ulimit -n 65535 \ && git clone --depth 1 --branch nightly-$FOUNDRY_TAG https://github.com/foundry-rs/foundry.git \ && cd foundry \ - && cargo build --profile local \ + && touch rust-toolchain.toml && echo '[toolchain]\nchannel = "1.80.0"\n' > rust-toolchain.toml \ + && cargo build --release \ && mkdir -p /opt/foundry/bin \ && for t in forge cast anvil chisel; do \ mv ./target/local/$t /opt/foundry/bin/$t; \ From a3dacd0dacc905166a9cfbf3fd22466036cb7765 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:50:45 +0000 Subject: [PATCH 2/7] fix prose --- build-images/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-images/Earthfile b/build-images/Earthfile index 4ecd1dae4e60..e27097301352 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -88,7 +88,7 @@ osxcross: foundry-build: LET FOUNDRY_TAG = 25f24e677a6a32a62512ad4f561995589ac2c7dc FROM +base-build - # This will not be run often, so we use rustup to manage the cargo version via a tool-chain file + # We use rustup rather than cargo to manage the cargo version via a tool-chain file # It is done this way to avoid conflicting with noir builds # This image should only be rebuilt when our foundry tag changes, so it should be extremely infrequent RUN apt remove -y cargo From 4ad44815f8a87fefbdfb40ff02c114636883a242 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:51:25 +0000 Subject: [PATCH 3/7] fix: update path --- build-images/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-images/Earthfile b/build-images/Earthfile index e27097301352..78039ad38ec4 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -100,7 +100,7 @@ foundry-build: && cargo build --release \ && mkdir -p /opt/foundry/bin \ && for t in forge cast anvil chisel; do \ - mv ./target/local/$t /opt/foundry/bin/$t; \ + mv ./target/release/$t /opt/foundry/bin/$t; \ strip /opt/foundry/bin/$t; \ done \ && rm -rf /foundry From 0241555ae66a5012bd473290b0d56fc6a6640c0e Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 13:55:43 +0000 Subject: [PATCH 4/7] fix: not needed cmd --- build-images/Earthfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-images/Earthfile b/build-images/Earthfile index 78039ad38ec4..8d3c577e4599 100644 --- a/build-images/Earthfile +++ b/build-images/Earthfile @@ -96,7 +96,7 @@ foundry-build: RUN ulimit -n 65535 \ && git clone --depth 1 --branch nightly-$FOUNDRY_TAG https://github.com/foundry-rs/foundry.git \ && cd foundry \ - && touch rust-toolchain.toml && echo '[toolchain]\nchannel = "1.80.0"\n' > rust-toolchain.toml \ + && echo '[toolchain]\nchannel = "1.80.0"\n' > rust-toolchain.toml \ && cargo build --release \ && mkdir -p /opt/foundry/bin \ && for t in forge cast anvil chisel; do \ From 57919716eea46261a40526738dcd39be0bd1187b Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:18:07 +0000 Subject: [PATCH 5/7] fix: forge fmt update --- l1-contracts/test/portals/TokenPortal.sol | 2 +- l1-contracts/test/portals/TokenPortal.t.sol | 4 ++-- l1-contracts/test/portals/UniswapPortal.t.sol | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l1-contracts/test/portals/TokenPortal.sol b/l1-contracts/test/portals/TokenPortal.sol index b70246776403..b6d0a503e148 100644 --- a/l1-contracts/test/portals/TokenPortal.sol +++ b/l1-contracts/test/portals/TokenPortal.sol @@ -118,7 +118,7 @@ contract TokenPortal { _amount, _withCaller ? msg.sender : address(0) ) - ) + ) }); IOutbox outbox = IRollup(registry.getRollup()).OUTBOX(); diff --git a/l1-contracts/test/portals/TokenPortal.t.sol b/l1-contracts/test/portals/TokenPortal.t.sol index 630b5106de33..d6c47232cffb 100644 --- a/l1-contracts/test/portals/TokenPortal.t.sol +++ b/l1-contracts/test/portals/TokenPortal.t.sol @@ -88,7 +88,7 @@ contract TokenPortalTest is Test { abi.encodeWithSignature( "mint_private(bytes32,uint256)", secretHashForRedeemingMintedNotes, amount ) - ), + ), secretHash: secretHashForL2MessageConsumption }); } @@ -166,7 +166,7 @@ contract TokenPortalTest is Test { abi.encodeWithSignature( "withdraw(address,uint256,address)", recipient, withdrawAmount, _designatedCaller ) - ) + ) }) ); diff --git a/l1-contracts/test/portals/UniswapPortal.t.sol b/l1-contracts/test/portals/UniswapPortal.t.sol index ca30d52df47e..aa3ee982ad06 100644 --- a/l1-contracts/test/portals/UniswapPortal.t.sol +++ b/l1-contracts/test/portals/UniswapPortal.t.sol @@ -90,7 +90,7 @@ contract UniswapPortalTest is Test { recipient: DataStructures.L1Actor(address(daiTokenPortal), block.chainid), content: Hash.sha256ToField( abi.encodeWithSignature("withdraw(address,uint256,address)", _recipient, amount, _caller) - ) + ) }); return message.sha256ToField(); @@ -122,7 +122,7 @@ contract UniswapPortalTest is Test { secretHash, _caller ) - ) + ) }); return message.sha256ToField(); @@ -153,7 +153,7 @@ contract UniswapPortalTest is Test { secretHash, _caller ) - ) + ) }); return message.sha256ToField(); From 707370dc85a2d3b83f9d467610742970aee648f9 Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 14:55:12 +0000 Subject: [PATCH 6/7] fix: pause gas metering on the frontier test --- l1-contracts/test/merkle/Frontier.t.sol | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l1-contracts/test/merkle/Frontier.t.sol b/l1-contracts/test/merkle/Frontier.t.sol index 719208f3c26c..b6b8e3844a90 100644 --- a/l1-contracts/test/merkle/Frontier.t.sol +++ b/l1-contracts/test/merkle/Frontier.t.sol @@ -8,7 +8,10 @@ import {NaiveMerkle} from "./Naive.sol"; import {FrontierMerkle} from "../harnesses/Frontier.sol"; contract FrontierTest is Test { - function setUp() public {} + function setUp() public { + // Pause gas metering as calculating the root on each insert is expensive + vm.pauseGasMetering(); + } function testFrontier() public { uint256 depth = 10; From c46b81f980c3a92db68a25bec3e621293d91faec Mon Sep 17 00:00:00 2001 From: Maddiaa0 <47148561+Maddiaa0@users.noreply.github.com> Date: Sat, 28 Sep 2024 15:17:18 +0000 Subject: [PATCH 7/7] fix: add image tag to aztec foundry builds in docker compose --- yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml | 2 +- yarn-project/end-to-end/scripts/docker-compose-p2p.yml | 2 +- yarn-project/end-to-end/scripts/docker-compose-wallet.yml | 2 +- yarn-project/end-to-end/scripts/docker-compose.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml index 3e59678e5967..9070e754e8a7 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-no-sandbox.yml @@ -1,7 +1,7 @@ version: '3' services: fork: - image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc + image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64 pull_policy: always entrypoint: > sh -c ' diff --git a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml index 676c53439629..084bd0523cb6 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-p2p.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-p2p.yml @@ -1,7 +1,7 @@ version: '3' services: fork: - image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc + image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64 pull_policy: always entrypoint: 'anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337' expose: diff --git a/yarn-project/end-to-end/scripts/docker-compose-wallet.yml b/yarn-project/end-to-end/scripts/docker-compose-wallet.yml index 1934edcdf6ee..b78db12fb972 100644 --- a/yarn-project/end-to-end/scripts/docker-compose-wallet.yml +++ b/yarn-project/end-to-end/scripts/docker-compose-wallet.yml @@ -1,7 +1,7 @@ version: '3' services: fork: - image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc + image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64 pull_policy: always entrypoint: > sh -c ' diff --git a/yarn-project/end-to-end/scripts/docker-compose.yml b/yarn-project/end-to-end/scripts/docker-compose.yml index 273a9bf4d4a5..a1c041d21c83 100644 --- a/yarn-project/end-to-end/scripts/docker-compose.yml +++ b/yarn-project/end-to-end/scripts/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: fork: - image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc + image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64 pull_policy: always entrypoint: > sh -c '