Skip to content

Commit d8e3292

Browse files
misc fixes
1 parent e3df61d commit d8e3292

File tree

9 files changed

+26
-87
lines changed

9 files changed

+26
-87
lines changed

mise.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ just = "1.37.0"
3131
# Foundry dependencies
3232
# Foundry is a special case because it supplies multiple binaries at the same
3333
# GitHub release, so we need to use the aliasing trick to get mise to not error
34-
forge = "nightly-59f354c179f4e7f6d7292acb3d068815c79286d1"
35-
cast = "nightly-59f354c179f4e7f6d7292acb3d068815c79286d1"
36-
anvil = "nightly-59f354c179f4e7f6d7292acb3d068815c79286d1"
34+
forge = "nightly-017c59d6806ce11f1dc131f8607178efad79d84a"
35+
cast = "nightly-017c59d6806ce11f1dc131f8607178efad79d84a"
36+
anvil = "nightly-017c59d6806ce11f1dc131f8607178efad79d84a"
3737

3838
# Fake dependencies
3939
# Put things here if you need to track versions of tools or projects that can't

packages/contracts-bedrock/foundry.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ build_info_path = 'artifacts/build-info'
1111
snapshots = 'notarealpath' # workaround for foundry#9477
1212

1313
optimizer = true
14-
optimizer_runs = 5000
14+
optimizer_runs = 999999
15+
16+
additional_compiler_profiles = [
17+
{ name = "dispute", optimizer_runs = 5000 },
18+
]
19+
compilation_restrictions = [
20+
{ paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 5000 },
21+
{ paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 5000 },
22+
]
1523

1624
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
1725
bytecode_hash = 'none'

packages/contracts-bedrock/interfaces/dispute/IFaultDisputeGame.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ interface IFaultDisputeGame is IDisputeGame {
7575
error UnexpectedString();
7676
error ValidStep();
7777
error InvalidBondDistributionMode();
78-
error GameNotFinalized(string reason);
78+
error GameNotFinalized();
7979
error GameNotResolved();
8080
error ReservedGameType();
8181

packages/contracts-bedrock/interfaces/dispute/IPermissionedDisputeGame.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ interface IPermissionedDisputeGame is IDisputeGame {
6464
error UnexpectedString();
6565
error ValidStep();
6666
error InvalidBondDistributionMode();
67-
error GameNotFinalized(string reason);
67+
error GameNotFinalized();
6868
error GameNotResolved();
6969
error ReservedGameType();
7070

packages/contracts-bedrock/snapshots/abi/AnchorStateRegistry.json

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@
164164
"internalType": "bool",
165165
"name": "",
166166
"type": "bool"
167-
},
168-
{
169-
"internalType": "string",
170-
"name": "",
171-
"type": "string"
172167
}
173168
],
174169
"stateMutability": "view",
@@ -188,11 +183,6 @@
188183
"internalType": "bool",
189184
"name": "",
190185
"type": "bool"
191-
},
192-
{
193-
"internalType": "string",
194-
"name": "",
195-
"type": "string"
196186
}
197187
],
198188
"stateMutability": "view",
@@ -397,11 +387,6 @@
397387
"name": "Initialized",
398388
"type": "event"
399389
},
400-
{
401-
"inputs": [],
402-
"name": "AnchorStateRegistry_ImproperAnchorGame",
403-
"type": "error"
404-
},
405390
{
406391
"inputs": [],
407392
"name": "AnchorStateRegistry_InvalidAnchorGame",
@@ -412,4 +397,4 @@
412397
"name": "AnchorStateRegistry_Unauthorized",
413398
"type": "error"
414399
}
415-
]
400+
]

packages/contracts-bedrock/snapshots/abi/FaultDisputeGame.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,13 +1045,7 @@
10451045
"type": "error"
10461046
},
10471047
{
1048-
"inputs": [
1049-
{
1050-
"internalType": "string",
1051-
"name": "reason",
1052-
"type": "string"
1053-
}
1054-
],
1048+
"inputs": [],
10551049
"name": "GameNotFinalized",
10561050
"type": "error"
10571051
},

packages/contracts-bedrock/snapshots/abi/PermissionedDisputeGame.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,13 +1086,7 @@
10861086
"type": "error"
10871087
},
10881088
{
1089-
"inputs": [
1090-
{
1091-
"internalType": "string",
1092-
"name": "reason",
1093-
"type": "string"
1094-
}
1095-
],
1089+
"inputs": [],
10961090
"name": "GameNotFinalized",
10971091
"type": "error"
10981092
},

packages/contracts-bedrock/snapshots/semver-lock.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"sourceCodeHash": "0x2d21506cc51ebe0b60bcf89883aff5e9b1269567ce44ee779de3d3940e23fb65"
2121
},
2222
"src/L1/OptimismPortal2.sol": {
23-
"initCodeHash": "0x52ddbe70f60a6f4e5c929fed417c92d99d82a85c05de8e1f0c8dfd0d634ad648",
24-
"sourceCodeHash": "0xc4a66e8adacd58b961938f473b22614a520fa0bdae70381b8f56210bc34f1f32"
23+
"initCodeHash": "0x32eceffc74182357cb79f7218851e02a76200b1e57db7629c2b97b9401d71a25",
24+
"sourceCodeHash": "0x95f68f577529c158070e3a23fd2da1c63581113471e1303716e387a07f3070d9"
2525
},
2626
"src/L1/OptimismPortalInterop.sol": {
27-
"initCodeHash": "0x6b05d7130c019d3c46dca39dfdae3797861088a9fb7b5baa84fd4e5cb87c5883",
28-
"sourceCodeHash": "0xae2fbe02c0f8685692babeed0252ae8a624dc6d3bfb082fc3807d7b84869004b"
27+
"initCodeHash": "0x271c17198970e361cb43aff3ae788d4f726d8d1a188eeea7d0a5f0c477380a76",
28+
"sourceCodeHash": "0xbb6acc3e88af9594ffcb8a2f30860511b76e09024330e70052316668fe55fd1f"
2929
},
3030
"src/L1/ProtocolVersions.sol": {
3131
"initCodeHash": "0x0000ec89712d8b4609873f1ba76afffd4205bf9110818995c90134dbec12e91e",
@@ -152,8 +152,8 @@
152152
"sourceCodeHash": "0xb7b0a06cd971c4647247dc19ce997d0c64a73e87c81d30731da9cf9efa1b952a"
153153
},
154154
"src/dispute/AnchorStateRegistry.sol": {
155-
"initCodeHash": "0x6e94c2f4129209d2b36d6a54adaaf99b91b3df322c8c75043d29f6b0a9143738",
156-
"sourceCodeHash": "0xb81181263522e939195a70b6e281fb038de2312c9682f9123723c6ae1babf559"
155+
"initCodeHash": "0x751e32c8d44c5ef9b1acae2d94e07f6e91f7f59663c24e12d21298638458b272",
156+
"sourceCodeHash": "0xb09dccd5bf662c42ab10afd19a2b51114df9fd3bc6e20d4d86e4ba7529036bbc"
157157
},
158158
"src/dispute/DelayedWETH.sol": {
159159
"initCodeHash": "0xb1f04c9ee86984a157b92a18754c84104e9d4df7a3838633301ca7f557d0220a",
@@ -164,8 +164,8 @@
164164
"sourceCodeHash": "0x155c0334f63616ed245aadf9a94f419ef7d5e2237b3b32172484fd19890a61dc"
165165
},
166166
"src/dispute/FaultDisputeGame.sol": {
167-
"initCodeHash": "0x734c4bce3822851f8925d3a8668630e4c503ee5a042e1234e448f4e9ea86582c",
168-
"sourceCodeHash": "0x8888b471b484c3f0662dca39317aa75fbb380deea4e12f6a8ccd5dde1202e5c7"
167+
"initCodeHash": "0xd59ffa7f487db9b0761b1fa3994c59e0d78e4546c76379a14a31dec1080b3f20",
168+
"sourceCodeHash": "0xd59fd93e7332bad50714ec1abe06cebd6378d32cc4ad18434f09156ac3c97982"
169169
},
170170
"src/legacy/DeployerWhitelist.sol": {
171171
"initCodeHash": "0x53099379ed48b87f027d55712dbdd1da7d7099925426eb0531da9c0012e02c29",
@@ -219,4 +219,4 @@
219219
"initCodeHash": "0x2bfce526f82622288333d53ca3f43a0a94306ba1bab99241daa845f8f4b18bd4",
220220
"sourceCodeHash": "0xf49d7b0187912a6bb67926a3222ae51121e9239495213c975b3b4b217ee57a1b"
221221
}
222-
}
222+
}

packages/contracts-bedrock/test/dispute/AnchorStateRegistry.t.sol

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -338,48 +338,6 @@ contract AnchorStateRegistry_SetAnchorState_TestFail is AnchorStateRegistry_Init
338338
assertEq(updatedL2BlockNumber, l2BlockNumber);
339339
assertEq(updatedRoot.raw(), root.raw());
340340
}
341-
}
342-
343-
contract AnchorStateRegistry_SetAnchorState_TestFail is AnchorStateRegistry_Init {
344-
/// @notice Tests that setAnchorState will revert if the sender is not the guardian.
345-
/// @param _sender The address of the sender.
346-
/// @param _l2BlockNumber The L2 block number to use for the game.
347-
function testFuzz_setAnchorState_notGuardian_fails(address _sender, uint256 _l2BlockNumber) public {
348-
// Grab block number of the existing anchor root.
349-
(Hash root, uint256 l2BlockNumber) = anchorStateRegistry.getAnchorRoot();
350-
351-
// Mock the l2BlockNumber call.
352-
vm.mockCall(address(gameProxy), abi.encodeCall(gameProxy.l2BlockNumber, ()), abi.encode(_l2BlockNumber));
353-
354-
// Mock the DEFENDER_WINS state.
355-
vm.mockCall(address(gameProxy), abi.encodeCall(gameProxy.status, ()), abi.encode(GameStatus.DEFENDER_WINS));
356-
357-
// Make our game type the respected game type.
358-
vm.mockCall(
359-
address(optimismPortal2),
360-
abi.encodeCall(optimismPortal2.respectedGameType, ()),
361-
abi.encode(gameProxy.gameType())
362-
);
363-
364-
// Mock the DisputeGameFactory to make it seem that the game was not registered.
365-
vm.mockCall(
366-
address(disputeGameFactory),
367-
abi.encodeCall(
368-
disputeGameFactory.games, (gameProxy.gameType(), gameProxy.rootClaim(), gameProxy.extraData())
369-
),
370-
abi.encode(address(0), 0)
371-
);
372-
373-
// Try to update the anchor state.
374-
vm.prank(_sender);
375-
vm.expectRevert(IAnchorStateRegistry.AnchorStateRegistry_Unauthorized.selector);
376-
anchorStateRegistry.setAnchorState(gameProxy);
377-
378-
// Confirm that the anchor state has not updated.
379-
(Hash updatedRoot, uint256 updatedL2BlockNumber) = anchorStateRegistry.anchors(gameProxy.gameType());
380-
assertEq(updatedL2BlockNumber, l2BlockNumber);
381-
assertEq(updatedRoot.raw(), root.raw());
382-
}
383341

384342
/// @notice Tests that setAnchorState will revert if the game is not registered.
385343
/// @param _l2BlockNumber The L2 block number to use for the game.

0 commit comments

Comments
 (0)