Skip to content

Commit

Permalink
custom-gas-token: add e2e test (ethereum-optimism#10440)
Browse files Browse the repository at this point in the history
* add tests for activating custom gas token and bridging tokens to l2

* update test following concurrent change in SystemConfig ABI

* update systemconfig bindings

steps to reproduce:

git checkout  v1.7.3 -- op-bindings

remove WETH9 from artifacts.json

cd op-bindings

make bindgen-generate-local

select this one file discard the others

* use require.NoError instead of require.Nil

* build: fix

* refactor using setup + subtests

* add assertions for WETH name and symbol getters

* minor changes in response to review

* devnet-allocs: use sender with known private key

some e2e tests require the ability to transact as the system owner safe owner, so we can't use the foundry default sender (private key unknown)

This uses the same address as "Deployer"

* use deployer as Safe owner

* WIP refactor test

* add most of the remaining test assertions

* rename file

* flatten out subtests

we want to specify a strict ordering of operations

* complete checkWithdrawal step

* reorder test steps

* check both ETH and token balances on l1 during withdraw

* simplify callViaSafe helper

* factor out expectations

* add some extra boilerplate to track TransactionDeposited event

and GasPayingTokenSet event on L2

* remove comments

* remove wayward line

* flatten out sub test

* add comment to devnet forge script command

* remove version check on systemConfig

* update systemconfig bindings

steps to reproduce:

git checkout  v1.7.3 -- op-bindings

remove WETH9 from artifacts.json

cd op-bindings

make bindgen-generate-local

select this one file discard the others

* skip TestCustomGasToken when UseFPAC is true

* use differente helper to skip test

* harmonize use of context.Background{}

* tidy up and add comments

* remove cfg.DeployConfig.FinalizationPeriodSeconds = 2

* remove log lines

* use decimal instead of hex

---------

Co-authored-by: Mark Tyneway <[email protected]>
  • Loading branch information
geoknee and tynes authored May 9, 2024
1 parent 1dd35b7 commit 4854ed9
Show file tree
Hide file tree
Showing 4 changed files with 519 additions and 67 deletions.
5 changes: 4 additions & 1 deletion bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ def devnet_l1_allocs(paths):

fqn = 'scripts/Deploy.s.sol:Deploy'
run_command([
'forge', 'script', fqn, "--sig", "runWithStateDump()"
# We need to set the sender here to an account we know the private key of,
# because the sender ends up being the owner of the ProxyAdmin SAFE
# (which we need to enable the Custom Gas Token feature).
'forge', 'script', fqn, "--sig", "runWithStateDump()", "--sender", "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
], env={
'DEPLOYMENT_OUTFILE': paths.l1_deployments_path,
'DEPLOY_CONFIG_PATH': paths.devnet_config_path,
Expand Down
130 changes: 65 additions & 65 deletions op-bindings/bindings/systemconfig.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion op-chain-ops/upgrades/l1.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,9 @@ func SystemConfig(batch *safe.Batch, implementations superchain.ImplementationLi
L1CrossDomainMessenger: common.Address(list.L1CrossDomainMessengerProxy),
L1ERC721Bridge: common.Address(list.L1ERC721BridgeProxy),
L1StandardBridge: common.Address(list.L1StandardBridgeProxy),
L2OutputOracle: common.Address(list.L2OutputOracleProxy),
OptimismPortal: common.Address(list.OptimismPortalProxy),
OptimismMintableERC20Factory: common.Address(list.OptimismMintableERC20FactoryProxy),
GasPayingToken: common.Address{},
},
)
if err != nil {
Expand Down
Loading

0 comments on commit 4854ed9

Please sign in to comment.