params

package
v0.1.1-experimental.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GenesisSlot represents the initial slot in the system.
	GenesisSlot = primitives.Slot(0)
	// GenesisEpoch represents the initial epoch in the system.
	GenesisEpoch = primitives.Epoch(0)
	// FarFutureEpoch represents a far future epoch value.
	FarFutureEpoch = primitives.Epoch(constants.Uint64Max)
)

This file contains various constants as defined: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#misc

Variables

This section is empty.

Functions

This section is empty.

Types

type BeaconChainConfig

type BeaconChainConfig struct {
	// Gwei value constants.
	//
	// MinDepositAmount is the minimum deposit amount per deposit
	// transaction.
	MinDepositAmount uint64 `mapstructure:"min-deposit-amount"`
	// MaxEffectiveBalance is the maximum effective balance allowed for a
	// validator.
	MaxEffectiveBalance uint64 `mapstructure:"max-effective-balance"`
	// EffectiveBalanceIncrement is the effective balance increment.
	EffectiveBalanceIncrement uint64 `mapstructure:"effective-balance-increment"`

	// Time parameters constants.
	//
	// SlotsPerEpoch is the number of slots per epoch.
	SlotsPerEpoch uint64 `mapstructure:"slots-per-epoch"`
	// SlotsPerHistoricalRoot is the number of slots per historical root.
	SlotsPerHistoricalRoot uint64 `mapstructure:"slots-per-historical-root"`

	// Eth1-related values.
	//
	// DepositContractAddress is the address of the deposit contract.
	DepositContractAddress primitives.ExecutionAddress `mapstructure:"deposit-contract-address"`

	// Fork-related values.
	//
	// ElectraForkEpoch is the epoch at which the Electra fork is activated.
	ElectraForkEpoch primitives.Epoch `mapstructure:"electra-fork-epoch"`

	// State list lengths
	//
	// EpochsPerHistoricalVector is the number of epochs in the historical
	// vector.
	EpochsPerHistoricalVector uint64 `mapstructure:"epochs-per-historical-vector"`
	// EpochsPerSlashingsVector is the number of epochs in the slashings vector.
	EpochsPerSlashingsVector uint64 `mapstructure:"epochs-per-slashings-vector"`

	// Max operations per block constants.
	//
	// MaxDepositsPerBlock specifies the maximum number of deposit operations
	// allowed per block.
	MaxDepositsPerBlock uint64 `mapstructure:"max-deposits-per-block"`
	// MaxWithdrawalsPerPayload indicates the maximum number of withdrawal
	// operations allowed in a single payload.
	MaxWithdrawalsPerPayload uint64 `mapstructure:"max-withdrawals-per-payload"`
	// MaxValidatorsPerWithdrawalsSweep specifies the maximum number of
	// validator
	// withdrawals allowed per sweep.
	MaxValidatorsPerWithdrawalsSweep uint64 `mapstructure:"max-validators-per-withdrawals-sweep"`

	// MaxBlobsPerBlock specifies the maximum number of blobs allowed per block.
	MaxBlobsPerBlock uint64 `mapstructure:"max-blobs-per-block"`

	// Rewards and penalties constants.
	//
	// ProportionalSlashingMultiplier is the slashing multiplier relative to the
	// base penalty.
	ProportionalSlashingMultiplier uint64 `mapstructure:"proportional-slashing-multiplier"`

	// Deneb Values
	//
	// MinEpochsForBlobsSidecarsRequest is the minimum number of epochs the node
	// will keep the blobs for.
	MinEpochsForBlobsSidecarsRequest uint64 `mapstructure:"min-epochs-for-blobs-sidecars-request"`
}

func DefaultBeaconConfig

func DefaultBeaconConfig() BeaconChainConfig

func (BeaconChainConfig) ActiveForkVersionForEpoch

func (c BeaconChainConfig) ActiveForkVersionForEpoch(
	epoch primitives.Epoch,
) uint32

ActiveForkVersionBySlot returns the active fork version for a given epoch.

func (BeaconChainConfig) ActiveForkVersionForSlot

func (c BeaconChainConfig) ActiveForkVersionForSlot(
	slot primitives.Slot,
) uint32

ActiveForkVersion returns the active fork version for a given slot.

func (BeaconChainConfig) SlotToEpoch

func (c BeaconChainConfig) SlotToEpoch(slot primitives.Slot) primitives.Epoch

SlotToEpoch converts a slot to an epoch.

func (BeaconChainConfig) WithinDAPeriod

func (c BeaconChainConfig) WithinDAPeriod(
	block, current primitives.Slot,
) bool

WithinDAPeriod checks if the block epoch is within MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS of the given current epoch.

Jump to

Keyboard shortcuts

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