Skip to content

Commit

Permalink
fix: multiple fuzz flakes (ethereum-optimism#11981)
Browse files Browse the repository at this point in the history
Fixes a couple of fuzz flakes that were found when fuzzing
heavily.
  • Loading branch information
smartcontracts authored and samlaf committed Nov 10, 2024
1 parent 5ac632b commit f9da2f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { computeCommitmentKeccak256 } from "src/L1/DataAvailabilityChallenge.sol";
import { Proxy } from "src/universal/Proxy.sol";
import { CommonTest } from "test/setup/CommonTest.sol";
import { Preinstalls } from "src/libraries/Preinstalls.sol";

contract DataAvailabilityChallengeTest is CommonTest {
function setUp() public virtual override {
Expand All @@ -33,6 +34,8 @@ contract DataAvailabilityChallengeTest is CommonTest {
function testWithdraw(address sender, uint256 amount) public {
assumePayable(sender);
assumeNotPrecompile(sender);
// EntryPoint will revert if using amount > type(uint112).max.
vm.assume(sender != Preinstalls.EntryPoint_v060);
vm.assume(sender != address(dataAvailabilityChallenge));
vm.assume(sender.balance == 0);
vm.deal(sender, amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ contract L2ToL2CrossDomainMessengerTest is Test {
)
external
{
// Ensure that the target contract is not a Forge contract.
assumeNotForgeAddress(_target);

// Ensure that the target contract is not CrossL2Inbox or L2ToL2CrossDomainMessenger
vm.assume(_target != Predeploys.CROSS_L2_INBOX && _target != Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
vm.assume(_target != Predeploys.CROSS_L2_INBOX);
vm.assume(_target != Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);

// Ensure that the target call is payable if value is sent
if (_value > 0) assumePayable(_target);
Expand Down

0 comments on commit f9da2f1

Please sign in to comment.