Documentation
¶
Index ¶
- type ActivationConfig
- type ChainTimestamper
- type DependencySet
- type DependencySetSource
- type FullConfigSet
- type FullConfigSetMerged
- type FullConfigSetSource
- type FullConfigSetSourceMerged
- type Genesis
- type JSONDependencySetLoader
- type JSONRollupConfigSetLoader
- type JSONRollupConfigsLoader
- type LinkCheckFn
- type LinkChecker
- type LinkCheckerImpl
- type LinkerConfig
- type RegistryFullConfigSetSource
- type RollupConfigSet
- type RollupConfigSetSource
- type StaticConfigDependency
- type StaticConfigDependencySet
- func (ds *StaticConfigDependencySet) Chains() []eth.ChainID
- func (ds *StaticConfigDependencySet) Dependencies() map[eth.ChainID]*StaticConfigDependency
- func (ds *StaticConfigDependencySet) HasChain(chainID eth.ChainID) bool
- func (ds *StaticConfigDependencySet) LoadDependencySet(ctx context.Context) (DependencySet, error)
- func (ds *StaticConfigDependencySet) MarshalJSON() ([]byte, error)
- func (ds *StaticConfigDependencySet) MarshalTOML() ([]byte, error)
- func (ds *StaticConfigDependencySet) MessageExpiryWindow() uint64
- func (ds *StaticConfigDependencySet) UnmarshalJSON(data []byte) error
- func (ds *StaticConfigDependencySet) UnmarshalTOML(v interface{}) error
- type StaticRollupConfig
- type StaticRollupConfigSet
- func (s StaticRollupConfigSet) Chains() []eth.ChainID
- func (s StaticRollupConfigSet) Genesis(chainID eth.ChainID) Genesis
- func (s StaticRollupConfigSet) HasChain(chainID eth.ChainID) bool
- func (s StaticRollupConfigSet) IsInterop(chainID eth.ChainID, ts uint64) bool
- func (s StaticRollupConfigSet) IsInteropActivationBlock(chainID eth.ChainID, ts uint64) bool
- func (c *StaticRollupConfigSet) LoadRollupConfigSet(ctx context.Context) (RollupConfigSet, error)
- type StaticTimestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationConfig ¶ added in v1.13.4
type ActivationConfig interface { // IsInterop returns true if the Interop hardfork is active for the given chain at the given timestamp. // It panics if the chain is not part of the rollup config set. // Use HasChain first to check if the chain is part of the rollup config set if // guarantee of existence isn't provided by the caller context. IsInterop(chainID eth.ChainID, ts uint64) bool // IsInteropActivationBlock returns true if the given timestamp is for an Interop activation block. // It panics if the chain is not part of the rollup config set. // Use HasChain first to check if the chain is part of the rollup config set if // guarantee of existence isn't provided by the caller context. IsInteropActivationBlock(chainID eth.ChainID, ts uint64) bool }
type ChainTimestamper ¶ added in v1.13.4
type DependencySet ¶
type DependencySet interface { // Chains returns the list of chains that are part of the dependency set. Chains() []eth.ChainID // HasChain determines if a chain is being tracked for interop purposes. // See CanExecuteAt and CanInitiateAt to check if a chain may message at a given time. HasChain(chainID eth.ChainID) bool // MessageExpiryWindow returns the message expiry window to use for this dependency set. MessageExpiryWindow() uint64 }
DependencySet is an initialized dependency set, ready to answer queries of what is and what is not part of the dependency set.
func FromRegistry ¶ added in v1.13.4
func FromRegistry(chainID eth.ChainID) (DependencySet, error)
FromRegistry loads a dependency set from the superchain-registry. Returns error of type superchain.ErrUnknownChain if the chain is not available in the superchain registry.
func ParseJSONDependencySet ¶ added in v1.13.4
func ParseJSONDependencySet(f io.Reader) (DependencySet, error)
type DependencySetSource ¶
type DependencySetSource interface {
LoadDependencySet(ctx context.Context) (DependencySet, error)
}
type FullConfigSet ¶ added in v1.13.4
type FullConfigSet interface { RollupConfigSet DependencySet }
type FullConfigSetMerged ¶ added in v1.13.4
type FullConfigSetMerged struct { RollupConfigSet DependencySet }
func NewFullConfigSetMerged ¶ added in v1.13.4
func NewFullConfigSetMerged(rollupConfigSet RollupConfigSet, dependencySet DependencySet) (FullConfigSetMerged, error)
NewFullConfigSetMerged creates a new FullConfigSetMerged from a RollupConfigSet and a DependencySet. It checks that the two sets contain the same chains.
func (FullConfigSetMerged) Chains ¶ added in v1.13.4
func (f FullConfigSetMerged) Chains() []eth.ChainID
func (FullConfigSetMerged) CheckChains ¶ added in v1.13.4
func (f FullConfigSetMerged) CheckChains() error
func (FullConfigSetMerged) HasChain ¶ added in v1.13.4
func (f FullConfigSetMerged) HasChain(chainID eth.ChainID) bool
func (FullConfigSetMerged) LoadFullConfigSet ¶ added in v1.13.4
func (f FullConfigSetMerged) LoadFullConfigSet(_ context.Context) (FullConfigSet, error)
type FullConfigSetSource ¶ added in v1.13.4
type FullConfigSetSource interface {
LoadFullConfigSet(ctx context.Context) (FullConfigSet, error)
}
type FullConfigSetSourceMerged ¶ added in v1.13.4
type FullConfigSetSourceMerged struct { RollupConfigSetSource DependencySetSource }
func (*FullConfigSetSourceMerged) LoadFullConfigSet ¶ added in v1.13.4
func (l *FullConfigSetSourceMerged) LoadFullConfigSet(ctx context.Context) (FullConfigSet, error)
type Genesis ¶ added in v1.13.4
type Genesis struct { // The L1 block that the rollup starts *after* (no derived transactions) L1 types.BlockSeal `json:"l1"` // The L2 block the rollup starts from (no transactions, pre-configured state, no parent) L2 types.BlockSeal `json:"l2"` }
Genesis provides the genesis information relevant for Interop. It's a trimmed down version of rollup.Genesis.
type JSONDependencySetLoader ¶ added in v1.13.4
type JSONDependencySetLoader struct {
Path string
}
JSONDependencySetLoader loads a dependency set from a file-path.
func (*JSONDependencySetLoader) LoadDependencySet ¶ added in v1.13.4
func (j *JSONDependencySetLoader) LoadDependencySet(ctx context.Context) (DependencySet, error)
type JSONRollupConfigSetLoader ¶ added in v1.13.4
type JSONRollupConfigSetLoader struct {
Path string
}
func (*JSONRollupConfigSetLoader) LoadRollupConfigSet ¶ added in v1.13.4
func (j *JSONRollupConfigSetLoader) LoadRollupConfigSet(ctx context.Context) (RollupConfigSet, error)
type JSONRollupConfigsLoader ¶ added in v1.13.4
JSONRollupConfigsLoader loads a set of op-node rollup.json configs into a supervisor rollup config set. The [PathPattern] is a glob pattern that matches the rollup.json files, e.g. "configs/rollup-*.json". See https://pkg.go.dev/path/filepath#Glob for more details. Because the rollup.Config doesn't include the genesis L1 block timestamp, they are queried from the L1 RPC at URL [L1RPCURL].
func (*JSONRollupConfigsLoader) LoadRollupConfigSet ¶ added in v1.13.4
func (j *JSONRollupConfigsLoader) LoadRollupConfigSet(ctx context.Context) (RollupConfigSet, error)
type LinkCheckFn ¶ added in v1.13.4
type LinkCheckFn func(execInChain eth.ChainID, execInTimestamp uint64, initChainID eth.ChainID, initTimestamp uint64) bool
LinkCheckFn is a function-type that implements LinkChecker, for testing and other special case definitions
func (LinkCheckFn) CanExecute ¶ added in v1.13.4
type LinkChecker ¶ added in v1.13.4
type LinkChecker interface { // CanExecute determines if an executing message is valid w.r.t. chain and timestamp constraints. // I.e. if the chain may be executing messages at the given timestamp, // from the given chain at the given initiating timestamp. // I.e. this does not check a full message, it merely checks some linking constraints. CanExecute(execInChain eth.ChainID, execInTimestamp uint64, initChainID eth.ChainID, initTimestamp uint64) bool }
type LinkCheckerImpl ¶ added in v1.13.4
type LinkCheckerImpl struct {
// contains filtered or unexported fields
}
LinkCheckerImpl implements a LinkChecker using the provided config
func LinkerFromConfig ¶ added in v1.13.4
func LinkerFromConfig(cfg LinkerConfig) *LinkCheckerImpl
func (*LinkCheckerImpl) CanExecute ¶ added in v1.13.4
type LinkerConfig ¶ added in v1.13.4
type LinkerConfig interface { ActivationConfig DependencySet }
LinkerConfig represents the config dependencies that are needed to create the default LinkChecker implementation LinkCheckerImpl.
type RegistryFullConfigSetSource ¶ added in v1.13.4
type RegistryFullConfigSetSource struct {
// contains filtered or unexported fields
}
func NewRegistryFullConfigSetSource ¶ added in v1.13.4
func NewRegistryFullConfigSetSource(l1RPCURL string, networks []string) (*RegistryFullConfigSetSource, error)
func (*RegistryFullConfigSetSource) LoadFullConfigSet ¶ added in v1.13.4
func (s *RegistryFullConfigSetSource) LoadFullConfigSet(ctx context.Context) (FullConfigSet, error)
type RollupConfigSet ¶ added in v1.13.4
type RollupConfigSet interface { // HasChain returns true if the chain is part of the rollup config set. HasChain(chainID eth.ChainID) bool // Chains returns the list of chains in the rollup config set. Chains() []eth.ChainID // Genesis returns the genesis configuration for the given chain. // It panics if the chain is not part of the rollup config set. // Use HasChain first to check if the chain is part of the rollup config set if // guarantee of existence isn't provided by the caller context. Genesis(chainID eth.ChainID) Genesis ActivationConfig }
RollupConfigSet provides access to minimal rollup configuration for a set of chains. Implementations should panic if any of the methods, besides HasChain, are called for a chain that is not part of the rollup config set.
type RollupConfigSetSource ¶ added in v1.13.4
type RollupConfigSetSource interface {
LoadRollupConfigSet(ctx context.Context) (RollupConfigSet, error)
}
type StaticConfigDependency ¶
type StaticConfigDependency struct { }
type StaticConfigDependencySet ¶
type StaticConfigDependencySet struct {
// contains filtered or unexported fields
}
StaticConfigDependencySet statically declares a DependencySet. It can be used as a DependencySetSource itself, by simply returning the itself when loading the set.
func NewStaticConfigDependencySet ¶
func NewStaticConfigDependencySet(dependencies map[eth.ChainID]*StaticConfigDependency) (*StaticConfigDependencySet, error)
func NewStaticConfigDependencySetWithMessageExpiryOverride ¶ added in v1.12.0
func NewStaticConfigDependencySetWithMessageExpiryOverride(dependencies map[eth.ChainID]*StaticConfigDependency, overrideMessageExpiryWindow uint64) (*StaticConfigDependencySet, error)
NewStaticConfigDependencySetWithMessageExpiryOverride creates a new StaticConfigDependencySet with a message expiry window override. To be used only for testing.
func (*StaticConfigDependencySet) Chains ¶
func (ds *StaticConfigDependencySet) Chains() []eth.ChainID
func (*StaticConfigDependencySet) Dependencies ¶ added in v1.13.3
func (ds *StaticConfigDependencySet) Dependencies() map[eth.ChainID]*StaticConfigDependency
Dependencies returns a deep copy of the dependencies map
func (*StaticConfigDependencySet) HasChain ¶
func (ds *StaticConfigDependencySet) HasChain(chainID eth.ChainID) bool
func (*StaticConfigDependencySet) LoadDependencySet ¶
func (ds *StaticConfigDependencySet) LoadDependencySet(ctx context.Context) (DependencySet, error)
func (*StaticConfigDependencySet) MarshalJSON ¶
func (ds *StaticConfigDependencySet) MarshalJSON() ([]byte, error)
func (*StaticConfigDependencySet) MarshalTOML ¶ added in v1.13.3
func (ds *StaticConfigDependencySet) MarshalTOML() ([]byte, error)
func (*StaticConfigDependencySet) MessageExpiryWindow ¶ added in v1.12.0
func (ds *StaticConfigDependencySet) MessageExpiryWindow() uint64
func (*StaticConfigDependencySet) UnmarshalJSON ¶
func (ds *StaticConfigDependencySet) UnmarshalJSON(data []byte) error
func (*StaticConfigDependencySet) UnmarshalTOML ¶ added in v1.13.3
func (ds *StaticConfigDependencySet) UnmarshalTOML(v interface{}) error
type StaticRollupConfig ¶ added in v1.13.4
type StaticRollupConfig struct { // Genesis anchor point of the rollup Genesis Genesis `json:"genesis"` // Seconds per L2 block BlockTime uint64 `json:"block_time"` // InteropTime sets the activation time for the Interop network upgrade. // Active if InteropTime != nil && L2 block timestamp >= *InteropTime, inactive otherwise. InteropTime *uint64 `json:"interop_time,omitempty"` }
StaticRollupConfig provides the rollup information relevant for Interop. It's a trimmed down version of rollup.Config.
func StaticRollupConfigFromRollupConfig ¶ added in v1.13.4
func StaticRollupConfigFromRollupConfig(cfg *rollup.Config, l1Time uint64) *StaticRollupConfig
func (*StaticRollupConfig) IsInterop ¶ added in v1.13.4
func (c *StaticRollupConfig) IsInterop(ts uint64) bool
IsInterop returns true if the Interop hardfork is active at or past the given timestamp.
func (*StaticRollupConfig) IsInteropActivationBlock ¶ added in v1.13.4
func (c *StaticRollupConfig) IsInteropActivationBlock(ts uint64) bool
type StaticRollupConfigSet ¶ added in v1.13.4
type StaticRollupConfigSet map[eth.ChainID]*StaticRollupConfig
func NewStaticRollupConfigSet ¶ added in v1.13.4
func NewStaticRollupConfigSet(cfgs map[eth.ChainID]*StaticRollupConfig) StaticRollupConfigSet
func StaticRollupConfigSetFromRollupConfigMap ¶ added in v1.13.4
func StaticRollupConfigSetFromRollupConfigMap(rcfgs map[eth.ChainID]*rollup.Config, l1Timestamps ChainTimestamper) StaticRollupConfigSet
func (StaticRollupConfigSet) Chains ¶ added in v1.13.4
func (s StaticRollupConfigSet) Chains() []eth.ChainID
Chains returns the list of chains in the rollup config set.
func (StaticRollupConfigSet) Genesis ¶ added in v1.13.4
func (s StaticRollupConfigSet) Genesis(chainID eth.ChainID) Genesis
Genesis returns the genesis configuration for the given chain. Panics if the chain is not part of the rollup config set.
func (StaticRollupConfigSet) HasChain ¶ added in v1.13.4
func (s StaticRollupConfigSet) HasChain(chainID eth.ChainID) bool
HasChain returns true if the chain is part of the rollup config set.
func (StaticRollupConfigSet) IsInterop ¶ added in v1.13.4
func (s StaticRollupConfigSet) IsInterop(chainID eth.ChainID, ts uint64) bool
IsInterop returns true if the Interop hardfork is active for the given chain at the given timestamp. Panics if the chain is not part of the rollup config set.
func (StaticRollupConfigSet) IsInteropActivationBlock ¶ added in v1.13.4
func (s StaticRollupConfigSet) IsInteropActivationBlock(chainID eth.ChainID, ts uint64) bool
IsInteropActivationBlock returns true if the given timestamp is the activation block for the Interop hardfork. Panics if the chain is not part of the rollup config set.
func (*StaticRollupConfigSet) LoadRollupConfigSet ¶ added in v1.13.4
func (c *StaticRollupConfigSet) LoadRollupConfigSet(ctx context.Context) (RollupConfigSet, error)
type StaticTimestamp ¶ added in v1.13.4
type StaticTimestamp uint64