Skip to content

Commit

Permalink
fix(ctb): Update proveWithdrawalTransaction replay require. (ethere…
Browse files Browse the repository at this point in the history
…um-optimism#9892)

* Update `proveWithdrawalTransaction` require

* revert message update in test
  • Loading branch information
clabby authored Mar 18, 2024
1 parent c9bdd91 commit dc2b714
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion op-bindings/bindingspreview/optimismportal2.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-bindings/bindingspreview/optimismportal2_more.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/contracts-bedrock/semver-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"sourceCodeHash": "0xf549ae16033b63e7cb3e032898a6495e1a13090dc8dd1422f7f650076ae973f8"
},
"src/L1/OptimismPortal2.sol": {
"initCodeHash": "0x718b2bc2925ca1551a98908b26237fc7dd6634f7ca35c766a42b3d7e20eecd5e",
"sourceCodeHash": "0x5941d020f7ce1f6eeab2be25bb492cd955b77c379eaed2d66880a5caaaeaf0de"
"initCodeHash": "0xd2947b6ce4c5976d550c84d72f14ead2c92f27449edc98ca8ef92b3e9c02b367",
"sourceCodeHash": "0x477df849308119f516e21e3c44e72422c1afa919fad5351be5046d3ec9f0e11f"
},
"src/L1/ProtocolVersions.sol": {
"initCodeHash": "0x72cd467e8bcf019c02675d72ab762e088bcc9cc0f1a4e9f587fa4589f7fdd1b8",
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts-bedrock/src/L1/OptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
}

/// @notice Semantic version.
/// @custom:semver 3.2.0
string public constant version = "3.2.0";
/// @custom:semver 3.3.0
string public constant version = "3.3.0";

/// @notice Constructs the OptimismPortal contract.
constructor(
Expand Down Expand Up @@ -273,11 +273,11 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
// in the case that an honest user proves their withdrawal against a dispute game that
// resolves against the root claim, or the dispute game is blacklisted, we allow
// re-proving the withdrawal against a new proposal.
IDisputeGame game = provenWithdrawal.disputeGameProxy;
IDisputeGame oldGame = provenWithdrawal.disputeGameProxy;
require(
provenWithdrawal.timestamp == 0 || gameProxy.status() == GameStatus.CHALLENGER_WINS
|| disputeGameBlacklist[gameProxy] || game.gameType().raw() != respectedGameType.raw(),
"OptimismPortal: withdrawal hash has already been proven, and dispute game is not invalid"
provenWithdrawal.timestamp == 0 || oldGame.status() == GameStatus.CHALLENGER_WINS
|| disputeGameBlacklist[oldGame] || oldGame.gameType().raw() != respectedGameType.raw(),
"OptimismPortal: withdrawal hash has already been proven, and the old dispute game is not invalid"
);

// Compute the storage slot of the withdrawal hash in the L2ToL1MessagePasser contract.
Expand Down
4 changes: 3 additions & 1 deletion packages/contracts-bedrock/test/L1/OptimismPortal2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
_withdrawalProof: _withdrawalProof
});

vm.expectRevert("OptimismPortal: withdrawal hash has already been proven, and dispute game is not invalid");
vm.expectRevert(
"OptimismPortal: withdrawal hash has already been proven, and the old dispute game is not invalid"
);
optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex,
Expand Down

0 comments on commit dc2b714

Please sign in to comment.