|
| 1 | +# L2 Execution Engine |
| 2 | + |
| 3 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 4 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 5 | +**Table of Contents** |
| 6 | + |
| 7 | +- [Overview](#overview) |
| 8 | +- [Timestamp Activation](#timestamp-activation) |
| 9 | +- [EVM Changes](#evm-changes) |
| 10 | + - [Transition from ZK Trie to MPT](#transition-from-zk-trie-to-mpt) |
| 11 | + - [`SELFDESTRUCT` opcode](#selfdestruct-opcode) |
| 12 | + - [`isSystemTransaction` boolean at transaction struct](#issystemtransaction-boolean-at-transaction-struct) |
| 13 | +- [Fee Distribution Process](#fee-distribution-process) |
| 14 | + |
| 15 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 16 | + |
| 17 | +[g-zktrie]: ../../glossary.md#zk-trie |
| 18 | +[g-mpt]: ../../glossary.md#merkle-patricia-trie |
| 19 | +[validator-system]: ../validator-v2/overview.md |
| 20 | + |
| 21 | +## Overview |
| 22 | + |
| 23 | +This upgrade changes the underlying trie structure of the execution client from the [ZK Trie][g-zktrie] to the |
| 24 | +[Merkle Patricia Trie][g-mpt]. There are also subsequent changes to the EVM to enhance the compatibility with |
| 25 | +Vanilla OP Stack. |
| 26 | + |
| 27 | +## Timestamp Activation |
| 28 | + |
| 29 | +Kroma MPT Migration upgrade, like other network upgrades, is activated at a timestamp. Changes to the L2 Block execution |
| 30 | +rules are applied when the `L2 Timestamp >= activation time`. |
| 31 | + |
| 32 | +## EVM Changes |
| 33 | + |
| 34 | +### Transition from ZK Trie to MPT |
| 35 | + |
| 36 | +The underlying trie structure of the execution client is changed from the ZK Trie to the Merkle Patricia Trie. This |
| 37 | +enhances the performance of the execution client, and reduces the operational cost of maintaining zkEVM circuits by |
| 38 | +enabling the proving scheme transition to zkVM. |
| 39 | + |
| 40 | +### `SELFDESTRUCT` opcode |
| 41 | + |
| 42 | +The `SELFDESTRUCT` opcode was regarded as invalid opcode, since zkEVM proving system used in ZK fault proof cannot prove |
| 43 | +the self-destruct operation. However, with the transition to zkVM, the `SELFDESTRUCT` opcode is now enabled, following |
| 44 | +rules that are defined at [EIP-6780]. |
| 45 | + |
| 46 | +[EIP-6780]: https://eips.ethereum.org/EIPS/eip-6780 |
| 47 | + |
| 48 | +### `isSystemTransaction` boolean at transaction struct |
| 49 | + |
| 50 | +In the previous version of the protocol, the `isSystemTransaction` boolean was removed. To enhance the compatibility |
| 51 | +with vanilla OP Stack, the `isSystemTransaction` boolean is re-enabled. |
| 52 | + |
| 53 | +However, since `isSystemTransaction` was disabled as in the [Regolith upgrade](../regolith/overview.md), system |
| 54 | +transactions remain to use the same gas accounting rules as regular deposits. |
| 55 | + |
| 56 | +## Fee Distribution Process |
| 57 | + |
| 58 | +The fee distribution process is updated to be compatible with OP Stack. Previously, the fee distribution process was |
| 59 | +defined to support robustness of validator system. |
| 60 | + |
| 61 | +| Vault | Address | Amount | |
| 62 | +|------------------------|----------------------------------------------|-----------------------------------------------------------------------| |
| 63 | +| `ProtocolVault` | `0x4200000000000000000000000000000000000006` | `(base_fee + priority_fee) * (10000 - validatorRewardScalar) / 10000` | |
| 64 | +| `L1FeeVault` | `0x4200000000000000000000000000000000000007` | `l1_cost` | |
| 65 | +| `ValidatorRewardVault` | `0x4200000000000000000000000000000000000008` | `(base_fee + priority_fee) * validatorRewardScalar / 10000` | |
| 66 | + |
| 67 | +However, with transition to [KRO-based validator system][validator-system], validators are now getting KRO rewards, |
| 68 | +and `validatorRewardScalar` was set to 0. After Kroma MPT Migration upgrade, the fee distribution process is updated |
| 69 | +as follows: |
| 70 | + |
| 71 | +| Vault | Address | Amount | |
| 72 | +|---------------------|----------------------------------------------|----------------| |
| 73 | +| `SequencerFeeVault` | `0x4200000000000000000000000000000000000011` | `priority_fee` | |
| 74 | +| `BaseFeeVault` | `0x4200000000000000000000000000000000000019` | `base_fee` | |
| 75 | +| `L1FeeVault` | `0x420000000000000000000000000000000000001a` | `l1_cost` | |
0 commit comments