Documentation
¶
Index ¶
- Constants
- func BankhashConfirmedForSlot(slot uint64, bankHash solana.Hash) int
- func BlockHeight() uint64
- func CalcUnixTimeForClockSysvar() bool
- func ClearEpochStakes(epoch uint64)
- func ClearPendingStakePubkeys()
- func DeleteStakeCacheItem(pubkey solana.PublicKey)
- func DeleteVoteCacheItem(pubkey solana.PublicKey)
- func DeserializeAndLoadEpochStakes(data []byte) (uint64, error)
- func Epoch() uint64
- func EpochAuthorizedVoters() *epochstakes.EpochAuthorizedVotersCache
- func EpochStakes(epoch uint64) map[solana.PublicKey]uint64
- func EpochStakesVoteAccts(epoch uint64) map[solana.PublicKey]*epochstakes.VoteAccount
- func EpochTotalStake(epoch uint64) uint64
- func FlushPendingStakePubkeys(accountsDbDir string) (int, error)
- func GetAllCachedEpochs() []uint64
- func HasEpochStakes(epoch uint64) bool
- func IncrTransactionCount(num uint64)
- func LatestBlockHash() [32]byte
- func LeaderForSlot(slot uint64) (solana.PublicKey, bool)
- func LoadStakePubkeyIndex(accountsDbDir string) ([]solana.PublicKey, error)
- func ManageBlockHeight() bool
- func ManageLeaderSchedule() bool
- func PutEpochAuthorizedVoter(voteAcct solana.PublicKey, authorizedVoter solana.PublicKey)
- func PutEpochStakesEntry(epoch uint64, pubkey solana.PublicKey, stake uint64, ...)
- func PutEpochTotalStake(epoch uint64, totalStake uint64)
- func PutSlotConfirmed(slot uint64)
- func PutStakeCacheItem(pubkey solana.PublicKey, delegation *sealevel.Delegation)
- func PutStakeCacheItemBulk(pubkey solana.PublicKey, delegation *sealevel.Delegation)
- func PutVoteCacheItem(pubkey solana.PublicKey, voteState *sealevel.VoteStateVersions)
- func SaveStakePubkeyIndex(accountsDbDir string) error
- func SerializeEpochStakes(epoch uint64) ([]byte, error)
- func SetBlockHeight(blockHeight uint64)
- func SetCalcUnixTimeForClockSysvar(calcUnixTime bool)
- func SetEpoch(epoch uint64)
- func SetForkChoice(forkChoice *forkchoice.ForkChoiceService)
- func SetLatestBlockHash(blockHash [32]byte)
- func SetLeaderSchedule(ls *leaderschedule.LeaderSchedule)
- func SetManageBlockHeight(manageBlockHeight bool)
- func SetManageLeaderSchedule(manageLeaderSchedule bool)
- func SetSlot(slot uint64)
- func Slot() uint64
- func SlotConfirmed(slot uint64) bool
- func StakeCache() map[solana.PublicKey]*sealevel.Delegation
- func StakeCacheSnapshot() map[solana.PublicKey]*sealevel.Delegation
- func StakeForVoteAcct(epoch uint64, voteAcct solana.PublicKey) uint64
- func SubmitBlockToForkChoiceService(slot uint64, txs []*solana.Transaction)
- func TransactionCount() uint64
- func VoteCache() map[solana.PublicKey]*sealevel.VoteStateVersions
- func VoteCacheItem(pubkey solana.PublicKey) *sealevel.VoteStateVersions
- func VoteCacheSnapshot() map[solana.PublicKey]*sealevel.VoteStateVersions
- type GlobalCtx
- func (globctx *GlobalCtx) BlockHeight() uint64
- func (globctx *GlobalCtx) Epoch() uint64
- func (globctx *GlobalCtx) IncrTransactionCount(num uint64)
- func (globctx *GlobalCtx) LatestBlockhash() [32]byte
- func (globctx *GlobalCtx) SetBlockHeight(blockHeight uint64)
- func (globctx *GlobalCtx) SetEpoch(epoch uint64)
- func (globctx *GlobalCtx) SetLatestBlockhash(blockhash [32]byte)
- func (globctx *GlobalCtx) SetSlot(slot uint64)
- func (globctx *GlobalCtx) Slot() uint64
- func (globctx *GlobalCtx) TransactionCount() uint64
Constants ¶
const StakePubkeyIndexFileName = "stake_pubkeys.idx"
StakePubkeyIndexFileName is the name of the stake pubkey index file
Variables ¶
This section is empty.
Functions ¶
func BlockHeight ¶
func BlockHeight() uint64
func CalcUnixTimeForClockSysvar ¶
func CalcUnixTimeForClockSysvar() bool
func ClearEpochStakes ¶
func ClearEpochStakes(epoch uint64)
ClearEpochStakes removes all stakes for a specific epoch. Used on resume to force rebuild from AccountsDB.
func ClearPendingStakePubkeys ¶
func ClearPendingStakePubkeys()
ClearPendingStakePubkeys discards any pending stake pubkeys without writing them. Used for rollback on failed block replay.
func DeleteStakeCacheItem ¶
func DeleteVoteCacheItem ¶
func DeserializeAndLoadEpochStakes ¶
DeserializeAndLoadEpochStakes deserializes and loads epoch stakes from JSON. Returns the epoch number that was loaded.
func EpochAuthorizedVoters ¶
func EpochAuthorizedVoters() *epochstakes.EpochAuthorizedVotersCache
func EpochStakesVoteAccts ¶
func EpochStakesVoteAccts(epoch uint64) map[solana.PublicKey]*epochstakes.VoteAccount
func EpochTotalStake ¶
func FlushPendingStakePubkeys ¶
FlushPendingStakePubkeys appends any new stake pubkeys discovered during replay to the stake pubkey index file. Called after each block commit. Returns the number of pubkeys flushed.
func GetAllCachedEpochs ¶
func GetAllCachedEpochs() []uint64
GetAllCachedEpochs returns all epochs currently in the epoch stakes cache.
func HasEpochStakes ¶
func IncrTransactionCount ¶
func IncrTransactionCount(num uint64)
func LatestBlockHash ¶
func LatestBlockHash() [32]byte
func LoadStakePubkeyIndex ¶
LoadStakePubkeyIndex reads the stake pubkey index file and returns deduplicated pubkeys. Validates that file length is a multiple of 32 bytes.
func ManageBlockHeight ¶
func ManageBlockHeight() bool
func ManageLeaderSchedule ¶
func ManageLeaderSchedule() bool
func PutEpochAuthorizedVoter ¶
func PutEpochStakesEntry ¶
func PutEpochStakesEntry(epoch uint64, pubkey solana.PublicKey, stake uint64, voteAcct *epochstakes.VoteAccount)
func PutEpochTotalStake ¶
func PutSlotConfirmed ¶
func PutSlotConfirmed(slot uint64)
func PutStakeCacheItem ¶
func PutStakeCacheItem(pubkey solana.PublicKey, delegation *sealevel.Delegation)
PutStakeCacheItem adds or updates a stake cache entry during replay. If this is a NEW pubkey (not already in cache), it's added to pendingNewStakePubkeys for later append to the index file via FlushPendingStakePubkeys.
func PutStakeCacheItemBulk ¶
func PutStakeCacheItemBulk(pubkey solana.PublicKey, delegation *sealevel.Delegation)
PutStakeCacheItemBulk adds a stake cache entry during bulk population (startup). Does NOT track new pubkeys - use this when loading cache from index/snapshot/scan to avoid enqueueing the entire cache on rebuild.
func PutVoteCacheItem ¶
func PutVoteCacheItem(pubkey solana.PublicKey, voteState *sealevel.VoteStateVersions)
func SaveStakePubkeyIndex ¶
SaveStakePubkeyIndex writes the current stake cache pubkeys to the index file. This compacts the index by removing duplicates and closed accounts. Used during graceful shutdown.
func SerializeEpochStakes ¶
SerializeEpochStakes serializes the stakes for a single epoch to JSON.
func SetBlockHeight ¶
func SetBlockHeight(blockHeight uint64)
func SetCalcUnixTimeForClockSysvar ¶
func SetCalcUnixTimeForClockSysvar(calcUnixTime bool)
func SetForkChoice ¶
func SetForkChoice(forkChoice *forkchoice.ForkChoiceService)
func SetLatestBlockHash ¶
func SetLatestBlockHash(blockHash [32]byte)
func SetLeaderSchedule ¶
func SetLeaderSchedule(ls *leaderschedule.LeaderSchedule)
func SetManageBlockHeight ¶
func SetManageBlockHeight(manageBlockHeight bool)
func SetManageLeaderSchedule ¶
func SetManageLeaderSchedule(manageLeaderSchedule bool)
func SlotConfirmed ¶
func StakeCache ¶
func StakeCache() map[solana.PublicKey]*sealevel.Delegation
func StakeCacheSnapshot ¶
func StakeCacheSnapshot() map[solana.PublicKey]*sealevel.Delegation
func SubmitBlockToForkChoiceService ¶
func SubmitBlockToForkChoiceService(slot uint64, txs []*solana.Transaction)
func TransactionCount ¶
func TransactionCount() uint64
func VoteCacheItem ¶
func VoteCacheItem(pubkey solana.PublicKey) *sealevel.VoteStateVersions
func VoteCacheSnapshot ¶
func VoteCacheSnapshot() map[solana.PublicKey]*sealevel.VoteStateVersions
Types ¶
type GlobalCtx ¶
type GlobalCtx struct {
// contains filtered or unexported fields
}