Skip to content

Commit

Permalink
enable optimizations in foundry.toml and fix ci
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
0xkarmacoma committed Jan 16, 2025
1 parent e3d913d commit 86b7eae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/regression/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ libs = ['../lib', 'lib']

evm_version = 'cancun'

optimizer = true

force = false
# compile options used by halmos (to prevent unnecessary recompilation when running forge test and halmos together)
extra_output = ["storageLayout", "metadata"]
7 changes: 5 additions & 2 deletions tests/regression/test/MegaMem.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,13 @@ contract MegaMemTest is Test, SymTest {
}
}

function keccak256_op(uint256 ptr, uint256 len) public pure {

function keccak256_op(uint256 ptr, uint256 len) public pure returns (bytes32) {
bytes32 hash;
assembly {
let hash := keccak256(ptr, len)
hash := keccak256(ptr, len)
}
return hash;
}

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

0 comments on commit 86b7eae

Please sign in to comment.