-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: cgt #18076
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
feat: cgt #18076
Conversation
Signed-off-by: Hex <[email protected]> Co-authored-by: niha <[email protected]> Co-authored-by: Ashitaka <[email protected]> Co-authored-by: AgusDuha <[email protected]>
* feat: add L1BlockCGT * feat: add L2ToL1MessagePasserCGT * chore: remove test exclution in test validation
* test(cgt): fix failing tests * test(cgt): fix portal version * test(cgt): skip tests on forked mode * fix: predeploys test cgt mismatch * test(cgt): minor fixes --------- Co-authored-by: niha <[email protected]>
Updates the implementation to use the new feature flagging system
Use the legacy config name so that less needs to change for legacy CGT chains
Remove leftover merge conflict
Add a specific test for CGT in the intent
Fix the build for this feature
Keeps it simple because development on Jovian is happening and we will inherit any Jovian modifications automatically
|
/ci authorize f621b77 |
* fix: remove dev feature flag from opcm * fix: lint
|
/ci authorize 43c0c81 |
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 a Custom Gas Token (CGT) architecture that enables OP Stack chains to use an asset other than ETH as their native fee currency. The implementation introduces two new predeploys (NativeAssetLiquidity and LiquidityController) and uses an isCustomGasToken() flag to disable ETH transfer flows in bridging operations.
Key changes:
- Added
NativeAssetLiquidityandLiquidityControllerpredeploy contracts to manage native asset supply - Introduced
CUSTOM_GAS_TOKENfeature flag inSystemConfigandL1Blockcontracts - Modified
OptimismPortal2,L2StandardBridge, andL2ToL1MessagePasserto reject ETH transfers when CGT is enabled - Extended test infrastructure to support CGT mode and added comprehensive test coverage
Reviewed changes
Copilot reviewed 109 out of 109 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/L2/NativeAssetLiquidity.sol |
New predeploy for managing native asset liquidity |
src/L2/LiquidityController.sol |
New predeploy for controlling liquidity minting/burning operations |
src/L2/L1BlockCGT.sol |
CGT-specific variant of L1Block with custom gas token support |
src/L2/L2ToL1MessagePasserCGT.sol |
CGT-specific variant blocking value transfers in CGT mode |
src/L1/OptimismPortal2.sol |
Added CGT checks to prevent ETH deposits/withdrawals |
src/L1/SystemConfig.sol |
Added isCustomGasToken() helper method |
src/libraries/Features.sol |
Added CUSTOM_GAS_TOKEN feature constant |
src/libraries/Predeploys.sol |
Added new predeploy addresses and support checks |
scripts/L2Genesis.s.sol |
Added CGT initialization logic |
op-deployer/pkg/deployer/state/chain_intent.go |
Added CGT configuration types and validation |
op-chain-ops/genesis/config.go |
Updated gas token configuration structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Looks like we need review from @ethereum-optimism/op-stack before we can merge |
Really looking forward to this feature. |
87d406d
|
Is it still not possible to test on Sepolia now? |
Description
Based on top of #17412
Enables OP Stack chains to use an asset other than ETH as their native fee currency by introducing a minimal, flexible, and standardizable Custom Gas Token (CGT) architecture. To do so, it introduces new predeploys (
NativeAssetLiquidityandLiquidityController) that decouple native asset management from core bridging operations while using a singleisCustomGasToken()flag that disables ETH transfer flows in all bridging methods. The two new pre-deploys manage the native asset supply.Tests
Core contracts:
OptimismPortalandL1Block: Tests forisCustomGasToken()flag blocking ETH deposits/withdrawalsNativeAssetLiquidity: Tests deposit/withdraw access control and functionalityLiquidityController: Tests minter authorization, mint/burn operations, and metadata functionsMetadata
Contributors