Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use different rust toolchain for foundry builds #8869

Merged
merged 7 commits into from
Sep 28, 2024
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
10 changes: 8 additions & 2 deletions build-images/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,19 @@ osxcross:
foundry-build:
LET FOUNDRY_TAG = 25f24e677a6a32a62512ad4f561995589ac2c7dc
FROM +base-build
# 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
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 \
&& 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; \
mv ./target/release/$t /opt/foundry/bin/$t; \
strip /opt/foundry/bin/$t; \
done \
&& rm -rf /foundry
Expand Down
5 changes: 4 additions & 1 deletion l1-contracts/test/merkle/Frontier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, have not seen this before

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing it 1000 times in a loop in this test, for each tree. Was making it exceed limits. I assumed its fine to just not meter as we dont use it like this in prod.

}

function testFrontier() public {
uint256 depth = 10;
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/test/portals/TokenPortal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ contract TokenPortal {
_amount,
_withCaller ? msg.sender : address(0)
)
)
)
});

IOutbox outbox = IRollup(registry.getRollup()).OUTBOX();
Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/test/portals/TokenPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ contract TokenPortalTest is Test {
abi.encodeWithSignature(
"mint_private(bytes32,uint256)", secretHashForRedeemingMintedNotes, amount
)
),
),
secretHash: secretHashForL2MessageConsumption
});
}
Expand Down Expand Up @@ -166,7 +166,7 @@ contract TokenPortalTest is Test {
abi.encodeWithSignature(
"withdraw(address,uint256,address)", recipient, withdrawAmount, _designatedCaller
)
)
)
})
);

Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/test/portals/UniswapPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -122,7 +122,7 @@ contract UniswapPortalTest is Test {
secretHash,
_caller
)
)
)
});

return message.sha256ToField();
Expand Down Expand Up @@ -153,7 +153,7 @@ contract UniswapPortalTest is Test {
secretHash,
_caller
)
)
)
});

return message.sha256ToField();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64
pull_policy: always
entrypoint: >
sh -c '
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/scripts/docker-compose-p2p.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/scripts/docker-compose-wallet.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64
pull_policy: always
entrypoint: >
sh -c '
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
fork:
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc
image: aztecprotocol/foundry:25f24e677a6a32a62512ad4f561995589ac2c7dc-amd64
pull_policy: always
entrypoint: >
sh -c '
Expand Down
Loading