Skip to content

Conversation

blockchaindevsh
Copy link

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

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
@qizhou
Copy link

qizhou commented Mar 17, 2025

The title is incorrect: GCT => CGT

@blockchaindevsh blockchaindevsh changed the title Revert "contracts-bedrock: remove GCT code (#13921)" Revert "contracts-bedrock: remove CGT code (#13921)" Mar 17, 2025
@blockchaindevsh
Copy link
Author

The title is incorrect: GCT => CGT

Fixed, it was generated automatically.

@qzhodl
Copy link

qzhodl commented Mar 18, 2025

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?

@blockchaindevsh
Copy link
Author

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 beta_contracts pointing to the version for the contracts we're using.

@qzhodl
Copy link

qzhodl commented Mar 19, 2025

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 beta_contracts pointing to the version for the contracts we're using.

So what is the motivation of this change? Do we want to upgrade these change to the beta testnet?

@blockchaindevsh
Copy link
Author

blockchaindevsh commented Mar 19, 2025

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 beta_contracts pointing to the version for the contracts we're using.

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.

@qzhodl
Copy link

qzhodl commented Mar 19, 2025

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 beta_contracts pointing to the version for the contracts we're using.

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.

@blockchaindevsh
Copy link
Author

blockchaindevsh commented Mar 19, 2025

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.
So the contract changes are expected to be maintained like this:
After the develop version is tested, we cherry-pick the diffs to the corresponding contract release of upstream, to create our corresponding contract release.

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.

@blockchaindevsh
Copy link
Author

I'm now inclined to doing all reverting in this single PR since it'll be a big one anyway.

WDYT?

@qzhodl
Copy link

qzhodl commented Mar 20, 2025

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.

@blockchaindevsh
Copy link
Author

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.
Otherwise we can merge this PR as is, and apply the tests in a follow-up PR.

/// @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
Copy link

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?

Copy link
Author

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();
Copy link

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.

Copy link
Author

@blockchaindevsh blockchaindevsh Mar 20, 2025

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();
Copy link

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?

Copy link
Author

@blockchaindevsh blockchaindevsh Mar 21, 2025

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:

  1. It is supposed to be always "wrapped eth" among the super chains.
  2. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants