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);
......
...@@ -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