Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions op-node/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,13 @@ var (
Destination: new(string),
Category: InteropCategory,
}
InteropDependencySet = &cli.PathFlag{
Name: "interop.dependency-set",
Usage: "Dependency-set configuration, point at JSON file.",
EnvVars: prefixEnvVars("INTEROP_DEPENDENCY_SET"),
TakesFile: true,
Category: InteropCategory,
}

IgnoreMissingPectraBlobSchedule = &cli.BoolFlag{
Name: "ignore-missing-pectra-blob-schedule",
Expand Down Expand Up @@ -497,6 +504,7 @@ var optionalFlags = []cli.Flag{
InteropRPCAddr,
InteropRPCPort,
InteropJWTSecret,
InteropDependencySet,
IgnoreMissingPectraBlobSchedule,
ExperimentalOPStackAPI,
}
Expand Down
3 changes: 3 additions & 0 deletions op-node/node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math"
"time"

"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum/go-ethereum/log"

altda "github.com/ethereum-optimism/optimism/op-alt-da"
Expand All @@ -31,6 +32,8 @@ type Config struct {

Rollup rollup.Config

DependencySet derive.DependencySet

// P2PSigner will be used for signing off on published content
// if the node is sequencing and if the p2p stack is enabled
P2PSigner p2p.SignerSetup
Expand Down
5 changes: 5 additions & 0 deletions op-node/rollup/derive/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
"github.com/ethereum-optimism/optimism/op-service/predeploys"
)

type DependencySet interface {
// Chains returns the number of chains in the dependency set
Chains() []eth.ChainID
}

// L1ReceiptsFetcher fetches L1 header info and receipts for the payload attributes derivation (the info tx and deposits)
type L1ReceiptsFetcher interface {
InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error)
Expand Down
15 changes: 15 additions & 0 deletions op-node/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"strings"

"github.com/ethereum-optimism/optimism/op-supervisor/supervisor/backend/depset"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -39,6 +40,11 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
return nil, err
}

depSet, err := NewDependencySetFromCLI(ctx)
if err != nil {
return nil, err
}

if !ctx.Bool(flags.RollupLoadProtocolVersions.Name) {
log.Info("Not opted in to ProtocolVersions signal loading, disabling ProtocolVersions contract now.")
rollupConfig.ProtocolVersionsAddress = common.Address{}
Expand Down Expand Up @@ -85,6 +91,7 @@ func NewConfig(ctx *cli.Context, log log.Logger) (*node.Config, error) {
L1: l1Endpoint,
L2: l2Endpoint,
Rollup: *rollupConfig,
DependencySet: depSet,
Driver: *driverConfig,
Beacon: NewBeaconEndpointConfig(ctx),
InteropConfig: NewSupervisorEndpointConfig(ctx),
Expand Down Expand Up @@ -285,6 +292,14 @@ func applyOverrides(ctx *cli.Context, rollupConfig *rollup.Config) {
}
}

func NewDependencySetFromCLI(ctx *cli.Context) (depset.DependencySet, error) {
if !ctx.IsSet(flags.InteropDependencySet.Name) {
return nil, nil
}
loader := &depset.JSONDependencySetLoader{Path: ctx.Path(flags.InteropDependencySet.Name)}
return loader.LoadDependencySet(ctx.Context)
}

func NewSyncConfig(ctx *cli.Context, log log.Logger) (*sync.Config, error) {
if ctx.IsSet(flags.L2EngineSyncEnabled.Name) && ctx.IsSet(flags.SyncModeFlag.Name) {
return nil, errors.New("cannot set both --l2.engine-sync and --syncmode at the same time")
Expand Down