-
Notifications
You must be signed in to change notification settings - Fork 46
feat: add custom gas token migration #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add custom gas token migration #313
Conversation
Signed-off-by: Joxes <[email protected]>
Signed-off-by: Joxes <[email protected]>
This is WIP so far but meant to show how it can work. The big todo is to rename the feature flag with the name of the hardfork that the CGT upgrade is included in. This does leak knowledge of CGT into the client software so that it can optionally deploy the CGT predeploys. It is expected that the CGT predeploys will be in the genesis if the hardfork is active at genesis only on CGT chains. Relevant links: - ethereum-optimism/design-docs#305 - ethereum-optimism/design-docs#313 - defi-wonderland#478
- In `SystemConfig`: | ||
- Removal of the `GasPayingToken` library. | ||
- This removes the `gasPayingToken`, `gasPayingTokenName`, and `gasPayingTokenSymbol`. | ||
- `isCustomGasToken()` boolean is introduced at initialization, as a replacement for `setGasPayingToken`. | ||
- In `OptimismPortal`: | ||
- Removal of the `depositERC20Transaction` and `gasPayingToken` dependencies. | ||
- Import `isCustomGasToken` to block `msg.value` > 0 during deposits, to block ETH sends. | ||
- Migrate funds into a new bridge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update this change 645a27d here too.
- `FeeVaults`: | ||
- Upgraded to allow withdrawals into an L2 address and turn off L1 withdrawals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update with this new approach to only add config checks on deployment. If misconfigured, withdrawals would revert because of L2ToL1MessagePasser
blocking condition.
|
||
- In `SystemConfig`: | ||
- Removal of the `GasPayingToken` library. | ||
- This removes the `gasPayingToken`, `gasPayingTokenName`, and `gasPayingTokenSymbol`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: also need to remove GAS_PAYING_TOKEN_DECIMALS
The OP Stack is getting a more flexible custom gas token design. To ensure simplicity and broad compatibility, the L1 custom gas token bridge enshrines 18 decimal places as the standard. Most software in the Ethereum ecosystem assumes that the native asset uses 18 decimals. Aligning with this convention reduces complexity and avoids unexpected behavior. If your custom gas token uses a different number of decimals, you will need an adapter to scale values to and from 18 decimals, ensuring accurate conversions and preventing precision loss. The custom gas token design is flexible, making it straightforward to plug in a new adapter if 18 decimals is not suitable for your use case. 👉 If your project requires support for tokens with non-18 decimals, please reach out, we’d love to work with you on designing the right adapter. |
Description
This document proposes a migration solution for OP Stack chains that use the old implementation to the new one proposed in #305.