Commit 0bb2ff57 authored by Sam Stokes's avatar Sam Stokes Committed by GitHub

repo: rename plasma --> altDA (#11370)

* update superchain-registry import

* replace all plasma with altda

* replace plasma with altda in filenames

* contracts: update snapshots

* go: update superchain import

* go: update superchain import after rebase

* go: run mod tidy

* op-batcher: fix altda env vars passed in devnet docker-compose

* go: update superchain import

* go: use main commit for superchain import
parent eaed52d1
...@@ -207,17 +207,17 @@ jobs: ...@@ -207,17 +207,17 @@ jobs:
name: Copy L2OO allocs to .devnet-l2oo name: Copy L2OO allocs to .devnet-l2oo
command: cp -r .devnet/ .devnet-l2oo/ command: cp -r .devnet/ .devnet-l2oo/
- run: - run:
name: Generate Plasma allocs name: Generate AltDA allocs
command: DEVNET_PLASMA="true" make devnet-allocs command: DEVNET_ALTDA="true" make devnet-allocs
- run: - run:
name: Copy Plasma allocs to .devnet-plasma name: Copy AltDA allocs to .devnet-altda
command: cp -r .devnet/ .devnet-plasma/ command: cp -r .devnet/ .devnet-altda/
- run: - run:
name: Generate Generic Plasma allocs name: Generate Generic AltDA allocs
command: DEVNET_PLASMA="true" GENERIC_PLASMA="true" make devnet-allocs command: DEVNET_ALTDA="true" GENERIC_ALTDA="true" make devnet-allocs
- run: - run:
name: Copy Plasma allocs to .devnet-plasma name: Copy AltDA allocs to .devnet-altda
command: cp -r .devnet/ .devnet-plasma-generic/ command: cp -r .devnet/ .devnet-altda-generic/
- run: - run:
name: Generate default allocs name: Generate default allocs
command: make devnet-allocs command: make devnet-allocs
...@@ -239,18 +239,18 @@ jobs: ...@@ -239,18 +239,18 @@ jobs:
- ".devnet-l2oo/allocs-l2-ecotone.json" - ".devnet-l2oo/allocs-l2-ecotone.json"
- ".devnet-l2oo/allocs-l2-fjord.json" - ".devnet-l2oo/allocs-l2-fjord.json"
- ".devnet-l2oo/allocs-l2-granite.json" - ".devnet-l2oo/allocs-l2-granite.json"
- ".devnet-plasma/allocs-l1.json" - ".devnet-altda/allocs-l1.json"
- ".devnet-plasma/addresses.json" - ".devnet-altda/addresses.json"
- ".devnet-plasma/allocs-l2-delta.json" - ".devnet-altda/allocs-l2-delta.json"
- ".devnet-plasma/allocs-l2-ecotone.json" - ".devnet-altda/allocs-l2-ecotone.json"
- ".devnet-plasma/allocs-l2-fjord.json" - ".devnet-altda/allocs-l2-fjord.json"
- ".devnet-plasma/allocs-l2-granite.json" - ".devnet-altda/allocs-l2-granite.json"
- ".devnet-plasma-generic/allocs-l1.json" - ".devnet-altda-generic/allocs-l1.json"
- ".devnet-plasma-generic/addresses.json" - ".devnet-altda-generic/addresses.json"
- ".devnet-plasma-generic/allocs-l2-delta.json" - ".devnet-altda-generic/allocs-l2-delta.json"
- ".devnet-plasma-generic/allocs-l2-ecotone.json" - ".devnet-altda-generic/allocs-l2-ecotone.json"
- ".devnet-plasma-generic/allocs-l2-fjord.json" - ".devnet-altda-generic/allocs-l2-fjord.json"
- ".devnet-plasma-generic/allocs-l2-granite.json" - ".devnet-altda-generic/allocs-l2-granite.json"
- "packages/contracts-bedrock/deploy-config/devnetL1.json" - "packages/contracts-bedrock/deploy-config/devnetL1.json"
- "packages/contracts-bedrock/deployments/devnetL1" - "packages/contracts-bedrock/deployments/devnetL1"
- notify-failures-on-develop - notify-failures-on-develop
...@@ -838,11 +838,11 @@ jobs: ...@@ -838,11 +838,11 @@ jobs:
command: echo 'export OP_E2E_USE_L2OO=true' >> $BASH_ENV command: echo 'export OP_E2E_USE_L2OO=true' >> $BASH_ENV
- when: - when:
condition: condition:
equal: ['-plasma', <<parameters.variant>>] equal: ['-altda', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set OP_E2E_USE_PLASMA = true name: Set OP_E2E_USE_ALTDA = true
command: echo 'export OP_E2E_USE_PLASMA=true' >> $BASH_ENV command: echo 'export OP_E2E_USE_ALTDA=true' >> $BASH_ENV
- check-changed: - check-changed:
patterns: op-(.+),cannon,contracts-bedrock patterns: op-(.+),cannon,contracts-bedrock
- run: - run:
...@@ -1067,26 +1067,26 @@ jobs: ...@@ -1067,26 +1067,26 @@ jobs:
DEVNET_NO_BUILD: 'true' DEVNET_NO_BUILD: 'true'
# Default value; Can be overridden. # Default value; Can be overridden.
DEVNET_L2OO: 'false' DEVNET_L2OO: 'false'
DEVNET_PLASMA: 'false' DEVNET_ALTDA: 'false'
steps: steps:
- checkout - checkout
- when: - when:
condition: condition:
equal: ['plasma', <<parameters.variant>>] equal: ['altda', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_PLASMA = true name: Set DEVNET_ALTDA = true
command: echo 'export DEVNET_PLASMA=true' >> $BASH_ENV command: echo 'export DEVNET_ALTDA=true' >> $BASH_ENV
- when: - when:
condition: condition:
equal: ['plasma-generic', <<parameters.variant>>] equal: ['altda-generic', <<parameters.variant>>]
steps: steps:
- run: - run:
name: Set DEVNET_PLASMA = true name: Set DEVNET_ALTDA = true
command: echo 'export DEVNET_PLASMA=true' >> $BASH_ENV command: echo 'export DEVNET_ALTDA=true' >> $BASH_ENV
- run: - run:
name: Set GENERIC_PLASMA = true name: Set GENERIC_ALTDA = true
command: echo 'export GENERIC_PLASMA=true' >> $BASH_ENV command: echo 'export GENERIC_ALTDA=true' >> $BASH_ENV
- check-changed: - check-changed:
patterns: op-(.+),packages,ops-bedrock,bedrock-devnet patterns: op-(.+),packages,ops-bedrock,bedrock-devnet
- run: - run:
...@@ -1576,7 +1576,7 @@ workflows: ...@@ -1576,7 +1576,7 @@ workflows:
name: op-e2e-action-tests<< matrix.variant >> name: op-e2e-action-tests<< matrix.variant >>
matrix: matrix:
parameters: parameters:
variant: ["", "-l2oo", "-plasma"] variant: ["", "-l2oo", "-altda"]
module: op-e2e module: op-e2e
target: test-actions target: test-actions
parallelism: 1 parallelism: 1
...@@ -1621,7 +1621,7 @@ workflows: ...@@ -1621,7 +1621,7 @@ workflows:
- op-e2e-HTTP-tests - op-e2e-HTTP-tests
- op-e2e-fault-proof-tests - op-e2e-fault-proof-tests
- op-e2e-action-tests - op-e2e-action-tests
- op-e2e-action-tests-plasma - op-e2e-action-tests-altda
- docker-build: - docker-build:
name: op-node-docker-build name: op-node-docker-build
docker_name: op-node docker_name: op-node
...@@ -1678,7 +1678,7 @@ workflows: ...@@ -1678,7 +1678,7 @@ workflows:
- devnet: - devnet:
matrix: matrix:
parameters: parameters:
variant: ["default", "plasma", "plasma-generic"] variant: ["default", "altda", "altda-generic"]
requires: requires:
- pnpm-monorepo - pnpm-monorepo
- op-batcher-docker-build - op-batcher-docker-build
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/op-heartbeat @ethereum-optimism/go-reviewers /op-heartbeat @ethereum-optimism/go-reviewers
/op-node @ethereum-optimism/go-reviewers /op-node @ethereum-optimism/go-reviewers
/op-node/rollup @protolambda @ajsutton /op-node/rollup @protolambda @ajsutton
/op-plasma @ethereum-optimism/go-reviewers /op-alt-da @ethereum-optimism/go-reviewers
/op-preimage @ethereum-optimism/go-reviewers /op-preimage @ethereum-optimism/go-reviewers
/op-program @ethereum-optimism/go-reviewers /op-program @ethereum-optimism/go-reviewers
/op-proposer @ethereum-optimism/go-reviewers /op-proposer @ethereum-optimism/go-reviewers
......
...@@ -27,8 +27,8 @@ FORKS = ["delta", "ecotone", "fjord", "granite"] ...@@ -27,8 +27,8 @@ FORKS = ["delta", "ecotone", "fjord", "granite"]
# 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_L2OO = os.getenv('DEVNET_L2OO') == "true" DEVNET_L2OO = os.getenv('DEVNET_L2OO') == "true"
DEVNET_PLASMA = os.getenv('DEVNET_PLASMA') == "true" DEVNET_ALTDA = os.getenv('DEVNET_ALTDA') == "true"
GENERIC_PLASMA = os.getenv('GENERIC_PLASMA') == "true" GENERIC_ALTDA = os.getenv('GENERIC_ALTDA') == "true"
class Bunch: class Bunch:
def __init__(self, **kwds): def __init__(self, **kwds):
...@@ -123,9 +123,9 @@ def init_devnet_l1_deploy_config(paths, update_timestamp=False): ...@@ -123,9 +123,9 @@ def init_devnet_l1_deploy_config(paths, update_timestamp=False):
deploy_config['l1GenesisBlockTimestamp'] = '{:#x}'.format(int(time.time())) deploy_config['l1GenesisBlockTimestamp'] = '{:#x}'.format(int(time.time()))
if DEVNET_L2OO: if DEVNET_L2OO:
deploy_config['useFaultProofs'] = False deploy_config['useFaultProofs'] = False
if DEVNET_PLASMA: if DEVNET_ALTDA:
deploy_config['usePlasma'] = True deploy_config['useAltDA'] = True
if GENERIC_PLASMA: if GENERIC_ALTDA:
deploy_config['daCommitmentType'] = "GenericCommitment" deploy_config['daCommitmentType'] = "GenericCommitment"
write_json(paths.devnet_config_path, deploy_config) write_json(paths.devnet_config_path, deploy_config)
...@@ -175,7 +175,7 @@ def devnet_deploy(paths): ...@@ -175,7 +175,7 @@ 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_L2OO or DEVNET_PLASMA: if not os.path.exists(paths.allocs_l1_path) or DEVNET_L2OO or DEVNET_ALTDA:
# If this is a devnet variant 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 setting the appropriate env var which means the allocs will be wrong. # without setting the appropriate env var which means the allocs will be wrong.
...@@ -267,19 +267,19 @@ def devnet_deploy(paths): ...@@ -267,19 +267,19 @@ def devnet_deploy(paths):
docker_env['DG_TYPE'] = '254' docker_env['DG_TYPE'] = '254'
docker_env['PROPOSAL_INTERVAL'] = '12s' docker_env['PROPOSAL_INTERVAL'] = '12s'
if DEVNET_PLASMA: if DEVNET_ALTDA:
docker_env['PLASMA_ENABLED'] = 'true' docker_env['ALTDA_ENABLED'] = 'true'
docker_env['DA_TYPE'] = 'calldata' docker_env['DA_TYPE'] = 'calldata'
else: else:
docker_env['PLASMA_ENABLED'] = 'false' docker_env['ALTDA_ENABLED'] = 'false'
docker_env['DA_TYPE'] = 'blobs' docker_env['DA_TYPE'] = 'blobs'
if GENERIC_PLASMA: if GENERIC_ALTDA:
docker_env['PLASMA_GENERIC_DA'] = 'true' docker_env['ALTDA_GENERIC_DA'] = 'true'
docker_env['PLASMA_DA_SERVICE'] = 'true' docker_env['ALTDA_SERVICE'] = 'true'
else: else:
docker_env['PLASMA_GENERIC_DA'] = 'false' docker_env['ALTDA_GENERIC_DA'] = 'false'
docker_env['PLASMA_DA_SERVICE'] = 'false' docker_env['ALTDA_SERVICE'] = 'false'
# Bring up the rest of the services. # Bring up the rest of the services.
log.info('Bringing up `op-node`, `op-proposer` and `op-batcher`.') log.info('Bringing up `op-node`, `op-proposer` and `op-batcher`.')
...@@ -291,7 +291,7 @@ def devnet_deploy(paths): ...@@ -291,7 +291,7 @@ def devnet_deploy(paths):
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)
# Optionally bring up Alt-DA Mode components. # Optionally bring up Alt-DA Mode components.
if DEVNET_PLASMA: if DEVNET_ALTDA:
log.info('Bringing up `da-server`, `sentinel`.') # TODO(10141): We don't have public sentinel images yet log.info('Bringing up `da-server`, `sentinel`.') # TODO(10141): We don't have public sentinel images yet
run_command(['docker', 'compose', 'up', '-d', 'da-server'], cwd=paths.ops_bedrock_dir, env=docker_env) run_command(['docker', 'compose', 'up', '-d', 'da-server'], cwd=paths.ops_bedrock_dir, env=docker_env)
......
...@@ -11,7 +11,7 @@ require ( ...@@ -11,7 +11,7 @@ require (
github.com/crate-crypto/go-kzg-4844 v1.0.0 github.com/crate-crypto/go-kzg-4844 v1.0.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240814192743-ea7e768a02a6
github.com/ethereum/go-ethereum v1.14.7 github.com/ethereum/go-ethereum v1.14.7
github.com/fsnotify/fsnotify v1.7.0 github.com/fsnotify/fsnotify v1.7.0
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb
......
...@@ -176,8 +176,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z ...@@ -176,8 +176,8 @@ github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3 h1:RWHKLhCrQThMfch+QJ1Z
github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs= github.com/ethereum-optimism/go-ethereum-hdwallet v0.1.3/go.mod h1:QziizLAiF0KqyLdNJYD7O5cpDlaFMNZzlxYNcWsJUxs=
github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a h1:OK3wB7HbdhCneSowC1XZusHaLIVdXoRLuCWgXp5Tjuc= github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a h1:OK3wB7HbdhCneSowC1XZusHaLIVdXoRLuCWgXp5Tjuc=
github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a/go.mod h1:9pT+bF20XwCBE7WkjfRSsCg6RN6Njdbr924DtQ3+geY= github.com/ethereum-optimism/op-geth v1.101407.0-rc.1.0.20240812224053-8d99ca68bb1a/go.mod h1:9pT+bF20XwCBE7WkjfRSsCg6RN6Njdbr924DtQ3+geY=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f h1:JTnVOiaYVQcXc+zgsSjnTQ18k3uOLOpch8SiPjO1eTo= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240814192743-ea7e768a02a6 h1:s51nSnpwPJRRU/F6mob/fnOebFmuPz3Ab1J/HCtC40U=
github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240813170044-d5be5587e58f/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM= github.com/ethereum-optimism/superchain-registry/superchain v0.0.0-20240814192743-ea7e768a02a6/go.mod h1:zy9f3TNPS7pwW4msMitF83fp0Wf452tZ6+Fg6d4JyXM=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4=
......
* *
!/op-service !/op-service
!/op-plasma !/op-alt-da
!/go.mod !/go.mod
!/go.sum !/go.sum
package plasma package altda
import ( import (
"fmt" "fmt"
...@@ -8,29 +8,25 @@ import ( ...@@ -8,29 +8,25 @@ import (
) )
var ( var (
EnabledFlagName, EnabledFlagAlias = altDAFlags("enabled") EnabledFlagName = altDAFlags("enabled")
DaServerAddressFlagName, DaServerAddressFlagAlias = altDAFlags("da-server") DaServerAddressFlagName = altDAFlags("da-server")
VerifyOnReadFlagName, VerifyOnReadFlagAlias = altDAFlags("verify-on-read") VerifyOnReadFlagName = altDAFlags("verify-on-read")
DaServiceFlag, DaServiceFlagAlias = altDAFlags("da-service") DaServiceFlag = altDAFlags("da-service")
) )
// altDAFlags returns the flag names for altDA, with an Alias for plasma // altDAFlags returns the flag names for altDA
func altDAFlags(v string) (string, string) { func altDAFlags(v string) string {
return "altda." + v, return "altda." + v
"plasma." + v
} }
func altDAEnvs(envprefix, v string) []string { func altDAEnvs(envprefix, v string) []string {
return []string{ return []string{envprefix + "_ALTDA_" + v}
envprefix + "_ALTDA_" + v,
envprefix + "_PLASMA_" + v}
} }
func CLIFlags(envPrefix string, category string) []cli.Flag { func CLIFlags(envPrefix string, category string) []cli.Flag {
return []cli.Flag{ return []cli.Flag{
&cli.BoolFlag{ &cli.BoolFlag{
Name: EnabledFlagName, Name: EnabledFlagName,
Aliases: []string{EnabledFlagAlias},
Usage: "Enable Alt-DA mode\nAlt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.", Usage: "Enable Alt-DA mode\nAlt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.",
Value: false, Value: false,
EnvVars: altDAEnvs(envPrefix, "ENABLED"), EnvVars: altDAEnvs(envPrefix, "ENABLED"),
...@@ -38,14 +34,12 @@ func CLIFlags(envPrefix string, category string) []cli.Flag { ...@@ -38,14 +34,12 @@ func CLIFlags(envPrefix string, category string) []cli.Flag {
}, },
&cli.StringFlag{ &cli.StringFlag{
Name: DaServerAddressFlagName, Name: DaServerAddressFlagName,
Aliases: []string{DaServerAddressFlagAlias},
Usage: "HTTP address of a DA Server", Usage: "HTTP address of a DA Server",
EnvVars: altDAEnvs(envPrefix, "DA_SERVER"), EnvVars: altDAEnvs(envPrefix, "DA_SERVER"),
Category: category, Category: category,
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: VerifyOnReadFlagName, Name: VerifyOnReadFlagName,
Aliases: []string{VerifyOnReadFlagAlias},
Usage: "Verify input data matches the commitments from the DA storage service", Usage: "Verify input data matches the commitments from the DA storage service",
Value: true, Value: true,
EnvVars: altDAEnvs(envPrefix, "VERIFY_ON_READ"), EnvVars: altDAEnvs(envPrefix, "VERIFY_ON_READ"),
...@@ -53,7 +47,6 @@ func CLIFlags(envPrefix string, category string) []cli.Flag { ...@@ -53,7 +47,6 @@ func CLIFlags(envPrefix string, category string) []cli.Flag {
}, },
&cli.BoolFlag{ &cli.BoolFlag{
Name: DaServiceFlag, Name: DaServiceFlag,
Aliases: []string{DaServiceFlagAlias},
Usage: "Use DA service type where commitments are generated by Alt-DA server", Usage: "Use DA service type where commitments are generated by Alt-DA server",
Value: false, Value: false,
EnvVars: altDAEnvs(envPrefix, "DA_SERVICE"), EnvVars: altDAEnvs(envPrefix, "DA_SERVICE"),
...@@ -72,7 +65,7 @@ type CLIConfig struct { ...@@ -72,7 +65,7 @@ type CLIConfig struct {
func (c CLIConfig) Check() error { func (c CLIConfig) Check() error {
if c.Enabled { if c.Enabled {
if c.DAServerURL == "" { if c.DAServerURL == "" {
return fmt.Errorf("DA server URL is required when plasma da is enabled") return fmt.Errorf("DA server URL is required when altDA is enabled")
} }
if _, err := url.Parse(c.DAServerURL); err != nil { if _, err := url.Parse(c.DAServerURL); err != nil {
return fmt.Errorf("DA server URL is invalid: %w", err) return fmt.Errorf("DA server URL is invalid: %w", err)
......
# Plasma DA Server # AltDA Server
## Introduction ## Introduction
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
"github.com/ethereum-optimism/optimism/op-service/opio" "github.com/ethereum-optimism/optimism/op-service/opio"
) )
...@@ -25,9 +25,9 @@ func StartDAServer(cliCtx *cli.Context) error { ...@@ -25,9 +25,9 @@ func StartDAServer(cliCtx *cli.Context) error {
l := oplog.NewLogger(oplog.AppOut(cliCtx), logCfg) l := oplog.NewLogger(oplog.AppOut(cliCtx), logCfg)
oplog.SetGlobalLogHandler(l.Handler()) oplog.SetGlobalLogHandler(l.Handler())
l.Info("Initializing Plasma DA server...") l.Info("Initializing AltDA server...")
var store plasma.KVStore var store altda.KVStore
if cfg.FileStoreEnabled() { if cfg.FileStoreEnabled() {
l.Info("Using file storage", "path", cfg.FileStoreDirPath) l.Info("Using file storage", "path", cfg.FileStoreDirPath)
...@@ -41,7 +41,7 @@ func StartDAServer(cliCtx *cli.Context) error { ...@@ -41,7 +41,7 @@ func StartDAServer(cliCtx *cli.Context) error {
store = s3 store = s3
} }
server := plasma.NewDAServer(cliCtx.String(ListenAddrFlagName), cliCtx.Int(PortFlagName), store, l, cfg.UseGenericComm) server := altda.NewDAServer(cliCtx.String(ListenAddrFlagName), cliCtx.Int(PortFlagName), store, l, cfg.UseGenericComm)
if err := server.Start(); err != nil { if err := server.Start(); err != nil {
return fmt.Errorf("failed to start the DA server") return fmt.Errorf("failed to start the DA server")
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"os" "os"
"path" "path"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
) )
type FileStore struct { type FileStore struct {
...@@ -23,7 +23,7 @@ func (s *FileStore) Get(ctx context.Context, key []byte) ([]byte, error) { ...@@ -23,7 +23,7 @@ func (s *FileStore) Get(ctx context.Context, key []byte) ([]byte, error) {
data, err := os.ReadFile(s.fileName(key)) data, err := os.ReadFile(s.fileName(key))
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
return nil, plasma.ErrNotFound return nil, altda.ErrNotFound
} }
return nil, err return nil, err
} }
......
...@@ -21,7 +21,7 @@ const ( ...@@ -21,7 +21,7 @@ const (
GenericCommFlagName = "generic-commitment" GenericCommFlagName = "generic-commitment"
) )
const EnvVarPrefix = "OP_PLASMA_DA_SERVER" const EnvVarPrefix = "OP_ALTDA_SERVER"
func prefixEnvVars(name string) []string { func prefixEnvVars(name string) []string {
return opservice.PrefixEnvVar(EnvVarPrefix, name) return opservice.PrefixEnvVar(EnvVarPrefix, name)
......
...@@ -22,8 +22,8 @@ func main() { ...@@ -22,8 +22,8 @@ func main() {
app.Flags = cliapp.ProtectFlags(Flags) app.Flags = cliapp.ProtectFlags(Flags)
app.Version = opservice.FormatVersion(Version, "", "", "") app.Version = opservice.FormatVersion(Version, "", "", "")
app.Name = "da-server" app.Name = "da-server"
app.Usage = "Plasma DA Storage Service" app.Usage = "AltDA Storage Service"
app.Description = "Service for storing plasma DA inputs" app.Description = "Service for storing AltDA inputs"
app.Action = StartDAServer app.Action = StartDAServer
ctx := opio.WithInterruptBlocker(context.Background()) ctx := opio.WithInterruptBlocker(context.Background())
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"github.com/minio/minio-go/v7" "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials" "github.com/minio/minio-go/v7/pkg/credentials"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
) )
type S3Config struct { type S3Config struct {
...@@ -43,7 +43,7 @@ func (s *S3Store) Get(ctx context.Context, key []byte) ([]byte, error) { ...@@ -43,7 +43,7 @@ func (s *S3Store) Get(ctx context.Context, key []byte) ([]byte, error) {
if err != nil { if err != nil {
errResponse := minio.ToErrorResponse(err) errResponse := minio.ToErrorResponse(err)
if errResponse.Code == "NoSuchKey" { if errResponse.Code == "NoSuchKey" {
return nil, plasma.ErrNotFound return nil, altda.ErrNotFound
} }
return nil, err return nil, err
} }
......
package plasma package altda
import ( import (
"bytes" "bytes"
......
package plasma package altda
import ( import (
"testing" "testing"
......
package plasma package altda
import ( import (
"bytes" "bytes"
......
package plasma package altda
import ( import (
"context" "context"
......
package plasma package altda
import ( import (
"context" "context"
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum-optimism/optimism/op-plasma/bindings" "github.com/ethereum-optimism/optimism/op-alt-da/bindings"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -47,7 +47,7 @@ type DAStorage interface { ...@@ -47,7 +47,7 @@ type DAStorage interface {
// HeadSignalFn is the callback function to accept head-signals without a context. // HeadSignalFn is the callback function to accept head-signals without a context.
type HeadSignalFn func(eth.L1BlockRef) type HeadSignalFn func(eth.L1BlockRef)
// Config is the relevant subset of rollup config for plasma DA. // Config is the relevant subset of rollup config for AltDA.
type Config struct { type Config struct {
// Required for filtering contract events // Required for filtering contract events
DAChallengeContractAddress common.Address DAChallengeContractAddress common.Address
...@@ -77,13 +77,13 @@ type DA struct { ...@@ -77,13 +77,13 @@ type DA struct {
finalizedHeadSignalHandler HeadSignalFn finalizedHeadSignalHandler HeadSignalFn
} }
// NewPlasmaDA creates a new PlasmaDA instance with the given log and CLIConfig. // NewAltDA creates a new AltDA instance with the given log and CLIConfig.
func NewPlasmaDA(log log.Logger, cli CLIConfig, cfg Config, metrics Metricer) *DA { func NewAltDA(log log.Logger, cli CLIConfig, cfg Config, metrics Metricer) *DA {
return NewPlasmaDAWithStorage(log, cfg, cli.NewDAClient(), metrics) return NewAltDAWithStorage(log, cfg, cli.NewDAClient(), metrics)
} }
// NewPlasmaDAWithStorage creates a new PlasmaDA instance with the given log and DAStorage interface. // NewAltDAWithStorage creates a new AltDA instance with the given log and DAStorage interface.
func NewPlasmaDAWithStorage(log log.Logger, cfg Config, storage DAStorage, metrics Metricer) *DA { func NewAltDAWithStorage(log log.Logger, cfg Config, storage DAStorage, metrics Metricer) *DA {
return &DA{ return &DA{
log: log, log: log,
cfg: cfg, cfg: cfg,
...@@ -93,9 +93,9 @@ func NewPlasmaDAWithStorage(log log.Logger, cfg Config, storage DAStorage, metri ...@@ -93,9 +93,9 @@ func NewPlasmaDAWithStorage(log log.Logger, cfg Config, storage DAStorage, metri
} }
} }
// NewPlasmaDAWithState creates a plasma storage from initial state used for testing in isolation. // NewAltDAWithState creates an AltDA storage from initial state used for testing in isolation.
// We pass the L1Fetcher to each method so it is kept in sync with the conf depth of the pipeline. // We pass the L1Fetcher to each method so it is kept in sync with the conf depth of the pipeline.
func NewPlasmaDAWithState(log log.Logger, cfg Config, storage DAStorage, metrics Metricer, state *State) *DA { func NewAltDAWithState(log log.Logger, cfg Config, storage DAStorage, metrics Metricer, state *State) *DA {
return &DA{ return &DA{
log: log, log: log,
cfg: cfg, cfg: cfg,
...@@ -143,12 +143,12 @@ func (d *DA) Finalize(l1Finalized eth.L1BlockRef) { ...@@ -143,12 +143,12 @@ func (d *DA) Finalize(l1Finalized eth.L1BlockRef) {
d.metrics.RecordChallengesHead("finalized", d.finalizedHead.Number) d.metrics.RecordChallengesHead("finalized", d.finalizedHead.Number)
// Record and Log the latest L1 finalized head // Record and Log the latest L1 finalized head
d.log.Info("received l1 finalized signal, forwarding plasma finalization to finalizedHeadSignalHandler", d.log.Info("received l1 finalized signal, forwarding altDA finalization to finalizedHeadSignalHandler",
"l1", l1Finalized, "l1", l1Finalized,
"plasma", d.finalizedHead) "altDA", d.finalizedHead)
// execute the handler function if set // execute the handler function if set
// the handler function is called with the plasma finalized head // the handler function is called with the altDA finalized head
if d.finalizedHeadSignalHandler == nil { if d.finalizedHeadSignalHandler == nil {
d.log.Warn("finalized head signal handler not set") d.log.Warn("finalized head signal handler not set")
return return
...@@ -277,7 +277,7 @@ func (d *DA) AdvanceChallengeOrigin(ctx context.Context, l1 L1Fetcher, block eth ...@@ -277,7 +277,7 @@ func (d *DA) AdvanceChallengeOrigin(ctx context.Context, l1 L1Fetcher, block eth
// set and record the new challenge origin // set and record the new challenge origin
d.challengeOrigin = block d.challengeOrigin = block
d.metrics.RecordChallengesHead("latest", d.challengeOrigin.Number) d.metrics.RecordChallengesHead("latest", d.challengeOrigin.Number)
d.log.Info("processed plasma challenge origin", "origin", block) d.log.Info("processed altDA challenge origin", "origin", block)
return nil return nil
} }
...@@ -299,7 +299,7 @@ func (d *DA) AdvanceCommitmentOrigin(ctx context.Context, l1 L1Fetcher, block et ...@@ -299,7 +299,7 @@ func (d *DA) AdvanceCommitmentOrigin(ctx context.Context, l1 L1Fetcher, block et
// set and record the new commitment origin // set and record the new commitment origin
d.commitmentOrigin = block d.commitmentOrigin = block
d.metrics.RecordChallengesHead("latest", d.challengeOrigin.Number) d.metrics.RecordChallengesHead("latest", d.challengeOrigin.Number)
d.log.Info("processed plasma l1 origin", "origin", block, "finalized", d.finalizedHead.ID(), "l1-finalize", d.l1FinalizedHead.ID()) d.log.Info("processed altDA l1 origin", "origin", block, "finalized", d.finalizedHead.ID(), "l1-finalize", d.l1FinalizedHead.ID())
return nil return nil
} }
......
package plasma package altda
import ( import (
"context" "context"
...@@ -248,7 +248,7 @@ func TestAdvanceChallengeOrigin(t *testing.T) { ...@@ -248,7 +248,7 @@ func TestAdvanceChallengeOrigin(t *testing.T) {
state := NewState(logger, &NoopMetrics{}, pcfg) state := NewState(logger, &NoopMetrics{}, pcfg)
da := NewPlasmaDAWithState(logger, pcfg, storage, &NoopMetrics{}, state) da := NewAltDAWithState(logger, pcfg, storage, &NoopMetrics{}, state)
receipts := types.Receipts{&types.Receipt{ receipts := types.Receipts{&types.Receipt{
Type: 2, Type: 2,
......
package plasma package altda
import ( import (
"context" "context"
...@@ -75,27 +75,27 @@ func (f *DAErrFaker) ActSetPreImageFail() { ...@@ -75,27 +75,27 @@ func (f *DAErrFaker) ActSetPreImageFail() {
f.setInputErr = errors.New("set input failed") f.setInputErr = errors.New("set input failed")
} }
var Disabled = &PlasmaDisabled{} var Disabled = &AltDADisabled{}
var ErrNotEnabled = errors.New("plasma not enabled") var ErrNotEnabled = errors.New("altDA not enabled")
// PlasmaDisabled is a noop plasma DA implementation for stubbing. // AltDADisabled is a noop AltDA implementation for stubbing.
type PlasmaDisabled struct{} type AltDADisabled struct{}
func (d *PlasmaDisabled) GetInput(ctx context.Context, l1 L1Fetcher, commitment CommitmentData, blockId eth.L1BlockRef) (eth.Data, error) { func (d *AltDADisabled) GetInput(ctx context.Context, l1 L1Fetcher, commitment CommitmentData, blockId eth.L1BlockRef) (eth.Data, error) {
return nil, ErrNotEnabled return nil, ErrNotEnabled
} }
func (d *PlasmaDisabled) Reset(ctx context.Context, base eth.L1BlockRef, baseCfg eth.SystemConfig) error { func (d *AltDADisabled) Reset(ctx context.Context, base eth.L1BlockRef, baseCfg eth.SystemConfig) error {
return io.EOF return io.EOF
} }
func (d *PlasmaDisabled) Finalize(ref eth.L1BlockRef) { func (d *AltDADisabled) Finalize(ref eth.L1BlockRef) {
} }
func (d *PlasmaDisabled) OnFinalizedHeadSignal(f HeadSignalFn) { func (d *AltDADisabled) OnFinalizedHeadSignal(f HeadSignalFn) {
} }
func (d *PlasmaDisabled) AdvanceL1Origin(ctx context.Context, l1 L1Fetcher, blockId eth.BlockID) error { func (d *AltDADisabled) AdvanceL1Origin(ctx context.Context, l1 L1Fetcher, blockId eth.BlockID) error {
return ErrNotEnabled return ErrNotEnabled
} }
package plasma package altda
import ( import (
"context" "context"
......
package plasma package altda
import ( import (
"errors" "errors"
...@@ -50,7 +50,7 @@ func challengeKey(comm CommitmentData, inclusionBlockNumber uint64) string { ...@@ -50,7 +50,7 @@ func challengeKey(comm CommitmentData, inclusionBlockNumber uint64) string {
// When commitments are moved to Expired, if there is an active challenge, the DA Manager is informed that a commitment became invalid. // When commitments are moved to Expired, if there is an active challenge, the DA Manager is informed that a commitment became invalid.
// Challenges and Commitments can be pruned when they are beyond a certain block number (e.g. when they are finalized). // Challenges and Commitments can be pruned when they are beyond a certain block number (e.g. when they are finalized).
// In the special case of a L2 reorg, challenges are still tracked but commitments are removed. // In the special case of a L2 reorg, challenges are still tracked but commitments are removed.
// This will allow the plasma fetcher to find the expired challenge. // This will allow the altDA fetcher to find the expired challenge.
type State struct { type State struct {
commitments []Commitment // commitments where the challenge/resolve period has not expired yet commitments []Commitment // commitments where the challenge/resolve period has not expired yet
expiredCommitments []Commitment // commitments where the challenge/resolve period has expired but not finalized expiredCommitments []Commitment // commitments where the challenge/resolve period has expired but not finalized
......
package plasma package altda
import ( import (
"github.com/ethereum-optimism/optimism/op-service/metrics" "github.com/ethereum-optimism/optimism/op-service/metrics"
......
package plasma package altda
// MaxInputSize ensures the canonical chain cannot include input batches too large to // MaxInputSize ensures the canonical chain cannot include input batches too large to
// challenge in the Data Availability Challenge contract. Value in number of bytes. // challenge in the Data Availability Challenge contract. Value in number of bytes.
...@@ -6,6 +6,6 @@ package plasma ...@@ -6,6 +6,6 @@ package plasma
const MaxInputSize = 130672 const MaxInputSize = 130672
// TxDataVersion1 is the version number for batcher transactions containing // TxDataVersion1 is the version number for batcher transactions containing
// plasma commitments. It should not collide with DerivationVersion which is still // altDA commitments. It should not collide with DerivationVersion which is still
// used downstream when parsing the frames. // used downstream when parsing the frames.
const TxDataVersion1 = 1 const TxDataVersion1 = 1
...@@ -8,10 +8,10 @@ import ( ...@@ -8,10 +8,10 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-batcher/compressor" "github.com/ethereum-optimism/optimism/op-batcher/compressor"
"github.com/ethereum-optimism/optimism/op-batcher/flags" "github.com/ethereum-optimism/optimism/op-batcher/flags"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics" opmetrics "github.com/ethereum-optimism/optimism/op-service/metrics"
"github.com/ethereum-optimism/optimism/op-service/oppprof" "github.com/ethereum-optimism/optimism/op-service/oppprof"
...@@ -104,7 +104,7 @@ type CLIConfig struct { ...@@ -104,7 +104,7 @@ type CLIConfig struct {
MetricsConfig opmetrics.CLIConfig MetricsConfig opmetrics.CLIConfig
PprofConfig oppprof.CLIConfig PprofConfig oppprof.CLIConfig
RPC oprpc.CLIConfig RPC oprpc.CLIConfig
PlasmaDA plasma.CLIConfig AltDA altda.CLIConfig
} }
func (c *CLIConfig) Check() error { func (c *CLIConfig) Check() error {
...@@ -192,6 +192,6 @@ func NewConfig(ctx *cli.Context) *CLIConfig { ...@@ -192,6 +192,6 @@ func NewConfig(ctx *cli.Context) *CLIConfig {
MetricsConfig: opmetrics.ReadCLIConfig(ctx), MetricsConfig: opmetrics.ReadCLIConfig(ctx),
PprofConfig: oppprof.ReadCLIConfig(ctx), PprofConfig: oppprof.ReadCLIConfig(ctx),
RPC: oprpc.ReadCLIConfig(ctx), RPC: oprpc.ReadCLIConfig(ctx),
PlasmaDA: plasma.ReadCLIConfig(ctx), AltDA: altda.ReadCLIConfig(ctx),
} }
} }
...@@ -11,10 +11,10 @@ import ( ...@@ -11,10 +11,10 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-batcher/metrics" "github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/dial" "github.com/ethereum-optimism/optimism/op-service/dial"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/txmgr" "github.com/ethereum-optimism/optimism/op-service/txmgr"
...@@ -65,7 +65,7 @@ type DriverSetup struct { ...@@ -65,7 +65,7 @@ type DriverSetup struct {
L1Client L1Client L1Client L1Client
EndpointProvider dial.L2EndpointProvider EndpointProvider dial.L2EndpointProvider
ChannelConfig ChannelConfigProvider ChannelConfig ChannelConfigProvider
PlasmaDA *plasma.DAClient AltDA *altda.DAClient
} }
// BatchSubmitter encapsulates a service responsible for submitting L2 tx // BatchSubmitter encapsulates a service responsible for submitting L2 tx
...@@ -569,17 +569,17 @@ func (l *BatchSubmitter) sendTransaction(ctx context.Context, txdata txData, que ...@@ -569,17 +569,17 @@ func (l *BatchSubmitter) sendTransaction(ctx context.Context, txdata txData, que
l.Log.Crit("Unexpected number of frames in calldata tx", "num_frames", nf) l.Log.Crit("Unexpected number of frames in calldata tx", "num_frames", nf)
} }
data := txdata.CallData() data := txdata.CallData()
// if plasma DA is enabled we post the txdata to the DA Provider and replace it with the commitment. // if AltDA is enabled we post the txdata to the DA Provider and replace it with the commitment.
if l.Config.UsePlasma { if l.Config.UseAltDA {
comm, err := l.PlasmaDA.SetInput(ctx, data) comm, err := l.AltDA.SetInput(ctx, data)
if err != nil { if err != nil {
l.Log.Error("Failed to post input to Plasma DA", "error", err) l.Log.Error("Failed to post input to Alt DA", "error", err)
// requeue frame if we fail to post to the DA Provider so it can be retried // requeue frame if we fail to post to the DA Provider so it can be retried
l.recordFailedTx(txdata.ID(), err) l.recordFailedTx(txdata.ID(), err)
return nil return nil
} }
l.Log.Info("Set plasma input", "commitment", comm, "tx", txdata.ID()) l.Log.Info("Set AltDA input", "commitment", comm, "tx", txdata.ID())
// signal plasma commitment tx with TxDataVersion1 // signal AltDA commitment tx with TxDataVersion1
data = comm.TxData() data = comm.TxData()
} }
candidate = l.calldataTxCandidate(data) candidate = l.calldataTxCandidate(data)
......
...@@ -12,12 +12,12 @@ import ( ...@@ -12,12 +12,12 @@ import (
"github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-batcher/flags" "github.com/ethereum-optimism/optimism/op-batcher/flags"
"github.com/ethereum-optimism/optimism/op-batcher/metrics" "github.com/ethereum-optimism/optimism/op-batcher/metrics"
"github.com/ethereum-optimism/optimism/op-batcher/rpc" "github.com/ethereum-optimism/optimism/op-batcher/rpc"
"github.com/ethereum-optimism/optimism/op-node/chaincfg" "github.com/ethereum-optimism/optimism/op-node/chaincfg"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/cliapp" "github.com/ethereum-optimism/optimism/op-service/cliapp"
"github.com/ethereum-optimism/optimism/op-service/dial" "github.com/ethereum-optimism/optimism/op-service/dial"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
...@@ -35,9 +35,9 @@ type BatcherConfig struct { ...@@ -35,9 +35,9 @@ type BatcherConfig struct {
PollInterval time.Duration PollInterval time.Duration
MaxPendingTransactions uint64 MaxPendingTransactions uint64
// UsePlasma is true if the rollup config has a DA challenge address so the batcher // UseAltDA is true if the rollup config has a DA challenge address so the batcher
// will post inputs to the Plasma DA server and post commitments to blobs or calldata. // will post inputs to the DA server and post commitments to blobs or calldata.
UsePlasma bool UseAltDA bool
WaitNodeSync bool WaitNodeSync bool
CheckRecentTxsDepth int CheckRecentTxsDepth int
...@@ -51,7 +51,7 @@ type BatcherService struct { ...@@ -51,7 +51,7 @@ type BatcherService struct {
L1Client *ethclient.Client L1Client *ethclient.Client
EndpointProvider dial.L2EndpointProvider EndpointProvider dial.L2EndpointProvider
TxManager *txmgr.SimpleTxManager TxManager *txmgr.SimpleTxManager
PlasmaDA *plasma.DAClient AltDA *altda.DAClient
BatcherConfig BatcherConfig
...@@ -115,8 +115,8 @@ func (bs *BatcherService) initFromCLIConfig(ctx context.Context, version string, ...@@ -115,8 +115,8 @@ func (bs *BatcherService) initFromCLIConfig(ctx context.Context, version string,
return fmt.Errorf("failed to init profiling: %w", err) return fmt.Errorf("failed to init profiling: %w", err)
} }
// init before driver // init before driver
if err := bs.initPlasmaDA(cfg); err != nil { if err := bs.initAltDA(cfg); err != nil {
return fmt.Errorf("failed to init plasma DA: %w", err) return fmt.Errorf("failed to init AltDA: %w", err)
} }
bs.initDriver() bs.initDriver()
if err := bs.initRPCServer(cfg); err != nil { if err := bs.initRPCServer(cfg); err != nil {
...@@ -214,8 +214,8 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error { ...@@ -214,8 +214,8 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error {
return fmt.Errorf("unknown data availability type: %v", cfg.DataAvailabilityType) return fmt.Errorf("unknown data availability type: %v", cfg.DataAvailabilityType)
} }
if bs.UsePlasma && cc.MaxFrameSize > plasma.MaxInputSize { if bs.UseAltDA && cc.MaxFrameSize > altda.MaxInputSize {
return fmt.Errorf("max frame size %d exceeds plasma max input size %d", cc.MaxFrameSize, plasma.MaxInputSize) return fmt.Errorf("max frame size %d exceeds altDA max input size %d", cc.MaxFrameSize, altda.MaxInputSize)
} }
cc.InitCompressorConfig(cfg.ApproxComprRatio, cfg.Compressor, cfg.CompressionAlgo) cc.InitCompressorConfig(cfg.ApproxComprRatio, cfg.Compressor, cfg.CompressionAlgo)
...@@ -237,7 +237,7 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error { ...@@ -237,7 +237,7 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error {
} }
bs.Log.Info("Initialized channel-config", bs.Log.Info("Initialized channel-config",
"da_type", cfg.DataAvailabilityType, "da_type", cfg.DataAvailabilityType,
"use_plasma", bs.UsePlasma, "use_alt_da", bs.UseAltDA,
"max_frame_size", cc.MaxFrameSize, "max_frame_size", cc.MaxFrameSize,
"target_num_frames", cc.TargetNumFrames, "target_num_frames", cc.TargetNumFrames,
"compressor", cc.CompressorConfig.Kind, "compressor", cc.CompressorConfig.Kind,
...@@ -246,7 +246,7 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error { ...@@ -246,7 +246,7 @@ func (bs *BatcherService) initChannelConfig(cfg *CLIConfig) error {
"max_channel_duration", cc.MaxChannelDuration, "max_channel_duration", cc.MaxChannelDuration,
"channel_timeout", cc.ChannelTimeout, "channel_timeout", cc.ChannelTimeout,
"sub_safety_margin", cc.SubSafetyMargin) "sub_safety_margin", cc.SubSafetyMargin)
if bs.UsePlasma { if bs.UseAltDA {
bs.Log.Warn("Alt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.") bs.Log.Warn("Alt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.")
} }
...@@ -321,7 +321,7 @@ func (bs *BatcherService) initDriver() { ...@@ -321,7 +321,7 @@ func (bs *BatcherService) initDriver() {
L1Client: bs.L1Client, L1Client: bs.L1Client,
EndpointProvider: bs.EndpointProvider, EndpointProvider: bs.EndpointProvider,
ChannelConfig: bs.ChannelConfig, ChannelConfig: bs.ChannelConfig,
PlasmaDA: bs.PlasmaDA, AltDA: bs.AltDA,
}) })
} }
...@@ -346,13 +346,13 @@ func (bs *BatcherService) initRPCServer(cfg *CLIConfig) error { ...@@ -346,13 +346,13 @@ func (bs *BatcherService) initRPCServer(cfg *CLIConfig) error {
return nil return nil
} }
func (bs *BatcherService) initPlasmaDA(cfg *CLIConfig) error { func (bs *BatcherService) initAltDA(cfg *CLIConfig) error {
config := cfg.PlasmaDA config := cfg.AltDA
if err := config.Check(); err != nil { if err := config.Check(); err != nil {
return err return err
} }
bs.PlasmaDA = config.NewDAClient() bs.AltDA = config.NewDAClient()
bs.UsePlasma = config.Enabled bs.UseAltDA = config.Enabled
return nil return nil
} }
......
...@@ -8,9 +8,9 @@ import ( ...@@ -8,9 +8,9 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-batcher/compressor" "github.com/ethereum-optimism/optimism/op-batcher/compressor"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
opservice "github.com/ethereum-optimism/optimism/op-service" opservice "github.com/ethereum-optimism/optimism/op-service"
openum "github.com/ethereum-optimism/optimism/op-service/enum" openum "github.com/ethereum-optimism/optimism/op-service/enum"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
...@@ -192,7 +192,7 @@ func init() { ...@@ -192,7 +192,7 @@ func init() {
optionalFlags = append(optionalFlags, opmetrics.CLIFlags(EnvVarPrefix)...) optionalFlags = append(optionalFlags, opmetrics.CLIFlags(EnvVarPrefix)...)
optionalFlags = append(optionalFlags, oppprof.CLIFlags(EnvVarPrefix)...) optionalFlags = append(optionalFlags, oppprof.CLIFlags(EnvVarPrefix)...)
optionalFlags = append(optionalFlags, txmgr.CLIFlags(EnvVarPrefix)...) optionalFlags = append(optionalFlags, txmgr.CLIFlags(EnvVarPrefix)...)
optionalFlags = append(optionalFlags, plasma.CLIFlags(EnvVarPrefix, "")...) optionalFlags = append(optionalFlags, altda.CLIFlags(EnvVarPrefix, "")...)
Flags = append(requiredFlags, optionalFlags...) Flags = append(requiredFlags, optionalFlags...)
} }
......
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
"strings" "strings"
"testing" "testing"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
opservice "github.com/ethereum-optimism/optimism/op-service" opservice "github.com/ethereum-optimism/optimism/op-service"
"github.com/ethereum-optimism/optimism/op-service/txmgr" "github.com/ethereum-optimism/optimism/op-service/txmgr"
...@@ -58,14 +57,6 @@ func TestBetaFlags(t *testing.T) { ...@@ -58,14 +57,6 @@ func TestBetaFlags(t *testing.T) {
} }
func TestHasEnvVar(t *testing.T) { func TestHasEnvVar(t *testing.T) {
// known exceptions to the number of env vars
expEnvVars := map[string]int{
plasma.EnabledFlagName: 2,
plasma.DaServerAddressFlagName: 2,
plasma.VerifyOnReadFlagName: 2,
plasma.DaServiceFlag: 2,
}
for _, flag := range Flags { for _, flag := range Flags {
flag := flag flag := flag
flagName := flag.Names()[0] flagName := flag.Names()[0]
...@@ -76,11 +67,7 @@ func TestHasEnvVar(t *testing.T) { ...@@ -76,11 +67,7 @@ func TestHasEnvVar(t *testing.T) {
}) })
require.True(t, ok, "must be able to cast the flag to an EnvVar interface") require.True(t, ok, "must be able to cast the flag to an EnvVar interface")
envFlags := envFlagGetter.GetEnvVars() envFlags := envFlagGetter.GetEnvVars()
if numEnvVars, ok := expEnvVars[flagName]; ok {
require.Equalf(t, numEnvVars, len(envFlags), "flags should have %d env vars", numEnvVars)
} else {
require.Equal(t, 1, len(envFlags), "flags should have exactly one env var") require.Equal(t, 1, len(envFlags), "flags should have exactly one env var")
}
}) })
} }
} }
......
...@@ -17,8 +17,8 @@ import ( ...@@ -17,8 +17,8 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -491,10 +491,10 @@ func (d *L2CoreDeployConfig) Check(log log.Logger) error { ...@@ -491,10 +491,10 @@ func (d *L2CoreDeployConfig) Check(log log.Logger) error {
return nil return nil
} }
// PlasmaDeployConfig configures optional Alt-DA and Plasma functionality. // AltDADeployConfig configures optional AltDA functionality.
type PlasmaDeployConfig struct { type AltDADeployConfig struct {
// UsePlasma is a flag that indicates if the system is using op-plasma // UseAltDA is a flag that indicates if the system is using op-alt-da
UsePlasma bool `json:"usePlasma"` UseAltDA bool `json:"useAltDA"`
// DACommitmentType specifies the allowed commitment // DACommitmentType specifies the allowed commitment
DACommitmentType string `json:"daCommitmentType"` DACommitmentType string `json:"daCommitmentType"`
// DAChallengeWindow represents the block interval during which the availability of a data commitment can be challenged. // DAChallengeWindow represents the block interval during which the availability of a data commitment can be challenged.
...@@ -508,15 +508,15 @@ type PlasmaDeployConfig struct { ...@@ -508,15 +508,15 @@ type PlasmaDeployConfig struct {
DAResolverRefundPercentage uint64 `json:"daResolverRefundPercentage"` DAResolverRefundPercentage uint64 `json:"daResolverRefundPercentage"`
} }
var _ ConfigChecker = (*PlasmaDeployConfig)(nil) var _ ConfigChecker = (*AltDADeployConfig)(nil)
func (d *PlasmaDeployConfig) Check(log log.Logger) error { func (d *AltDADeployConfig) Check(log log.Logger) error {
if d.UsePlasma { if d.UseAltDA {
if !(d.DACommitmentType == plasma.KeccakCommitmentString || d.DACommitmentType == plasma.GenericCommitmentString) { if !(d.DACommitmentType == altda.KeccakCommitmentString || d.DACommitmentType == altda.GenericCommitmentString) {
return fmt.Errorf("%w: DACommitmentType must be either KeccakCommitment or GenericCommitment", ErrInvalidDeployConfig) return fmt.Errorf("%w: DACommitmentType must be either KeccakCommitment or GenericCommitment", ErrInvalidDeployConfig)
} }
// only enforce challenge and resolve window if using alt-da mode with Keccak Commitments // only enforce challenge and resolve window if using alt-da mode with Keccak Commitments
if d.DACommitmentType != plasma.GenericCommitmentString { if d.DACommitmentType != altda.GenericCommitmentString {
if d.DAChallengeWindow == 0 { if d.DAChallengeWindow == 0 {
return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig) return fmt.Errorf("%w: DAChallengeWindow cannot be 0 when using alt-da mode with Keccak Commitments", ErrInvalidDeployConfig)
} }
...@@ -542,7 +542,7 @@ type L2InitializationConfig struct { ...@@ -542,7 +542,7 @@ type L2InitializationConfig struct {
EIP1559DeployConfig EIP1559DeployConfig
UpgradeScheduleDeployConfig UpgradeScheduleDeployConfig
L2CoreDeployConfig L2CoreDeployConfig
PlasmaDeployConfig AltDADeployConfig
} }
func (d *L2InitializationConfig) Check(log log.Logger) error { func (d *L2InitializationConfig) Check(log log.Logger) error {
...@@ -719,7 +719,7 @@ type L1DependenciesConfig struct { ...@@ -719,7 +719,7 @@ type L1DependenciesConfig struct {
// DependencyContext is the contextual configuration needed to verify the L1 dependencies, // DependencyContext is the contextual configuration needed to verify the L1 dependencies,
// used by DeployConfig.CheckAddresses. // used by DeployConfig.CheckAddresses.
type DependencyContext struct { type DependencyContext struct {
UsePlasma bool UseAltDA bool
DACommitmentType string DACommitmentType string
} }
...@@ -740,9 +740,9 @@ func (d *L1DependenciesConfig) CheckAddresses(dependencyContext DependencyContex ...@@ -740,9 +740,9 @@ func (d *L1DependenciesConfig) CheckAddresses(dependencyContext DependencyContex
return fmt.Errorf("%w: OptimismPortalProxy cannot be address(0)", ErrInvalidDeployConfig) return fmt.Errorf("%w: OptimismPortalProxy cannot be address(0)", ErrInvalidDeployConfig)
} }
if dependencyContext.UsePlasma && dependencyContext.DACommitmentType == plasma.KeccakCommitmentString && d.DAChallengeProxy == (common.Address{}) { if dependencyContext.UseAltDA && dependencyContext.DACommitmentType == altda.KeccakCommitmentString && d.DAChallengeProxy == (common.Address{}) {
return fmt.Errorf("%w: DAChallengeContract cannot be address(0) when using alt-da mode", ErrInvalidDeployConfig) return fmt.Errorf("%w: DAChallengeContract cannot be address(0) when using alt-da mode", ErrInvalidDeployConfig)
} else if dependencyContext.UsePlasma && dependencyContext.DACommitmentType == plasma.GenericCommitmentString && d.DAChallengeProxy != (common.Address{}) { } else if dependencyContext.UseAltDA && dependencyContext.DACommitmentType == altda.GenericCommitmentString && d.DAChallengeProxy != (common.Address{}) {
return fmt.Errorf("%w: DAChallengeContract must be address(0) when using generic commitments in alt-da mode", ErrInvalidDeployConfig) return fmt.Errorf("%w: DAChallengeContract must be address(0) when using generic commitments in alt-da mode", ErrInvalidDeployConfig)
} }
return nil return nil
...@@ -834,7 +834,7 @@ func (d *DeployConfig) Check(log log.Logger) error { ...@@ -834,7 +834,7 @@ func (d *DeployConfig) Check(log log.Logger) error {
// circular dependency that should be resolved in the future. // circular dependency that should be resolved in the future.
func (d *DeployConfig) CheckAddresses() error { func (d *DeployConfig) CheckAddresses() error {
return d.L1DependenciesConfig.CheckAddresses(DependencyContext{ return d.L1DependenciesConfig.CheckAddresses(DependencyContext{
UsePlasma: d.UsePlasma, UseAltDA: d.UseAltDA,
DACommitmentType: d.DACommitmentType, DACommitmentType: d.DACommitmentType,
}) })
} }
...@@ -858,9 +858,9 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas ...@@ -858,9 +858,9 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
if d.SystemConfigProxy == (common.Address{}) { if d.SystemConfigProxy == (common.Address{}) {
return nil, errors.New("SystemConfigProxy cannot be address(0)") return nil, errors.New("SystemConfigProxy cannot be address(0)")
} }
var plasma *rollup.PlasmaConfig var altDA *rollup.AltDAConfig
if d.UsePlasma { if d.UseAltDA {
plasma = &rollup.PlasmaConfig{ altDA = &rollup.AltDAConfig{
CommitmentType: d.DACommitmentType, CommitmentType: d.DACommitmentType,
DAChallengeAddress: d.DAChallengeProxy, DAChallengeAddress: d.DAChallengeProxy,
DAChallengeWindow: d.DAChallengeWindow, DAChallengeWindow: d.DAChallengeWindow,
...@@ -903,7 +903,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas ...@@ -903,7 +903,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
FjordTime: d.FjordTime(l1StartBlock.Time()), FjordTime: d.FjordTime(l1StartBlock.Time()),
GraniteTime: d.GraniteTime(l1StartBlock.Time()), GraniteTime: d.GraniteTime(l1StartBlock.Time()),
InteropTime: d.InteropTime(l1StartBlock.Time()), InteropTime: d.InteropTime(l1StartBlock.Time()),
PlasmaConfig: plasma, AltDAConfig: altDA,
}, nil }, nil
} }
...@@ -987,7 +987,7 @@ func (d *L1Deployments) Check(deployConfig *DeployConfig) error { ...@@ -987,7 +987,7 @@ func (d *L1Deployments) Check(deployConfig *DeployConfig) error {
name == "DisputeGameFactoryProxy") { name == "DisputeGameFactoryProxy") {
continue continue
} }
if !deployConfig.UsePlasma && if !deployConfig.UseAltDA &&
(name == "DataAvailabilityChallenge" || (name == "DataAvailabilityChallenge" ||
name == "DataAvailabilityChallengeProxy") { name == "DataAvailabilityChallengeProxy") {
continue continue
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
"respectedGameType": 0, "respectedGameType": 0,
"useCustomGasToken": false, "useCustomGasToken": false,
"useFaultProofs": false, "useFaultProofs": false,
"usePlasma": false, "useAltDA": false,
"daBondSize": 0, "daBondSize": 0,
"daCommitmentType": "KeccakCommitment", "daCommitmentType": "KeccakCommitment",
"daChallengeProxy": "0x0000000000000000000000000000000000000000", "daChallengeProxy": "0x0000000000000000000000000000000000000000",
......
...@@ -12,25 +12,25 @@ import ( ...@@ -12,25 +12,25 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-alt-da/bindings"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/node/safedb" "github.com/ethereum-optimism/optimism/op-node/node/safedb"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/event" "github.com/ethereum-optimism/optimism/op-node/rollup/event"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-plasma/bindings"
"github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/sources"
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
) )
// Devnet allocs should have alt-da mode enabled for these tests to pass // Devnet allocs should have alt-da mode enabled for these tests to pass
// L2PlasmaDA is a test harness for manipulating plasma DA state. // L2AltDA is a test harness for manipulating AltDA state.
type L2PlasmaDA struct { type L2AltDA struct {
log log.Logger log log.Logger
storage *plasma.DAErrFaker storage *altda.DAErrFaker
daMgr *plasma.DA daMgr *altda.DA
plasmaCfg plasma.Config altDACfg altda.Config
contract *bindings.DataAvailabilityChallenge contract *bindings.DataAvailabilityChallenge
batcher *L2Batcher batcher *L2Batcher
sequencer *L2Sequencer sequencer *L2Sequencer
...@@ -44,15 +44,15 @@ type L2PlasmaDA struct { ...@@ -44,15 +44,15 @@ type L2PlasmaDA struct {
lastCommBn uint64 lastCommBn uint64
} }
type PlasmaParam func(p *e2eutils.TestParams) type AltDAParam func(p *e2eutils.TestParams)
func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { func NewL2AltDA(t Testing, params ...AltDAParam) *L2AltDA {
p := &e2eutils.TestParams{ p := &e2eutils.TestParams{
MaxSequencerDrift: 40, MaxSequencerDrift: 40,
SequencerWindowSize: 12, SequencerWindowSize: 12,
ChannelTimeout: 12, ChannelTimeout: 12,
L1BlockTime: 12, L1BlockTime: 12,
UsePlasma: true, UseAltDA: true,
} }
for _, apply := range params { for _, apply := range params {
apply(p) apply(p)
...@@ -62,7 +62,7 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { ...@@ -62,7 +62,7 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA {
dp := e2eutils.MakeDeployParams(t, p) dp := e2eutils.MakeDeployParams(t, p)
sd := e2eutils.Setup(t, dp, defaultAlloc) sd := e2eutils.Setup(t, dp, defaultAlloc)
require.True(t, sd.RollupCfg.PlasmaEnabled()) require.True(t, sd.RollupCfg.AltDAEnabled())
miner := NewL1Miner(t, log, sd.L1Cfg) miner := NewL1Miner(t, log, sd.L1Cfg)
l1Client := miner.EthClient() l1Client := miner.EthClient()
...@@ -71,21 +71,21 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { ...@@ -71,21 +71,21 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA {
engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath) engine := NewL2Engine(t, log, sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath)
engCl := engine.EngineClient(t, sd.RollupCfg) engCl := engine.EngineClient(t, sd.RollupCfg)
storage := &plasma.DAErrFaker{Client: plasma.NewMockDAClient(log)} storage := &altda.DAErrFaker{Client: altda.NewMockDAClient(log)}
l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindBasic)) l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindBasic))
require.NoError(t, err) require.NoError(t, err)
plasmaCfg, err := sd.RollupCfg.GetOPPlasmaConfig() altDACfg, err := sd.RollupCfg.GetOPAltDAConfig()
require.NoError(t, err) require.NoError(t, err)
daMgr := plasma.NewPlasmaDAWithStorage(log, plasmaCfg, storage, &plasma.NoopMetrics{}) daMgr := altda.NewAltDAWithStorage(log, altDACfg, storage, &altda.NoopMetrics{})
sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), daMgr, engCl, sd.RollupCfg, 0) sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), daMgr, engCl, sd.RollupCfg, 0)
miner.ActL1SetFeeRecipient(common.Address{'A'}) miner.ActL1SetFeeRecipient(common.Address{'A'})
sequencer.ActL2PipelineFull(t) sequencer.ActL2PipelineFull(t)
batcher := NewL2Batcher(log, sd.RollupCfg, PlasmaBatcherCfg(dp, storage), sequencer.RollupClient(), l1Client, engine.EthClient(), engCl) batcher := NewL2Batcher(log, sd.RollupCfg, AltDABatcherCfg(dp, storage), sequencer.RollupClient(), l1Client, engine.EthClient(), engCl)
addresses := e2eutils.CollectAddresses(sd, dp) addresses := e2eutils.CollectAddresses(sd, dp)
cl := engine.EthClient() cl := engine.EthClient()
...@@ -98,22 +98,22 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { ...@@ -98,22 +98,22 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA {
alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b))) alice := NewCrossLayerUser(log, dp.Secrets.Alice, rand.New(rand.NewSource(0xa57b)))
alice.L2.SetUserEnv(l2UserEnv) alice.L2.SetUserEnv(l2UserEnv)
contract, err := bindings.NewDataAvailabilityChallenge(sd.RollupCfg.PlasmaConfig.DAChallengeAddress, l1Client) contract, err := bindings.NewDataAvailabilityChallenge(sd.RollupCfg.AltDAConfig.DAChallengeAddress, l1Client)
require.NoError(t, err) require.NoError(t, err)
challengeWindow, err := contract.ChallengeWindow(nil) challengeWindow, err := contract.ChallengeWindow(nil)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, plasmaCfg.ChallengeWindow, challengeWindow.Uint64()) require.Equal(t, altDACfg.ChallengeWindow, challengeWindow.Uint64())
resolveWindow, err := contract.ResolveWindow(nil) resolveWindow, err := contract.ResolveWindow(nil)
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, plasmaCfg.ResolveWindow, resolveWindow.Uint64()) require.Equal(t, altDACfg.ResolveWindow, resolveWindow.Uint64())
return &L2PlasmaDA{ return &L2AltDA{
log: log, log: log,
storage: storage, storage: storage,
daMgr: daMgr, daMgr: daMgr,
plasmaCfg: plasmaCfg, altDACfg: altDACfg,
contract: contract, contract: contract,
batcher: batcher, batcher: batcher,
sequencer: sequencer, sequencer: sequencer,
...@@ -126,25 +126,25 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA { ...@@ -126,25 +126,25 @@ func NewL2PlasmaDA(t Testing, params ...PlasmaParam) *L2PlasmaDA {
} }
} }
func (a *L2PlasmaDA) StorageClient() *plasma.DAErrFaker { func (a *L2AltDA) StorageClient() *altda.DAErrFaker {
return a.storage return a.storage
} }
func (a *L2PlasmaDA) NewVerifier(t Testing) *L2Verifier { func (a *L2AltDA) NewVerifier(t Testing) *L2Verifier {
jwtPath := e2eutils.WriteDefaultJWT(t) jwtPath := e2eutils.WriteDefaultJWT(t)
engine := NewL2Engine(t, a.log, a.sd.L2Cfg, a.sd.RollupCfg.Genesis.L1, jwtPath) engine := NewL2Engine(t, a.log, a.sd.L2Cfg, a.sd.RollupCfg.Genesis.L1, jwtPath)
engCl := engine.EngineClient(t, a.sd.RollupCfg) engCl := engine.EngineClient(t, a.sd.RollupCfg)
l1F, err := sources.NewL1Client(a.miner.RPCClient(), a.log, nil, sources.L1ClientDefaultConfig(a.sd.RollupCfg, false, sources.RPCKindBasic)) l1F, err := sources.NewL1Client(a.miner.RPCClient(), a.log, nil, sources.L1ClientDefaultConfig(a.sd.RollupCfg, false, sources.RPCKindBasic))
require.NoError(t, err) require.NoError(t, err)
daMgr := plasma.NewPlasmaDAWithStorage(a.log, a.plasmaCfg, a.storage, &plasma.NoopMetrics{}) daMgr := altda.NewAltDAWithStorage(a.log, a.altDACfg, a.storage, &altda.NoopMetrics{})
verifier := NewL2Verifier(t, a.log, l1F, a.miner.BlobStore(), daMgr, engCl, a.sd.RollupCfg, &sync.Config{}, safedb.Disabled) verifier := NewL2Verifier(t, a.log, l1F, a.miner.BlobStore(), daMgr, engCl, a.sd.RollupCfg, &sync.Config{}, safedb.Disabled)
return verifier return verifier
} }
func (a *L2PlasmaDA) ActSequencerIncludeTx(t Testing) { func (a *L2AltDA) ActSequencerIncludeTx(t Testing) {
a.alice.L2.ActResetTxOpts(t) a.alice.L2.ActResetTxOpts(t)
a.alice.L2.ActSetTxToAddr(&a.dp.Addresses.Bob)(t) a.alice.L2.ActSetTxToAddr(&a.dp.Addresses.Bob)(t)
a.alice.L2.ActMakeTx(t) a.alice.L2.ActMakeTx(t)
...@@ -156,7 +156,7 @@ func (a *L2PlasmaDA) ActSequencerIncludeTx(t Testing) { ...@@ -156,7 +156,7 @@ func (a *L2PlasmaDA) ActSequencerIncludeTx(t Testing) {
a.sequencer.ActL2EndBlock(t) a.sequencer.ActL2EndBlock(t)
} }
func (a *L2PlasmaDA) ActNewL2Tx(t Testing) { func (a *L2AltDA) ActNewL2Tx(t Testing) {
a.ActSequencerIncludeTx(t) a.ActSequencerIncludeTx(t)
a.batcher.ActL2BatchBuffer(t) a.batcher.ActL2BatchBuffer(t)
...@@ -173,17 +173,17 @@ func (a *L2PlasmaDA) ActNewL2Tx(t Testing) { ...@@ -173,17 +173,17 @@ func (a *L2PlasmaDA) ActNewL2Tx(t Testing) {
a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64() a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64()
} }
func (a *L2PlasmaDA) ActDeleteLastInput(t Testing) { func (a *L2AltDA) ActDeleteLastInput(t Testing) {
require.NoError(t, a.storage.Client.DeleteData(a.lastComm)) require.NoError(t, a.storage.Client.DeleteData(a.lastComm))
} }
func (a *L2PlasmaDA) ActChallengeLastInput(t Testing) { func (a *L2AltDA) ActChallengeLastInput(t Testing) {
a.ActChallengeInput(t, a.lastComm, a.lastCommBn) a.ActChallengeInput(t, a.lastComm, a.lastCommBn)
a.log.Info("challenged last input", "block", a.lastCommBn) a.log.Info("challenged last input", "block", a.lastCommBn)
} }
func (a *L2PlasmaDA) ActChallengeInput(t Testing, comm []byte, bn uint64) { func (a *L2AltDA) ActChallengeInput(t Testing, comm []byte, bn uint64) {
bondValue, err := a.contract.BondSize(&bind.CallOpts{}) bondValue, err := a.contract.BondSize(&bind.CallOpts{})
require.NoError(t, err) require.NoError(t, err)
...@@ -209,15 +209,15 @@ func (a *L2PlasmaDA) ActChallengeInput(t Testing, comm []byte, bn uint64) { ...@@ -209,15 +209,15 @@ func (a *L2PlasmaDA) ActChallengeInput(t Testing, comm []byte, bn uint64) {
a.miner.ActL1EndBlock(t) a.miner.ActL1EndBlock(t)
} }
func (a *L2PlasmaDA) ActExpireLastInput(t Testing) { func (a *L2AltDA) ActExpireLastInput(t Testing) {
reorgWindow := a.plasmaCfg.ResolveWindow + a.plasmaCfg.ChallengeWindow reorgWindow := a.altDACfg.ResolveWindow + a.altDACfg.ChallengeWindow
for a.miner.l1Chain.CurrentBlock().Number.Uint64() <= a.lastCommBn+reorgWindow { for a.miner.l1Chain.CurrentBlock().Number.Uint64() <= a.lastCommBn+reorgWindow {
a.miner.ActL1StartBlock(12)(t) a.miner.ActL1StartBlock(12)(t)
a.miner.ActL1EndBlock(t) a.miner.ActL1EndBlock(t)
} }
} }
func (a *L2PlasmaDA) ActResolveInput(t Testing, comm []byte, input []byte, bn uint64) { func (a *L2AltDA) ActResolveInput(t Testing, comm []byte, input []byte, bn uint64) {
txOpts, err := bind.NewKeyedTransactorWithChainID(a.dp.Secrets.Alice, a.sd.L1Cfg.Config.ChainID) txOpts, err := bind.NewKeyedTransactorWithChainID(a.dp.Secrets.Alice, a.sd.L1Cfg.Config.ChainID)
require.NoError(t, err) require.NoError(t, err)
...@@ -229,22 +229,22 @@ func (a *L2PlasmaDA) ActResolveInput(t Testing, comm []byte, input []byte, bn ui ...@@ -229,22 +229,22 @@ func (a *L2PlasmaDA) ActResolveInput(t Testing, comm []byte, input []byte, bn ui
a.miner.ActL1EndBlock(t) a.miner.ActL1EndBlock(t)
} }
func (a *L2PlasmaDA) ActResolveLastChallenge(t Testing) { func (a *L2AltDA) ActResolveLastChallenge(t Testing) {
// remove derivation byte prefix // remove derivation byte prefix
input, err := a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(a.lastComm[1:])) input, err := a.storage.GetInput(t.Ctx(), altda.Keccak256Commitment(a.lastComm[1:]))
require.NoError(t, err) require.NoError(t, err)
a.ActResolveInput(t, a.lastComm, input, a.lastCommBn) a.ActResolveInput(t, a.lastComm, input, a.lastCommBn)
} }
func (a *L2PlasmaDA) ActL1Blocks(t Testing, n uint64) { func (a *L2AltDA) ActL1Blocks(t Testing, n uint64) {
for i := uint64(0); i < n; i++ { for i := uint64(0); i < n; i++ {
a.miner.ActL1StartBlock(12)(t) a.miner.ActL1StartBlock(12)(t)
a.miner.ActL1EndBlock(t) a.miner.ActL1EndBlock(t)
} }
} }
func (a *L2PlasmaDA) GetLastTxBlock(t Testing) *types.Block { func (a *L2AltDA) GetLastTxBlock(t Testing) *types.Block {
rcpt, err := a.engine.EthClient().TransactionReceipt(t.Ctx(), a.alice.L2.lastTxHash) rcpt, err := a.engine.EthClient().TransactionReceipt(t.Ctx(), a.alice.L2.lastTxHash)
require.NoError(t, err) require.NoError(t, err)
blk, err := a.engine.EthClient().BlockByHash(t.Ctx(), rcpt.BlockHash) blk, err := a.engine.EthClient().BlockByHash(t.Ctx(), rcpt.BlockHash)
...@@ -252,7 +252,7 @@ func (a *L2PlasmaDA) GetLastTxBlock(t Testing) *types.Block { ...@@ -252,7 +252,7 @@ func (a *L2PlasmaDA) GetLastTxBlock(t Testing) *types.Block {
return blk return blk
} }
func (a *L2PlasmaDA) ActL1Finalized(t Testing) { func (a *L2AltDA) ActL1Finalized(t Testing) {
latest := a.miner.l1Chain.CurrentBlock().Number.Uint64() latest := a.miner.l1Chain.CurrentBlock().Number.Uint64()
a.miner.ActL1Safe(t, latest) a.miner.ActL1Safe(t, latest)
a.miner.ActL1Finalize(t, latest) a.miner.ActL1Finalize(t, latest)
...@@ -260,13 +260,13 @@ func (a *L2PlasmaDA) ActL1Finalized(t Testing) { ...@@ -260,13 +260,13 @@ func (a *L2PlasmaDA) ActL1Finalized(t Testing) {
} }
// Commitment is challenged but never resolved, chain reorgs when challenge window expires. // Commitment is challenged but never resolved, chain reorgs when challenge window expires.
func TestPlasma_ChallengeExpired(gt *testing.T) { func TestAltDA_ChallengeExpired(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
harness := NewL2PlasmaDA(t) harness := NewL2AltDA(t)
// generate enough initial l1 blocks to have a finalized head. // generate enough initial l1 blocks to have a finalized head.
harness.ActL1Blocks(t, 5) harness.ActL1Blocks(t, 5)
...@@ -288,7 +288,7 @@ func TestPlasma_ChallengeExpired(gt *testing.T) { ...@@ -288,7 +288,7 @@ func TestPlasma_ChallengeExpired(gt *testing.T) {
// catch up the sequencer derivation pipeline with the new l1 blocks. // catch up the sequencer derivation pipeline with the new l1 blocks.
harness.sequencer.ActL2PipelineFull(t) harness.sequencer.ActL2PipelineFull(t)
// the L1 finalized signal should trigger plasma to finalize the engine queue. // the L1 finalized signal should trigger altDA to finalize the engine queue.
harness.ActL1Finalized(t) harness.ActL1Finalized(t)
// move one more block for engine controller to update. // move one more block for engine controller to update.
...@@ -320,13 +320,13 @@ func TestPlasma_ChallengeExpired(gt *testing.T) { ...@@ -320,13 +320,13 @@ func TestPlasma_ChallengeExpired(gt *testing.T) {
// Commitment is challenged after sequencer derived the chain but data disappears. A verifier // Commitment is challenged after sequencer derived the chain but data disappears. A verifier
// derivation pipeline stalls until the challenge is resolved and then resumes with data from the contract. // derivation pipeline stalls until the challenge is resolved and then resumes with data from the contract.
func TestPlasma_ChallengeResolved(gt *testing.T) { func TestAltDA_ChallengeResolved(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
harness := NewL2PlasmaDA(t) harness := NewL2AltDA(t)
// include a new l2 transaction, submitting an input commitment to the l1. // include a new l2 transaction, submitting an input commitment to the l1.
harness.ActNewL2Tx(t) harness.ActNewL2Tx(t)
...@@ -368,13 +368,13 @@ func TestPlasma_ChallengeResolved(gt *testing.T) { ...@@ -368,13 +368,13 @@ func TestPlasma_ChallengeResolved(gt *testing.T) {
} }
// DA storage service goes offline while sequencer keeps making blocks. When storage comes back online, it should be able to catch up. // DA storage service goes offline while sequencer keeps making blocks. When storage comes back online, it should be able to catch up.
func TestPlasma_StorageError(gt *testing.T) { func TestAltDA_StorageError(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
harness := NewL2PlasmaDA(t) harness := NewL2AltDA(t)
// include a new l2 transaction, submitting an input commitment to the l1. // include a new l2 transaction, submitting an input commitment to the l1.
harness.ActNewL2Tx(t) harness.ActNewL2Tx(t)
...@@ -397,13 +397,13 @@ func TestPlasma_StorageError(gt *testing.T) { ...@@ -397,13 +397,13 @@ func TestPlasma_StorageError(gt *testing.T) {
// L1 chain reorgs a resolved challenge so it expires instead causing // L1 chain reorgs a resolved challenge so it expires instead causing
// the l2 chain to reorg as well. // the l2 chain to reorg as well.
func TestPlasma_ChallengeReorg(gt *testing.T) { func TestAltDA_ChallengeReorg(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
harness := NewL2PlasmaDA(t) harness := NewL2AltDA(t)
// New L2 tx added to a batch and committed to L1 // New L2 tx added to a batch and committed to L1
harness.ActNewL2Tx(t) harness.ActNewL2Tx(t)
...@@ -445,20 +445,20 @@ func TestPlasma_ChallengeReorg(gt *testing.T) { ...@@ -445,20 +445,20 @@ func TestPlasma_ChallengeReorg(gt *testing.T) {
// Sequencer stalls as data is not available, batcher keeps posting, untracked commitments are // Sequencer stalls as data is not available, batcher keeps posting, untracked commitments are
// challenged and resolved, then sequencer resumes and catches up. // challenged and resolved, then sequencer resumes and catches up.
func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) { func TestAltDA_SequencerStalledMultiChallenges(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
a := NewL2PlasmaDA(t) a := NewL2AltDA(t)
// create a new tx on l2 and commit it to l1 // create a new tx on l2 and commit it to l1
a.ActNewL2Tx(t) a.ActNewL2Tx(t)
// keep track of the related commitment // keep track of the related commitment
comm1 := a.lastComm comm1 := a.lastComm
input1, err := a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(comm1[1:])) input1, err := a.storage.GetInput(t.Ctx(), altda.Keccak256Commitment(comm1[1:]))
bn1 := a.lastCommBn bn1 := a.lastCommBn
require.NoError(t, err) require.NoError(t, err)
...@@ -507,7 +507,7 @@ func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) { ...@@ -507,7 +507,7 @@ func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) {
// keep track of the second commitment // keep track of the second commitment
comm2 := a.lastComm comm2 := a.lastComm
_, err = a.storage.GetInput(t.Ctx(), plasma.Keccak256Commitment(comm2[1:])) _, err = a.storage.GetInput(t.Ctx(), altda.Keccak256Commitment(comm2[1:]))
require.NoError(t, err) require.NoError(t, err)
a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64() a.lastCommBn = a.miner.l1Chain.CurrentBlock().Number.Uint64()
...@@ -539,14 +539,14 @@ func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) { ...@@ -539,14 +539,14 @@ func TestPlasma_SequencerStalledMultiChallenges(gt *testing.T) {
require.Equal(t, unsafeBlk.Hash(), safeBlk.Hash()) require.Equal(t, unsafeBlk.Hash(), safeBlk.Hash())
} }
// Verify that finalization happens based on plasma DA windows. // Verify that finalization happens based on altDA windows.
// based on l2_batcher_test.go L2Finalization // based on l2_batcher_test.go L2Finalization
func TestPlasma_Finalization(gt *testing.T) { func TestAltDA_Finalization(gt *testing.T) {
if !e2eutils.UsePlasma() { if !e2eutils.UseAltDA() {
gt.Skip("Plasma is not enabled") gt.Skip("AltDA is not enabled")
} }
t := NewDefaultTesting(gt) t := NewDefaultTesting(gt)
a := NewL2PlasmaDA(t) a := NewL2AltDA(t)
// build L1 block #1 // build L1 block #1
a.ActL1Blocks(t, 1) a.ActL1Blocks(t, 1)
...@@ -617,9 +617,9 @@ func TestPlasma_Finalization(gt *testing.T) { ...@@ -617,9 +617,9 @@ func TestPlasma_Finalization(gt *testing.T) {
require.Equal(t, uint64(0), a.sequencer.SyncStatus().FinalizedL2.Number) require.Equal(t, uint64(0), a.sequencer.SyncStatus().FinalizedL2.Number)
// expire the challenge window so these blocks can no longer be challenged // expire the challenge window so these blocks can no longer be challenged
a.ActL1Blocks(t, a.plasmaCfg.ChallengeWindow) a.ActL1Blocks(t, a.altDACfg.ChallengeWindow)
// advance derivation and finalize plasma via the L1 signal // advance derivation and finalize altDA via the L1 signal
a.sequencer.ActL2PipelineFull(t) a.sequencer.ActL2PipelineFull(t)
a.ActL1Finalized(t) a.ActL1Finalized(t)
a.sequencer.ActL2PipelineFull(t) // finality event needs to be processed a.sequencer.ActL2PipelineFull(t) // finality event needs to be processed
......
...@@ -19,13 +19,13 @@ import ( ...@@ -19,13 +19,13 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-batcher/batcher" "github.com/ethereum-optimism/optimism/op-batcher/batcher"
"github.com/ethereum-optimism/optimism/op-batcher/compressor" "github.com/ethereum-optimism/optimism/op-batcher/compressor"
batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags" batcherFlags "github.com/ethereum-optimism/optimism/op-batcher/flags"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/txmgr" "github.com/ethereum-optimism/optimism/op-service/txmgr"
) )
...@@ -44,8 +44,8 @@ type L1TxAPI interface { ...@@ -44,8 +44,8 @@ type L1TxAPI interface {
SendTransaction(ctx context.Context, tx *types.Transaction) error SendTransaction(ctx context.Context, tx *types.Transaction) error
} }
type PlasmaInputSetter interface { type AltDAInputSetter interface {
SetInput(ctx context.Context, img []byte) (plasma.CommitmentData, error) SetInput(ctx context.Context, img []byte) (altda.CommitmentData, error)
} }
type BatcherCfg struct { type BatcherCfg struct {
...@@ -59,10 +59,10 @@ type BatcherCfg struct { ...@@ -59,10 +59,10 @@ type BatcherCfg struct {
ForceSubmitSingularBatch bool ForceSubmitSingularBatch bool
ForceSubmitSpanBatch bool ForceSubmitSpanBatch bool
UsePlasma bool UseAltDA bool
DataAvailabilityType batcherFlags.DataAvailabilityType DataAvailabilityType batcherFlags.DataAvailabilityType
PlasmaDA PlasmaInputSetter AltDA AltDAInputSetter
} }
func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg { func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg {
...@@ -74,14 +74,14 @@ func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg { ...@@ -74,14 +74,14 @@ func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg {
} }
} }
func PlasmaBatcherCfg(dp *e2eutils.DeployParams, plasmaDa PlasmaInputSetter) *BatcherCfg { func AltDABatcherCfg(dp *e2eutils.DeployParams, altDA AltDAInputSetter) *BatcherCfg {
return &BatcherCfg{ return &BatcherCfg{
MinL1TxSize: 0, MinL1TxSize: 0,
MaxL1TxSize: 128_000, MaxL1TxSize: 128_000,
BatcherKey: dp.Secrets.Batcher, BatcherKey: dp.Secrets.Batcher,
DataAvailabilityType: batcherFlags.CalldataType, DataAvailabilityType: batcherFlags.CalldataType,
PlasmaDA: plasmaDa, AltDA: altDA,
UsePlasma: true, UseAltDA: true,
} }
} }
...@@ -250,9 +250,9 @@ func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.Dynamic ...@@ -250,9 +250,9 @@ func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.Dynamic
} }
payload := data.Bytes() payload := data.Bytes()
if s.l2BatcherCfg.UsePlasma { if s.l2BatcherCfg.UseAltDA {
comm, err := s.l2BatcherCfg.PlasmaDA.SetInput(t.Ctx(), payload) comm, err := s.l2BatcherCfg.AltDA.SetInput(t.Ctx(), payload)
require.NoError(t, err, "failed to set input for plasma") require.NoError(t, err, "failed to set input for altda")
payload = comm.TxData() payload = comm.TxData()
} }
......
...@@ -50,8 +50,8 @@ type L2Sequencer struct { ...@@ -50,8 +50,8 @@ type L2Sequencer struct {
} }
func NewL2Sequencer(t Testing, log log.Logger, l1 derive.L1Fetcher, blobSrc derive.L1BlobsFetcher, func NewL2Sequencer(t Testing, log log.Logger, l1 derive.L1Fetcher, blobSrc derive.L1BlobsFetcher,
plasmaSrc driver.PlasmaIface, eng L2API, cfg *rollup.Config, seqConfDepth uint64) *L2Sequencer { altDASrc driver.AltDAIface, eng L2API, cfg *rollup.Config, seqConfDepth uint64) *L2Sequencer {
ver := NewL2Verifier(t, log, l1, blobSrc, plasmaSrc, eng, cfg, &sync.Config{}, safedb.Disabled) ver := NewL2Verifier(t, log, l1, blobSrc, altDASrc, eng, cfg, &sync.Config{}, safedb.Disabled)
attrBuilder := derive.NewFetchingAttributesBuilder(cfg, l1, eng) attrBuilder := derive.NewFetchingAttributesBuilder(cfg, l1, eng)
seqConfDepthL1 := confdepth.NewConfDepth(seqConfDepth, ver.syncStatus.L1Head, l1) seqConfDepthL1 := confdepth.NewConfDepth(seqConfDepth, ver.syncStatus.L1Head, l1)
l1OriginSelector := &MockL1OriginSelector{ l1OriginSelector := &MockL1OriginSelector{
......
...@@ -15,8 +15,8 @@ import ( ...@@ -15,8 +15,8 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/sources"
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
) )
...@@ -48,7 +48,7 @@ func setupSequencerTest(t Testing, sd *e2eutils.SetupData, log log.Logger) (*L1M ...@@ -48,7 +48,7 @@ func setupSequencerTest(t Testing, sd *e2eutils.SetupData, log log.Logger) (*L1M
l2Cl, err := sources.NewEngineClient(engine.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) l2Cl, err := sources.NewEngineClient(engine.RPCClient(), log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg))
require.NoError(t, err) require.NoError(t, err)
sequencer := NewL2Sequencer(t, log.New("role", "sequencer"), l1F, miner.BlobStore(), plasma.Disabled, l2Cl, sd.RollupCfg, 0) sequencer := NewL2Sequencer(t, log.New("role", "sequencer"), l1F, miner.BlobStore(), altda.Disabled, l2Cl, sd.RollupCfg, 0)
return miner, engine, sequencer return miner, engine, sequencer
} }
......
...@@ -84,7 +84,7 @@ type safeDB interface { ...@@ -84,7 +84,7 @@ type safeDB interface {
node.SafeDBReader node.SafeDBReader
} }
func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc derive.L1BlobsFetcher, plasmaSrc driver.PlasmaIface, eng L2API, cfg *rollup.Config, syncCfg *sync.Config, safeHeadListener safeDB) *L2Verifier { func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc derive.L1BlobsFetcher, altDASrc driver.AltDAIface, eng L2API, cfg *rollup.Config, syncCfg *sync.Config, safeHeadListener safeDB) *L2Verifier {
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
t.Cleanup(cancel) t.Cleanup(cancel)
...@@ -115,8 +115,8 @@ func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc deri ...@@ -115,8 +115,8 @@ func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc deri
sys.Register("cl-sync", clSync, opts) sys.Register("cl-sync", clSync, opts)
var finalizer driver.Finalizer var finalizer driver.Finalizer
if cfg.PlasmaEnabled() { if cfg.AltDAEnabled() {
finalizer = finality.NewPlasmaFinalizer(ctx, log, cfg, l1, plasmaSrc) finalizer = finality.NewAltDAFinalizer(ctx, log, cfg, l1, altDASrc)
} else { } else {
finalizer = finality.NewFinalizer(ctx, log, cfg, l1) finalizer = finality.NewFinalizer(ctx, log, cfg, l1)
} }
...@@ -125,7 +125,7 @@ func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc deri ...@@ -125,7 +125,7 @@ func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc deri
sys.Register("attributes-handler", sys.Register("attributes-handler",
attributes.NewAttributesHandler(log, cfg, ctx, eng), opts) attributes.NewAttributesHandler(log, cfg, ctx, eng), opts)
pipeline := derive.NewDerivationPipeline(log, cfg, l1, blobsSrc, plasmaSrc, eng, metrics) pipeline := derive.NewDerivationPipeline(log, cfg, l1, blobsSrc, altDASrc, eng, metrics)
sys.Register("pipeline", derive.NewPipelineDeriver(ctx, pipeline), opts) sys.Register("pipeline", derive.NewPipelineDeriver(ctx, pipeline), opts)
testActionEmitter := sys.Register("test-action", nil, opts) testActionEmitter := sys.Register("test-action", nil, opts)
......
...@@ -3,8 +3,8 @@ package actions ...@@ -3,8 +3,8 @@ package actions
import ( import (
"testing" "testing"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/node/safedb" "github.com/ethereum-optimism/optimism/op-node/node/safedb"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
...@@ -41,7 +41,7 @@ func setupVerifier(t Testing, sd *e2eutils.SetupData, log log.Logger, l1F derive ...@@ -41,7 +41,7 @@ func setupVerifier(t Testing, sd *e2eutils.SetupData, log log.Logger, l1F derive
jwtPath := e2eutils.WriteDefaultJWT(t) jwtPath := e2eutils.WriteDefaultJWT(t)
engine := NewL2Engine(t, log.New("role", "verifier-engine"), sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, EngineWithP2P()) engine := NewL2Engine(t, log.New("role", "verifier-engine"), sd.L2Cfg, sd.RollupCfg.Genesis.L1, jwtPath, EngineWithP2P())
engCl := engine.EngineClient(t, sd.RollupCfg) engCl := engine.EngineClient(t, sd.RollupCfg)
verifier := NewL2Verifier(t, log.New("role", "verifier"), l1F, blobSrc, plasma.Disabled, engCl, sd.RollupCfg, syncCfg, cfg.safeHeadListener) verifier := NewL2Verifier(t, log.New("role", "verifier"), l1F, blobSrc, altda.Disabled, engCl, sd.RollupCfg, syncCfg, cfg.safeHeadListener)
return engine, verifier return engine, verifier
} }
......
...@@ -14,9 +14,9 @@ import ( ...@@ -14,9 +14,9 @@ import (
"github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/node"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/client" "github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/sources"
...@@ -613,7 +613,7 @@ func RestartOpGeth(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { ...@@ -613,7 +613,7 @@ func RestartOpGeth(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
engRpc := &rpcWrapper{seqEng.RPCClient()} engRpc := &rpcWrapper{seqEng.RPCClient()}
l2Cl, err := sources.NewEngineClient(engRpc, log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg)) l2Cl, err := sources.NewEngineClient(engRpc, log, nil, sources.EngineClientDefaultConfig(sd.RollupCfg))
require.NoError(t, err) require.NoError(t, err)
sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), plasma.Disabled, l2Cl, sd.RollupCfg, 0) sequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), altda.Disabled, l2Cl, sd.RollupCfg, 0)
batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), batcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp),
sequencer.RollupClient(), miner.EthClient(), seqEng.EthClient(), seqEng.EngineClient(t, sd.RollupCfg)) sequencer.RollupClient(), miner.EthClient(), seqEng.EthClient(), seqEng.EngineClient(t, sd.RollupCfg))
...@@ -701,7 +701,7 @@ func ConflictingL2Blocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) { ...@@ -701,7 +701,7 @@ func ConflictingL2Blocks(gt *testing.T, deltaTimeOffset *hexutil.Uint64) {
require.NoError(t, err) require.NoError(t, err)
l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard)) l1F, err := sources.NewL1Client(miner.RPCClient(), log, nil, sources.L1ClientDefaultConfig(sd.RollupCfg, false, sources.RPCKindStandard))
require.NoError(t, err) require.NoError(t, err)
altSequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), plasma.Disabled, altSeqEngCl, sd.RollupCfg, 0) altSequencer := NewL2Sequencer(t, log, l1F, miner.BlobStore(), altda.Disabled, altSeqEngCl, sd.RollupCfg, 0)
altBatcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp), altBatcher := NewL2Batcher(log, sd.RollupCfg, DefaultBatcherCfg(dp),
altSequencer.RollupClient(), miner.EthClient(), altSeqEng.EthClient(), altSeqEng.EngineClient(t, sd.RollupCfg)) altSequencer.RollupClient(), miner.EthClient(), altSeqEng.EthClient(), altSeqEng.EngineClient(t, sd.RollupCfg))
......
...@@ -19,13 +19,13 @@ import ( ...@@ -19,13 +19,13 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/rpc"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-e2e/e2eutils" "github.com/ethereum-optimism/optimism/op-e2e/e2eutils"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
engine2 "github.com/ethereum-optimism/optimism/op-node/rollup/engine" engine2 "github.com/ethereum-optimism/optimism/op-node/rollup/engine"
"github.com/ethereum-optimism/optimism/op-node/rollup/event" "github.com/ethereum-optimism/optimism/op-node/rollup/event"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/sources"
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
...@@ -819,7 +819,7 @@ func TestELSyncTransitionsToCLSyncAfterNodeRestart(gt *testing.T) { ...@@ -819,7 +819,7 @@ func TestELSyncTransitionsToCLSyncAfterNodeRestart(gt *testing.T) {
PrepareELSyncedNode(t, miner, sequencer, seqEng, verifier, verEng, seqEngCl, batcher, dp) PrepareELSyncedNode(t, miner, sequencer, seqEng, verifier, verEng, seqEngCl, batcher, dp)
// Create a new verifier which is essentially a new op-node with the sync mode of ELSync and default geth engine kind. // Create a new verifier which is essentially a new op-node with the sync mode of ELSync and default geth engine kind.
verifier = NewL2Verifier(t, captureLog, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), plasma.Disabled, verifier.eng, sd.RollupCfg, &sync.Config{SyncMode: sync.ELSync}, defaultVerifierCfg().safeHeadListener) verifier = NewL2Verifier(t, captureLog, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), altda.Disabled, verifier.eng, sd.RollupCfg, &sync.Config{SyncMode: sync.ELSync}, defaultVerifierCfg().safeHeadListener)
// Build another 10 L1 blocks on the sequencer // Build another 10 L1 blocks on the sequencer
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
...@@ -861,7 +861,7 @@ func TestForcedELSyncCLAfterNodeRestart(gt *testing.T) { ...@@ -861,7 +861,7 @@ func TestForcedELSyncCLAfterNodeRestart(gt *testing.T) {
PrepareELSyncedNode(t, miner, sequencer, seqEng, verifier, verEng, seqEngCl, batcher, dp) PrepareELSyncedNode(t, miner, sequencer, seqEng, verifier, verEng, seqEngCl, batcher, dp)
// Create a new verifier which is essentially a new op-node with the sync mode of ELSync and erigon engine kind. // Create a new verifier which is essentially a new op-node with the sync mode of ELSync and erigon engine kind.
verifier2 := NewL2Verifier(t, captureLog, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), plasma.Disabled, verifier.eng, sd.RollupCfg, &sync.Config{SyncMode: sync.ELSync, SupportsPostFinalizationELSync: true}, defaultVerifierCfg().safeHeadListener) verifier2 := NewL2Verifier(t, captureLog, miner.L1Client(t, sd.RollupCfg), miner.BlobStore(), altda.Disabled, verifier.eng, sd.RollupCfg, &sync.Config{SyncMode: sync.ELSync, SupportsPostFinalizationELSync: true}, defaultVerifierCfg().safeHeadListener)
// Build another 10 L1 blocks on the sequencer // Build another 10 L1 blocks on the sequencer
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
......
...@@ -14,10 +14,10 @@ import ( ...@@ -14,10 +14,10 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis" "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
"github.com/ethereum-optimism/optimism/op-e2e/config" "github.com/ethereum-optimism/optimism/op-e2e/config"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -47,7 +47,7 @@ type TestParams struct { ...@@ -47,7 +47,7 @@ type TestParams struct {
SequencerWindowSize uint64 SequencerWindowSize uint64
ChannelTimeout uint64 ChannelTimeout uint64
L1BlockTime uint64 L1BlockTime uint64
UsePlasma bool UseAltDA bool
} }
func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
...@@ -62,7 +62,7 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams { ...@@ -62,7 +62,7 @@ func MakeDeployParams(t require.TestingT, tp *TestParams) *DeployParams {
deployConfig.ChannelTimeoutBedrock = tp.ChannelTimeout deployConfig.ChannelTimeoutBedrock = tp.ChannelTimeout
deployConfig.ChannelTimeoutGranite = tp.ChannelTimeout deployConfig.ChannelTimeoutGranite = tp.ChannelTimeout
deployConfig.L1BlockTime = tp.L1BlockTime deployConfig.L1BlockTime = tp.L1BlockTime
deployConfig.UsePlasma = tp.UsePlasma deployConfig.UseAltDA = tp.UseAltDA
ApplyDeployConfigForks(deployConfig) ApplyDeployConfigForks(deployConfig)
logger := log.NewLogger(log.DiscardHandler()) logger := log.NewLogger(log.DiscardHandler())
...@@ -148,13 +148,13 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * ...@@ -148,13 +148,13 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *
l2Genesis.Alloc[addr] = val l2Genesis.Alloc[addr] = val
} }
var pcfg *rollup.PlasmaConfig var pcfg *rollup.AltDAConfig
if deployConf.UsePlasma { if deployConf.UseAltDA {
pcfg = &rollup.PlasmaConfig{ pcfg = &rollup.AltDAConfig{
DAChallengeAddress: l1Deployments.DataAvailabilityChallengeProxy, DAChallengeAddress: l1Deployments.DataAvailabilityChallengeProxy,
DAChallengeWindow: deployConf.DAChallengeWindow, DAChallengeWindow: deployConf.DAChallengeWindow,
DAResolveWindow: deployConf.DAResolveWindow, DAResolveWindow: deployConf.DAResolveWindow,
CommitmentType: plasma.KeccakCommitmentString, CommitmentType: altda.KeccakCommitmentString,
} }
} }
...@@ -188,7 +188,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) * ...@@ -188,7 +188,7 @@ func Setup(t require.TestingT, deployParams *DeployParams, alloc *AllocParams) *
FjordTime: deployConf.FjordTime(uint64(deployConf.L1GenesisBlockTimestamp)), FjordTime: deployConf.FjordTime(uint64(deployConf.L1GenesisBlockTimestamp)),
GraniteTime: deployConf.GraniteTime(uint64(deployConf.L1GenesisBlockTimestamp)), GraniteTime: deployConf.GraniteTime(uint64(deployConf.L1GenesisBlockTimestamp)),
InteropTime: deployConf.InteropTime(uint64(deployConf.L1GenesisBlockTimestamp)), InteropTime: deployConf.InteropTime(uint64(deployConf.L1GenesisBlockTimestamp)),
PlasmaConfig: pcfg, AltDAConfig: pcfg,
} }
require.NoError(t, rollupCfg.Check()) require.NoError(t, rollupCfg.Check())
...@@ -247,7 +247,7 @@ func UseL2OO() bool { ...@@ -247,7 +247,7 @@ func UseL2OO() bool {
os.Getenv("DEVNET_L2OO") == "true") os.Getenv("DEVNET_L2OO") == "true")
} }
func UsePlasma() bool { func UseAltDA() bool {
return (os.Getenv("OP_E2E_USE_PLASMA") == "true" || return (os.Getenv("OP_E2E_USE_ALTDA") == "true" ||
os.Getenv("DEVNET_PLASMA") == "true") os.Getenv("DEVNET_ALTDA") == "true")
} }
...@@ -6,9 +6,9 @@ import ( ...@@ -6,9 +6,9 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup/engine" "github.com/ethereum-optimism/optimism/op-node/rollup/engine"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
openum "github.com/ethereum-optimism/optimism/op-service/enum" openum "github.com/ethereum-optimism/optimism/op-service/enum"
opflags "github.com/ethereum-optimism/optimism/op-service/flags" opflags "github.com/ethereum-optimism/optimism/op-service/flags"
oplog "github.com/ethereum-optimism/optimism/op-service/log" oplog "github.com/ethereum-optimism/optimism/op-service/log"
...@@ -438,7 +438,7 @@ func init() { ...@@ -438,7 +438,7 @@ func init() {
optionalFlags = append(optionalFlags, oppprof.CLIFlagsWithCategory(EnvVarPrefix, OperationsCategory)...) optionalFlags = append(optionalFlags, oppprof.CLIFlagsWithCategory(EnvVarPrefix, OperationsCategory)...)
optionalFlags = append(optionalFlags, DeprecatedFlags...) optionalFlags = append(optionalFlags, DeprecatedFlags...)
optionalFlags = append(optionalFlags, opflags.CLIFlags(EnvVarPrefix, RollupCategory)...) optionalFlags = append(optionalFlags, opflags.CLIFlags(EnvVarPrefix, RollupCategory)...)
optionalFlags = append(optionalFlags, plasma.CLIFlags(EnvVarPrefix, AltDACategory)...) optionalFlags = append(optionalFlags, altda.CLIFlags(EnvVarPrefix, AltDACategory)...)
Flags = append(requiredFlags, optionalFlags...) Flags = append(requiredFlags, optionalFlags...)
} }
......
...@@ -5,7 +5,6 @@ import ( ...@@ -5,7 +5,6 @@ import (
"strings" "strings"
"testing" "testing"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
opservice "github.com/ethereum-optimism/optimism/op-service" opservice "github.com/ethereum-optimism/optimism/op-service"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
...@@ -75,10 +74,6 @@ func TestHasEnvVar(t *testing.T) { ...@@ -75,10 +74,6 @@ func TestHasEnvVar(t *testing.T) {
// known exceptions to the number of env vars // known exceptions to the number of env vars
expEnvVars := map[string]int{ expEnvVars := map[string]int{
BeaconFallbackAddrs.Name: 2, BeaconFallbackAddrs.Name: 2,
plasma.EnabledFlagName: 2,
plasma.DaServerAddressFlagName: 2,
plasma.VerifyOnReadFlagName: 2,
plasma.DaServiceFlag: 2,
} }
for _, flag := range Flags { for _, flag := range Flags {
......
...@@ -9,8 +9,8 @@ import ( ...@@ -9,8 +9,8 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/p2p/store" "github.com/ethereum-optimism/optimism/op-node/p2p/store"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
ophttp "github.com/ethereum-optimism/optimism/op-service/httputil" ophttp "github.com/ethereum-optimism/optimism/op-service/httputil"
"github.com/ethereum-optimism/optimism/op-service/metrics" "github.com/ethereum-optimism/optimism/op-service/metrics"
...@@ -135,7 +135,7 @@ type Metrics struct { ...@@ -135,7 +135,7 @@ type Metrics struct {
TransactionsSequencedTotal prometheus.Counter TransactionsSequencedTotal prometheus.Counter
PlasmaMetrics plasma.Metricer AltDAMetrics altda.Metricer
// Channel Bank Metrics // Channel Bank Metrics
headChannelOpenedEvent *metrics.Event headChannelOpenedEvent *metrics.Event
...@@ -425,7 +425,7 @@ func NewMetrics(procName string) *Metrics { ...@@ -425,7 +425,7 @@ func NewMetrics(procName string) *Metrics {
"required", "required",
}), }),
PlasmaMetrics: plasma.MakeMetrics(ns, factory), AltDAMetrics: altda.MakeMetrics(ns, factory),
registry: registry, registry: registry,
factory: factory, factory: factory,
......
...@@ -7,12 +7,12 @@ import ( ...@@ -7,12 +7,12 @@ import (
"math" "math"
"time" "time"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/flags" "github.com/ethereum-optimism/optimism/op-node/flags"
"github.com/ethereum-optimism/optimism/op-node/p2p" "github.com/ethereum-optimism/optimism/op-node/p2p"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/oppprof" "github.com/ethereum-optimism/optimism/op-service/oppprof"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
...@@ -74,8 +74,8 @@ type Config struct { ...@@ -74,8 +74,8 @@ type Config struct {
ConductorRpc string ConductorRpc string
ConductorRpcTimeout time.Duration ConductorRpcTimeout time.Duration
// Plasma DA config // AltDA config
Plasma plasma.CLIConfig AltDA altda.CLIConfig
} }
type RPCConfig struct { type RPCConfig struct {
...@@ -171,10 +171,10 @@ func (cfg *Config) Check() error { ...@@ -171,10 +171,10 @@ func (cfg *Config) Check() error {
return fmt.Errorf("sequencer must be enabled when conductor is enabled") return fmt.Errorf("sequencer must be enabled when conductor is enabled")
} }
} }
if err := cfg.Plasma.Check(); err != nil { if err := cfg.AltDA.Check(); err != nil {
return fmt.Errorf("plasma config error: %w", err) return fmt.Errorf("altDA config error: %w", err)
} }
if cfg.Plasma.Enabled { if cfg.AltDA.Enabled {
log.Warn("Alt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.") log.Warn("Alt-DA Mode is a Beta feature of the MIT licensed OP Stack. While it has received initial review from core contributors, it is still undergoing testing, and may have bugs or other issues.")
} }
return nil return nil
......
...@@ -15,6 +15,7 @@ import ( ...@@ -15,6 +15,7 @@ import (
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/heartbeat" "github.com/ethereum-optimism/optimism/op-node/heartbeat"
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/node/safedb" "github.com/ethereum-optimism/optimism/op-node/node/safedb"
...@@ -24,7 +25,6 @@ import ( ...@@ -24,7 +25,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup/driver" "github.com/ethereum-optimism/optimism/op-node/rollup/driver"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
"github.com/ethereum-optimism/optimism/op-node/version" "github.com/ethereum-optimism/optimism/op-node/version"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/client" "github.com/ethereum-optimism/optimism/op-service/client"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/httputil" "github.com/ethereum-optimism/optimism/op-service/httputil"
...@@ -385,12 +385,12 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config) error { ...@@ -385,12 +385,12 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config) error {
sequencerConductor = NewConductorClient(cfg, n.log, n.metrics) sequencerConductor = NewConductorClient(cfg, n.log, n.metrics)
} }
// if plasma is not explicitly activated in the node CLI, the config + any error will be ignored. // if altDA is not explicitly activated in the node CLI, the config + any error will be ignored.
rpCfg, err := cfg.Rollup.GetOPPlasmaConfig() rpCfg, err := cfg.Rollup.GetOPAltDAConfig()
if cfg.Plasma.Enabled && err != nil { if cfg.AltDA.Enabled && err != nil {
return fmt.Errorf("failed to get plasma config: %w", err) return fmt.Errorf("failed to get altDA config: %w", err)
} }
plasmaDA := plasma.NewPlasmaDA(n.log, cfg.Plasma, rpCfg, n.metrics.PlasmaMetrics) altDA := altda.NewAltDA(n.log, cfg.AltDA, rpCfg, n.metrics.AltDAMetrics)
if cfg.SafeDBPath != "" { if cfg.SafeDBPath != "" {
n.log.Info("Safe head database enabled", "path", cfg.SafeDBPath) n.log.Info("Safe head database enabled", "path", cfg.SafeDBPath)
safeDB, err := safedb.NewSafeDB(n.log, cfg.SafeDBPath) safeDB, err := safedb.NewSafeDB(n.log, cfg.SafeDBPath)
...@@ -401,7 +401,7 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config) error { ...@@ -401,7 +401,7 @@ func (n *OpNode) initL2(ctx context.Context, cfg *Config) error {
} else { } else {
n.safeDB = safedb.Disabled n.safeDB = safedb.Disabled
} }
n.l2Driver = driver.NewDriver(&cfg.Driver, &cfg.Rollup, n.l2Source, n.l1Source, n.beacon, n, n, n.log, n.metrics, cfg.ConfigPersistence, n.safeDB, &cfg.Sync, sequencerConductor, plasmaDA) n.l2Driver = driver.NewDriver(&cfg.Driver, &cfg.Rollup, n.l2Source, n.l1Source, n.beacon, n, n, n.log, n.metrics, cfg.ConfigPersistence, n.safeDB, &cfg.Sync, sequencerConductor, altDA)
return nil return nil
} }
......
...@@ -51,7 +51,7 @@ var testConfig = Config{ ...@@ -51,7 +51,7 @@ var testConfig = Config{
DepositContractAddress: common.HexToAddress("0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"), DepositContractAddress: common.HexToAddress("0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"),
L1SystemConfigAddress: common.HexToAddress("0x229047fed2591dbec1eF1118d64F7aF3dB9EB290"), L1SystemConfigAddress: common.HexToAddress("0x229047fed2591dbec1eF1118d64F7aF3dB9EB290"),
ProtocolVersionsAddress: common.HexToAddress("0x8062AbC286f5e7D9428a0Ccb9AbD71e50d93b935"), ProtocolVersionsAddress: common.HexToAddress("0x8062AbC286f5e7D9428a0Ccb9AbD71e50d93b935"),
PlasmaConfig: nil, AltDAConfig: nil,
} }
func TestChainSpec_CanyonForkActivation(t *testing.T) { func TestChainSpec_CanyonForkActivation(t *testing.T) {
......
...@@ -5,25 +5,25 @@ import ( ...@@ -5,25 +5,25 @@ import (
"errors" "errors"
"fmt" "fmt"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
) )
// PlasmaDataSource is a data source that fetches inputs from a plasma DA provider given // AltDADataSource is a data source that fetches inputs from a AltDA provider given
// their onchain commitments. Same as CalldataSource it will keep attempting to fetch. // their onchain commitments. Same as CalldataSource it will keep attempting to fetch.
type PlasmaDataSource struct { type AltDADataSource struct {
log log.Logger log log.Logger
src DataIter src DataIter
fetcher PlasmaInputFetcher fetcher AltDAInputFetcher
l1 L1Fetcher l1 L1Fetcher
id eth.L1BlockRef id eth.L1BlockRef
// keep track of a pending commitment so we can keep trying to fetch the input. // keep track of a pending commitment so we can keep trying to fetch the input.
comm plasma.CommitmentData comm altda.CommitmentData
} }
func NewPlasmaDataSource(log log.Logger, src DataIter, l1 L1Fetcher, fetcher PlasmaInputFetcher, id eth.L1BlockRef) *PlasmaDataSource { func NewAltDADataSource(log log.Logger, src DataIter, l1 L1Fetcher, fetcher AltDAInputFetcher, id eth.L1BlockRef) *AltDADataSource {
return &PlasmaDataSource{ return &AltDADataSource{
log: log, log: log,
src: src, src: src,
fetcher: fetcher, fetcher: fetcher,
...@@ -32,16 +32,16 @@ func NewPlasmaDataSource(log log.Logger, src DataIter, l1 L1Fetcher, fetcher Pla ...@@ -32,16 +32,16 @@ func NewPlasmaDataSource(log log.Logger, src DataIter, l1 L1Fetcher, fetcher Pla
} }
} }
func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) { func (s *AltDADataSource) Next(ctx context.Context) (eth.Data, error) {
// Process origin syncs the challenge contract events and updates the local challenge states // Process origin syncs the challenge contract events and updates the local challenge states
// before we can proceed to fetch the input data. This function can be called multiple times // before we can proceed to fetch the input data. This function can be called multiple times
// for the same origin and noop if the origin was already processed. It is also called if // for the same origin and noop if the origin was already processed. It is also called if
// there is not commitment in the current origin. // there is not commitment in the current origin.
if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil { if err := s.fetcher.AdvanceL1Origin(ctx, s.l1, s.id.ID()); err != nil {
if errors.Is(err, plasma.ErrReorgRequired) { if errors.Is(err, altda.ErrReorgRequired) {
return nil, NewResetError(errors.New("new expired challenge")) return nil, NewResetError(errors.New("new expired challenge"))
} }
return nil, NewTemporaryError(fmt.Errorf("failed to advance plasma L1 origin: %w", err)) return nil, NewTemporaryError(fmt.Errorf("failed to advance altDA L1 origin: %w", err))
} }
if s.comm == nil { if s.comm == nil {
...@@ -54,37 +54,37 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) { ...@@ -54,37 +54,37 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) {
if len(data) == 0 { if len(data) == 0 {
return nil, NotEnoughData return nil, NotEnoughData
} }
// If the tx data type is not plasma, we forward it downstream to let the next // If the tx data type is not altDA, we forward it downstream to let the next
// steps validate and potentially parse it as L1 DA inputs. // steps validate and potentially parse it as L1 DA inputs.
if data[0] != plasma.TxDataVersion1 { if data[0] != altda.TxDataVersion1 {
return data, nil return data, nil
} }
// validate batcher inbox data is a commitment. // validate batcher inbox data is a commitment.
// strip the transaction data version byte from the data before decoding. // strip the transaction data version byte from the data before decoding.
comm, err := plasma.DecodeCommitmentData(data[1:]) comm, err := altda.DecodeCommitmentData(data[1:])
if err != nil { if err != nil {
s.log.Warn("invalid commitment", "commitment", data, "err", err) s.log.Warn("invalid commitment", "commitment", data, "err", err)
return nil, NotEnoughData return nil, NotEnoughData
} }
s.comm = comm s.comm = comm
} }
// use the commitment to fetch the input from the plasma DA provider. // use the commitment to fetch the input from the AltDA provider.
data, err := s.fetcher.GetInput(ctx, s.l1, s.comm, s.id) data, err := s.fetcher.GetInput(ctx, s.l1, s.comm, s.id)
// GetInput may call for a reorg if the pipeline is stalled and the plasma DA manager // GetInput may call for a reorg if the pipeline is stalled and the AltDA manager
// continued syncing origins detached from the pipeline origin. // continued syncing origins detached from the pipeline origin.
if errors.Is(err, plasma.ErrReorgRequired) { if errors.Is(err, altda.ErrReorgRequired) {
// challenge for a new previously derived commitment expired. // challenge for a new previously derived commitment expired.
return nil, NewResetError(err) return nil, NewResetError(err)
} else if errors.Is(err, plasma.ErrExpiredChallenge) { } else if errors.Is(err, altda.ErrExpiredChallenge) {
// this commitment was challenged and the challenge expired. // this commitment was challenged and the challenge expired.
s.log.Warn("challenge expired, skipping batch", "comm", s.comm) s.log.Warn("challenge expired, skipping batch", "comm", s.comm)
s.comm = nil s.comm = nil
// skip the input // skip the input
return s.Next(ctx) return s.Next(ctx)
} else if errors.Is(err, plasma.ErrMissingPastWindow) { } else if errors.Is(err, altda.ErrMissingPastWindow) {
return nil, NewCriticalError(fmt.Errorf("data for comm %s not available: %w", s.comm, err)) return nil, NewCriticalError(fmt.Errorf("data for comm %s not available: %w", s.comm, err))
} else if errors.Is(err, plasma.ErrPendingChallenge) { } else if errors.Is(err, altda.ErrPendingChallenge) {
// continue stepping without slowing down. // continue stepping without slowing down.
return nil, NotEnoughData return nil, NotEnoughData
} else if err != nil { } else if err != nil {
...@@ -92,8 +92,8 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) { ...@@ -92,8 +92,8 @@ func (s *PlasmaDataSource) Next(ctx context.Context) (eth.Data, error) {
return nil, NewTemporaryError(fmt.Errorf("failed to fetch input data with comm %s from da service: %w", s.comm, err)) return nil, NewTemporaryError(fmt.Errorf("failed to fetch input data with comm %s from da service: %w", s.comm, err))
} }
// inputs are limited to a max size to ensure they can be challenged in the DA contract. // inputs are limited to a max size to ensure they can be challenged in the DA contract.
if s.comm.CommitmentType() == plasma.Keccak256CommitmentType && len(data) > plasma.MaxInputSize { if s.comm.CommitmentType() == altda.Keccak256CommitmentType && len(data) > altda.MaxInputSize {
s.log.Warn("input data exceeds max size", "size", len(data), "max", plasma.MaxInputSize) s.log.Warn("input data exceeds max size", "size", len(data), "max", altda.MaxInputSize)
s.comm = nil s.comm = nil
return s.Next(ctx) return s.Next(ctx)
} }
......
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
"math/rand" "math/rand"
"testing" "testing"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum-optimism/optimism/op-service/testutils" "github.com/ethereum-optimism/optimism/op-service/testutils"
...@@ -35,13 +35,13 @@ func (m *MockFinalitySignal) ExpectFinalized(blockRef eth.L1BlockRef) { ...@@ -35,13 +35,13 @@ func (m *MockFinalitySignal) ExpectFinalized(blockRef eth.L1BlockRef) {
m.On("OnFinalized", blockRef).Once() m.On("OnFinalized", blockRef).Once()
} }
// TestPlasmaDataSource verifies that commitments are correctly read from l1 and then // TestAltDADataSource verifies that commitments are correctly read from l1 and then
// forwarded to the Plasma DA to return the correct inputs in the iterator. // forwarded to the AltDA to return the correct inputs in the iterator.
// First it generates some L1 refs containing a random number of commitments, challenges // First it generates some L1 refs containing a random number of commitments, challenges
// the first 4 commitments then generates enough blocks to expire the challenge. // the first 4 commitments then generates enough blocks to expire the challenge.
// Then it simulates rederiving while verifying it does skip the expired input until the next // Then it simulates rederiving while verifying it does skip the expired input until the next
// challenge expires. // challenge expires.
func TestPlasmaDataSource(t *testing.T) { func TestAltDADataSource(t *testing.T) {
logger := testlog.Logger(t, log.LevelDebug) logger := testlog.Logger(t, log.LevelDebug)
ctx := context.Background() ctx := context.Background()
...@@ -49,16 +49,16 @@ func TestPlasmaDataSource(t *testing.T) { ...@@ -49,16 +49,16 @@ func TestPlasmaDataSource(t *testing.T) {
l1F := &testutils.MockL1Source{} l1F := &testutils.MockL1Source{}
storage := plasma.NewMockDAClient(logger) storage := altda.NewMockDAClient(logger)
pcfg := plasma.Config{ pcfg := altda.Config{
ChallengeWindow: 90, ResolveWindow: 90, ChallengeWindow: 90, ResolveWindow: 90,
} }
metrics := &plasma.NoopMetrics{} metrics := &altda.NoopMetrics{}
daState := plasma.NewState(logger, metrics, pcfg) daState := altda.NewState(logger, metrics, pcfg)
da := plasma.NewPlasmaDAWithState(logger, pcfg, storage, metrics, daState) da := altda.NewAltDAWithState(logger, pcfg, storage, metrics, daState)
finalitySignal := &MockFinalitySignal{} finalitySignal := &MockFinalitySignal{}
da.OnFinalizedHeadSignal(finalitySignal.OnFinalized) da.OnFinalizedHeadSignal(finalitySignal.OnFinalized)
...@@ -88,15 +88,15 @@ func TestPlasmaDataSource(t *testing.T) { ...@@ -88,15 +88,15 @@ func TestPlasmaDataSource(t *testing.T) {
BlockTime: 1, BlockTime: 1,
SeqWindowSize: 20, SeqWindowSize: 20,
BatchInboxAddress: batcherInbox, BatchInboxAddress: batcherInbox,
PlasmaConfig: &rollup.PlasmaConfig{ AltDAConfig: &rollup.AltDAConfig{
DAChallengeWindow: pcfg.ChallengeWindow, DAChallengeWindow: pcfg.ChallengeWindow,
DAResolveWindow: pcfg.ResolveWindow, DAResolveWindow: pcfg.ResolveWindow,
CommitmentType: plasma.KeccakCommitmentString, CommitmentType: altda.KeccakCommitmentString,
}, },
} }
// keep track of random input data to validate against // keep track of random input data to validate against
var inputs [][]byte var inputs [][]byte
var comms []plasma.CommitmentData var comms []altda.CommitmentData
var inclusionBlocks []eth.L1BlockRef var inclusionBlocks []eth.L1BlockRef
signer := cfg.L1Signer() signer := cfg.L1Signer()
...@@ -128,8 +128,8 @@ func TestPlasmaDataSource(t *testing.T) { ...@@ -128,8 +128,8 @@ func TestPlasmaDataSource(t *testing.T) {
// mock input commitments in l1 transactions // mock input commitments in l1 transactions
input := testutils.RandomData(rng, 2000) input := testutils.RandomData(rng, 2000)
comm, _ := storage.SetInput(ctx, input) comm, _ := storage.SetInput(ctx, input)
// plasma da tests are designed for keccak256 commitments, so we type assert here // altDA tests are designed for keccak256 commitments, so we type assert here
kComm := comm.(plasma.Keccak256Commitment) kComm := comm.(altda.Keccak256Commitment)
inputs = append(inputs, input) inputs = append(inputs, input)
comms = append(comms, kComm) comms = append(comms, kComm)
inclusionBlocks = append(inclusionBlocks, ref) inclusionBlocks = append(inclusionBlocks, ref)
...@@ -231,8 +231,8 @@ func TestPlasmaDataSource(t *testing.T) { ...@@ -231,8 +231,8 @@ func TestPlasmaDataSource(t *testing.T) {
// mock input commitments in l1 transactions // mock input commitments in l1 transactions
input := testutils.RandomData(rng, 2000) input := testutils.RandomData(rng, 2000)
comm, _ := storage.SetInput(ctx, input) comm, _ := storage.SetInput(ctx, input)
// plasma da tests are designed for keccak256 commitments, so we type assert here // altDA tests are designed for keccak256 commitments, so we type assert here
kComm := comm.(plasma.Keccak256Commitment) kComm := comm.(altda.Keccak256Commitment)
inputs = append(inputs, input) inputs = append(inputs, input)
comms = append(comms, kComm) comms = append(comms, kComm)
...@@ -283,7 +283,7 @@ func TestPlasmaDataSource(t *testing.T) { ...@@ -283,7 +283,7 @@ func TestPlasmaDataSource(t *testing.T) {
} }
// This tests makes sure the pipeline returns a temporary error if data is not found. // This tests makes sure the pipeline returns a temporary error if data is not found.
func TestPlasmaDataSourceStall(t *testing.T) { func TestAltDADataSourceStall(t *testing.T) {
logger := testlog.Logger(t, log.LevelDebug) logger := testlog.Logger(t, log.LevelDebug)
ctx := context.Background() ctx := context.Background()
...@@ -291,17 +291,17 @@ func TestPlasmaDataSourceStall(t *testing.T) { ...@@ -291,17 +291,17 @@ func TestPlasmaDataSourceStall(t *testing.T) {
l1F := &testutils.MockL1Source{} l1F := &testutils.MockL1Source{}
storage := plasma.NewMockDAClient(logger) storage := altda.NewMockDAClient(logger)
pcfg := plasma.Config{ pcfg := altda.Config{
ChallengeWindow: 90, ResolveWindow: 90, ChallengeWindow: 90, ResolveWindow: 90,
} }
metrics := &plasma.NoopMetrics{} metrics := &altda.NoopMetrics{}
daState := plasma.NewState(logger, metrics, pcfg) daState := altda.NewState(logger, metrics, pcfg)
da := plasma.NewPlasmaDAWithState(logger, pcfg, storage, metrics, daState) da := altda.NewAltDAWithState(logger, pcfg, storage, metrics, daState)
finalitySignal := &MockFinalitySignal{} finalitySignal := &MockFinalitySignal{}
da.OnFinalizedHeadSignal(finalitySignal.OnFinalized) da.OnFinalizedHeadSignal(finalitySignal.OnFinalized)
...@@ -331,10 +331,10 @@ func TestPlasmaDataSourceStall(t *testing.T) { ...@@ -331,10 +331,10 @@ func TestPlasmaDataSourceStall(t *testing.T) {
BlockTime: 1, BlockTime: 1,
SeqWindowSize: 20, SeqWindowSize: 20,
BatchInboxAddress: batcherInbox, BatchInboxAddress: batcherInbox,
PlasmaConfig: &rollup.PlasmaConfig{ AltDAConfig: &rollup.AltDAConfig{
DAChallengeWindow: pcfg.ChallengeWindow, DAChallengeWindow: pcfg.ChallengeWindow,
DAResolveWindow: pcfg.ResolveWindow, DAResolveWindow: pcfg.ResolveWindow,
CommitmentType: plasma.KeccakCommitmentString, CommitmentType: altda.KeccakCommitmentString,
}, },
} }
...@@ -410,9 +410,9 @@ func TestPlasmaDataSourceStall(t *testing.T) { ...@@ -410,9 +410,9 @@ func TestPlasmaDataSourceStall(t *testing.T) {
l1F.AssertExpectations(t) l1F.AssertExpectations(t)
} }
// TestPlasmaDataSourceInvalidData tests that the pipeline skips invalid data and continues // TestAltDADataSourceInvalidData tests that the pipeline skips invalid data and continues
// this includes invalid commitments and oversized inputs. // this includes invalid commitments and oversized inputs.
func TestPlasmaDataSourceInvalidData(t *testing.T) { func TestAltDADataSourceInvalidData(t *testing.T) {
logger := testlog.Logger(t, log.LevelDebug) logger := testlog.Logger(t, log.LevelDebug)
ctx := context.Background() ctx := context.Background()
...@@ -420,13 +420,13 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) { ...@@ -420,13 +420,13 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) {
l1F := &testutils.MockL1Source{} l1F := &testutils.MockL1Source{}
storage := plasma.NewMockDAClient(logger) storage := altda.NewMockDAClient(logger)
pcfg := plasma.Config{ pcfg := altda.Config{
ChallengeWindow: 90, ResolveWindow: 90, ChallengeWindow: 90, ResolveWindow: 90,
} }
da := plasma.NewPlasmaDAWithStorage(logger, pcfg, storage, &plasma.NoopMetrics{}) da := altda.NewAltDAWithStorage(logger, pcfg, storage, &altda.NoopMetrics{})
// Create rollup genesis and config // Create rollup genesis and config
l1Time := uint64(2) l1Time := uint64(2)
...@@ -453,10 +453,10 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) { ...@@ -453,10 +453,10 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) {
BlockTime: 1, BlockTime: 1,
SeqWindowSize: 20, SeqWindowSize: 20,
BatchInboxAddress: batcherInbox, BatchInboxAddress: batcherInbox,
PlasmaConfig: &rollup.PlasmaConfig{ AltDAConfig: &rollup.AltDAConfig{
DAChallengeWindow: pcfg.ChallengeWindow, DAChallengeWindow: pcfg.ChallengeWindow,
DAResolveWindow: pcfg.ResolveWindow, DAResolveWindow: pcfg.ResolveWindow,
CommitmentType: plasma.KeccakCommitmentString, CommitmentType: altda.KeccakCommitmentString,
}, },
} }
...@@ -474,7 +474,7 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) { ...@@ -474,7 +474,7 @@ func TestPlasmaDataSourceInvalidData(t *testing.T) {
} }
l1F.ExpectFetchReceipts(ref.Hash, nil, types.Receipts{}, nil) l1F.ExpectFetchReceipts(ref.Hash, nil, types.Receipts{}, nil)
// mock input commitments in l1 transactions with an oversized input // mock input commitments in l1 transactions with an oversized input
input := testutils.RandomData(rng, plasma.MaxInputSize+1) input := testutils.RandomData(rng, altda.MaxInputSize+1)
comm, _ := storage.SetInput(ctx, input) comm, _ := storage.SetInput(ctx, input)
tx1, err := types.SignNewTx(batcherPriv, signer, &types.DynamicFeeTx{ tx1, err := types.SignNewTx(batcherPriv, signer, &types.DynamicFeeTx{
......
...@@ -8,8 +8,8 @@ import ( ...@@ -8,8 +8,8 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -26,11 +26,11 @@ type L1BlobsFetcher interface { ...@@ -26,11 +26,11 @@ type L1BlobsFetcher interface {
GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error) GetBlobs(ctx context.Context, ref eth.L1BlockRef, hashes []eth.IndexedBlobHash) ([]*eth.Blob, error)
} }
type PlasmaInputFetcher interface { type AltDAInputFetcher interface {
// GetInput fetches the input for the given commitment at the given block number from the DA storage service. // GetInput fetches the input for the given commitment at the given block number from the DA storage service.
GetInput(ctx context.Context, l1 plasma.L1Fetcher, c plasma.CommitmentData, blockId eth.L1BlockRef) (eth.Data, error) GetInput(ctx context.Context, l1 altda.L1Fetcher, c altda.CommitmentData, blockId eth.L1BlockRef) (eth.Data, error)
// AdvanceL1Origin advances the L1 origin to the given block number, syncing the DA challenge events. // AdvanceL1Origin advances the L1 origin to the given block number, syncing the DA challenge events.
AdvanceL1Origin(ctx context.Context, l1 plasma.L1Fetcher, blockId eth.BlockID) error AdvanceL1Origin(ctx context.Context, l1 altda.L1Fetcher, blockId eth.BlockID) error
// Reset the challenge origin in case of L1 reorg // Reset the challenge origin in case of L1 reorg
Reset(ctx context.Context, base eth.L1BlockRef, baseCfg eth.SystemConfig) error Reset(ctx context.Context, base eth.L1BlockRef, baseCfg eth.SystemConfig) error
} }
...@@ -43,29 +43,29 @@ type DataSourceFactory struct { ...@@ -43,29 +43,29 @@ type DataSourceFactory struct {
dsCfg DataSourceConfig dsCfg DataSourceConfig
fetcher L1Fetcher fetcher L1Fetcher
blobsFetcher L1BlobsFetcher blobsFetcher L1BlobsFetcher
plasmaFetcher PlasmaInputFetcher altDAFetcher AltDAInputFetcher
ecotoneTime *uint64 ecotoneTime *uint64
} }
func NewDataSourceFactory(log log.Logger, cfg *rollup.Config, fetcher L1Fetcher, blobsFetcher L1BlobsFetcher, plasmaFetcher PlasmaInputFetcher) *DataSourceFactory { func NewDataSourceFactory(log log.Logger, cfg *rollup.Config, fetcher L1Fetcher, blobsFetcher L1BlobsFetcher, altDAFetcher AltDAInputFetcher) *DataSourceFactory {
config := DataSourceConfig{ config := DataSourceConfig{
l1Signer: cfg.L1Signer(), l1Signer: cfg.L1Signer(),
batchInboxAddress: cfg.BatchInboxAddress, batchInboxAddress: cfg.BatchInboxAddress,
plasmaEnabled: cfg.PlasmaEnabled(), altDAEnabled: cfg.AltDAEnabled(),
} }
return &DataSourceFactory{ return &DataSourceFactory{
log: log, log: log,
dsCfg: config, dsCfg: config,
fetcher: fetcher, fetcher: fetcher,
blobsFetcher: blobsFetcher, blobsFetcher: blobsFetcher,
plasmaFetcher: plasmaFetcher, altDAFetcher: altDAFetcher,
ecotoneTime: cfg.EcotoneTime, ecotoneTime: cfg.EcotoneTime,
} }
} }
// OpenData returns the appropriate data source for the L1 block `ref`. // OpenData returns the appropriate data source for the L1 block `ref`.
func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, batcherAddr common.Address) (DataIter, error) { func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, batcherAddr common.Address) (DataIter, error) {
// Creates a data iterator from blob or calldata source so we can forward it to the plasma source // Creates a data iterator from blob or calldata source so we can forward it to the altDA source
// if enabled as it still requires an L1 data source for fetching input commmitments. // if enabled as it still requires an L1 data source for fetching input commmitments.
var src DataIter var src DataIter
if ds.ecotoneTime != nil && ref.Time >= *ds.ecotoneTime { if ds.ecotoneTime != nil && ref.Time >= *ds.ecotoneTime {
...@@ -76,9 +76,9 @@ func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, b ...@@ -76,9 +76,9 @@ func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, b
} else { } else {
src = NewCalldataSource(ctx, ds.log, ds.dsCfg, ds.fetcher, ref, batcherAddr) src = NewCalldataSource(ctx, ds.log, ds.dsCfg, ds.fetcher, ref, batcherAddr)
} }
if ds.dsCfg.plasmaEnabled { if ds.dsCfg.altDAEnabled {
// plasma([calldata | blobdata](l1Ref)) -> data // altDA([calldata | blobdata](l1Ref)) -> data
return NewPlasmaDataSource(ds.log, src, ds.fetcher, ds.plasmaFetcher, ref), nil return NewAltDADataSource(ds.log, src, ds.fetcher, ds.altDAFetcher, ref), nil
} }
return src, nil return src, nil
} }
...@@ -87,7 +87,7 @@ func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, b ...@@ -87,7 +87,7 @@ func (ds *DataSourceFactory) OpenData(ctx context.Context, ref eth.L1BlockRef, b
type DataSourceConfig struct { type DataSourceConfig struct {
l1Signer types.Signer l1Signer types.Signer
batchInboxAddress common.Address batchInboxAddress common.Address
plasmaEnabled bool altDAEnabled bool
} }
// isValidBatchTx returns true if: // isValidBatchTx returns true if:
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
) )
// count the tagging info as 200 in terms of buffer size. // count the tagging info as 200 in terms of buffer size.
...@@ -21,8 +21,8 @@ func frameSize(frame Frame) uint64 { ...@@ -21,8 +21,8 @@ func frameSize(frame Frame) uint64 {
const DerivationVersion0 = 0 const DerivationVersion0 = 0
// DerivationVersion1 is reserved for batcher transactions containing plasma commitments. // DerivationVersion1 is reserved for batcher transactions containing altDA commitments.
const DerivationVersion1 = plasma.TxDataVersion1 const DerivationVersion1 = altda.TxDataVersion1
// MaxSpanBatchElementCount is the maximum number of blocks, transactions in total, // MaxSpanBatchElementCount is the maximum number of blocks, transactions in total,
// or transaction per block allowed in a span batch. // or transaction per block allowed in a span batch.
......
...@@ -52,7 +52,7 @@ type DerivationPipeline struct { ...@@ -52,7 +52,7 @@ type DerivationPipeline struct {
log log.Logger log log.Logger
rollupCfg *rollup.Config rollupCfg *rollup.Config
l1Fetcher L1Fetcher l1Fetcher L1Fetcher
plasma PlasmaInputFetcher altDA AltDAInputFetcher
l2 L2Source l2 L2Source
...@@ -77,11 +77,11 @@ type DerivationPipeline struct { ...@@ -77,11 +77,11 @@ type DerivationPipeline struct {
// NewDerivationPipeline creates a DerivationPipeline, to turn L1 data into L2 block-inputs. // NewDerivationPipeline creates a DerivationPipeline, to turn L1 data into L2 block-inputs.
func NewDerivationPipeline(log log.Logger, rollupCfg *rollup.Config, l1Fetcher L1Fetcher, l1Blobs L1BlobsFetcher, func NewDerivationPipeline(log log.Logger, rollupCfg *rollup.Config, l1Fetcher L1Fetcher, l1Blobs L1BlobsFetcher,
plasma PlasmaInputFetcher, l2Source L2Source, metrics Metrics) *DerivationPipeline { altDA AltDAInputFetcher, l2Source L2Source, metrics Metrics) *DerivationPipeline {
// Pull stages // Pull stages
l1Traversal := NewL1Traversal(log, rollupCfg, l1Fetcher) l1Traversal := NewL1Traversal(log, rollupCfg, l1Fetcher)
dataSrc := NewDataSourceFactory(log, rollupCfg, l1Fetcher, l1Blobs, plasma) // auxiliary stage for L1Retrieval dataSrc := NewDataSourceFactory(log, rollupCfg, l1Fetcher, l1Blobs, altDA) // auxiliary stage for L1Retrieval
l1Src := NewL1Retrieval(log, dataSrc, l1Traversal) l1Src := NewL1Retrieval(log, dataSrc, l1Traversal)
frameQueue := NewFrameQueue(log, l1Src) frameQueue := NewFrameQueue(log, l1Src)
bank := NewChannelBank(log, rollupCfg, frameQueue, l1Fetcher, metrics) bank := NewChannelBank(log, rollupCfg, frameQueue, l1Fetcher, metrics)
...@@ -93,13 +93,13 @@ func NewDerivationPipeline(log log.Logger, rollupCfg *rollup.Config, l1Fetcher L ...@@ -93,13 +93,13 @@ func NewDerivationPipeline(log log.Logger, rollupCfg *rollup.Config, l1Fetcher L
// Reset from ResetEngine then up from L1 Traversal. The stages do not talk to each other during // Reset from ResetEngine then up from L1 Traversal. The stages do not talk to each other during
// the ResetEngine, but after the ResetEngine, this is the order in which the stages could talk to each other. // the ResetEngine, but after the ResetEngine, this is the order in which the stages could talk to each other.
// Note: The ResetEngine is the only reset that can fail. // Note: The ResetEngine is the only reset that can fail.
stages := []ResettableStage{l1Traversal, l1Src, plasma, frameQueue, bank, chInReader, batchQueue, attributesQueue} stages := []ResettableStage{l1Traversal, l1Src, altDA, frameQueue, bank, chInReader, batchQueue, attributesQueue}
return &DerivationPipeline{ return &DerivationPipeline{
log: log, log: log,
rollupCfg: rollupCfg, rollupCfg: rollupCfg,
l1Fetcher: l1Fetcher, l1Fetcher: l1Fetcher,
plasma: plasma, altDA: altDA,
resetting: 0, resetting: 0,
stages: stages, stages: stages,
metrics: metrics, metrics: metrics,
......
...@@ -6,6 +6,7 @@ import ( ...@@ -6,6 +6,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/async" "github.com/ethereum-optimism/optimism/op-node/rollup/async"
"github.com/ethereum-optimism/optimism/op-node/rollup/attributes" "github.com/ethereum-optimism/optimism/op-node/rollup/attributes"
...@@ -19,7 +20,6 @@ import ( ...@@ -19,7 +20,6 @@ import (
"github.com/ethereum-optimism/optimism/op-node/rollup/sequencing" "github.com/ethereum-optimism/optimism/op-node/rollup/sequencing"
"github.com/ethereum-optimism/optimism/op-node/rollup/status" "github.com/ethereum-optimism/optimism/op-node/rollup/status"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -105,13 +105,13 @@ type Finalizer interface { ...@@ -105,13 +105,13 @@ type Finalizer interface {
event.Deriver event.Deriver
} }
type PlasmaIface interface { type AltDAIface interface {
// Notify L1 finalized head so plasma finality is always behind L1 // Notify L1 finalized head so AltDA finality is always behind L1
Finalize(ref eth.L1BlockRef) Finalize(ref eth.L1BlockRef)
// Set the engine finalization signal callback // Set the engine finalization signal callback
OnFinalizedHeadSignal(f plasma.HeadSignalFn) OnFinalizedHeadSignal(f altda.HeadSignalFn)
derive.PlasmaInputFetcher derive.AltDAInputFetcher
} }
type SyncStatusTracker interface { type SyncStatusTracker interface {
...@@ -164,7 +164,7 @@ func NewDriver( ...@@ -164,7 +164,7 @@ func NewDriver(
safeHeadListener rollup.SafeHeadListener, safeHeadListener rollup.SafeHeadListener,
syncCfg *sync.Config, syncCfg *sync.Config,
sequencerConductor conductor.SequencerConductor, sequencerConductor conductor.SequencerConductor,
plasma PlasmaIface, altDA AltDAIface,
) *Driver { ) *Driver {
driverCtx, driverCancel := context.WithCancel(context.Background()) driverCtx, driverCancel := context.WithCancel(context.Background())
...@@ -200,8 +200,8 @@ func NewDriver( ...@@ -200,8 +200,8 @@ func NewDriver(
sys.Register("cl-sync", clSync, opts) sys.Register("cl-sync", clSync, opts)
var finalizer Finalizer var finalizer Finalizer
if cfg.PlasmaEnabled() { if cfg.AltDAEnabled() {
finalizer = finality.NewPlasmaFinalizer(driverCtx, log, cfg, l1, plasma) finalizer = finality.NewAltDAFinalizer(driverCtx, log, cfg, l1, altDA)
} else { } else {
finalizer = finality.NewFinalizer(driverCtx, log, cfg, l1) finalizer = finality.NewFinalizer(driverCtx, log, cfg, l1)
} }
...@@ -210,7 +210,7 @@ func NewDriver( ...@@ -210,7 +210,7 @@ func NewDriver(
sys.Register("attributes-handler", sys.Register("attributes-handler",
attributes.NewAttributesHandler(log, cfg, driverCtx, l2), opts) attributes.NewAttributesHandler(log, cfg, driverCtx, l2), opts)
derivationPipeline := derive.NewDerivationPipeline(log, cfg, verifConfDepth, l1Blobs, plasma, l2, metrics) derivationPipeline := derive.NewDerivationPipeline(log, cfg, verifConfDepth, l1Blobs, altDA, l2, metrics)
sys.Register("pipeline", sys.Register("pipeline",
derive.NewPipelineDeriver(driverCtx, derivationPipeline), opts) derive.NewPipelineDeriver(driverCtx, derivationPipeline), opts)
......
...@@ -5,48 +5,48 @@ import ( ...@@ -5,48 +5,48 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/event" "github.com/ethereum-optimism/optimism/op-node/rollup/event"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
type PlasmaBackend interface { type AltDABackend interface {
// Finalize notifies the L1 finalized head so plasma finality is always behind L1. // Finalize notifies the L1 finalized head so AltDA finality is always behind L1.
Finalize(ref eth.L1BlockRef) Finalize(ref eth.L1BlockRef)
// OnFinalizedHeadSignal sets the engine finalization signal callback. // OnFinalizedHeadSignal sets the engine finalization signal callback.
OnFinalizedHeadSignal(f plasma.HeadSignalFn) OnFinalizedHeadSignal(f altda.HeadSignalFn)
} }
// PlasmaFinalizer is a special type of Finalizer, wrapping a regular Finalizer, // AltDAFinalizer is a special type of Finalizer, wrapping a regular Finalizer,
// but overriding the finality signal handling: // but overriding the finality signal handling:
// it proxies L1 finality signals to the plasma backend, // it proxies L1 finality signals to the AltDA backend,
// and relies on the backend to then signal when finality is really applicable. // and relies on the backend to then signal when finality is really applicable.
type PlasmaFinalizer struct { type AltDAFinalizer struct {
*Finalizer *Finalizer
backend PlasmaBackend backend AltDABackend
} }
func NewPlasmaFinalizer(ctx context.Context, log log.Logger, cfg *rollup.Config, func NewAltDAFinalizer(ctx context.Context, log log.Logger, cfg *rollup.Config,
l1Fetcher FinalizerL1Interface, l1Fetcher FinalizerL1Interface,
backend PlasmaBackend) *PlasmaFinalizer { backend AltDABackend) *AltDAFinalizer {
inner := NewFinalizer(ctx, log, cfg, l1Fetcher) inner := NewFinalizer(ctx, log, cfg, l1Fetcher)
// In alt-da mode, the finalization signal is proxied through the plasma manager. // In alt-da mode, the finalization signal is proxied through the AltDA manager.
// Finality signal will come from the DA contract or L1 finality whichever is last. // Finality signal will come from the DA contract or L1 finality whichever is last.
// The plasma module will then call the inner.Finalize function when applicable. // The AltDA module will then call the inner.Finalize function when applicable.
backend.OnFinalizedHeadSignal(func(ref eth.L1BlockRef) { backend.OnFinalizedHeadSignal(func(ref eth.L1BlockRef) {
inner.OnEvent(FinalizeL1Event{FinalizedL1: ref}) inner.OnEvent(FinalizeL1Event{FinalizedL1: ref})
}) })
return &PlasmaFinalizer{ return &AltDAFinalizer{
Finalizer: inner, Finalizer: inner,
backend: backend, backend: backend,
} }
} }
func (fi *PlasmaFinalizer) OnEvent(ev event.Event) bool { func (fi *AltDAFinalizer) OnEvent(ev event.Event) bool {
switch x := ev.(type) { switch x := ev.(type) {
case FinalizeL1Event: case FinalizeL1Event:
fi.backend.Finalize(x.FinalizedL1) fi.backend.Finalize(x.FinalizedL1)
......
...@@ -10,32 +10,32 @@ import ( ...@@ -10,32 +10,32 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/engine" "github.com/ethereum-optimism/optimism/op-node/rollup/engine"
"github.com/ethereum-optimism/optimism/op-node/rollup/event" "github.com/ethereum-optimism/optimism/op-node/rollup/event"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
"github.com/ethereum-optimism/optimism/op-service/testlog" "github.com/ethereum-optimism/optimism/op-service/testlog"
"github.com/ethereum-optimism/optimism/op-service/testutils" "github.com/ethereum-optimism/optimism/op-service/testutils"
) )
type fakePlasmaBackend struct { type fakeAltDABackend struct {
plasmaFn plasma.HeadSignalFn altDAFn altda.HeadSignalFn
forwardTo plasma.HeadSignalFn forwardTo altda.HeadSignalFn
} }
func (b *fakePlasmaBackend) Finalize(ref eth.L1BlockRef) { func (b *fakeAltDABackend) Finalize(ref eth.L1BlockRef) {
b.plasmaFn(ref) b.altDAFn(ref)
} }
func (b *fakePlasmaBackend) OnFinalizedHeadSignal(f plasma.HeadSignalFn) { func (b *fakeAltDABackend) OnFinalizedHeadSignal(f altda.HeadSignalFn) {
b.forwardTo = f b.forwardTo = f
} }
var _ PlasmaBackend = (*fakePlasmaBackend)(nil) var _ AltDABackend = (*fakeAltDABackend)(nil)
func TestPlasmaFinalityData(t *testing.T) { func TestAltDAFinalityData(t *testing.T) {
logger := testlog.Logger(t, log.LevelInfo) logger := testlog.Logger(t, log.LevelInfo)
l1F := &testutils.MockL1Source{} l1F := &testutils.MockL1Source{}
...@@ -66,14 +66,14 @@ func TestPlasmaFinalityData(t *testing.T) { ...@@ -66,14 +66,14 @@ func TestPlasmaFinalityData(t *testing.T) {
BlockTime: 1, BlockTime: 1,
SeqWindowSize: 2, SeqWindowSize: 2,
} }
plasmaCfg := &rollup.PlasmaConfig{ altDACfg := &rollup.AltDAConfig{
DAChallengeWindow: 90, DAChallengeWindow: 90,
DAResolveWindow: 90, DAResolveWindow: 90,
} }
// shoud return l1 finality if plasma is not enabled // shoud return l1 finality if altda is not enabled
require.Equal(t, uint64(defaultFinalityLookback), calcFinalityLookback(cfg)) require.Equal(t, uint64(defaultFinalityLookback), calcFinalityLookback(cfg))
cfg.PlasmaConfig = plasmaCfg cfg.AltDAConfig = altDACfg
expFinalityLookback := 181 expFinalityLookback := 181
require.Equal(t, uint64(expFinalityLookback), calcFinalityLookback(cfg)) require.Equal(t, uint64(expFinalityLookback), calcFinalityLookback(cfg))
...@@ -86,20 +86,20 @@ func TestPlasmaFinalityData(t *testing.T) { ...@@ -86,20 +86,20 @@ func TestPlasmaFinalityData(t *testing.T) {
SequenceNumber: 1, SequenceNumber: 1,
} }
// Simulate plasma finality by waiting for the finalized-inclusion // Simulate altda finality by waiting for the finalized-inclusion
// of a commitment to turn into undisputed finalized data. // of a commitment to turn into undisputed finalized data.
commitmentInclusionFinalized := eth.L1BlockRef{} commitmentInclusionFinalized := eth.L1BlockRef{}
plasmaBackend := &fakePlasmaBackend{ altDABackend := &fakeAltDABackend{
plasmaFn: func(ref eth.L1BlockRef) { altDAFn: func(ref eth.L1BlockRef) {
commitmentInclusionFinalized = ref commitmentInclusionFinalized = ref
}, },
forwardTo: nil, forwardTo: nil,
} }
emitter := &testutils.MockEmitter{} emitter := &testutils.MockEmitter{}
fi := NewPlasmaFinalizer(context.Background(), logger, cfg, l1F, plasmaBackend) fi := NewAltDAFinalizer(context.Background(), logger, cfg, l1F, altDABackend)
fi.AttachEmitter(emitter) fi.AttachEmitter(emitter)
require.NotNil(t, plasmaBackend.forwardTo, "plasma backend must have access to underlying standard finalizer") require.NotNil(t, altDABackend.forwardTo, "altda backend must have access to underlying standard finalizer")
require.Equal(t, expFinalityLookback, cap(fi.finalityData)) require.Equal(t, expFinalityLookback, cap(fi.finalityData))
...@@ -112,7 +112,7 @@ func TestPlasmaFinalityData(t *testing.T) { ...@@ -112,7 +112,7 @@ func TestPlasmaFinalityData(t *testing.T) {
if i == 10 { // finalize a L1 commitment if i == 10 { // finalize a L1 commitment
fi.OnEvent(FinalizeL1Event{FinalizedL1: l1parent}) fi.OnEvent(FinalizeL1Event{FinalizedL1: l1parent})
emitter.AssertExpectations(t) // no events emitted upon L1 finality emitter.AssertExpectations(t) // no events emitted upon L1 finality
require.Equal(t, l1parent, commitmentInclusionFinalized, "plasma backend received L1 signal") require.Equal(t, l1parent, commitmentInclusionFinalized, "altda backend received L1 signal")
} }
previous := l1parent previous := l1parent
...@@ -144,23 +144,23 @@ func TestPlasmaFinalityData(t *testing.T) { ...@@ -144,23 +144,23 @@ func TestPlasmaFinalityData(t *testing.T) {
// clear expectations // clear expectations
emitter.Mock.ExpectedCalls = nil emitter.Mock.ExpectedCalls = nil
// no L2 finalize event, as no L1 finality signal has been forwarded by plasma backend yet // no L2 finalize event, as no L1 finality signal has been forwarded by altda backend yet
fi.OnEvent(TryFinalizeEvent{}) fi.OnEvent(TryFinalizeEvent{})
emitter.AssertExpectations(t) emitter.AssertExpectations(t)
// Pretend to be the plasma backend, // Pretend to be the altda backend,
// send the original finalization signal to the underlying finalizer, // send the original finalization signal to the underlying finalizer,
// now that we are sure the commitment itself is not just finalized, // now that we are sure the commitment itself is not just finalized,
// but the referenced data cannot be disputed anymore. // but the referenced data cannot be disputed anymore.
plasmaFinalization := commitmentInclusionFinalized.Number + cfg.PlasmaConfig.DAChallengeWindow altdaFinalization := commitmentInclusionFinalized.Number + cfg.AltDAConfig.DAChallengeWindow
if commitmentInclusionFinalized != (eth.L1BlockRef{}) && l1parent.Number == plasmaFinalization { if commitmentInclusionFinalized != (eth.L1BlockRef{}) && l1parent.Number == altdaFinalization {
// When the signal is forwarded, a finalization attempt will be scheduled // When the signal is forwarded, a finalization attempt will be scheduled
emitter.ExpectOnce(TryFinalizeEvent{}) emitter.ExpectOnce(TryFinalizeEvent{})
plasmaBackend.forwardTo(commitmentInclusionFinalized) altDABackend.forwardTo(commitmentInclusionFinalized)
emitter.AssertExpectations(t) emitter.AssertExpectations(t)
require.Equal(t, commitmentInclusionFinalized, fi.finalizedL1, "finality signal now made its way in regular finalizer") require.Equal(t, commitmentInclusionFinalized, fi.finalizedL1, "finality signal now made its way in regular finalizer")
// As soon as a finalization attempt is made, after the finality signal was triggered by plasma backend, // As soon as a finalization attempt is made, after the finality signal was triggered by altda backend,
// we should get an attempt to get a finalized L2 block. // we should get an attempt to get a finalized L2 block.
// In this test the L1 origin of the simulated L2 blocks lags 1 behind the block the L2 block is included in on L1. // In this test the L1 origin of the simulated L2 blocks lags 1 behind the block the L2 block is included in on L1.
// So to check the L2 finality progress, we check if the next L1 block after the L1 origin // So to check the L2 finality progress, we check if the next L1 block after the L1 origin
......
...@@ -34,14 +34,14 @@ const defaultFinalityLookback = 4*32 + 1 ...@@ -34,14 +34,14 @@ const defaultFinalityLookback = 4*32 + 1
// We do not want to do this too often, since it requires fetching a L1 block by number, so no cache data. // We do not want to do this too often, since it requires fetching a L1 block by number, so no cache data.
const finalityDelay = 64 const finalityDelay = 64
// calcFinalityLookback calculates the default finality lookback based on DA challenge window if plasma // calcFinalityLookback calculates the default finality lookback based on DA challenge window if altDA
// mode is activated or L1 finality lookback. // mode is activated or L1 finality lookback.
func calcFinalityLookback(cfg *rollup.Config) uint64 { func calcFinalityLookback(cfg *rollup.Config) uint64 {
// in alt-da mode the longest finality lookback is a commitment is challenged on the last block of // in alt-da mode the longest finality lookback is a commitment is challenged on the last block of
// the challenge window in which case it will be both challenge + resolve window. // the challenge window in which case it will be both challenge + resolve window.
if cfg.PlasmaEnabled() { if cfg.AltDAEnabled() {
lkb := cfg.PlasmaConfig.DAChallengeWindow + cfg.PlasmaConfig.DAResolveWindow + 1 lkb := cfg.AltDAConfig.DAChallengeWindow + cfg.AltDAConfig.DAResolveWindow + 1
// in the case only if the plasma windows are longer than the default finality lookback // in the case only if the altDA windows are longer than the default finality lookback
if lkb > defaultFinalityLookback { if lkb > defaultFinalityLookback {
return lkb return lkb
} }
......
...@@ -44,12 +44,12 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { ...@@ -44,12 +44,12 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
return nil, fmt.Errorf("unable to retrieve deposit contract address") return nil, fmt.Errorf("unable to retrieve deposit contract address")
} }
var plasma *PlasmaConfig var altDA *AltDAConfig
if chConfig.Plasma != nil { if chConfig.AltDA != nil {
plasma = &PlasmaConfig{ altDA = &AltDAConfig{
DAChallengeAddress: common.Address(*chConfig.Plasma.DAChallengeAddress), DAChallengeAddress: common.Address(*chConfig.AltDA.DAChallengeAddress),
DAChallengeWindow: *chConfig.Plasma.DAChallengeWindow, DAChallengeWindow: *chConfig.AltDA.DAChallengeWindow,
DAResolveWindow: *chConfig.Plasma.DAResolveWindow, DAResolveWindow: *chConfig.AltDA.DAResolveWindow,
} }
} }
...@@ -87,7 +87,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) { ...@@ -87,7 +87,7 @@ func LoadOPStackRollupConfig(chainID uint64) (*Config, error) {
BatchInboxAddress: common.Address(chConfig.BatchInboxAddr), BatchInboxAddress: common.Address(chConfig.BatchInboxAddr),
DepositContractAddress: common.Address(addrs.OptimismPortalProxy), DepositContractAddress: common.Address(addrs.OptimismPortalProxy),
L1SystemConfigAddress: common.Address(addrs.SystemConfigProxy), L1SystemConfigAddress: common.Address(addrs.SystemConfigProxy),
PlasmaConfig: plasma, AltDAConfig: altDA,
} }
if superChain.Config.ProtocolVersionsAddr != nil { // Set optional protocol versions address if superChain.Config.ProtocolVersionsAddr != nil { // Set optional protocol versions address
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
plasma "github.com/ethereum-optimism/optimism/op-plasma" altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum-optimism/optimism/op-service/eth"
) )
...@@ -51,7 +51,7 @@ type Genesis struct { ...@@ -51,7 +51,7 @@ type Genesis struct {
SystemConfig eth.SystemConfig `json:"system_config"` SystemConfig eth.SystemConfig `json:"system_config"`
} }
type PlasmaConfig struct { type AltDAConfig struct {
// L1 DataAvailabilityChallenge contract proxy address // L1 DataAvailabilityChallenge contract proxy address
DAChallengeAddress common.Address `json:"da_challenge_contract_address,omitempty"` DAChallengeAddress common.Address `json:"da_challenge_contract_address,omitempty"`
// CommitmentType specifies which commitment type can be used. Defaults to Keccak (type 0) if not present // CommitmentType specifies which commitment type can be used. Defaults to Keccak (type 0) if not present
...@@ -137,22 +137,8 @@ type Config struct { ...@@ -137,22 +137,8 @@ type Config struct {
// L1 address that declares the protocol versions, optional (Beta feature) // L1 address that declares the protocol versions, optional (Beta feature)
ProtocolVersionsAddress common.Address `json:"protocol_versions_address,omitempty"` ProtocolVersionsAddress common.Address `json:"protocol_versions_address,omitempty"`
// Plasma Config. We are in the process of migrating to the PlasmaConfig from these legacy top level values // AltDAConfig. We are in the process of migrating to the AltDAConfig from these legacy top level values
PlasmaConfig *PlasmaConfig `json:"plasma_config,omitempty"` AltDAConfig *AltDAConfig `json:"alt_da,omitempty"`
// L1 DataAvailabilityChallenge contract proxy address
LegacyDAChallengeAddress common.Address `json:"da_challenge_contract_address,omitempty"`
// DA challenge window value set on the DAC contract. Used in alt-da mode
// to compute when a commitment can no longer be challenged.
LegacyDAChallengeWindow uint64 `json:"da_challenge_window,omitempty"`
// DA resolve window value set on the DAC contract. Used in alt-da mode
// to compute when a challenge expires and trigger a reorg if needed.
LegacyDAResolveWindow uint64 `json:"da_resolve_window,omitempty"`
// LegacyUsePlasma is activated when the chain is in alt-da mode.
LegacyUsePlasma bool `json:"use_plasma,omitempty"`
} }
// ValidateL1Config checks L1 config variables for errors. // ValidateL1Config checks L1 config variables for errors.
...@@ -328,7 +314,7 @@ func (cfg *Config) Check() error { ...@@ -328,7 +314,7 @@ func (cfg *Config) Check() error {
if cfg.L2ChainID.Sign() < 1 { if cfg.L2ChainID.Sign() < 1 {
return ErrL2ChainIDNotPositive return ErrL2ChainIDNotPositive
} }
if err := validatePlasmaConfig(cfg); err != nil { if err := validateAltDAConfig(cfg); err != nil {
return err return err
} }
...@@ -354,38 +340,16 @@ func (cfg *Config) Check() error { ...@@ -354,38 +340,16 @@ func (cfg *Config) Check() error {
return nil return nil
} }
// validatePlasmaConfig checks the two approaches to configuring alt-da mode. // validateAltDAConfig checks the two approaches to configuring alt-da mode.
// If the legacy values are set, they are copied to the new location. If both are set, they are check for consistency. // If the legacy values are set, they are copied to the new location. If both are set, they are check for consistency.
func validatePlasmaConfig(cfg *Config) error { func validateAltDAConfig(cfg *Config) error {
if cfg.LegacyUsePlasma && cfg.PlasmaConfig == nil { if cfg.AltDAConfig != nil {
// copy from top level to plasma config if !(cfg.AltDAConfig.CommitmentType == altda.KeccakCommitmentString || cfg.AltDAConfig.CommitmentType == altda.GenericCommitmentString) {
cfg.PlasmaConfig = &PlasmaConfig{ return fmt.Errorf("invalid commitment type: %v", cfg.AltDAConfig.CommitmentType)
DAChallengeAddress: cfg.LegacyDAChallengeAddress, }
DAChallengeWindow: cfg.LegacyDAChallengeWindow, if cfg.AltDAConfig.CommitmentType == altda.KeccakCommitmentString && cfg.AltDAConfig.DAChallengeAddress == (common.Address{}) {
DAResolveWindow: cfg.LegacyDAResolveWindow,
CommitmentType: plasma.KeccakCommitmentString,
}
} else if cfg.LegacyUsePlasma && cfg.PlasmaConfig != nil {
// validate that both are the same
if cfg.LegacyDAChallengeAddress != cfg.PlasmaConfig.DAChallengeAddress {
return fmt.Errorf("LegacyDAChallengeAddress (%v) != PlasmaConfig.DAChallengeAddress (%v)", cfg.LegacyDAChallengeAddress, cfg.PlasmaConfig.DAChallengeAddress)
}
if cfg.LegacyDAChallengeWindow != cfg.PlasmaConfig.DAChallengeWindow {
return fmt.Errorf("LegacyDAChallengeWindow (%v) != PlasmaConfig.DAChallengeWindow (%v)", cfg.LegacyDAChallengeWindow, cfg.PlasmaConfig.DAChallengeWindow)
}
if cfg.LegacyDAResolveWindow != cfg.PlasmaConfig.DAResolveWindow {
return fmt.Errorf("LegacyDAResolveWindow (%v) != PlasmaConfig.DAResolveWindow (%v)", cfg.LegacyDAResolveWindow, cfg.PlasmaConfig.DAResolveWindow)
}
if cfg.PlasmaConfig.CommitmentType != plasma.KeccakCommitmentString {
return errors.New("Cannot set CommitmentType with the legacy config")
}
} else if cfg.PlasmaConfig != nil {
if !(cfg.PlasmaConfig.CommitmentType == plasma.KeccakCommitmentString || cfg.PlasmaConfig.CommitmentType == plasma.GenericCommitmentString) {
return fmt.Errorf("invalid commitment type: %v", cfg.PlasmaConfig.CommitmentType)
}
if cfg.PlasmaConfig.CommitmentType == plasma.KeccakCommitmentString && cfg.PlasmaConfig.DAChallengeAddress == (common.Address{}) {
return errors.New("Must set da_challenge_contract_address for keccak commitments") return errors.New("Must set da_challenge_contract_address for keccak commitments")
} else if cfg.PlasmaConfig.CommitmentType == plasma.GenericCommitmentString && cfg.PlasmaConfig.DAChallengeAddress != (common.Address{}) { } else if cfg.AltDAConfig.CommitmentType == altda.GenericCommitmentString && cfg.AltDAConfig.DAChallengeAddress != (common.Address{}) {
return errors.New("Must set empty da_challenge_contract_address for generic commitments") return errors.New("Must set empty da_challenge_contract_address for generic commitments")
} }
} }
...@@ -549,38 +513,38 @@ func (c *Config) GetPayloadVersion(timestamp uint64) eth.EngineAPIMethod { ...@@ -549,38 +513,38 @@ func (c *Config) GetPayloadVersion(timestamp uint64) eth.EngineAPIMethod {
} }
} }
// GetOPPlasmaConfig validates and returns the plasma config from the rollup config. // GetOPAltDAConfig validates and returns the altDA config from the rollup config.
func (c *Config) GetOPPlasmaConfig() (plasma.Config, error) { func (c *Config) GetOPAltDAConfig() (altda.Config, error) {
if c.PlasmaConfig == nil { if c.AltDAConfig == nil {
return plasma.Config{}, errors.New("no plasma config") return altda.Config{}, errors.New("no altDA config")
} }
if c.PlasmaConfig.DAChallengeWindow == uint64(0) { if c.AltDAConfig.DAChallengeWindow == uint64(0) {
return plasma.Config{}, errors.New("missing DAChallengeWindow") return altda.Config{}, errors.New("missing DAChallengeWindow")
} }
if c.PlasmaConfig.DAResolveWindow == uint64(0) { if c.AltDAConfig.DAResolveWindow == uint64(0) {
return plasma.Config{}, errors.New("missing DAResolveWindow") return altda.Config{}, errors.New("missing DAResolveWindow")
} }
t, err := plasma.CommitmentTypeFromString(c.PlasmaConfig.CommitmentType) t, err := altda.CommitmentTypeFromString(c.AltDAConfig.CommitmentType)
if err != nil { if err != nil {
return plasma.Config{}, err return altda.Config{}, err
} }
return plasma.Config{ return altda.Config{
DAChallengeContractAddress: c.PlasmaConfig.DAChallengeAddress, DAChallengeContractAddress: c.AltDAConfig.DAChallengeAddress,
ChallengeWindow: c.PlasmaConfig.DAChallengeWindow, ChallengeWindow: c.AltDAConfig.DAChallengeWindow,
ResolveWindow: c.PlasmaConfig.DAResolveWindow, ResolveWindow: c.AltDAConfig.DAResolveWindow,
CommitmentType: t, CommitmentType: t,
}, nil }, nil
} }
func (c *Config) PlasmaEnabled() bool { func (c *Config) AltDAEnabled() bool {
return c.PlasmaConfig != nil return c.AltDAConfig != nil
} }
// SyncLookback computes the number of blocks to walk back in order to find the correct L1 origin. // SyncLookback computes the number of blocks to walk back in order to find the correct L1 origin.
// In alt-da mode longest possible window is challenge + resolve windows. // In alt-da mode longest possible window is challenge + resolve windows.
func (c *Config) SyncLookback() uint64 { func (c *Config) SyncLookback() uint64 {
if c.PlasmaEnabled() { if c.AltDAEnabled() {
if win := (c.PlasmaConfig.DAChallengeWindow + c.PlasmaConfig.DAResolveWindow); win > c.SeqWindowSize { if win := (c.AltDAConfig.DAChallengeWindow + c.AltDAConfig.DAResolveWindow); win > c.SeqWindowSize {
return win return win
} }
} }
...@@ -623,8 +587,8 @@ func (c *Config) Description(l2Chains map[string]string) string { ...@@ -623,8 +587,8 @@ func (c *Config) Description(l2Chains map[string]string) string {
banner += fmt.Sprintf(" - Interop: %s\n", fmtForkTimeOrUnset(c.InteropTime)) banner += fmt.Sprintf(" - Interop: %s\n", fmtForkTimeOrUnset(c.InteropTime))
// Report the protocol version // Report the protocol version
banner += fmt.Sprintf("Node supports up to OP-Stack Protocol Version: %s\n", OPStackSupport) banner += fmt.Sprintf("Node supports up to OP-Stack Protocol Version: %s\n", OPStackSupport)
if c.PlasmaConfig != nil { if c.AltDAConfig != nil {
banner += fmt.Sprintf("Node supports Alt-DA Mode with CommitmentType %v\n", c.PlasmaConfig.CommitmentType) banner += fmt.Sprintf("Node supports Alt-DA Mode with CommitmentType %v\n", c.AltDAConfig.CommitmentType)
} }
return banner return banner
} }
...@@ -657,7 +621,7 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) { ...@@ -657,7 +621,7 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) {
"granite_time", fmtForkTimeOrUnset(c.GraniteTime), "granite_time", fmtForkTimeOrUnset(c.GraniteTime),
"holocene_time", fmtForkTimeOrUnset(c.HoloceneTime), "holocene_time", fmtForkTimeOrUnset(c.HoloceneTime),
"interop_time", fmtForkTimeOrUnset(c.InteropTime), "interop_time", fmtForkTimeOrUnset(c.InteropTime),
"plasma_mode", c.PlasmaConfig != nil, "alt_da", c.AltDAConfig != nil,
) )
} }
......
...@@ -9,8 +9,8 @@ import ( ...@@ -9,8 +9,8 @@ import (
"os" "os"
"strings" "strings"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/chaincfg" "github.com/ethereum-optimism/optimism/op-node/chaincfg"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
"github.com/ethereum-optimism/optimism/op-service/oppprof" "github.com/ethereum-optimism/optimism/op-service/oppprof"
"github.com/ethereum-optimism/optimism/op-service/sources" "github.com/ethereum-optimism/optimism/op-service/sources"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
...@@ -111,7 +111,7 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) { ...@@ -111,7 +111,7 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
ConductorRpc: ctx.String(flags.ConductorRpcFlag.Name), ConductorRpc: ctx.String(flags.ConductorRpcFlag.Name),
ConductorRpcTimeout: ctx.Duration(flags.ConductorRpcTimeoutFlag.Name), ConductorRpcTimeout: ctx.Duration(flags.ConductorRpcTimeoutFlag.Name),
Plasma: plasma.ReadCLIConfig(ctx), AltDA: altda.ReadCLIConfig(ctx),
} }
if err := cfg.LoadPersisted(log); err != nil { if err := cfg.LoadPersisted(log); err != nil {
......
...@@ -6,13 +6,13 @@ import ( ...@@ -6,13 +6,13 @@ import (
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
altda "github.com/ethereum-optimism/optimism/op-alt-da"
"github.com/ethereum-optimism/optimism/op-node/metrics" "github.com/ethereum-optimism/optimism/op-node/metrics"
"github.com/ethereum-optimism/optimism/op-node/rollup" "github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive" "github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/rollup/engine" "github.com/ethereum-optimism/optimism/op-node/rollup/engine"
"github.com/ethereum-optimism/optimism/op-node/rollup/event" "github.com/ethereum-optimism/optimism/op-node/rollup/event"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync" "github.com/ethereum-optimism/optimism/op-node/rollup/sync"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
) )
type EndCondition interface { type EndCondition interface {
...@@ -36,7 +36,7 @@ func NewDriver(logger log.Logger, cfg *rollup.Config, l1Source derive.L1Fetcher, ...@@ -36,7 +36,7 @@ func NewDriver(logger log.Logger, cfg *rollup.Config, l1Source derive.L1Fetcher,
logger: logger, logger: logger,
} }
pipeline := derive.NewDerivationPipeline(logger, cfg, l1Source, l1BlobsSource, plasma.Disabled, l2Source, metrics.NoopMetrics) pipeline := derive.NewDerivationPipeline(logger, cfg, l1Source, l1BlobsSource, altda.Disabled, l2Source, metrics.NoopMetrics)
pipelineDeriver := derive.NewPipelineDeriver(context.Background(), pipeline) pipelineDeriver := derive.NewPipelineDeriver(context.Background(), pipeline)
pipelineDeriver.AttachEmitter(d) pipelineDeriver.AttachEmitter(d)
......
...@@ -126,9 +126,9 @@ services: ...@@ -126,9 +126,9 @@ services:
--pprof.enabled --pprof.enabled
--rpc.enable-admin --rpc.enable-admin
--safedb.path=/db --safedb.path=/db
--plasma.enabled=${PLASMA_ENABLED} --altda.enabled=${ALTDA_ENABLED}
--plasma.da-service=${PLASMA_DA_SERVICE} --altda.da-service=${ALTDA_SERVICE}
--plasma.da-server=http://da-server:3100 --altda.da-server=http://da-server:3100
ports: ports:
- "7545:8545" - "7545:8545"
- "9003:9003" - "9003:9003"
...@@ -200,9 +200,9 @@ services: ...@@ -200,9 +200,9 @@ services:
OP_BATCHER_METRICS_ENABLED: "true" OP_BATCHER_METRICS_ENABLED: "true"
OP_BATCHER_RPC_ENABLE_ADMIN: "true" OP_BATCHER_RPC_ENABLE_ADMIN: "true"
OP_BATCHER_BATCH_TYPE: 1 OP_BATCHER_BATCH_TYPE: 1
OP_BATCHER_PLASMA_ENABLED: "${PLASMA_ENABLED}" OP_BATCHER_ALTDA_ENABLED: "${ALTDA_ENABLED}"
OP_BATCHER_PLASMA_DA_SERVICE: "${PLASMA_DA_SERVICE}" OP_BATCHER_ALTDA_DA_SERVICE: "${ALTDA_SERVICE}"
OP_BATCHER_PLASMA_DA_SERVER: "http://da-server:3100" OP_BATCHER_ALTDA_DA_SERVER: "http://da-server:3100"
OP_BATCHER_DATA_AVAILABILITY_TYPE: "${DA_TYPE}" OP_BATCHER_DATA_AVAILABILITY_TYPE: "${DA_TYPE}"
op-challenger: op-challenger:
...@@ -251,7 +251,7 @@ services: ...@@ -251,7 +251,7 @@ services:
--addr=0.0.0.0 --addr=0.0.0.0
--port=3100 --port=3100
--log.level=debug --log.level=debug
--generic-commitment="${PLASMA_GENERIC_DA}" --generic-commitment="${ALTDA_GENERIC_DA}"
ports: ports:
- "3100:3100" - "3100:3100"
volumes: volumes:
......
...@@ -98,7 +98,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build cd op-conductor && make op-c ...@@ -98,7 +98,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build cd op-conductor && make op-c
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_CONDUCTOR_VERSION" GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE VERSION="$OP_CONDUCTOR_VERSION"
FROM --platform=$BUILDPLATFORM builder AS da-server-builder FROM --platform=$BUILDPLATFORM builder AS da-server-builder
RUN --mount=type=cache,target=/root/.cache/go-build cd op-plasma && make da-server \ RUN --mount=type=cache,target=/root/.cache/go-build cd op-alt-da && make da-server \
GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE GOOS=$TARGETOS GOARCH=$TARGETARCH GITCOMMIT=$GIT_COMMIT GITDATE=$GIT_DATE
FROM --platform=$BUILDPLATFORM builder AS op-supervisor-builder FROM --platform=$BUILDPLATFORM builder AS op-supervisor-builder
...@@ -153,7 +153,7 @@ COPY --from=op-conductor-builder /app/op-conductor/bin/op-conductor /usr/local/b ...@@ -153,7 +153,7 @@ COPY --from=op-conductor-builder /app/op-conductor/bin/op-conductor /usr/local/b
CMD ["op-conductor"] CMD ["op-conductor"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS da-server-target FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS da-server-target
COPY --from=da-server-builder /app/op-plasma/bin/da-server /usr/local/bin/ COPY --from=da-server-builder /app/op-alt-da/bin/da-server /usr/local/bin/
CMD ["da-server"] CMD ["da-server"]
FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-supervisor-target FROM --platform=$TARGETPLATFORM $TARGET_BASE_IMAGE AS op-supervisor-target
......
...@@ -18,6 +18,6 @@ ...@@ -18,6 +18,6 @@
!/op-service !/op-service
!/op-supervisor !/op-supervisor
!/op-wheel !/op-wheel
!/op-plasma !/op-alt-da
!/go.mod !/go.mod
!/go.sum !/go.sum
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
"disputeGameFinalityDelaySeconds": 6, "disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 254, "respectedGameType": 254,
"useFaultProofs": true, "useFaultProofs": true,
"usePlasma": false, "useAltDA": false,
"daCommitmentType": "KeccakCommitment", "daCommitmentType": "KeccakCommitment",
"daChallengeWindow": 16, "daChallengeWindow": 16,
"daResolveWindow": 16, "daResolveWindow": 16,
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"respectedGameType": 0, "respectedGameType": 0,
"useFaultProofs": false, "useFaultProofs": false,
"fundDevAccounts": true, "fundDevAccounts": true,
"usePlasma": false, "useAltDA": false,
"daChallengeWindow": 100, "daChallengeWindow": 100,
"daResolveWindow": 100, "daResolveWindow": 100,
"daBondSize": 1000, "daBondSize": 1000,
......
...@@ -289,11 +289,11 @@ contract Deploy is Deployer { ...@@ -289,11 +289,11 @@ contract Deploy is Deployer {
console.log("deployed Safe!"); console.log("deployed Safe!");
setupSuperchain(); setupSuperchain();
console.log("set up superchain!"); console.log("set up superchain!");
if (cfg.usePlasma()) { if (cfg.useAltDA()) {
bytes32 typeHash = keccak256(bytes(cfg.daCommitmentType())); bytes32 typeHash = keccak256(bytes(cfg.daCommitmentType()));
bytes32 keccakHash = keccak256(bytes("KeccakCommitment")); bytes32 keccakHash = keccak256(bytes("KeccakCommitment"));
if (typeHash == keccakHash) { if (typeHash == keccakHash) {
setupOpPlasma(); setupOpAltDA();
} }
} }
setupOpChain(); setupOpChain();
...@@ -416,9 +416,9 @@ contract Deploy is Deployer { ...@@ -416,9 +416,9 @@ contract Deploy is Deployer {
initializeAnchorStateRegistry(); initializeAnchorStateRegistry();
} }
/// @notice Add Plasma setup to the OP chain /// @notice Add AltDA setup to the OP chain
function setupOpPlasma() public { function setupOpAltDA() public {
console.log("Deploying OP Plasma"); console.log("Deploying OP AltDA");
deployDataAvailabilityChallengeProxy(); deployDataAvailabilityChallengeProxy();
deployDataAvailabilityChallenge(); deployDataAvailabilityChallenge();
initializeDataAvailabilityChallenge(); initializeDataAvailabilityChallenge();
......
...@@ -80,7 +80,7 @@ contract DeployConfig is Script { ...@@ -80,7 +80,7 @@ contract DeployConfig is Script {
uint256 public disputeGameFinalityDelaySeconds; uint256 public disputeGameFinalityDelaySeconds;
uint256 public respectedGameType; uint256 public respectedGameType;
bool public useFaultProofs; bool public useFaultProofs;
bool public usePlasma; bool public useAltDA;
string public daCommitmentType; string public daCommitmentType;
uint256 public daChallengeWindow; uint256 public daChallengeWindow;
uint256 public daResolveWindow; uint256 public daResolveWindow;
...@@ -165,7 +165,7 @@ contract DeployConfig is Script { ...@@ -165,7 +165,7 @@ contract DeployConfig is Script {
preimageOracleMinProposalSize = stdJson.readUint(_json, "$.preimageOracleMinProposalSize"); preimageOracleMinProposalSize = stdJson.readUint(_json, "$.preimageOracleMinProposalSize");
preimageOracleChallengePeriod = stdJson.readUint(_json, "$.preimageOracleChallengePeriod"); preimageOracleChallengePeriod = stdJson.readUint(_json, "$.preimageOracleChallengePeriod");
usePlasma = _readOr(_json, "$.usePlasma", false); useAltDA = _readOr(_json, "$.useAltDA", false);
daCommitmentType = _readOr(_json, "$.daCommitmentType", "KeccakCommitment"); daCommitmentType = _readOr(_json, "$.daCommitmentType", "KeccakCommitment");
daChallengeWindow = _readOr(_json, "$.daChallengeWindow", 1000); daChallengeWindow = _readOr(_json, "$.daChallengeWindow", 1000);
daResolveWindow = _readOr(_json, "$.daResolveWindow", 1000); daResolveWindow = _readOr(_json, "$.daResolveWindow", 1000);
...@@ -218,9 +218,9 @@ contract DeployConfig is Script { ...@@ -218,9 +218,9 @@ contract DeployConfig is Script {
return uint256(_l2OutputOracleStartingTimestamp); return uint256(_l2OutputOracleStartingTimestamp);
} }
/// @notice Allow the `usePlasma` config to be overridden in testing environments /// @notice Allow the `useAltDA` config to be overridden in testing environments
function setUsePlasma(bool _usePlasma) public { function setUseAltDA(bool _useAltDA) public {
usePlasma = _usePlasma; useAltDA = _useAltDA;
} }
/// @notice Allow the `useFaultProofs` config to be overridden in testing environments /// @notice Allow the `useFaultProofs` config to be overridden in testing environments
......
...@@ -2617,7 +2617,7 @@ ...@@ -2617,7 +2617,7 @@
"chainId": 31337, "chainId": 31337,
"forkId": 0 "forkId": 0
}, },
"data": "0x7277e7c9", "data": "0x08e0e2bb",
"deployedCode": "0x", "deployedCode": "0x",
"initialized": true, "initialized": true,
"kind": "StaticCall", "kind": "StaticCall",
...@@ -13,7 +13,7 @@ import { CommonTest } from "test/setup/CommonTest.sol"; ...@@ -13,7 +13,7 @@ import { CommonTest } from "test/setup/CommonTest.sol";
contract DataAvailabilityChallengeTest is CommonTest { contract DataAvailabilityChallengeTest is CommonTest {
function setUp() public virtual override { function setUp() public virtual override {
super.enablePlasma(); super.enableAltDA();
super.setUp(); super.setUp();
} }
......
...@@ -18,7 +18,7 @@ contract CommonTest is Test, Setup, Events { ...@@ -18,7 +18,7 @@ contract CommonTest is Test, Setup, Events {
FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi")))))); FFIInterface constant ffi = FFIInterface(address(uint160(uint256(keccak256(abi.encode("optimism.ffi"))))));
bool usePlasmaOverride; bool useAltDAOverride;
bool useFaultProofs; bool useFaultProofs;
address customGasToken; address customGasToken;
bool useInteropOverride; bool useInteropOverride;
...@@ -32,8 +32,8 @@ contract CommonTest is Test, Setup, Events { ...@@ -32,8 +32,8 @@ contract CommonTest is Test, Setup, Events {
Setup.setUp(); Setup.setUp();
// Override the config after the deploy script initialized the config // Override the config after the deploy script initialized the config
if (usePlasmaOverride) { if (useAltDAOverride) {
deploy.cfg().setUsePlasma(true); deploy.cfg().setUseAltDA(true);
} }
if (useFaultProofs) { if (useFaultProofs) {
deploy.cfg().setUseFaultProofs(true); deploy.cfg().setUseFaultProofs(true);
...@@ -119,14 +119,14 @@ contract CommonTest is Test, Setup, Events { ...@@ -119,14 +119,14 @@ contract CommonTest is Test, Setup, Events {
useFaultProofs = true; useFaultProofs = true;
} }
function enablePlasma() public { function enableAltDA() public {
// Check if the system has already been deployed, based off of the heuristic that alice and bob have not been // Check if the system has already been deployed, based off of the heuristic that alice and bob have not been
// set by the `setUp` function yet. // set by the `setUp` function yet.
if (!(alice == address(0) && bob == address(0))) { if (!(alice == address(0) && bob == address(0))) {
revert("CommonTest: Cannot enable plasma after deployment. Consider overriding `setUp`."); revert("CommonTest: Cannot enable altda after deployment. Consider overriding `setUp`.");
} }
usePlasmaOverride = true; useAltDAOverride = true;
} }
function enableCustomGasToken(address _token) public { function enableCustomGasToken(address _token) public {
......
...@@ -172,7 +172,7 @@ contract Setup { ...@@ -172,7 +172,7 @@ contract Setup {
vm.label(deploy.mustGetAddress("SuperchainConfigProxy"), "SuperchainConfigProxy"); vm.label(deploy.mustGetAddress("SuperchainConfigProxy"), "SuperchainConfigProxy");
vm.label(AddressAliasHelper.applyL1ToL2Alias(address(l1CrossDomainMessenger)), "L1CrossDomainMessenger_aliased"); vm.label(AddressAliasHelper.applyL1ToL2Alias(address(l1CrossDomainMessenger)), "L1CrossDomainMessenger_aliased");
if (deploy.cfg().usePlasma()) { if (deploy.cfg().useAltDA()) {
dataAvailabilityChallenge = dataAvailabilityChallenge =
DataAvailabilityChallenge(deploy.mustGetAddress("DataAvailabilityChallengeProxy")); DataAvailabilityChallenge(deploy.mustGetAddress("DataAvailabilityChallengeProxy"));
vm.label(address(dataAvailabilityChallenge), "DataAvailabilityChallengeProxy"); vm.label(address(dataAvailabilityChallenge), "DataAvailabilityChallengeProxy");
......
...@@ -34,7 +34,7 @@ contract Initializer_Test is Bridge_Initializer { ...@@ -34,7 +34,7 @@ contract Initializer_Test is Bridge_Initializer {
InitializeableContract[] contracts; InitializeableContract[] contracts;
function setUp() public override { function setUp() public override {
super.enablePlasma(); super.enableAltDA();
// Run the `Bridge_Initializer`'s `setUp()` function. // Run the `Bridge_Initializer`'s `setUp()` function.
super.setUp(); super.setUp();
......
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