Skip to content

Commit 86b7eae

Browse files
committed
enable optimizations in foundry.toml and fix ci
keccak256_op was optimized to return(0, 0), which does not revert, which caused the test to fail for context, newer foundry versions have the optimizer turned off (but ci uses the stable channel of foundry, which still has the optimizer turned on by default)
1 parent e3d913d commit 86b7eae

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/regression/foundry.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ libs = ['../lib', 'lib']
55

66
evm_version = 'cancun'
77

8+
optimizer = true
9+
810
force = false
911
# compile options used by halmos (to prevent unnecessary recompilation when running forge test and halmos together)
1012
extra_output = ["storageLayout", "metadata"]

tests/regression/test/MegaMem.t.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ contract MegaMemTest is Test, SymTest {
7676
}
7777
}
7878

79-
function keccak256_op(uint256 ptr, uint256 len) public pure {
79+
80+
function keccak256_op(uint256 ptr, uint256 len) public pure returns (bytes32) {
81+
bytes32 hash;
8082
assembly {
81-
let hash := keccak256(ptr, len)
83+
hash := keccak256(ptr, len)
8284
}
85+
return hash;
8386
}
8487

8588
function mcopy(uint256 dst_ptr, uint256 src_ptr, uint256 src_len) public pure {

0 commit comments

Comments
 (0)