Etherlink: FA token bridge
This is a sub-milestone of %Etherlink: main launch, dedicated to implementing kernel changes required to be able to bridge FA assets between Etherlink and Tezos L1.
It mainly relies on two features: depositing and withdrawing. TODO for @naih: elaborate just a bit so that readers understand the global architecture and flow of assets behind with these two operations (with pointers to https://github.com/baking-bad/etherlink-bridge and TZIP-029). Also expose why it's important to have that (for tokens like tzBTC, USDT, etc.)
Work break down
Headless bridge
Permissionless ticket transport, w/o full indexing support.
Preliminaries
-
!11840 (merged): Kernel/EVM: FA bridge module -
!13618 (merged): Kernel/EVM: Moving ticketer to the world state -
!12072 (merged): EVM: Add ticket table to account for FA deposits -
!13535 (merged): Etherlink: FA Bridge feature flag in kernel
FA deposits
-
!13532 (merged): EVM: add support for FA deposits to the sequencer -
!13720 (merged): EVM: add FA deposit structure and helper methods -
!13773 (merged): EVM: add methods for FA deposit execution. -
!13835 (merged): EVM: integrate FA deposit application behind the feature flag.
FA withdrawals
-
!13751 (merged): EVM: refactor xtz native withdrawals. -
!13843 (merged): EVM: add FA withdrawal struct and helper methods. -
!13941 (merged): EVM: add FA bridge precompile and FA withdrawal execution. -
!13958 (merged): EVM: enable FA withdrawals behind the feature flag.
Merged bridge
Full indexing support, including native bridge.
Track XTZ deposits and withdrawals on L2
-
!14012 (merged): EVM: add event logs for native token deposits -
!14014 (merged): EVM: emit event log when native token withdrawal is applied. -
!14260 (merged) EVM: L1 proxy address added to the FA withdrawal event
Track XTZ and FA withdrawals on L1*
The resolution is that we can do matching without tracking transactions (and dummy contract on L1).
-
!13925 (merged): Kernel SDK: allow to enqueue heterogeneous batches of messages to outbox. -
!14059 (closed) TODO: To index withdrawals, we need to include an additional "tracking" transaction to the outbox message batch.
Fixups
-
!14389 (merged): EVM/Kernel: make withdrawal counter revertible
Enable bridge
-
!14342 (merged) EVM/Kernel: Enable FA bridge in Ghostnet -
Test Ghostnet upgrade that enables FA bridge
Follow up
Adjusting tick model and addressing issues discovered during the audit.
Tick & gas model
-
!14475 (merged): EVM/Kernel: benchmark FA deposits and withdrawals -
!14481 (merged): EVM/Kernel: rewrite delayed outbox queue resilience tezt scenario -
!14016 (merged): EVM/Kernel: tune FA bridge tick & gas model
Reentrancy fixups
-
!14545 (merged): EVM/Kernel: ensure FA deposit cannot invoke XTZ/FA withdrawal precompiles -
!14390 (merged): EVM/Kernel: prevent circular calls of impure precompiles
Misc
-
!14639 (closed): EVM/Kernel: FA bridge whitelisted code hashes