Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NetworkGenesisRoots = map[string]uint64{
"0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95": 1,
"0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb": 5,
"0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078": 11155111,
"0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1": 17000,
"0x212f13fc4df078b6cb7db228f1c8307566dcecf900867401a92023d7ba99cb5f": 560048,
}
var NetworkIds = map[uint64]NetworkName{ 1: NetworkNameMainnet, 5: NetworkNameGoerli, 11155111: NetworkNameSepolia, 17000: NetworkNameHolesky, 560048: NetworkNameHoodi, }
Functions ¶
func ComputeForkDigest ¶ added in v1.8.2
ComputeForkDigest computes the beacon chain fork digest. fork_digest = SHA256(fork_version || genesis_validators_root)[:4]
func ComputeForkIDHash ¶ added in v1.8.2
ComputeForkIDHash computes the EIP-2124 fork ID hash from a genesis hash. For a fresh network at genesis, FORK_HASH = CRC32(genesis_hash)
Types ¶
type DevnetConfig ¶ added in v1.8.2
type DevnetConfig struct {
// URL is the base URL to the network config directory (e.g., https://raw.githubusercontent.com/ethpandaops/blob-devnets/master/network-configs/devnet-0)
URL string `yaml:"url"`
}
DevnetConfig represents the configuration for fetching network config from a URL.
func (*DevnetConfig) Fetch ¶ added in v1.8.2
func (c *DevnetConfig) Fetch(ctx context.Context) (*FetchedDevnetConfig, error)
Fetch fetches and parses the network configuration from the URL.
func (*DevnetConfig) Validate ¶ added in v1.8.2
func (c *DevnetConfig) Validate() error
Validate checks if the DevnetConfig is valid.
type FetchedDevnetConfig ¶ added in v1.8.2
type FetchedDevnetConfig struct {
// ChainID is the network/chain ID from config.yaml DEPOSIT_CHAIN_ID
ChainID uint64
// GenesisHash is the execution layer genesis hash
GenesisHash [32]byte
// GenesisValidatorsRoot is the consensus layer GVR
GenesisValidatorsRoot [32]byte
// ForkVersions contains all fork versions from config.yaml
ForkVersions []ForkVersionConfig
// BootNodes contains ENR strings from bootstrap_nodes.txt
BootNodes []string
// ForkIDHash is the computed EIP-2124 fork ID hash (first 4 bytes of CRC32(genesis_hash))
ForkIDHash [4]byte
// ForkDigests contains computed fork digests for each fork version
ForkDigests []ForkDigest
}
FetchedDevnetConfig contains all the computed network parameters from a devnet config.
func (*FetchedDevnetConfig) CurrentForkDigestHex ¶ added in v1.8.2
func (f *FetchedDevnetConfig) CurrentForkDigestHex() string
CurrentForkDigestHex returns the most recent (highest epoch) fork digest as a hex string.
func (*FetchedDevnetConfig) ForkDigestHexes ¶ added in v1.8.2
func (f *FetchedDevnetConfig) ForkDigestHexes() []string
ForkDigestHexes returns all fork digests as hex strings with 0x prefix.
func (*FetchedDevnetConfig) ForkIDHashHex ¶ added in v1.8.2
func (f *FetchedDevnetConfig) ForkIDHashHex() string
ForkIDHashHex returns the fork ID hash as a hex string with 0x prefix.
type ForkDigest ¶ added in v1.8.2
ForkDigest represents a computed fork digest.
type ForkVersionConfig ¶ added in v1.8.2
ForkVersionConfig represents a fork version with its name.
type Network ¶
type Network struct {
Name NetworkName
ID uint64
}
func DeriveFromGenesisRoot ¶
func DeriveFromID ¶
type NetworkName ¶
type NetworkName string
var ( NetworkNameNone NetworkName = "none" NetworkNameUnknown NetworkName = "unknown" NetworkNameMainnet NetworkName = "mainnet" NetworkNameGoerli NetworkName = "goerli" NetworkNameSepolia NetworkName = "sepolia" NetworkNameHolesky NetworkName = "holesky" NetworkNameHoodi NetworkName = "hoodi" )