EVM: emit event log when native token withdrawal is applied
What
This MR introduces a new kernel EVM event that is emitted by the withdrawal precompile upon successful execution.
Why
Currently there's no easy way to track withdrawal status along the way from L2 to L1, partially because of how the delayed outbox works.
This MR fixes that, and also allows to use the same indexer & frontend for both native token and FA bridges.
How
Withdrawal precompile now adds special event to the execution outcome logs, which contains:
- Sender: L2 account that initiated the withdrawal)
- Receiver: final destination on L1
- Amount: in wei, before conversion to mutez
- Withdrawal ID: nonce (counter) that is incremented on every successful or failed withdrawal (also both for native and FA tokens)
Manually testing the MR
cargo test
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Michael Zaikin