Documentation
¶
Index ¶
- func EffectivePoolRegistrationsForEpoch(db *gorm.DB, pkhs [][]byte, epochStartSlot uint64, endedEpoch uint64, ...) ([]models.PoolRegistration, error)
- func GetPoolOwnerStakeAtSlot(db *gorm.DB, ownerKeys [][]byte, slot uint64) (map[string]uint64, error)
- func GetStakeByPoolsAtSlot(db *gorm.DB, poolKeyHashes [][]byte, slot uint64) (map[string]uint64, map[string]uint64, error)
- func PopulatePoolRegistrationOwners(db *gorm.DB, registrations []models.PoolRegistration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectivePoolRegistrationsForEpoch ¶ added in v0.65.0
func EffectivePoolRegistrationsForEpoch( db *gorm.DB, pkhs [][]byte, epochStartSlot uint64, endedEpoch uint64, snapshotSlot uint64, ) ([]models.PoolRegistration, error)
EffectivePoolRegistrationsForEpoch returns, per pool, the registration certificate whose parameters were in the ledger's pool-params map during the ended epoch spanning [epochStartSlot, snapshotSlot] — the params cardano-ledger's SNAP rule snapshots at the boundary ending that epoch.
A re-registration by an already-registered pool is a future-params update: it promotes at the NEXT boundary (POOLREAP runs after SNAP), so a cert the pool submitted during the ended epoch must not be used. A fresh registration (pool absent from the params map: brand new, or registering again after an executed retirement) takes effect immediately, so for those pools the EARLIEST cert inside the epoch applies.
Selection per pool: rank all registration certs plus executed-retirement candidates (retirement certs scheduled for an epoch at or before the ended epoch) that precede epochStartSlot by chain position. If the latest such event is a registration, it is the effective cert — any earlier retirement was either cancelled or followed by that fresh registration. If it is a retirement (or no event exists), the pool entered the params map during the ended epoch and its earliest in-epoch cert applies.
func GetPoolOwnerStakeAtSlot ¶ added in v0.65.0
func GetPoolOwnerStakeAtSlot( db *gorm.DB, ownerKeys [][]byte, slot uint64, ) (map[string]uint64, error)
GetPoolOwnerStakeAtSlot returns stake only for the requested key-hash owner credentials, and only under the pool to which each credential was delegated at slot. The result cardinality is bounded by the owner set, not by all pool delegators.
func GetStakeByPoolsAtSlot ¶
func GetStakeByPoolsAtSlot( db *gorm.DB, poolKeyHashes [][]byte, slot uint64, ) (map[string]uint64, map[string]uint64, error)
GetStakeByPoolsAtSlot returns delegated stake and delegator counts at a historical slot. It uses certificate history to find each credential's latest stake delegation and registration state, and account rows as synthetic state for imported/bootstrap data where the certificate history is unavailable.
func PopulatePoolRegistrationOwners ¶ added in v0.65.0
func PopulatePoolRegistrationOwners( db *gorm.DB, registrations []models.PoolRegistration, ) error
PopulatePoolRegistrationOwners loads and attaches the owners for a set of pool registrations. Queries are chunked according to the backend's bind variable capacity.
Types ¶
This section is empty.