standard

package
v0.0.0-...-ca80c8f Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 7 Imported by: 1

README

Standard Rollup Blockspace Charter definition files

This directory contains a number of TOML files which declare various parameters, addresses, contract versions and other data which define a standard chain in the sense of the Standard Rollup Charter.

Distinct, named declaration files have been added (where necessary) to allow testnets to have greater flexibility in their configurations.

Parameters may be declared to be equal to a pair of values, meaning that the parameter must be within the bounds defined by those values.

The TOML files are embedded into Go bindings, which are in turn referenced by the validation checks in the parent directory. The entrypoint for those checks is validation_test.go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Release            Tag
	ContractVersions                          = make(map[string]map[Tag]superchain.ContractVersions)
	BytecodeHashes     BytecodeHashTags       = make(BytecodeHashTags, 0)
	BytecodeImmutables BytecodeImmutablesTags = make(BytecodeImmutablesTags, 0)
)
View Source
var (
	ErrNoSuchContractName = fmt.Errorf("no such contract name")
	ErrFieldNotTypeString = fmt.Errorf("field is not type string")
	ErrHashNotSpecified   = fmt.Errorf("hash not specified")
)
View Source
var Config = ConfigType{}

Functions

This section is empty.

Types

type BigIntBounds

type BigIntBounds [2]*big.Int

func (BigIntBounds) Check

func (bb BigIntBounds) Check() error

type BytecodeHashTags

type BytecodeHashTags = map[Tag]L1ContractBytecodeHashes

type BytecodeImmutablesTags

type BytecodeImmutablesTags = map[Tag]ContractBytecodeImmutables

type ConfigType

type ConfigType struct {
	Params        map[string]*Params
	Roles         *Roles
	MultisigRoles map[string]*MultisigRoles
}

Config.Params is keyed by superchain target, e.g. "mainnet" or "sepolia" or "sepolia-dev-0"

type ContractBytecodeImmutables

type ContractBytecodeImmutables struct {
	AnchorStateRegistry string `toml:"anchor_state_registry,omitempty"`
	DelayedWETH         string `toml:"delayed_weth,omitempty"`
	FaultDisputeGame    string `toml:"fault_dispute_game,omitempty"`
	MIPS                string `toml:"mips,omitempty"`
}

ContractBytecodeImmutables stores the immutable references as a raw stringified JSON string in a TOML config. it is stored this way because it can be plucked out of the contract compilation output as is and pasted into the TOML config file.

func (ContractBytecodeImmutables) ForContractWithName

func (c ContractBytecodeImmutables) ForContractWithName(name string) (string, bool)

type EcotoneGasPriceOracleBounds

type EcotoneGasPriceOracleBounds struct {
	Decimals          BigIntBounds `toml:"decimals"`
	BlobBaseFeeScalar Uint32Bounds `toml:"blob_base_fee_scalar"`
	BaseFeeScalar     Uint32Bounds `toml:"base_fee_scalar"`
}

func (*EcotoneGasPriceOracleBounds) Check

func (ec *EcotoneGasPriceOracleBounds) Check() error

type GasPriceOracleBounds

type GasPriceOracleBounds struct {
	PreEcotone PreEcotoneGasPriceOracleBounds `toml:"pre-ecotone"`
	Ecotone    EcotoneGasPriceOracleBounds    `toml:"ecotone"`
}

type L1

type L1 struct {
	Universal      Resolutions `toml:"universal"`
	NonFaultProofs Resolutions `toml:"nonFaultProofs"`
	FaultProofs    Resolutions `toml:"FaultProofs"`
}

func (L1) GetResolutions

func (r L1) GetResolutions(isFaultProofs bool) Resolutions

type L1ContractBytecodeHashes

type L1ContractBytecodeHashes superchain.ContractBytecodeHashes

L1ContractBytecodeHashes represents the hash of the contract bytecode (as a hex string) for each L1 contract

func (L1ContractBytecodeHashes) GetBytecodeHashFor

func (bch L1ContractBytecodeHashes) GetBytecodeHashFor(name string) (string, error)

func (L1ContractBytecodeHashes) GetNonEmpty

func (bch L1ContractBytecodeHashes) GetNonEmpty() []string

GetNonEmpty returns a slice of contract name strings, with an entry for each key in the receiver with a non-empty value

type L2

type L2 struct {
	Universal Resolutions `toml:"universal"`
}

type MultisigRoles

type MultisigRoles struct {
	L1          L1 `toml:"l1"`
	L2          L2 `toml:"l2"`
	KeyHandover struct {
		L1 L1
		L2 L2
	} `toml:"key-handover"`
}

type Multisigs

type Multisigs struct{}

type OptimismPortal2Bounds

type OptimismPortal2Bounds struct {
	ProofMaturityDelaySeconds       [2]uint64 `toml:"proof_maturity_delay_seconds"`
	DisputeGameFinalityDelaySeconds [2]uint64 `toml:"dispute_game_finality_delay_seconds"`
	RespectedGameType               uint32    `toml:"respected_game_type"`
}

func (*OptimismPortal2Bounds) Check

func (op *OptimismPortal2Bounds) Check() error

type Params

type Params struct {
	RollupConfig          RollupConfigBounds    `toml:"rollup_config"`
	OptimismPortal2Config OptimismPortal2Bounds `toml:"optimism_portal_2"`
	ResourceConfig        ResourceConfig        `toml:"resource_config"`
	GPOParams             GasPriceOracleBounds  `toml:"gas_price_oracle"`
	SystemConfig          SystemConfig          `toml:"system_config"`
}

func (*Params) Check

func (p *Params) Check() error

type PreEcotoneGasPriceOracleBounds

type PreEcotoneGasPriceOracleBounds struct {
	Decimals BigIntBounds `toml:"decimals"`
	Overhead BigIntBounds `toml:"overhead"`
	Scalar   BigIntBounds `toml:"scalar"`
}

func (*PreEcotoneGasPriceOracleBounds) Check

type Resolutions

type Resolutions map[string]map[string]string // e.g. "AddressManager": "owner()":  "ProxyAdmin"

type ResourceConfig

type ResourceConfig struct {
	MaxResourceLimit            uint32   `toml:"max_resource_limit"`
	ElasticityMultiplier        uint8    `toml:"elasticity_multiplier"`
	BaseFeeMaxChangeDenominator uint8    `toml:"base_fee_max_change_denominator"`
	MinimumBaseFee              uint32   `toml:"minimum_base_fee"`
	SystemTxMaxGas              uint32   `toml:"system_tx_max_gas"`
	MaximumBaseFee              *big.Int `toml:"maximum_base_fee"`
}

func (*ResourceConfig) Check

func (rc *ResourceConfig) Check() error

type Roles

type Roles struct {
	L1 L1 `toml:"l1"`
	L2 L2 `toml:"L2"`
}

type RollupConfigBounds

type RollupConfigBounds struct {
	AltDA               *superchain.AltDAConfig `toml:"alt_da"`
	BlockTime           [2]uint64               `toml:"block_time"`
	SequencerWindowSize [2]uint64               `toml:"seq_window_size"`
}

func (*RollupConfigBounds) Check

func (rc *RollupConfigBounds) Check() error

type SystemConfig

type SystemConfig struct {
	GasLimit [2]uint64 `toml:"gas_limit"`
}

func (*SystemConfig) Check

func (sc *SystemConfig) Check() error

type Tag

type Tag string

type Uint32Bounds

type Uint32Bounds [2]uint32

func (Uint32Bounds) Check

func (ub Uint32Bounds) Check() error

Jump to

Keyboard shortcuts

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