epochstakes

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EpochAuthorizedVotersCache

type EpochAuthorizedVotersCache struct {
	// contains filtered or unexported fields
}

func NewEpochAuthorizedVotersCache

func NewEpochAuthorizedVotersCache() *EpochAuthorizedVotersCache

func (*EpochAuthorizedVotersCache) IsAuthorizedVoter

func (cache *EpochAuthorizedVotersCache) IsAuthorizedVoter(voteAcct solana.PublicKey, pubkey solana.PublicKey) bool

func (*EpochAuthorizedVotersCache) PutEntry

func (cache *EpochAuthorizedVotersCache) PutEntry(voteAcct solana.PublicKey, authorizedVoter solana.PublicKey)

type EpochStakesCache

type EpochStakesCache struct {
	// contains filtered or unexported fields
}

func NewEpochStakesCache

func NewEpochStakesCache() *EpochStakesCache

func (*EpochStakesCache) ClearEpochStakes

func (cache *EpochStakesCache) ClearEpochStakes(epoch uint64)

ClearEpochStakes removes all stakes for a specific epoch. Used on resume to force rebuild from AccountsDB.

func (*EpochStakesCache) DeserializeAndLoadEpoch

func (cache *EpochStakesCache) DeserializeAndLoadEpoch(data []byte) (uint64, error)

DeserializeAndLoadEpoch deserializes epoch stakes from JSON and loads into cache. Returns the epoch number that was loaded.

func (*EpochStakesCache) EpochStakes

func (cache *EpochStakesCache) EpochStakes(epoch uint64) map[solana.PublicKey]uint64

func (*EpochStakesCache) EpochStakesAccts

func (cache *EpochStakesCache) EpochStakesAccts(epoch uint64) map[solana.PublicKey]*VoteAccount

func (*EpochStakesCache) GetAllEpochs

func (cache *EpochStakesCache) GetAllEpochs() []uint64

GetAllEpochs returns a list of all epochs in the cache.

func (*EpochStakesCache) HasEpochStakes

func (cache *EpochStakesCache) HasEpochStakes(epoch uint64) bool

func (*EpochStakesCache) PutEntry

func (cache *EpochStakesCache) PutEntry(epoch uint64, pubkey solana.PublicKey, stake uint64, voteAcct *VoteAccount)

func (*EpochStakesCache) PutTotalEpochStake

func (cache *EpochStakesCache) PutTotalEpochStake(epoch uint64, totalStake uint64)

func (*EpochStakesCache) SerializeEpoch

func (cache *EpochStakesCache) SerializeEpoch(epoch uint64) ([]byte, error)

SerializeEpoch serializes the stakes for a single epoch to JSON.

func (*EpochStakesCache) TotalStake

func (cache *EpochStakesCache) TotalStake(epoch uint64) uint64

type PersistedEpochStakes

type PersistedEpochStakes struct {
	Epoch      uint64                      `json:"epoch"`
	TotalStake uint64                      `json:"total_stake"`
	Stakes     map[string]uint64           `json:"stakes"`     // base58 pubkey → stake
	VoteAccts  map[string]*VoteAccountJSON `json:"vote_accts"` // base58 pubkey → metadata
}

PersistedEpochStakes is the JSON-serializable format for epoch stakes.

type VoteAccount

type VoteAccount struct {
	Lamports          uint64
	NodePubkey        solana.PublicKey
	LastTimestampTs   int64
	LastTimestampSlot uint64
	Owner             solana.PublicKey
	Executable        byte
	RentEpoch         uint64
}

type VoteAccountJSON

type VoteAccountJSON struct {
	Lamports          uint64 `json:"lamports"`
	NodePubkey        string `json:"node_pubkey"`
	LastTimestampTs   int64  `json:"last_ts"`
	LastTimestampSlot uint64 `json:"last_ts_slot"`
	Owner             string `json:"owner"`
	Executable        byte   `json:"executable"`
	RentEpoch         uint64 `json:"rent_epoch"`
}

VoteAccountJSON is the JSON-serializable format for vote account metadata.

Jump to

Keyboard shortcuts

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