Commit c41dcf7a authored by Adrian Sutton's avatar Adrian Sutton Committed by GitHub

Switch devnet/e2e to default to using fault proofs (#10719)

* Introduce fast dispute game type

Avoids the need to change configuration to support fast withdrawals via fault proofs.

* e2e: Wait for game to become resolvable.

* Update kontrol snapshots.

* e2e: Set correct game type for proposer.

* challenger: Fast games are alphabet vm, not cannon.

* Set fast game clock duration to 0.

* Update snapshots again

* Use game type consistently.

* Switch devnet/e2e to default to using fault proofs

---------
Co-authored-by: default avatarrefcell <abigger87@gmail.com>
parent d87c88d5
...@@ -213,11 +213,11 @@ jobs: ...@@ -213,11 +213,11 @@ jobs:
FOUNDRY_PROFILE: ci FOUNDRY_PROFILE: ci
command: pnpm build command: pnpm build
- run: - run:
name: Generate FPAC allocs name: Generate L2OO allocs
command: DEVNET_FPAC="true" make devnet-allocs command: DEVNET_L2OO="true" make devnet-allocs
- run: - run:
name: Copy FPAC allocs to .devnet-fpac name: Copy L2OO allocs to .devnet-l2oo
command: cp -r .devnet/ .devnet-fault-proofs/ command: cp -r .devnet/ .devnet-l2oo/
- run: - run:
name: Generate Plasma allocs name: Generate Plasma allocs
command: DEVNET_PLASMA="true" make devnet-allocs command: DEVNET_PLASMA="true" make devnet-allocs
...@@ -231,7 +231,7 @@ jobs: ...@@ -231,7 +231,7 @@ jobs:
name: Copy Plasma allocs to .devnet-plasma name: Copy Plasma allocs to .devnet-plasma
command: cp -r .devnet/ .devnet-plasma-generic/ command: cp -r .devnet/ .devnet-plasma-generic/
- run: - run:
name: Generate non-FPAC allocs name: Generate default allocs
command: make devnet-allocs command: make devnet-allocs
- persist_to_workspace: - persist_to_workspace:
root: "." root: "."
...@@ -247,11 +247,11 @@ jobs: ...@@ -247,11 +247,11 @@ jobs:
- ".devnet/allocs-l2-delta.json" - ".devnet/allocs-l2-delta.json"
- ".devnet/allocs-l2-ecotone.json" - ".devnet/allocs-l2-ecotone.json"
- ".devnet/addresses.json" - ".devnet/addresses.json"
- ".devnet-fault-proofs/allocs-l1.json" - ".devnet-l2oo/allocs-l1.json"
- ".devnet-fault-proofs/addresses.json" - ".devnet-l2oo/addresses.json"
- ".devnet-fault-proofs/allocs-l2.json" - ".devnet-l2oo/allocs-l2.json"
- ".devnet-fault-proofs/allocs-l2-delta.json" - ".devnet-l2oo/allocs-l2-delta.json"
- ".devnet-fault-proofs/allocs-l2-ecotone.json" - ".devnet-l2oo/allocs-l2-ecotone.json"
- ".devnet-plasma/allocs-l1.json" - ".devnet-plasma/allocs-l1.json"
- ".devnet-plasma/addresses.json" - ".devnet-plasma/addresses.json"
- ".devnet-plasma/allocs-l2.json" - ".devnet-plasma/allocs-l2.json"
...@@ -936,7 +936,7 @@ jobs: ...@@ -936,7 +936,7 @@ jobs:
go-e2e-test: go-e2e-test:
parameters: parameters:
fpac: variant:
type: string type: string
default: '' default: ''
module: module:
...@@ -958,8 +958,8 @@ jobs: ...@@ -958,8 +958,8 @@ jobs:
type: string type: string
default: "" default: ""
environment: environment:
DEVNET_FPAC: 'false' DEVNET_L2OO: 'false'
OP_E2E_USE_FPAC: 'false' OP_E2E_USE_L2OO: 'false'
docker: docker:
- image: <<pipeline.parameters.ci_builder_image>> - image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge resource_class: xlarge
...@@ -968,17 +968,17 @@ jobs: ...@@ -968,17 +968,17 @@ jobs:
- checkout - checkout
- when: - when:
condition: condition:
equal: ['-fault-proofs', <<parameters.fpac>>] equal: ['-l2oo', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_FPAC = true name: Set DEVNET_L2OO = true
command: echo 'export DEVNET_FPAC=true' >> $BASH_ENV command: echo 'export DEVNET_L2OO=true' >> $BASH_ENV
- run: - run:
name: Set OP_E2E_USE_FPAC = true name: Set OP_E2E_USE_L2OO = true
command: echo 'export OP_E2E_USE_FPAC=true' >> $BASH_ENV command: echo 'export OP_E2E_USE_L2OO=true' >> $BASH_ENV
- when: - when:
condition: condition:
equal: ['-plasma', <<parameters.fpac>>] equal: ['-plasma', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set OP_E2E_USE_PLASMA = true name: Set OP_E2E_USE_PLASMA = true
...@@ -1000,11 +1000,11 @@ jobs: ...@@ -1000,11 +1000,11 @@ jobs:
name: Load devnet-allocs name: Load devnet-allocs
command: | command: |
mkdir -p .devnet mkdir -p .devnet
cp /tmp/workspace/.devnet<<parameters.fpac>>/allocs-l2.json .devnet/allocs-l2.json cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2.json .devnet/allocs-l2.json
cp /tmp/workspace/.devnet<<parameters.fpac>>/allocs-l2-delta.json .devnet/allocs-l2-delta.json cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-delta.json .devnet/allocs-l2-delta.json
cp /tmp/workspace/.devnet<<parameters.fpac>>/allocs-l2-ecotone.json .devnet/allocs-l2-ecotone.json cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l2-ecotone.json .devnet/allocs-l2-ecotone.json
cp /tmp/workspace/.devnet<<parameters.fpac>>/allocs-l1.json .devnet/allocs-l1.json cp /tmp/workspace/.devnet<<parameters.variant>>/allocs-l1.json .devnet/allocs-l1.json
cp /tmp/workspace/.devnet<<parameters.fpac>>/addresses.json .devnet/addresses.json cp /tmp/workspace/.devnet<<parameters.variant>>/addresses.json .devnet/addresses.json
cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json packages/contracts-bedrock/deploy-config/devnetL1.json cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json packages/contracts-bedrock/deploy-config/devnetL1.json
cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments/devnetL1 cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments/devnetL1
- run: - run:
...@@ -1027,6 +1027,9 @@ jobs: ...@@ -1027,6 +1027,9 @@ jobs:
- store_artifacts: - store_artifacts:
path: /testlogs path: /testlogs
when: always when: always
- store_artifacts:
path: /tmp/test-results
when: always
- store_test_results: - store_test_results:
path: /tmp/test-results path: /tmp/test-results
- when: - when:
...@@ -1084,12 +1087,12 @@ jobs: ...@@ -1084,12 +1087,12 @@ jobs:
indexer-tests: indexer-tests:
parameters: parameters:
fpac: variant:
type: string type: string
default: '' default: ''
environment: environment:
DEVNET_FPAC: 'false' DEVNET_L2OO: 'false'
OP_E2E_USE_FPAC: 'false' OP_E2E_USE_L2OO: 'false'
docker: docker:
- image: <<pipeline.parameters.ci_builder_image>> - image: <<pipeline.parameters.ci_builder_image>>
- image: cimg/postgres:14.1 - image: cimg/postgres:14.1
...@@ -1098,14 +1101,14 @@ jobs: ...@@ -1098,14 +1101,14 @@ jobs:
- checkout - checkout
- when: - when:
condition: condition:
equal: ['fault-proofs', <<parameters.fpac>>] equal: ['l2oo', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_FPAC = true name: Set DEVNET_L2OO = true
command: echo 'export DEVNET_FPAC=true' >> $BASH_ENV command: echo 'export DEVNET_L2OO=true' >> $BASH_ENV
- run: - run:
name: Set OP_E2E_USE_FPAC = true name: Set OP_E2E_USE_L2OO = true
command: echo 'export OP_E2E_USE_FPAC=true' >> $BASH_ENV command: echo 'export OP_E2E_USE_L2OO=true' >> $BASH_ENV
- check-changed: - check-changed:
patterns: indexer patterns: indexer
- run: - run:
...@@ -1257,33 +1260,33 @@ jobs: ...@@ -1257,33 +1260,33 @@ jobs:
machine: machine:
image: <<pipeline.parameters.base_image>> image: <<pipeline.parameters.base_image>>
parameters: parameters:
fpac: variant:
type: string type: string
environment: environment:
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
DEVNET_NO_BUILD: 'true' DEVNET_NO_BUILD: 'true'
# Default value; Can be overridden. # Default value; Can be overridden.
DEVNET_FPAC: 'false' DEVNET_L2OO: 'false'
DEVNET_PLASMA: 'false' DEVNET_PLASMA: 'false'
steps: steps:
- checkout - checkout
- when: - when:
condition: condition:
equal: ['fault-proofs', <<parameters.fpac>>] equal: ['l2oo', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_FPAC = true name: Set DEVNET_L2OO = true
command: echo 'export DEVNET_FPAC=true' >> $BASH_ENV command: echo 'export DEVNET_L2OO=true' >> $BASH_ENV
- when: - when:
condition: condition:
equal: ['plasma', <<parameters.fpac>>] equal: ['plasma', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_PLASMA = true name: Set DEVNET_PLASMA = true
command: echo 'export DEVNET_PLASMA=true' >> $BASH_ENV command: echo 'export DEVNET_PLASMA=true' >> $BASH_ENV
- when: - when:
condition: condition:
equal: ['plasma-generic', <<parameters.fpac>>] equal: ['plasma-generic', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_PLASMA = true name: Set DEVNET_PLASMA = true
...@@ -1341,11 +1344,11 @@ jobs: ...@@ -1341,11 +1344,11 @@ jobs:
- when: - when:
condition: condition:
not: not:
equal: ['legacy', <<parameters.fpac>>] equal: ['default', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Use non-legacy devnet allocs name: Use non-default devnet allocs
command: rm -r .devnet && mv .devnet-<<parameters.fpac>> .devnet command: rm -r .devnet && mv .devnet-<<parameters.variant>> .devnet
- run: - run:
name: Load and tag docker images name: Load and tag docker images
command: | command: |
...@@ -1700,10 +1703,10 @@ workflows: ...@@ -1700,10 +1703,10 @@ workflows:
binary_name: proxyd binary_name: proxyd
working_directory: proxyd working_directory: proxyd
- indexer-tests: - indexer-tests:
name: indexer-tests<< matrix.fpac >> name: indexer-tests<< matrix.variant >>
matrix: matrix:
parameters: parameters:
fpac: ["", "-fault-proofs"] variant: ["", "-l2oo"]
- semgrep-scan - semgrep-scan
- go-mod-download - go-mod-download
- fuzz-golang: - fuzz-golang:
...@@ -1779,10 +1782,10 @@ workflows: ...@@ -1779,10 +1782,10 @@ workflows:
module: op-service module: op-service
requires: ["go-mod-download"] requires: ["go-mod-download"]
- go-e2e-test: - go-e2e-test:
name: op-e2e-HTTP-tests<< matrix.fpac >> name: op-e2e-HTTP-tests<< matrix.variant >>
matrix: matrix:
parameters: parameters:
fpac: ["", "-fault-proofs"] variant: ["", "-l2oo"]
module: op-e2e module: op-e2e
target: test-http target: test-http
parallelism: 4 parallelism: 4
...@@ -1790,10 +1793,10 @@ workflows: ...@@ -1790,10 +1793,10 @@ workflows:
- go-mod-download - go-mod-download
- pnpm-monorepo - pnpm-monorepo
- go-e2e-test: - go-e2e-test:
name: op-e2e-action-tests<< matrix.fpac >> name: op-e2e-action-tests<< matrix.variant >>
matrix: matrix:
parameters: parameters:
fpac: ["", "-fault-proofs", "-plasma"] variant: ["", "-l2oo", "-plasma"]
module: op-e2e module: op-e2e
target: test-actions target: test-actions
parallelism: 1 parallelism: 1
...@@ -1888,7 +1891,7 @@ workflows: ...@@ -1888,7 +1891,7 @@ workflows:
- devnet: - devnet:
matrix: matrix:
parameters: parameters:
fpac: ["legacy", "fault-proofs", "plasma", "plasma-generic"] variant: ["default", "l2oo", "plasma", "plasma-generic"]
requires: requires:
- pnpm-monorepo - pnpm-monorepo
- op-batcher-docker-build - op-batcher-docker-build
......
...@@ -28,7 +28,7 @@ log = logging.getLogger() ...@@ -28,7 +28,7 @@ log = logging.getLogger()
# Global environment variables # Global environment variables
DEVNET_NO_BUILD = os.getenv('DEVNET_NO_BUILD') == "true" DEVNET_NO_BUILD = os.getenv('DEVNET_NO_BUILD') == "true"
DEVNET_FPAC = os.getenv('DEVNET_FPAC') == "true" DEVNET_L2OO = os.getenv('DEVNET_L2OO') == "true"
DEVNET_PLASMA = os.getenv('DEVNET_PLASMA') == "true" DEVNET_PLASMA = os.getenv('DEVNET_PLASMA') == "true"
GENERIC_PLASMA = os.getenv('GENERIC_PLASMA') == "true" GENERIC_PLASMA = os.getenv('GENERIC_PLASMA') == "true"
...@@ -130,8 +130,8 @@ def init_devnet_l1_deploy_config(paths, update_timestamp=False): ...@@ -130,8 +130,8 @@ def init_devnet_l1_deploy_config(paths, update_timestamp=False):
deploy_config = read_json(paths.devnet_config_template_path) deploy_config = read_json(paths.devnet_config_template_path)
if update_timestamp: if update_timestamp:
deploy_config['l1GenesisBlockTimestamp'] = '{:#x}'.format(int(time.time())) deploy_config['l1GenesisBlockTimestamp'] = '{:#x}'.format(int(time.time()))
if DEVNET_FPAC: if DEVNET_L2OO:
deploy_config['useFaultProofs'] = True deploy_config['useFaultProofs'] = False
if DEVNET_PLASMA: if DEVNET_PLASMA:
deploy_config['usePlasma'] = True deploy_config['usePlasma'] = True
if GENERIC_PLASMA: if GENERIC_PLASMA:
...@@ -184,10 +184,10 @@ def devnet_deploy(paths): ...@@ -184,10 +184,10 @@ def devnet_deploy(paths):
log.info('L1 genesis already generated.') log.info('L1 genesis already generated.')
else: else:
log.info('Generating L1 genesis.') log.info('Generating L1 genesis.')
if not os.path.exists(paths.allocs_l1_path) or DEVNET_FPAC or DEVNET_PLASMA: if not os.path.exists(paths.allocs_l1_path) or DEVNET_L2OO or DEVNET_PLASMA:
# If this is the FPAC devnet then we need to generate the allocs # If this is a devnet variant then we need to generate the allocs
# file here always. This is because CI will run devnet-allocs # file here always. This is because CI will run devnet-allocs
# without DEVNET_FPAC=true which means the allocs will be wrong. # without setting the appropriate env var which means the allocs will be wrong.
# Re-running this step means the allocs will be correct. # Re-running this step means the allocs will be correct.
devnet_l1_allocs(paths) devnet_l1_allocs(paths)
else: else:
...@@ -219,9 +219,9 @@ def devnet_deploy(paths): ...@@ -219,9 +219,9 @@ def devnet_deploy(paths):
else: else:
log.info('Generating L2 genesis and rollup configs.') log.info('Generating L2 genesis and rollup configs.')
l2_allocs_path = pjoin(paths.devnet_dir, 'allocs-l2.json') l2_allocs_path = pjoin(paths.devnet_dir, 'allocs-l2.json')
if os.path.exists(l2_allocs_path) == False or DEVNET_FPAC == True: if os.path.exists(l2_allocs_path) == False or DEVNET_L2OO == True:
# Also regenerate if FPAC. # Also regenerate if L2OO.
# The FPAC flag may affect the L1 deployments addresses, which may affect the L2 genesis. # The L2OO flag may affect the L1 deployments addresses, which may affect the L2 genesis.
devnet_l2_allocs(paths) devnet_l2_allocs(paths)
else: else:
log.info('Re-using existing L2 allocs.') log.info('Re-using existing L2 allocs.')
...@@ -263,14 +263,14 @@ def devnet_deploy(paths): ...@@ -263,14 +263,14 @@ def devnet_deploy(paths):
'SEQUENCER_BATCH_INBOX_ADDRESS': batch_inbox_address 'SEQUENCER_BATCH_INBOX_ADDRESS': batch_inbox_address
} }
# Selectively set the L2OO_ADDRESS or DGF_ADDRESS if using FPAC. # Selectively set the L2OO_ADDRESS or DGF_ADDRESS if using L2OO.
# Must be done selectively because op-proposer throws if both are set. # Must be done selectively because op-proposer throws if both are set.
if DEVNET_FPAC: if DEVNET_L2OO:
docker_env['L2OO_ADDRESS'] = l2_output_oracle
else:
docker_env['DGF_ADDRESS'] = dispute_game_factory docker_env['DGF_ADDRESS'] = dispute_game_factory
docker_env['DG_TYPE'] = '254' docker_env['DG_TYPE'] = '254'
docker_env['PROPOSAL_INTERVAL'] = '10s' docker_env['PROPOSAL_INTERVAL'] = '10s'
else:
docker_env['L2OO_ADDRESS'] = l2_output_oracle
if DEVNET_PLASMA: if DEVNET_PLASMA:
docker_env['PLASMA_ENABLED'] = 'true' docker_env['PLASMA_ENABLED'] = 'true'
...@@ -290,7 +290,7 @@ def devnet_deploy(paths): ...@@ -290,7 +290,7 @@ def devnet_deploy(paths):
run_command(['docker', 'compose', 'up', '-d', 'op-node', 'op-proposer', 'op-batcher', 'artifact-server'], cwd=paths.ops_bedrock_dir, env=docker_env) run_command(['docker', 'compose', 'up', '-d', 'op-node', 'op-proposer', 'op-batcher', 'artifact-server'], cwd=paths.ops_bedrock_dir, env=docker_env)
# Optionally bring up op-challenger. # Optionally bring up op-challenger.
if DEVNET_FPAC: if not DEVNET_L2OO:
log.info('Bringing up `op-challenger`.') log.info('Bringing up `op-challenger`.')
run_command(['docker', 'compose', 'up', '-d', 'op-challenger'], cwd=paths.ops_bedrock_dir, env=docker_env) run_command(['docker', 'compose', 'up', '-d', 'op-challenger'], cwd=paths.ops_bedrock_dir, env=docker_env)
......
...@@ -65,7 +65,7 @@ func TestE2EETL(t *testing.T) { ...@@ -65,7 +65,7 @@ func TestE2EETL(t *testing.T) {
require.NoError(t, wait.For(context.Background(), time.Second, func() (bool, error) { require.NoError(t, wait.For(context.Background(), time.Second, func() (bool, error) {
var l2Height *big.Int var l2Height *big.Int
var err error var err error
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
gameCount, err := disputeGameFactory.GameCount(&bind.CallOpts{Context: context.Background()}) gameCount, err := disputeGameFactory.GameCount(&bind.CallOpts{Context: context.Background()})
require.NoError(t, err) require.NoError(t, err)
if gameCount.Cmp(big.NewInt(0)) == 0 { if gameCount.Cmp(big.NewInt(0)) == 0 {
......
...@@ -100,7 +100,7 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl ...@@ -100,7 +100,7 @@ func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Cl
var l2OutputOracle *bindings.L2OutputOracleCaller var l2OutputOracle *bindings.L2OutputOracleCaller
var disputeGameFactory *bindings.DisputeGameFactoryCaller var disputeGameFactory *bindings.DisputeGameFactoryCaller
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
disputeGameFactory, err = bindings.NewDisputeGameFactoryCaller(*cfg.DisputeGameFactoryAddr, l1) disputeGameFactory, err = bindings.NewDisputeGameFactoryCaller(*cfg.DisputeGameFactoryAddr, l1)
require.NoError(t, err) require.NoError(t, err)
} else { } else {
...@@ -137,7 +137,7 @@ func (p *L2Proposer) sendTx(t Testing, data []byte) { ...@@ -137,7 +137,7 @@ func (p *L2Proposer) sendTx(t Testing, data []byte) {
require.NoError(t, err) require.NoError(t, err)
var addr common.Address var addr common.Address
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
addr = *p.disputeGameFactoryAddr addr = *p.disputeGameFactoryAddr
} else { } else {
addr = *p.l2OutputOracleAddr addr = *p.l2OutputOracleAddr
...@@ -205,7 +205,7 @@ func toCallArg(msg ethereum.CallMsg) interface{} { ...@@ -205,7 +205,7 @@ func toCallArg(msg ethereum.CallMsg) interface{} {
} }
func (p *L2Proposer) fetchNextOutput(t Testing) (*eth.OutputResponse, bool, error) { func (p *L2Proposer) fetchNextOutput(t Testing) (*eth.OutputResponse, bool, error) {
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
blockNumber, err := p.driver.FetchCurrentBlockNumber(t.Ctx()) blockNumber, err := p.driver.FetchCurrentBlockNumber(t.Ctx())
if err != nil { if err != nil {
return nil, false, err return nil, false, err
...@@ -247,7 +247,7 @@ func (p *L2Proposer) ActMakeProposalTx(t Testing) { ...@@ -247,7 +247,7 @@ func (p *L2Proposer) ActMakeProposalTx(t Testing) {
} }
var txData []byte var txData []byte
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
txData, _, err = p.driver.ProposeL2OutputDGFTxData(output) txData, _, err = p.driver.ProposeL2OutputDGFTxData(output)
require.NoError(t, err) require.NoError(t, err)
} else { } else {
......
...@@ -56,7 +56,7 @@ func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { ...@@ -56,7 +56,7 @@ func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) rollupSeqCl, miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg))
var proposer *L2Proposer var proposer *L2Proposer
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient()) optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient())
require.NoError(t, err) require.NoError(t, err)
respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{}) respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{})
...@@ -113,7 +113,7 @@ func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { ...@@ -113,7 +113,7 @@ func RunProposerTest(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
} }
// check that L1 stored the expected output root // check that L1 stored the expected output root
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient()) optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient())
require.NoError(t, err) require.NoError(t, err)
respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{}) respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{})
......
...@@ -419,7 +419,7 @@ func (s *CrossLayerUser) getLatestWithdrawalParams(t Testing) (*withdrawals.Prov ...@@ -419,7 +419,7 @@ func (s *CrossLayerUser) getLatestWithdrawalParams(t Testing) (*withdrawals.Prov
var l2OutputBlockNr *big.Int var l2OutputBlockNr *big.Int
var l2OutputBlock *types.Block var l2OutputBlock *types.Block
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
latestGame, err := withdrawals.FindLatestGame(t.Ctx(), &s.L1.env.Bindings.DisputeGameFactory.DisputeGameFactoryCaller, &s.L1.env.Bindings.OptimismPortal2.OptimismPortal2Caller) latestGame, err := withdrawals.FindLatestGame(t.Ctx(), &s.L1.env.Bindings.DisputeGameFactory.DisputeGameFactoryCaller, &s.L1.env.Bindings.OptimismPortal2.OptimismPortal2Caller)
require.NoError(t, err) require.NoError(t, err)
l2OutputBlockNr = new(big.Int).SetBytes(latestGame.ExtraData[0:32]) l2OutputBlockNr = new(big.Int).SetBytes(latestGame.ExtraData[0:32])
...@@ -436,7 +436,7 @@ func (s *CrossLayerUser) getLatestWithdrawalParams(t Testing) (*withdrawals.Prov ...@@ -436,7 +436,7 @@ func (s *CrossLayerUser) getLatestWithdrawalParams(t Testing) (*withdrawals.Prov
return nil, fmt.Errorf("the latest L2 output is %d and is not past L2 block %d that includes the withdrawal yet, no withdrawal can be proved yet", l2OutputBlock.NumberU64(), l2WithdrawalBlock.NumberU64()) return nil, fmt.Errorf("the latest L2 output is %d and is not past L2 block %d that includes the withdrawal yet, no withdrawal can be proved yet", l2OutputBlock.NumberU64(), l2WithdrawalBlock.NumberU64())
} }
if !e2eutils.UseFPAC() { if !e2eutils.UseFaultProofs() {
finalizationPeriod, err := s.L1.env.Bindings.L2OutputOracle.FINALIZATIONPERIODSECONDS(&bind.CallOpts{}) finalizationPeriod, err := s.L1.env.Bindings.L2OutputOracle.FINALIZATIONPERIODSECONDS(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
l1Head, err := s.L1.env.EthCl.HeaderByNumber(t.Ctx(), nil) l1Head, err := s.L1.env.EthCl.HeaderByNumber(t.Ctx(), nil)
......
...@@ -136,7 +136,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) { ...@@ -136,7 +136,7 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) {
seq.RollupClient(), miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg)) seq.RollupClient(), miner.EthClient(), seqEngine.EthClient(), seqEngine.EngineClient(t, sd.RollupCfg))
var proposer *L2Proposer var proposer *L2Proposer
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient()) optimismPortal2Contract, err := bindingspreview.NewOptimismPortal2(sd.DeploymentsL1.OptimismPortalProxy, miner.EthClient())
require.NoError(t, err) require.NoError(t, err)
respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{}) respectedGameType, err := optimismPortal2Contract.RespectedGameType(&bind.CallOpts{})
...@@ -285,8 +285,8 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) { ...@@ -285,8 +285,8 @@ func runCrossLayerUserTest(gt *testing.T, test hardforkScheduledTest) {
miner.ActL1StartBlock(13)(t) miner.ActL1StartBlock(13)(t)
miner.ActL1EndBlock(t) miner.ActL1EndBlock(t)
// If using FPAC we need to resolve the game // If using fault proofs we need to resolve the game
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
// Resolve the root claim // Resolve the root claim
alice.ActResolveClaim(t) alice.ActResolveClaim(t)
miner.ActL1StartBlock(12)(t) miner.ActL1StartBlock(12)(t)
......
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
) )
func TestCustomGasToken(t *testing.T) { func TestCustomGasToken(t *testing.T) {
InitParallel(t, SkipOnFPAC) // Custom Gas Token feature is not yet compatible with FPAC InitParallel(t, SkipOnFaultProofs) // Custom Gas Token feature is not yet compatible with fault proofs
cfg := DefaultSystemConfig(t) cfg := DefaultSystemConfig(t)
offset := hexutil.Uint64(0) offset := hexutil.Uint64(0)
...@@ -175,7 +175,7 @@ func TestCustomGasToken(t *testing.T) { ...@@ -175,7 +175,7 @@ func TestCustomGasToken(t *testing.T) {
proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice) proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice)
finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice) finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice)
fees = new(big.Int).Add(proveFee, finalizeFee) fees = new(big.Int).Add(proveFee, finalizeFee)
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice) resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice)
resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice) resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice)
fees = new(big.Int).Add(fees, resolveClaimFee) fees = new(big.Int).Add(fees, resolveClaimFee)
......
...@@ -228,8 +228,12 @@ func ApplyDeployConfigForks(deployConfig *genesis.DeployConfig) { ...@@ -228,8 +228,12 @@ func ApplyDeployConfigForks(deployConfig *genesis.DeployConfig) {
deployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64) deployConfig.L2GenesisRegolithTimeOffset = new(hexutil.Uint64)
} }
func UseFPAC() bool { func UseFaultProofs() bool {
return os.Getenv("OP_E2E_USE_FPAC") == "true" return !UseL2OO()
}
func UseL2OO() bool {
return os.Getenv("OP_E2E_USE_L2OO") == "true"
} }
func UsePlasma() bool { func UsePlasma() bool {
......
...@@ -47,15 +47,15 @@ func UsesCannon(t e2eutils.TestingBase) { ...@@ -47,15 +47,15 @@ func UsesCannon(t e2eutils.TestingBase) {
} }
} }
func SkipOnFPAC(t e2eutils.TestingBase) { func SkipOnFaultProofs(t e2eutils.TestingBase) {
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
t.Skip("Skipping test for FPAC") t.Skip("Skipping test for fault proofs")
} }
} }
func SkipOnNotFPAC(t e2eutils.TestingBase) { func SkipOnL2OO(t e2eutils.TestingBase) {
if !e2eutils.UseFPAC() { if e2eutils.UseL2OO() {
t.Skip("Skipping test for non-FPAC") t.Skip("Skipping test for L2OO")
} }
} }
......
...@@ -776,7 +776,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste ...@@ -776,7 +776,7 @@ func (cfg SystemConfig) Start(t *testing.T, _opts ...SystemConfigOption) (*Syste
// L2Output Submitter // L2Output Submitter
var proposerCLIConfig *l2os.CLIConfig var proposerCLIConfig *l2os.CLIConfig
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
proposerCLIConfig = &l2os.CLIConfig{ proposerCLIConfig = &l2os.CLIConfig{
L1EthRpc: sys.EthInstances["l1"].WSEndpoint(), L1EthRpc: sys.EthInstances["l1"].WSEndpoint(),
RollupRpc: sys.RollupNodes["sequencer"].HTTPEndpoint(), RollupRpc: sys.RollupNodes["sequencer"].HTTPEndpoint(),
......
...@@ -90,7 +90,7 @@ func TestMain(m *testing.M) { ...@@ -90,7 +90,7 @@ func TestMain(m *testing.M) {
} }
func TestL2OutputSubmitter(t *testing.T) { func TestL2OutputSubmitter(t *testing.T) {
InitParallel(t, SkipOnFPAC) InitParallel(t, SkipOnFaultProofs)
cfg := DefaultSystemConfig(t) cfg := DefaultSystemConfig(t)
cfg.NonFinalizedProposals = true // speed up the time till we see output proposals cfg.NonFinalizedProposals = true // speed up the time till we see output proposals
...@@ -158,8 +158,8 @@ func TestL2OutputSubmitter(t *testing.T) { ...@@ -158,8 +158,8 @@ func TestL2OutputSubmitter(t *testing.T) {
} }
} }
func TestL2OutputSubmitterFPAC(t *testing.T) { func TestL2OutputSubmitterFaultProofs(t *testing.T) {
InitParallel(t, SkipOnNotFPAC) InitParallel(t, SkipOnL2OO)
cfg := DefaultSystemConfig(t) cfg := DefaultSystemConfig(t)
cfg.NonFinalizedProposals = true // speed up the time till we see output proposals cfg.NonFinalizedProposals = true // speed up the time till we see output proposals
...@@ -1150,7 +1150,7 @@ func TestWithdrawals(t *testing.T) { ...@@ -1150,7 +1150,7 @@ func TestWithdrawals(t *testing.T) {
proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice) proveFee := new(big.Int).Mul(new(big.Int).SetUint64(proveReceipt.GasUsed), proveReceipt.EffectiveGasPrice)
finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice) finalizeFee := new(big.Int).Mul(new(big.Int).SetUint64(finalizeReceipt.GasUsed), finalizeReceipt.EffectiveGasPrice)
fees = new(big.Int).Add(proveFee, finalizeFee) fees = new(big.Int).Add(proveFee, finalizeFee)
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice) resolveClaimFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveClaimReceipt.GasUsed), resolveClaimReceipt.EffectiveGasPrice)
resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice) resolveFee := new(big.Int).Mul(new(big.Int).SetUint64(resolveReceipt.GasUsed), resolveReceipt.EffectiveGasPrice)
fees = new(big.Int).Add(fees, resolveClaimFee) fees = new(big.Int).Add(fees, resolveClaimFee)
......
...@@ -549,7 +549,7 @@ func TestMixedWithdrawalValidity(t *testing.T) { ...@@ -549,7 +549,7 @@ func TestMixedWithdrawalValidity(t *testing.T) {
// Wait for the finalization period, then we can finalize this withdrawal. // Wait for the finalization period, then we can finalize this withdrawal.
require.NotEqual(t, cfg.L1Deployments.L2OutputOracleProxy, common.Address{}) require.NotEqual(t, cfg.L1Deployments.L2OutputOracleProxy, common.Address{})
var blockNumber uint64 var blockNumber uint64
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
blockNumber, err = wait.ForGamePublished(ctx, l1Client, cfg.L1Deployments.OptimismPortalProxy, cfg.L1Deployments.DisputeGameFactoryProxy, receipt.BlockNumber) blockNumber, err = wait.ForGamePublished(ctx, l1Client, cfg.L1Deployments.OptimismPortalProxy, cfg.L1Deployments.DisputeGameFactoryProxy, receipt.BlockNumber)
} else { } else {
blockNumber, err = wait.ForOutputRootPublished(ctx, l1Client, cfg.L1Deployments.L2OutputOracleProxy, receipt.BlockNumber) blockNumber, err = wait.ForOutputRootPublished(ctx, l1Client, cfg.L1Deployments.L2OutputOracleProxy, receipt.BlockNumber)
...@@ -655,7 +655,7 @@ func TestMixedWithdrawalValidity(t *testing.T) { ...@@ -655,7 +655,7 @@ func TestMixedWithdrawalValidity(t *testing.T) {
} else { } else {
require.NoError(t, err) require.NoError(t, err)
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
// Start a challenger to resolve claims and games once the clock expires // Start a challenger to resolve claims and games once the clock expires
factoryHelper := disputegame.NewFactoryHelper(t, ctx, sys) factoryHelper := disputegame.NewFactoryHelper(t, ctx, sys)
factoryHelper.StartChallenger(ctx, "Challenger", factoryHelper.StartChallenger(ctx, "Challenger",
...@@ -683,7 +683,7 @@ func TestMixedWithdrawalValidity(t *testing.T) { ...@@ -683,7 +683,7 @@ func TestMixedWithdrawalValidity(t *testing.T) {
// Wait for finalization and then create the Finalized Withdrawal Transaction // Wait for finalization and then create the Finalized Withdrawal Transaction
ctx, withdrawalCancel := context.WithTimeout(context.Background(), 60*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second) ctx, withdrawalCancel := context.WithTimeout(context.Background(), 60*time.Duration(cfg.DeployConfig.L1BlockTime)*time.Second)
defer withdrawalCancel() defer withdrawalCancel()
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
err = wait.ForWithdrawalCheck(ctx, l1Client, withdrawal, cfg.L1Deployments.OptimismPortalProxy, transactor.Account.L1Opts.From) err = wait.ForWithdrawalCheck(ctx, l1Client, withdrawal, cfg.L1Deployments.OptimismPortalProxy, transactor.Account.L1Opts.From)
require.NoError(t, err) require.NoError(t, err)
} else { } else {
......
...@@ -103,7 +103,7 @@ func ProveWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2N ...@@ -103,7 +103,7 @@ func ProveWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2N
l1Client := clients.NodeClient("l1") l1Client := clients.NodeClient("l1")
var blockNumber uint64 var blockNumber uint64
var err error var err error
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
blockNumber, err = wait.ForGamePublished(ctx, l1Client, config.L1Deployments.OptimismPortalProxy, config.L1Deployments.DisputeGameFactoryProxy, l2WithdrawalReceipt.BlockNumber) blockNumber, err = wait.ForGamePublished(ctx, l1Client, config.L1Deployments.OptimismPortalProxy, config.L1Deployments.DisputeGameFactoryProxy, l2WithdrawalReceipt.BlockNumber)
require.Nil(t, err) require.Nil(t, err)
} else { } else {
...@@ -164,8 +164,8 @@ func ProveWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2N ...@@ -164,8 +164,8 @@ func ProveWithdrawal(t *testing.T, cfg SystemConfig, clients ClientProvider, l2N
} }
func ProveWithdrawalParameters(ctx context.Context, proofCl withdrawals.ProofClient, l2ReceiptCl withdrawals.ReceiptClient, l2BlockCl withdrawals.BlockClient, txHash common.Hash, header *types.Header, l2OutputOracleContract *bindings.L2OutputOracleCaller, disputeGameFactoryContract *bindings.DisputeGameFactoryCaller, optimismPortal2Contract *bindingspreview.OptimismPortal2Caller) (withdrawals.ProvenWithdrawalParameters, error) { func ProveWithdrawalParameters(ctx context.Context, proofCl withdrawals.ProofClient, l2ReceiptCl withdrawals.ReceiptClient, l2BlockCl withdrawals.BlockClient, txHash common.Hash, header *types.Header, l2OutputOracleContract *bindings.L2OutputOracleCaller, disputeGameFactoryContract *bindings.DisputeGameFactoryCaller, optimismPortal2Contract *bindingspreview.OptimismPortal2Caller) (withdrawals.ProvenWithdrawalParameters, error) {
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
return withdrawals.ProveWithdrawalParametersFPAC(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, disputeGameFactoryContract, optimismPortal2Contract) return withdrawals.ProveWithdrawalParametersFaultProofs(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, disputeGameFactoryContract, optimismPortal2Contract)
} else { } else {
return withdrawals.ProveWithdrawalParameters(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, header, l2OutputOracleContract) return withdrawals.ProveWithdrawalParameters(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, header, l2OutputOracleContract)
} }
...@@ -190,7 +190,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie ...@@ -190,7 +190,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie
var resolveClaimReceipt *types.Receipt var resolveClaimReceipt *types.Receipt
var resolveReceipt *types.Receipt var resolveReceipt *types.Receipt
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
portal2, err := bindingspreview.NewOptimismPortal2(config.L1Deployments.OptimismPortalProxy, l1Client) portal2, err := bindingspreview.NewOptimismPortal2(config.L1Deployments.OptimismPortalProxy, l1Client)
require.Nil(t, err) require.Nil(t, err)
...@@ -231,7 +231,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie ...@@ -231,7 +231,7 @@ func FinalizeWithdrawal(t *testing.T, cfg SystemConfig, l1Client *ethclient.Clie
require.Equal(t, types.ReceiptStatusSuccessful, resolveReceipt.Status) require.Equal(t, types.ReceiptStatusSuccessful, resolveReceipt.Status)
} }
if e2eutils.UseFPAC() { if e2eutils.UseFaultProofs() {
err := wait.ForWithdrawalCheck(ctx, l1Client, wd, config.L1Deployments.OptimismPortalProxy, opts.From) err := wait.ForWithdrawalCheck(ctx, l1Client, wd, config.L1Deployments.OptimismPortalProxy, opts.From)
require.Nil(t, err) require.Nil(t, err)
} else { } else {
......
...@@ -57,8 +57,8 @@ func ProveWithdrawalParameters(ctx context.Context, proofCl ProofClient, l2Recei ...@@ -57,8 +57,8 @@ func ProveWithdrawalParameters(ctx context.Context, proofCl ProofClient, l2Recei
return ProveWithdrawalParametersForBlock(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, l2BlockNumber, l2OutputIndex) return ProveWithdrawalParametersForBlock(ctx, proofCl, l2ReceiptCl, l2BlockCl, txHash, l2BlockNumber, l2OutputIndex)
} }
// ProveWithdrawalParametersFPAC calls ProveWithdrawalParametersForBlock with the most recent L2 output after the latest game. // ProveWithdrawalParametersFaultProofs calls ProveWithdrawalParametersForBlock with the most recent L2 output after the latest game.
func ProveWithdrawalParametersFPAC(ctx context.Context, proofCl ProofClient, l2ReceiptCl ReceiptClient, l2BlockCl BlockClient, txHash common.Hash, disputeGameFactoryContract *bindings.DisputeGameFactoryCaller, optimismPortal2Contract *bindingspreview.OptimismPortal2Caller) (ProvenWithdrawalParameters, error) { func ProveWithdrawalParametersFaultProofs(ctx context.Context, proofCl ProofClient, l2ReceiptCl ReceiptClient, l2BlockCl BlockClient, txHash common.Hash, disputeGameFactoryContract *bindings.DisputeGameFactoryCaller, optimismPortal2Contract *bindingspreview.OptimismPortal2Caller) (ProvenWithdrawalParameters, error) {
latestGame, err := FindLatestGame(ctx, disputeGameFactoryContract, optimismPortal2Contract) latestGame, err := FindLatestGame(ctx, disputeGameFactoryContract, optimismPortal2Contract)
if err != nil { if err != nil {
return ProvenWithdrawalParameters{}, fmt.Errorf("failed to find latest game: %w", err) return ProvenWithdrawalParameters{}, fmt.Errorf("failed to find latest game: %w", err)
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
"proofMaturityDelaySeconds": 12, "proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6, "disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 254, "respectedGameType": 254,
"useFaultProofs": false, "useFaultProofs": true,
"usePlasma": false, "usePlasma": false,
"daCommitmentType": "KeccakCommitment", "daCommitmentType": "KeccakCommitment",
"daChallengeWindow": 160, "daChallengeWindow": 160,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment