package
5.2.0
Repository: https://github.com/prysmaticlabs/prysm.git
Documentation: pkg.go.dev

# Packages

Package interop contains useful utilities for persisting ssz-encoded states and blocks to disk during each state transition for development purposes.
Package stateutils contains useful tools for faster computation of state transitions using maps to represent validators instead of slices.

# Functions

CalculateStateRoot defines the procedure for a state transition function.
EmptyGenesisState returns an empty beacon state object.
EmptyGenesisStateBellatrix returns an empty beacon state object.
ExecuteStateTransition defines the procedure for a state transition function.
ExecuteStateTransitionNoVerifyAnySig defines the procedure for a state transition function.
GenesisBeaconState gets called when MinGenesisActiveValidatorCount count of full deposits were made to the deposit contract and the ChainStart log gets emitted.
GenesisBeaconStateBellatrix gets called when MinGenesisActiveValidatorCount count of full deposits were made to the deposit contract and the ChainStart log gets emitted.
IsValidGenesisState gets called whenever there's a deposit event, it checks whether there's enough effective balance to trigger and if the minimum genesis time arrived already.
LastCachedState returns the last cached state and root in the cache.
NextSlotState returns the saved state for the given blockroot.
OptimizedGenesisBeaconState is used to create a state that has already processed deposits.
OptimizedGenesisBeaconStateBellatrix is used to create a state that has already processed deposits.
PreminedGenesisBeaconState works almost exactly like GenesisBeaconState, except that it assumes that genesis deposits are not represented in the deposit contract and are only found in the genesis state validator registry.
ProcessBlockForStateRoot processes the state for state root computation.
ProcessBlockNoVerifyAnySig creates a new, modified beacon state by applying block operation transformations as defined in the Ethereum Serenity specification.
ProcessEpoch is a wrapper on fork specific epoch processing.
ProcessEpochPrecompute describes the per epoch operations that are performed on the beacon state.
ProcessOperationsNoVerifyAttsSigs processes the operations in the beacon block and updates beacon state with the operations in block.
ProcessSlot happens every slot and focuses on the slot counter and block roots record updates.
ProcessSlots includes core slot processing as well as a cache.
ProcessSlotsCore process through skip slots and apply epoch transition when it's needed Spec pseudocode definition: def process_slots(state: BeaconState, slot: Slot) -> None: assert state.slot < slot while state.slot < slot: process_slot(state) # Process epoch on the start slot of the next epoch if (state.slot + 1) % SLOTS_PER_EPOCH == 0: process_epoch(state) state.slot = Slot(state.slot + 1).
ProcessSlotsIfPossible executes ProcessSlots on the input state when target slot is above the state's slot.
ProcessSlotsUsingNextSlotCache processes slots by using next slot cache for higher efficiency.
UpdateNextSlotCache updates the `nextSlotCache`.
UpgradeState upgrades the state to the next version if possible.
VerifyOperationLengths verifies that block operation lengths are valid.

# Variables

SkipSlotCache exists for the unlikely scenario that is a large gap between the head state and the current slot.