manage

package
v0.0.0-...-eba1366 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const CollectorConcurrency = 8

Variables

View Source
var (
	ErrNoStagedConfig               = errors.New("no staged chain config found")
	ErrNoStagedSuperchainDefinition = errors.New("no staged superchain definition found")
)
View Source
var (
	ErrDuplicateChainID    = fmt.Errorf("duplicate chain ID")
	ErrDuplicateShortName  = fmt.Errorf("duplicate short name")
	ErrGenesisHashMismatch = fmt.Errorf("genesis hash mismatch")
)
View Source
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 GenChainsReadme(rootP string, outP string) error

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 GetContractAddressesFromState

func GetContractAddressesFromState(st deployer.OpaqueState, idx int) (config.Addresses, error)

func GetRolesFromState

func GetRolesFromState(st deployer.OpaqueState, idx int) (config.Roles, error)

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 ReadChainConfig(rootP string, superchain config.Superchain, shortName string) (*config.Chain, error)

func ReadGenesis

func ReadGenesis(rootP string, genPath string) (*core.Genesis, error)

func ReadSuperchainGenesis

func ReadSuperchainGenesis(rootP string, superchain config.Superchain, shortName string) (*core.Genesis, error)

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 ValidateGenesisIntegrity

func ValidateGenesisIntegrity(cfg *config.Chain, genesis *core.Genesis) error

func ValidateUniqueness

func ValidateUniqueness(
	in *config.StagedChain,
	chains []DiskChainConfig,
) error

func WriteChainConfig

func WriteChainConfig(rootP string, in *config.StagedChain) error

func WriteGenesis

func WriteGenesis(rootP string, genPath string, gen *core.Genesis) error

func WriteSuperchainDefinition

func WriteSuperchainDefinition(fname string, in *config.SuperchainDefinition) error

func WriteSuperchainGenesis

func WriteSuperchainGenesis(rootP string, superchain config.Superchain, shortName string, gen *core.Genesis) error

Types

type ChainEntry

type ChainEntry struct {
	ChainID   uint64 `json:"chainId"`
	Name      string `json:"name"`
	ShortName string `json:"shortName"`
}

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)

type GlobalChainIDs

type GlobalChainIDs struct {
	ChainIDs   map[uint64]bool
	ShortNames map[string]bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL