Documentation
¶
Index ¶
- Variables
- type BlobSchedule
- type BlobScheduleEntry
- type ForkEpoch
- type ForkEpochs
- func (f *ForkEpochs) Active(epoch phase0.Epoch) []*ForkEpoch
- func (f *ForkEpochs) AsScheduledForks() ([]*ScheduledFork, error)
- func (f *ForkEpochs) CurrentFork(epoch phase0.Epoch) (*ForkEpoch, error)
- func (f *ForkEpochs) GetByName(name string) (*ForkEpoch, error)
- func (f *ForkEpochs) IndexOf(name spec.DataVersion) int
- func (f *ForkEpochs) PreviousFork(epoch phase0.Epoch) (*ForkEpoch, error)
- func (f *ForkEpochs) Scheduled(epoch phase0.Epoch) []*ForkEpoch
- type ScheduledFork
- type Spec
- type StringerDuration
Constants ¶
This section is empty.
Variables ¶
var ( // ForkOrder is the canonical order of the forks. ForkOrder = []spec.DataVersion{ spec.DataVersionPhase0, spec.DataVersionAltair, spec.DataVersionBellatrix, spec.DataVersionCapella, spec.DataVersionDeneb, spec.DataVersionElectra, spec.DataVersionFulu, } )
Functions ¶
This section is empty.
Types ¶
type BlobSchedule ¶ added in v0.63.0
type BlobSchedule []BlobScheduleEntry
BlobSchedule represents the BLOB_SCHEDULE configuration.
func (BlobSchedule) GetMaxBlobsPerBlock ¶ added in v0.63.0
func (bs BlobSchedule) GetMaxBlobsPerBlock(epoch phase0.Epoch) uint64
GetMaxBlobsPerBlock returns the maximum number of blobs that can be included in a block for a given epoch.
type BlobScheduleEntry ¶ added in v0.63.0
type BlobScheduleEntry struct {
Epoch phase0.Epoch `json:"EPOCH,string"`
MaxBlobsPerBlock uint64 `json:"MAX_BLOBS_PER_BLOCK,string"`
}
BlobScheduleEntry represents a single entry in the BLOB_SCHEDULE configuration.
type ForkEpoch ¶
type ForkEpoch struct {
Epoch phase0.Epoch `yaml:"epoch"`
Version string `json:"version"`
Name spec.DataVersion `json:"name"`
}
ForkEpoch is a beacon fork that activates at a specific epoch.
type ForkEpochs ¶
type ForkEpochs []*ForkEpoch
ForkEpochs is a list of forks that activate at specific epochs.
func (*ForkEpochs) Active ¶
func (f *ForkEpochs) Active(epoch phase0.Epoch) []*ForkEpoch
Active returns a list of forks that are active at the given epoch.
func (*ForkEpochs) AsScheduledForks ¶
func (f *ForkEpochs) AsScheduledForks() ([]*ScheduledFork, error)
AsScheduledForks returns the forks as scheduled forks.
func (*ForkEpochs) CurrentFork ¶
func (f *ForkEpochs) CurrentFork(epoch phase0.Epoch) (*ForkEpoch, error)
CurrentFork returns the current fork at the given epoch.
func (*ForkEpochs) GetByName ¶
func (f *ForkEpochs) GetByName(name string) (*ForkEpoch, error)
GetByName returns the fork with the given name.
func (*ForkEpochs) IndexOf ¶ added in v0.43.0
func (f *ForkEpochs) IndexOf(name spec.DataVersion) int
IndexOf returns the index of the given data version in the fork order.
func (*ForkEpochs) PreviousFork ¶
func (f *ForkEpochs) PreviousFork(epoch phase0.Epoch) (*ForkEpoch, error)
PreviousFork returns the previous fork at the given epoch.
type ScheduledFork ¶
type ScheduledFork struct {
CurrentVersion string `json:"current_version"`
Epoch string `json:"epoch"`
PreviousVersion string `json:"previous_version"`
}
ScheduledFork is an upcoming fork.
func ForkScheduleFromForkEpochs ¶
func ForkScheduleFromForkEpochs(forks ForkEpochs) ([]*ScheduledFork, error)
ForkScheduleFromForkEpochs returns a fork schedule from a list of forks.
type Spec ¶
type Spec struct {
PresetBase string `json:"PRESET_BASE"`
ConfigName string `json:"CONFIG_NAME"`
DepositChainID uint64 `json:"DEPOSIT_CHAIN_ID,string"`
DepositContractAddress string `json:"DEPOSIT_CONTRACT_ADDRESS"`
SafeSlotsToUpdateJustified phase0.Slot `json:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED,string"`
SlotsPerEpoch phase0.Slot `json:"SLOTS_PER_EPOCH,string"`
EpochsPerSyncCommitteePeriod phase0.Epoch `json:"EPOCHS_PER_SYNC_COMMITTEE_PERIOD,string"`
MinSyncCommitteeParticipants uint64 `json:"MIN_SYNC_COMMITTEE_PARTICIPANTS,string"`
TargetCommitteeSize uint64 `json:"TARGET_COMMITTEE_SIZE,string"`
SyncCommitteeSize uint64 `json:"SYNC_COMMITTEE_SIZE,string"`
TerminalBlockHashActivationEpoch phase0.Epoch `json:"TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH,string"`
TerminalTotalDifficulty big.Int `json:"-"`
MaxValidatorsPerCommittee uint64 `json:"MAX_VALIDATORS_PER_COMMITTEE,string"`
BaseRewardFactor uint64 `json:"BASE_REWARD_FACTOR,string"`
EffectiveBalanceIncrement phase0.Gwei `json:"EFFECTIVE_BALANCE_INCREMENT,string"`
MaxEffectiveBalance phase0.Gwei `json:"MAX_EFFECTIVE_BALANCE,string"`
MinDepositAmount phase0.Gwei `json:"MIN_DEPOSIT_AMOUNT,string"`
MaxAttestations uint64 `json:"MAX_ATTESTATIONS,string"`
SecondsPerEth1Block StringerDuration `json:"SECONDS_PER_ETH1_BLOCK,string"`
GenesisDelay StringerDuration `json:"GENESIS_DELAY,string"`
SecondsPerSlot StringerDuration `json:"SECONDS_PER_SLOT,string"`
MaxDeposits uint64 `json:"MAX_DEPOSITS,string"`
MinGenesisActiveValidatorCount uint64 `json:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT,string"`
Eth1FollowDistance uint64 `json:"ETH1_FOLLOW_DISTANCE,string"`
ForkEpochs ForkEpochs `json:"-"`
BlobSchedule BlobSchedule `json:"BLOB_SCHEDULE"`
FullSpec map[string]any `json:"-"`
}
Spec represents the state of the spec.
func (*Spec) GetMaxBlobsPerBlock ¶ added in v0.63.0
GetMaxBlobsPerBlock returns the maximum number of blobs that can be included in a block for a given epoch.
type StringerDuration ¶
StringerDuration is a time.Duration that can be marshalled to JSON as a string.
func (StringerDuration) AsDuration ¶
func (s StringerDuration) AsDuration() time.Duration
AsDuration returns the duration as a time.Duration.
func (StringerDuration) MarshalJSON ¶
func (s StringerDuration) MarshalJSON() ([]byte, error)
func (*StringerDuration) UnmarshalJSON ¶
func (s *StringerDuration) UnmarshalJSON(b []byte) error