genesis

package
v0.0.0-...-1b5297f Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const InitializedValue uint8 = 1

initialzedValue represents the `Initializable` contract value.

View Source
const MaxInitializedValue uint8 = 255

Variables

This section is empty.

Functions

func BuildL2Genesis

func BuildL2Genesis(ctx context.Context, config *GenesisConfig, l1StartBlock *types.Block) (*core.Genesis, error)

func GeneratePredeployConfig

func GeneratePredeployConfig(config *GenesisConfig, block *types.Block) predeploys.PredeployConfigs

func NewL2EmptyGenesis

func NewL2EmptyGenesis(config *GenesisConfig, block *types.Block) (*core.Genesis, error)

Types

type GenesisConfig

type GenesisConfig struct {
	// L2ChainID is the chain ID of the L2 chain.
	L2ChainID uint64 `json:"l2ChainID"`

	L2GenesisBlockNonce         hexutil.Uint64 `json:"l2GenesisBlockNonce"`
	L2GenesisBlockGasLimit      hexutil.Uint64 `json:"l2GenesisBlockGasLimit"`
	L2GenesisBlockDifficulty    *hexutil.Big   `json:"l2GenesisBlockDifficulty"`
	L2GenesisBlockMixHash       common.Hash    `json:"l2GenesisBlockMixHash"`
	L2GenesisBlockCoinbase      common.Address `json:"l2GenesisBlockCoinbase"`
	L2GenesisBlockNumber        hexutil.Uint64 `json:"l2GenesisBlockNumber"`
	L2GenesisBlockGasUsed       hexutil.Uint64 `json:"l2GenesisBlockGasUsed"`
	L2GenesisBlockParentHash    common.Hash    `json:"l2GenesisBlockParentHash"`
	L2GenesisBlockBaseFeePerGas *hexutil.Big   `json:"l2GenesisBlockBaseFeePerGas"`
	L2GenesisBlockExtraData     hexutil.Bytes  `json:"l2GenesisBlockExtraData"`

	L2PredeployOwner         common.Address `json:"l2PredeployOwner"`
	L1PortalAddress          common.Address `json:"l1PortalAddress,omitempty"`
	L1StandardBridgeAddress  common.Address `json:"l1StandardBridgeAddress,omitempty"`
	L2FeesWithdrawalAddress  common.Address `json:"l2FeesWithdrawalAddress"`
	L2FeesMinWithdrwalAmount *hexutil.Big   `json:"l2FeesMinWithdrwalAmount"`

	L1FeeOverhead *hexutil.Big `json:"l1FeeOverhead"`
	L1FeeScalar   *hexutil.Big `json:"l1FeeScalar"`

	Alloc core.GenesisAlloc `json:"alloc"`
}

func NewGenesisConfig

func NewGenesisConfig(path string) (*GenesisConfig, error)

Jump to

Keyboard shortcuts

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