Documentation
¶
Index ¶
- Constants
- Variables
- func CopyDeployConfigHFTimes(src *genesis.UpgradeScheduleDeployConfig, dst *config.Hardforks) error
- func ExtractInteropDepSet(st deployer.OpaqueState) (*config.Interop, error)
- func FetchChains(egCtx context.Context, lgr log.Logger, wd string, l1RpcUrls []string, ...) (map[uint64]script.ChainConfig, error)
- func FetchGlobalChainIDs() (map[uint64]ChainEntry, error)
- func GenChainsReadme(rootP string, outP string) error
- func GenerateChainArtifacts(statePath string, wd string, shortName string, name *string, ...) error
- func GetContractAddressesFromState(st deployer.OpaqueState, idx int) (config.Addresses, error)
- func GetRolesFromState(st deployer.OpaqueState, idx int) (config.Roles, error)
- func InflateChainConfig(opd *deployer.OpDeployer, st deployer.OpaqueState, statePath string, idx int) (*config.StagedChain, error)
- func InflateSuperchainDefinition(name string, st deployer.OpaqueState) (*config.SuperchainDefinition, error)
- func ReadChainConfig(rootP string, superchain config.Superchain, shortName string) (*config.Chain, error)
- func ReadGenesis(rootP string, genPath string) (*core.Genesis, error)
- func ReadSuperchainGenesis(rootP string, superchain config.Superchain, shortName string) (*core.Genesis, error)
- func StagedChainConfigs(rootP string) ([]*config.StagedChain, error)
- func StagedSuperchainDefinition(rootP string) (*config.SuperchainDefinition, error)
- func ValidateGenesisIntegrity(cfg *config.Chain, genesis *core.Genesis) error
- func ValidateUniqueness(in *config.StagedChain, chains []DiskChainConfig) error
- func WriteChainConfig(rootP string, in *config.StagedChain) error
- func WriteGenesis(rootP string, genPath string, gen *core.Genesis) error
- func WriteSuperchainDefinition(fname string, in *config.SuperchainDefinition) error
- func WriteSuperchainGenesis(rootP string, superchain config.Superchain, shortName string, ...) error
- type ChainEntry
- type ChainsReadmeData
- type CodegenSyncer
- func (s *CodegenSyncer) ProcessAllChains() error
- func (s *CodegenSyncer) ProcessSingleChain(chainId uint64, onchainCfg script.ChainConfig) error
- func (s *CodegenSyncer) SyncAll() error
- func (s *CodegenSyncer) UpdateChainList(chainID string, onchainCfg script.ChainConfig) error
- func (s *CodegenSyncer) WriteFiles() error
- type CodegenSyncerOption
- type DepsetChecker
- type DiskChainConfig
- type GlobalChainIDs
Constants ¶
const CollectorConcurrency = 8
Variables ¶
var ( ErrNoStagedConfig = errors.New("no staged chain config found") ErrNoStagedSuperchainDefinition = errors.New("no staged superchain definition found") )
var ( ErrDuplicateChainID = fmt.Errorf("duplicate chain ID") ErrDuplicateShortName = fmt.Errorf("duplicate short name") ErrGenesisHashMismatch = fmt.Errorf("genesis hash mismatch") )
var ErrNotLossless = errors.New("conversion is not lossless, consider updating op-geth dependency")
Functions ¶
func CopyDeployConfigHFTimes ¶
func CopyDeployConfigHFTimes(src *genesis.UpgradeScheduleDeployConfig, dst *config.Hardforks) error
func ExtractInteropDepSet ¶
func ExtractInteropDepSet(st deployer.OpaqueState) (*config.Interop, error)
ExtractInteropDepSet reads the interop dependency set from state and converts it to config.Interop
func FetchChains ¶
func FetchChains(egCtx context.Context, lgr log.Logger, wd string, l1RpcUrls []string, chainIds []uint64, superchains []config.Superchain) (map[uint64]script.ChainConfig, error)
FetchChains fetches chain configurations for specified chain IDs or all chains if none specified
func FetchGlobalChainIDs ¶
func FetchGlobalChainIDs() (map[uint64]ChainEntry, error)
func GenChainsReadme ¶
func GenerateChainArtifacts ¶
func GenerateChainArtifacts( statePath string, wd string, shortName string, name *string, superchain *string, idx int, opDeployerVersion string, opDeployerBinDir string, ) error
GenerateChainArtifacts creates a chain config and genesis file for the chain at index idx in the given state file using the given shortName (and optionally, name and superchain identifier). It writes these files to the staging directory.
func GetRolesFromState ¶
func InflateChainConfig ¶
func InflateChainConfig(opd *deployer.OpDeployer, st deployer.OpaqueState, statePath string, idx int) (*config.StagedChain, error)
func InflateSuperchainDefinition ¶
func InflateSuperchainDefinition(name string, st deployer.OpaqueState) (*config.SuperchainDefinition, error)
func ReadChainConfig ¶
func ReadSuperchainGenesis ¶
func StagedChainConfigs ¶
func StagedChainConfigs(rootP string) ([]*config.StagedChain, error)
func StagedSuperchainDefinition ¶
func StagedSuperchainDefinition(rootP string) (*config.SuperchainDefinition, error)
StagedSuperchainDefinition finds a superchain.toml file in the staging directory (if it exists) and returns the parsed SuperchainDefinition struct.
func ValidateUniqueness ¶
func ValidateUniqueness( in *config.StagedChain, chains []DiskChainConfig, ) error
func WriteChainConfig ¶
func WriteChainConfig(rootP string, in *config.StagedChain) error
func WriteSuperchainDefinition ¶
func WriteSuperchainDefinition(fname string, in *config.SuperchainDefinition) error
func WriteSuperchainGenesis ¶
Types ¶
type ChainEntry ¶
type ChainsReadmeData ¶
type ChainsReadmeData struct { Superchains []config.Superchain ChainData [][]*config.Chain }
type CodegenSyncer ¶
type CodegenSyncer struct { ChainList []config.ChainListEntry Addresses config.AddressesJSON // contains filtered or unexported fields }
CodegenSyncer manages syncing of codegen files with on-chain data
func NewCodegenSyncer ¶
func NewCodegenSyncer(lgr log.Logger, wd string, chainCfgs map[uint64]script.ChainConfig, opts ...CodegenSyncerOption) (*CodegenSyncer, error)
func (*CodegenSyncer) ProcessAllChains ¶
func (s *CodegenSyncer) ProcessAllChains() error
ProcessAllChains reads all input chain files and updates syncer's internal data accordingly
func (*CodegenSyncer) ProcessSingleChain ¶
func (s *CodegenSyncer) ProcessSingleChain(chainId uint64, onchainCfg script.ChainConfig) error
ProcessSingleChain updates syncer's internal data for a given chain
func (*CodegenSyncer) SyncAll ¶
func (s *CodegenSyncer) SyncAll() error
SyncAll syncs codegen files with all entries in syncer.onchainCfgs
func (*CodegenSyncer) UpdateChainList ¶
func (s *CodegenSyncer) UpdateChainList(chainID string, onchainCfg script.ChainConfig) error
UpdateChainList updates the ChainList entry for the given chain ID
func (*CodegenSyncer) WriteFiles ¶
func (s *CodegenSyncer) WriteFiles() error
WriteFiles writes all updated data to disk
type CodegenSyncerOption ¶
type CodegenSyncerOption func(*CodegenSyncer)
func WithOutputDirectory ¶
func WithOutputDirectory(outputDir string) CodegenSyncerOption
type DepsetChecker ¶
type DepsetChecker struct {
// contains filtered or unexported fields
}
func NewDepsetChecker ¶
func NewDepsetChecker(logger log.Logger, cfgs []DiskChainConfig, addrs config.AddressesJSON) *DepsetChecker
func (*DepsetChecker) Check ¶
func (dc *DepsetChecker) Check() error
type DiskChainConfig ¶
type DiskChainConfig struct { ShortName string Filepath string Superchain config.Superchain Config *config.Chain }
func CollectChainConfigs ¶
func CollectChainConfigs(p string) ([]DiskChainConfig, error)