Commit 3f9de382 authored by clabby's avatar clabby Committed by GitHub

feat: Add extension event to `OptimismPortal2` (#10350)

* feat: Add extension event to `OptimismPortal2`

Adds an extension event to the `OptimismPortal2` that allows for easier
indexing of proven withdrawals by off-chain monitoring services.
Previously, in order to look up a proof for a withdrawal when syncing an
indexer, archival state access was required.

* semver lock
parent fff6563c
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
"sourceCodeHash": "0xd3450653cecc14bf8fbc21f2fa9b4a5fde348c2b6313d72e74e08666201295a2" "sourceCodeHash": "0xd3450653cecc14bf8fbc21f2fa9b4a5fde348c2b6313d72e74e08666201295a2"
}, },
"src/L1/OptimismPortal2.sol": { "src/L1/OptimismPortal2.sol": {
"initCodeHash": "0x34432a932e5deaebb856320d6e5d243a3db5d9a8e5e572915346875923ba70be", "initCodeHash": "0xea32d79e8297956d4f9a4c7985bb53ff8bb3735e5b307d4e118fea71f503a38e",
"sourceCodeHash": "0xe90774d3f89f937c56439fb7d567106bef0be0fc298fe07bbbc74f2b08445aa5" "sourceCodeHash": "0x2b662e100d1e282588eaaf3704aca0d0a6900ec3b8f8134e2d5d577ee372e42f"
}, },
"src/L1/ProtocolVersions.sol": { "src/L1/ProtocolVersions.sol": {
"initCodeHash": "0x72cd467e8bcf019c02675d72ab762e088bcc9cc0f1a4e9f587fa4589f7fdd1b8", "initCodeHash": "0x72cd467e8bcf019c02675d72ab762e088bcc9cc0f1a4e9f587fa4589f7fdd1b8",
......
...@@ -691,6 +691,25 @@ ...@@ -691,6 +691,25 @@
"name": "WithdrawalProven", "name": "WithdrawalProven",
"type": "event" "type": "event"
}, },
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "withdrawalHash",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "address",
"name": "proofSubmitter",
"type": "address"
}
],
"name": "WithdrawalProvenExtension1",
"type": "event"
},
{ {
"inputs": [], "inputs": [],
"name": "BadTarget", "name": "BadTarget",
......
...@@ -113,6 +113,12 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -113,6 +113,12 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
/// @param to Address that the withdrawal transaction is directed to. /// @param to Address that the withdrawal transaction is directed to.
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to); event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
/// @notice Emitted when a withdrawal transaction is proven. Exists as a separate event to allow for backwards
/// compatibility for tooling that observes the `WithdrawalProven` event.
/// @param withdrawalHash Hash of the withdrawal transaction.
/// @param proofSubmitter Address of the proof submitter.
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
/// @notice Emitted when a withdrawal transaction is finalized. /// @notice Emitted when a withdrawal transaction is finalized.
/// @param withdrawalHash Hash of the withdrawal transaction. /// @param withdrawalHash Hash of the withdrawal transaction.
/// @param success Whether the withdrawal transaction was successful. /// @param success Whether the withdrawal transaction was successful.
...@@ -305,6 +311,8 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver { ...@@ -305,6 +311,8 @@ contract OptimismPortal2 is Initializable, ResourceMetering, ISemver {
// Emit a `WithdrawalProven` event. // Emit a `WithdrawalProven` event.
emit WithdrawalProven(withdrawalHash, _tx.sender, _tx.target); emit WithdrawalProven(withdrawalHash, _tx.sender, _tx.target);
// Emit a `WithdrawalProvenExtension1` event.
emit WithdrawalProvenExtension1(withdrawalHash, msg.sender);
// Add the proof submitter to the list of proof submitters for this withdrawal hash. // Add the proof submitter to the list of proof submitters for this withdrawal hash.
proofSubmitters[withdrawalHash].push(msg.sender); proofSubmitters[withdrawalHash].push(msg.sender);
......
...@@ -449,6 +449,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -449,6 +449,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_proveWithdrawalTransaction_replayProve_differentGameChallengerWins_reverts() external { function test_proveWithdrawalTransaction_replayProve_differentGameChallengerWins_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -496,6 +498,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -496,6 +498,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_proveWithdrawalTransaction_replayProveBlacklisted_suceeds() external { function test_proveWithdrawalTransaction_replayProveBlacklisted_suceeds() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -517,6 +521,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -517,6 +521,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -530,6 +536,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -530,6 +536,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_proveWithdrawalTransaction_replayProveBadProposal_suceeds() external { function test_proveWithdrawalTransaction_replayProveBadProposal_suceeds() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -547,6 +555,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -547,6 +555,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -561,6 +571,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -561,6 +571,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Prove the withdrawal against a game with the current respected game type. // Prove the withdrawal against a game with the current respected game type.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -584,6 +596,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -584,6 +596,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Re-proving should be successful against the new game. // Re-proving should be successful against the new game.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex + 1, _disputeGameIndex: _proposedGameIndex + 1,
...@@ -596,6 +610,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -596,6 +610,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() external { function test_proveWithdrawalTransaction_validWithdrawalProof_succeeds() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -612,6 +628,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -612,6 +628,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Submit the first proof for the withdrawal hash. // Submit the first proof for the withdrawal hash.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -622,6 +640,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -622,6 +640,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Submit a second proof for the same withdrawal hash. // Submit a second proof for the same withdrawal hash.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(0xb0b));
vm.prank(address(0xb0b)); vm.prank(address(0xb0b));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
...@@ -651,6 +671,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -651,6 +671,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -686,6 +708,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -686,6 +708,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Prove the withdrawal transaction against the invalid dispute game, as 0xb0b. // Prove the withdrawal transaction against the invalid dispute game, as 0xb0b.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(0xb0b));
vm.prank(address(0xb0b)); vm.prank(address(0xb0b));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
...@@ -701,6 +725,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -701,6 +725,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// game. // game.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -753,6 +779,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -753,6 +779,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -774,6 +802,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -774,6 +802,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Prove our withdrawal // Prove our withdrawal
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -803,6 +833,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -803,6 +833,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Prove our withdrawal // Prove our withdrawal
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -828,6 +860,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -828,6 +860,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -852,6 +886,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -852,6 +886,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_finalizeWithdrawalTransaction_onReplay_reverts() external { function test_finalizeWithdrawalTransaction_onReplay_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -947,6 +983,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -947,6 +983,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(withdrawalHash, alice, address(this)); emit WithdrawalProven(withdrawalHash, alice, address(this));
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction(_testTx, _proposedGameIndex, outputRootProof, withdrawalProof); optimismPortal2.proveWithdrawalTransaction(_testTx, _proposedGameIndex, outputRootProof, withdrawalProof);
// Resolve the dispute game. // Resolve the dispute game.
...@@ -1041,6 +1079,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -1041,6 +1079,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_finalizeWithdrawalTransaction_blacklisted_reverts() external { function test_finalizeWithdrawalTransaction_blacklisted_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -1066,6 +1106,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -1066,6 +1106,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_finalizeWithdrawalTransaction_gameInAirGap_reverts() external { function test_finalizeWithdrawalTransaction_gameInAirGap_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -1095,6 +1137,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -1095,6 +1137,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_finalizeWithdrawalTransaction_respectedTypeChangedSinceProving_reverts() external { function test_finalizeWithdrawalTransaction_respectedTypeChangedSinceProving_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -1122,6 +1166,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -1122,6 +1166,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
function test_finalizeWithdrawalTransaction_gameOlderThanRespectedGameTypeUpdate_reverts() external { function test_finalizeWithdrawalTransaction_gameOlderThanRespectedGameTypeUpdate_reverts() external {
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
...@@ -1152,6 +1198,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest { ...@@ -1152,6 +1198,8 @@ contract OptimismPortal2_FinalizeWithdrawal_Test is CommonTest {
// Prove the withdrawal transaction. // Prove the withdrawal transaction.
vm.expectEmit(true, true, true, true); vm.expectEmit(true, true, true, true);
emit WithdrawalProven(_withdrawalHash, alice, bob); emit WithdrawalProven(_withdrawalHash, alice, bob);
vm.expectEmit(true, true, true, true);
emit WithdrawalProvenExtension1(_withdrawalHash, address(this));
optimismPortal2.proveWithdrawalTransaction({ optimismPortal2.proveWithdrawalTransaction({
_tx: _defaultTx, _tx: _defaultTx,
_disputeGameIndex: _proposedGameIndex, _disputeGameIndex: _proposedGameIndex,
......
...@@ -14,6 +14,7 @@ contract Events { ...@@ -14,6 +14,7 @@ contract Events {
event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success); event WithdrawalFinalized(bytes32 indexed withdrawalHash, bool success);
event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to); event WithdrawalProven(bytes32 indexed withdrawalHash, address indexed from, address indexed to);
event WithdrawalProvenExtension1(bytes32 indexed withdrawalHash, address indexed proofSubmitter);
event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit); event SentMessage(address indexed target, address sender, bytes message, uint256 messageNonce, uint256 gasLimit);
event SentMessageExtension1(address indexed sender, uint256 value); event SentMessageExtension1(address indexed sender, uint256 value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment