Skip to content

Commit

Permalink
remove blacklist check in getAnchorRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmolasses committed Feb 6, 2025
1 parent 192e511 commit 1c5b698
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/contracts-bedrock/snapshots/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@
"sourceCodeHash": "0xb7b0a06cd971c4647247dc19ce997d0c64a73e87c81d30731da9cf9efa1b952a"
},
"src/dispute/AnchorStateRegistry.sol": {
"initCodeHash": "0x378970d3613b8cf0202cc660afd8b0447988a22c18fdb9e7096a5dedbb389ad8",
"sourceCodeHash": "0x95cd2860ee20ed54615da02f53c87ca836aa15af20e3164ae6ef5a9b9cfd3983"
"initCodeHash": "0x82a7b481e5379e6dd0b6932ae2291cd8e34a567e9ddbbef68728238dfada1229",
"sourceCodeHash": "0x3f9e640dfba9c826a81942d24281933ef22c923427a8cc6eab6bc7e15bbefe5b"
},
"src/dispute/DelayedWETH.sol": {
"initCodeHash": "0xdd0b5e523f3b53563fe0b6e6165fb73605b14910ffa32a7cbed855cdebab47c6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ contract AnchorStateRegistry is Initializable, ISemver {
return (startingAnchorRoot.root, startingAnchorRoot.l2BlockNumber);
}

if (isGameBlacklisted(anchorGame)) {
revert AnchorStateRegistry_AnchorGameBlacklisted();
}

// Otherwise, return the anchor root.
return (Hash.wrap(anchorGame.rootClaim().raw()), anchorGame.l2BlockNumber());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,9 @@ contract AnchorStateRegistry_GetAnchorRoot_Test is AnchorStateRegistry_Init {
assertEq(root.raw(), gameProxy.rootClaim().raw());
assertEq(l2BlockNumber, gameProxy.l2BlockNumber());
}
}

contract AnchorStateRegistry_GetAnchorRoot_TestFail is AnchorStateRegistry_Init {
/// @notice Tests that getAnchorRoot will revert if the anchor game is blacklisted.
function test_getAnchorRoot_blacklistedGame_fails() public {
/// @notice Tests that getAnchorRoot returns even if the anchor game is blacklisted.
function test_getAnchorRoot_blacklistedGame_succeeds() public {
// Mock the game to be resolved.
vm.mockCall(address(gameProxy), abi.encodeCall(gameProxy.resolvedAt, ()), abi.encode(block.timestamp));
vm.warp(block.timestamp + optimismPortal2.disputeGameFinalityDelaySeconds() + 1);
Expand All @@ -116,8 +114,11 @@ contract AnchorStateRegistry_GetAnchorRoot_TestFail is AnchorStateRegistry_Init
abi.encodeCall(optimismPortal2.disputeGameBlacklist, (gameProxy)),
abi.encode(true)
);
vm.expectRevert(IAnchorStateRegistry.AnchorStateRegistry_AnchorGameBlacklisted.selector);
anchorStateRegistry.getAnchorRoot();

// Get the anchor root.
(Hash root, uint256 l2BlockNumber) = anchorStateRegistry.getAnchorRoot();
assertEq(root.raw(), gameProxy.rootClaim().raw());
assertEq(l2BlockNumber, gameProxy.l2BlockNumber());
}
}

Expand Down

0 comments on commit 1c5b698

Please sign in to comment.