celo-org / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
3 stars 2 forks source link

Add CustomGasToken functionality #174

Open ezdac opened 1 week ago

ezdac commented 1 week ago

Implements #325

In order to run a local devnet with the custom gas-token functionality activated, the DEVNET_CELO=true and DEVNET_L2OO=true env-var has to be present when running the devnet scripts like DEVNET_CELO=true DEVNET_L2OO=true make devnet-up.

In order to activate the feature with the ERC20 token already deployed on L1, the deploy-config requires the parameters:

{ 
"useFaultProofs": "false",
"useCustomGasToken": "true",
"customGasTokenAddress": "0xFB11dFD1F793201e3b6e301332fC9Cc5cAe44338" 
}

given that the L1 ERC20 token is deployed at 0xFB11dFD1F793201e3b6e301332fC9Cc5cAe44338

If the L1 token should be deployed on L1 by the deploy script, the following parameters are required:

{ 
"useFaultProofs": "false",
"useCustomGasToken": "true",
"customGasTokenAddress": "0x0000000000000000000000000000000000000000" 
}

This means that this feature currently will not work with the newly added fault-proofs, mainly because the OptimismPortal2 has not been modified with the required changes yet.

socket-security[bot] commented 1 week ago

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/preset-env@7.24.7 environment, filesystem Transitive: shell, unsafe +102 10.8 MB nicolo-ribaudo
npm/babel-jest@29.7.0 environment Transitive: eval, filesystem, network, shell, unsafe +44 3.04 MB simenb
npm/jest@29.7.0 Transitive: environment, eval, filesystem, network, shell, unsafe +104 5.71 MB simenb
npm/reverse-mirage@1.1.0 environment 0 844 kB kyscott
npm/viem@2.13.1 network Transitive: environment +7 15.8 MB jmoxey

View full report↗︎

codecov-commenter commented 11 hours ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.32%. Comparing base (e120768) to head (27e0114).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## celo7 #174 +/- ## ======================================= Coverage 61.32% 61.32% ======================================= Files 20 20 Lines 1753 1753 Branches 71 71 ======================================= Hits 1075 1075 Misses 646 646 Partials 32 32 ``` | [Flag](https://app.codecov.io/gh/celo-org/optimism/pull/174/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org) | Coverage Δ | | |---|---|---| | [cannon-go-tests](https://app.codecov.io/gh/celo-org/optimism/pull/174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org) | `81.03% <ø> (ø)` | | | [chain-mon-tests](https://app.codecov.io/gh/celo-org/optimism/pull/174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org) | `27.14% <ø> (ø)` | | | [sdk-tests](https://app.codecov.io/gh/celo-org/optimism/pull/174/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org) | `16.44% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=celo-org#carryforward-flags-in-the-pull-request-comment) to find out more.
ezdac commented 9 hours ago

@pahor167 - @karlb updated the snapshots with the foundry version corresponding to the checked in version-lock, and now the CI checks pass.

One last thing regarding this PR: The newly added withdraw / deposit E2E test is currently not run in CI - do we want to include this as a CI job even though it is quite long-running and requires the devnet instantiation?