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