-
Notifications
You must be signed in to change notification settings - Fork 179
feat: add custom gas token #749
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 #749
Conversation
Signed-off-by: Hex <[email protected]> Co-authored-by: AgusDuha <[email protected]> Co-authored-by: Joxes <[email protected]>
…nc-main chore: custom gas token sync main
|
We will need to coordinate with some other teams to know for sure if this lands in jovian or in the following hardfork. Will follow up on this |
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.
Pull Request Overview
This PR implements Custom Gas Token (CGT) support for OP Stack chains, allowing chains to use native assets other than ETH as their gas currency. The specification defines the minimal contract modifications, predeploy enhancements, and protocol changes needed while maintaining backward compatibility.
- Introduces new predeploys
NativeAssetLiquidityandLiquidityControllerfor CGT chains - Adds CGT flag checking across system contracts to block ETH operations when CGT is enabled
- Updates documentation to specify CGT behavior and requirements
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| words.txt | Updates word list with new terms and capitalizations for CGT feature |
| specs/protocol/jovian/withdrawals.md | Specifies withdrawal restrictions for CGT mode |
| specs/protocol/jovian/system-config.md | Documents system config CGT flag functionality |
| specs/protocol/jovian/predeploys.md | Comprehensive specification of new CGT predeploys and existing predeploy modifications |
| specs/protocol/jovian/overview.md | High-level overview of CGT feature and architecture |
| specs/protocol/jovian/optimism-portal.md | OptimismPortal CGT restrictions specification |
| specs/protocol/jovian/messengers.md | Cross-domain messenger CGT restrictions |
| specs/protocol/jovian/bridges.md | Bridge contract CGT behavior overview |
| specs/interop/managed-node.md | Minor documentation reference fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@tynes Is this going to be in jovian folder? I See there are some conflicts and I would like to know if I have to move the files to another folder or resolve the conflicts. |
| | Name | Address | Introduced | Deprecated | Proxied | | ||
| | -------------------- | ------------------------------------------ | ---------- | ---------- | ------- | | ||
| | NativeAssetLiquidity | 0x4200000000000000000000000000000000000029 | Jovian | No | Yes | | ||
| | LiquidityController | 0x420000000000000000000000000000000000002A | Jovian | No | Yes | |
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.
What if we remove NativeAssetLiquidity and LiquidityController, and instead allow only the Portal contract to mint native assets on L2 if CGT is enabled? Here is an implementation following this model.
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.
This couples the minting logic to be on L1. A design goal was to enable the minting logic to be on L1 or L2
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.
Could you explain how minting on L1 is addressed in this specification? I didn’t see any modifications to the Portal contract related to L1 minting.
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.
@tynes, when you say minting on L1, do you mean:
- bridging the L1 ERC20 to L2 via OP's standard L1 bridge
- minting via the
LiquidityControllerusing the bridged L2 ERC20?
or via the to-be-specified L1CGTBridge ?
specs/protocol/jovian/overview.md
Outdated
| - **ETH Bridging Disabled**: ETH bridging functions in `L2ToL1MessagePasser` and `OptimismPortal` MUST revert | ||
| when CGT mode is enabled to prevent confusion about which asset is the native currency. | ||
| - **Native Asset Bridging**: Custom Gas Token chains use dedicated CGT bridges (`L1CGTBridge` and | ||
| `L2CGTBridge`) for native asset transfers between L1 ERC20 tokens and L2 native assets. |
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.
Where are L1CGTBridge/L2CGTBridge defined? More importantly, do they interact with L1CrossDomainMessenger/L2CrossDomainMessenger?
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.
The L1CGTBridge/L2CGTBridge will be defined in a following spec.
Just to follow up on this, we should not put this in the |
Signed-off-by: Hex <[email protected]> Co-authored-by: Joxes <[email protected]>
Description
This specification defines the technical implementation requirements for Custom Gas Token ("CGT") support on OP Stack chains. It specifies the minimal contract modifications, predeploy enhancements, and protocol changes needed to enable chains to use native assets other than ETH as their gas currency. The specification provides detailed function signatures, validation rules, and behavioral requirements for all affected system components while maintaining backward compatibility.
Design Doc: ethereum-optimism/design-docs#305