-
Notifications
You must be signed in to change notification settings - Fork 0
Revert "contracts-bedrock: remove CGT code (#13921)" #29
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: op-es
Are you sure you want to change the base?
Conversation
This reverts commit ef03df7. Conflicts: packages/contracts-bedrock/snapshots/.gas-snapshot packages/contracts-bedrock/snapshots/semver-lock.json packages/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol packages/contracts-bedrock/src/L1/L1StandardBridge.sol packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol packages/contracts-bedrock/src/L1/SystemConfigInterop.sol
The title is incorrect: GCT => CGT |
Fixed, it was generated automatically. |
Do we want to maintain a separate branch to store the contract code we are using (similar to how Celo does it), or should we keep the old contract code in the default branch and merge upstream changes as needed? |
There's a tag |
So what is the motivation of this change? Do we want to upgrade these change to the beta testnet? |
This change is only for the develop version. We can create a new release version after the develop version is thoroughly tested. AFAIK there's no project doing overall contracts upgrades besides the super chains right now. Most probably the new release will be used to deploy a new testnet. |
I think if we plan to use the latest contract code for the upcoming mainnet launch, we may need to consider the testnet strategy. We have two options: either upgrade the contract on the beta testnet or deploy a new testnet specifically for validation. Additionally, have we successfully passed the CircleCI tests for this PR? It would also be beneficial to include details in the PR description about the types of tests conducted to validate these changes. |
When we merge with upstream, the contracts are automatically merged to the latest develop version. The test PRs are yet to come, in order to make this PR not too big. There're 3 upstream PRs in total related with CGT as posted in our group. |
I'm now inclined to doing all reverting in this single PR since it'll be a big one anyway. WDYT? |
It is a really big PR and it would be more convenient for me (any opinions from other reviewers?) if it is possible to divide it into smaller ones. |
The other two PRs are tests for CGT, so if we want this PR to be tested before merging, we have to include them here. |
/// @notice Semantic version. | ||
/// @custom:semver 1.0.0-beta.6 | ||
string public constant version = "1.0.0-beta.6"; | ||
/// @custom:semver 1.0.0-beta.5 |
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.
Why are we downgrading the version number?
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.
It's done automatically when reverting a commit, it should be ok since we're not using the version and it'll be recovered next time we merge with upstream.
/// @notice Allows an address to lock ETH liquidity into this contract. | ||
function burn() external payable { | ||
if (msg.sender != Predeploys.SUPERCHAIN_WETH) revert Unauthorized(); | ||
if (IL1Block(Predeploys.L1_BLOCK_ATTRIBUTES).isCustomGasToken()) revert NotCustomGasToken(); |
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.
Is it possible that even if we reintroduce the CGT feature in the latest version, it still won’t function properly due to numerous revert conditions throughout the code? Additionally, since CGT has been removed, future updates may not consider this case, making the added feature incompatible with CGT.
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.
Yes, it's possible, but hopefully will be caught by the other 2 test PRs, especially the e2e test. But yeah it can happen that even the test passes, there're still cases not caught.
We are quite sure that CGT is working for Holocene, but may be left out in subsequent HF. So in the future if we want to enable new HFs, we may need to manually port CGT feature&tests to the new forks.
|
||
/// @inheritdoc WETH98 | ||
function deposit() public payable override { | ||
if (IL1Block(Predeploys.L1_BLOCK_ATTRIBUTES).isCustomGasToken()) revert NotCustomGasToken(); |
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 is the relationship between CGT and SuperchainWETH (is it related to interoperability)?
Does it imply that an L2 with CGT enabled cannot join the Superchain ecosystem?
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.
I think SuperchainWETH
has some assumptions here:
- It is supposed to be always "wrapped eth" among the super chains.
- The native token on L2 is supposed to be ETH.
The assumptions don't hold when CGT is enabled. I remember previously @yazhenwish mentioned super chains can not have code change?
This reverts commit ef03df7, thus re-enables CGT.
Conflicts:
packages/contracts-bedrock/snapshots/.gas-snapshot
packages/contracts-bedrock/snapshots/semver-lock.json
packages/contracts-bedrock/src/L1/L1CrossDomainMessenger.sol
packages/contracts-bedrock/src/L1/L1StandardBridge.sol
packages/contracts-bedrock/src/L1/OptimismPortalInterop.sol
packages/contracts-bedrock/src/L1/SystemConfigInterop.sol