Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyEmbeddedDbSchema(version int64) error
- func ConvertInt64ToUint64(i int64) uint64
- func ConvertUint64ToInt64(u uint64) int64
- func DeleteBidsBeforeSlot(minSlot uint64, tx *sqlx.Tx) error
- func DeleteElZeroBalances(ctx context.Context, dbTx *sqlx.Tx) (int64, error)
- func DeleteFinalizedForks(ctx context.Context, tx *sqlx.Tx, finalizedRoots [][]byte) error
- func DeletePendingFunctionSignatures(ctx context.Context, tx *sqlx.Tx, sigBytes []types.TxSignatureBytes) error
- func DeleteUnfinalizedBlocksBefore(ctx context.Context, tx *sqlx.Tx, slot uint64) error
- func DeleteUnfinalizedDutiesBefore(ctx context.Context, tx *sqlx.Tx, epoch uint64) error
- func DeleteUnfinalizedEpochsBefore(ctx context.Context, tx *sqlx.Tx, epoch uint64) error
- func DeleteValidatorNames(ctx context.Context, tx *sqlx.Tx, validatorNames []uint64) error
- func DeleteWithdrawalsByBlockUid(ctx context.Context, dbTx *sqlx.Tx, blockUid uint64) error
- func EngineQuery(queryMap map[dbtypes.DBEngineType]string) string
- func GetActiveBuilderByIndex(ctx context.Context, index uint64) *dbtypes.Builder
- func GetBidsByBlockHashes(ctx context.Context, blockHashes [][]byte, builderIndex uint64) map[string]*dbtypes.BlockBid
- func GetBidsByBuilderIndex(ctx context.Context, builderIndex uint64, offset uint64, limit uint32) ([]*dbtypes.BlockBid, uint64)
- func GetBidsBySlots(ctx context.Context, slots []uint64, builderIndex int64) map[uint64]*dbtypes.BlockBid
- func GetBidsForBlockRoot(ctx context.Context, blockRoot []byte, slot uint64) []*dbtypes.BlockBid
- func GetBidsForSlotRange(ctx context.Context, minSlot uint64) []*dbtypes.BlockBid
- func GetBlob(ctx context.Context, commitment []byte, withData bool) *dbtypes.Blob
- func GetBlockFeesByAccountKeyset(ctx context.Context, accountID uint64, beforeBlockUid uint64, limit uint32) ([]*dbtypes.ElBlock, bool, error)
- func GetBlockFeesByAccountPrevAnchor(ctx context.Context, accountID uint64, afterBlockUid uint64, limit uint32) (uint64, bool, bool, error)
- func GetBlockHeadByRoot(ctx context.Context, root []byte) *dbtypes.BlockHead
- func GetBlockHeadBySlot(ctx context.Context, slot uint64) *dbtypes.BlockHead
- func GetBlockHeadBySlotRange(ctx context.Context, startSlot uint64, endSlot uint64) []*dbtypes.BlockHead
- func GetBuilderByPubkey(ctx context.Context, pubkey []byte) *dbtypes.Builder
- func GetBuilderCount(ctx context.Context, activeOnly bool) (uint64, error)
- func GetBuilderDepositTxsByDequeueRange(ctx context.Context, dequeueFirst uint64, dequeueLast uint64) []*dbtypes.BuilderDepositTx
- func GetBuilderDepositTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.BuilderDepositTx
- func GetBuilderDepositTxsFiltered(ctx context.Context, offset uint64, limit uint32, ...) ([]*dbtypes.BuilderDepositTx, uint64, error)
- func GetBuilderDepositsByElBlockRange(ctx context.Context, firstBlock uint64, lastBlock uint64) []*dbtypes.BuilderDeposit
- func GetBuilderDepositsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.BuilderDeposit, uint64, error)
- func GetBuilderExitTxsByDequeueRange(ctx context.Context, dequeueFirst uint64, dequeueLast uint64) []*dbtypes.BuilderExitTx
- func GetBuilderExitTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.BuilderExitTx
- func GetBuilderExitTxsFiltered(ctx context.Context, offset uint64, limit uint32, ...) ([]*dbtypes.BuilderExitTx, uint64, error)
- func GetBuilderExitsByElBlockRange(ctx context.Context, firstBlock uint64, lastBlock uint64) []*dbtypes.BuilderExit
- func GetBuilderExitsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.BuilderExit, uint64, error)
- func GetBuilderIndexesByFilter(ctx context.Context, filter dbtypes.BuilderFilter, currentEpoch uint64) ([]uint64, error)
- func GetBuilderRange(ctx context.Context, startIndex uint64, endIndex uint64) []*dbtypes.Builder
- func GetBuildersByExecutionAddress(ctx context.Context, address []byte) []*dbtypes.Builder
- func GetBuildersByIndex(ctx context.Context, index uint64) []*dbtypes.Builder
- func GetConsolidationRequestTxsByDequeueRange(ctx context.Context, dequeueFirst uint64, dequeueLast uint64) []*dbtypes.ConsolidationRequestTx
- func GetConsolidationRequestTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.ConsolidationRequestTx
- func GetConsolidationRequestTxsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.ConsolidationRequestTx, uint64, error)
- func GetConsolidationRequestsByElBlockRange(ctx context.Context, firstSlot uint64, lastSlot uint64) []*dbtypes.ConsolidationRequest
- func GetConsolidationRequestsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.ConsolidationRequest, uint64, error)
- func GetDatabaseSize() (int64, error)
- func GetDepositRequestsBySlots(ctx context.Context, slots []uint64, canonicalForkIds []uint64) ([]*dbtypes.Deposit, error)
- func GetDepositTxs(ctx context.Context, firstIndex uint64, limit uint32) []*dbtypes.DepositTx
- func GetDepositTxsByIndexes(ctx context.Context, indexes []uint64) []*dbtypes.DepositTx
- func GetDepositTxsByPublicKeys(ctx context.Context, publicKeys [][]byte) []*dbtypes.DepositTx
- func GetDepositTxsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.DepositTx, uint64, error)
- func GetDepositsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.DepositWithTx, uint64, error)
- func GetElAccountByAddress(ctx context.Context, address []byte) (*dbtypes.ElAccount, error)
- func GetElAccountByID(ctx context.Context, id uint64) (*dbtypes.ElAccount, error)
- func GetElAccountsByAddresses(ctx context.Context, addresses [][]byte) (map[string]*dbtypes.ElAccount, error)
- func GetElAccountsByIDs(ctx context.Context, ids []uint64) ([]*dbtypes.ElAccount, error)
- func GetElBalance(ctx context.Context, accountID uint64, tokenID uint64) (*dbtypes.ElBalance, error)
- func GetElBalancesByAccountID(ctx context.Context, accountID uint64, offset uint64, limit uint32) ([]*dbtypes.ElBalance, uint64, error)
- func GetElBlock(ctx context.Context, blockUid uint64) (*dbtypes.ElBlock, error)
- func GetElBlockDataSizeBefore(ctx context.Context, blockUidThreshold uint64) (int64, error)
- func GetElBlocksByUids(ctx context.Context, blockUids []uint64) ([]*dbtypes.ElBlock, error)
- func GetElRevertReasonsByIDs(ctx context.Context, ids []uint32) (map[uint32]string, error)
- func GetElTokenByContract(ctx context.Context, contract []byte) (*dbtypes.ElToken, error)
- func GetElTokenByID(ctx context.Context, id uint64) (*dbtypes.ElToken, error)
- func GetElTokenTransferCountByTxUid(ctx context.Context, txUid uint64) (uint64, error)
- func GetElTokenTransfersByAccount(ctx context.Context, accountID uint64, direction uint8, ...) ([]*dbtypes.ElTokenTransfer, bool, error)
- func GetElTokenTransfersByAccountPrevAnchor(ctx context.Context, accountID uint64, direction uint8, ...) (uint64, uint32, bool, bool, error)
- func GetElTokenTransfersByTxUid(ctx context.Context, txUid uint64) ([]*dbtypes.ElTokenTransfer, error)
- func GetElTokenTransfersFiltered(ctx context.Context, filter *dbtypes.ElTokenTransferFilter, beforeTxUid uint64, ...) ([]*dbtypes.ElTokenTransfer, bool, error)
- func GetElTokenTransfersPrevAnchor(ctx context.Context, filter *dbtypes.ElTokenTransferFilter, afterTxUid uint64, ...) (uint64, uint32, bool, bool, error)
- func GetElTokensByContracts(ctx context.Context, contracts [][]byte) (map[string]*dbtypes.ElToken, error)
- func GetElTokensByIDs(ctx context.Context, ids []uint64) ([]*dbtypes.ElToken, error)
- func GetElTokensFiltered(ctx context.Context, offset uint64, limit uint32, ...) ([]*dbtypes.ElToken, uint64, error)
- func GetElTransactionsByAccount(ctx context.Context, accountID uint64, direction uint8, ...) ([]*dbtypes.ElTransaction, bool, error)
- func GetElTransactionsByAccountPrevAnchor(ctx context.Context, accountID uint64, direction uint8, ...) (uint64, bool, bool, error)
- func GetElTransactionsByBlockUid(ctx context.Context, blockUid uint64) ([]*dbtypes.ElTransaction, error)
- func GetElTransactionsByHash(ctx context.Context, txHash []byte) ([]*dbtypes.ElTransaction, error)
- func GetElTransactionsByTxUids(ctx context.Context, txUids []uint64) ([]*dbtypes.ElTransaction, error)
- func GetElTransactionsFiltered(ctx context.Context, filter *dbtypes.ElTransactionFilter, beforeTxUid uint64, ...) ([]*dbtypes.ElTransaction, bool, error)
- func GetElTransactionsInternalByAccountKeyset(ctx context.Context, accountID uint64, beforeTxUid uint64, limit uint32) ([]*dbtypes.ElTransactionInternal, bool, error)
- func GetElTransactionsInternalByAccountPrevAnchor(ctx context.Context, accountID uint64, afterTxUid uint64, limit uint32) (uint64, bool, bool, error)
- func GetElTransactionsInternalCountByTxUid(ctx context.Context, txUid uint64) (uint64, error)
- func GetElTransactionsPrevAnchor(ctx context.Context, filter *dbtypes.ElTransactionFilter, afterTxUid uint64, ...) (uint64, bool, bool, error)
- func GetElTxHashStats(ctx context.Context) (count int64, sizeBytes int64, err error)
- func GetEpochs(ctx context.Context, firstEpoch uint64, limit uint32) []*dbtypes.Epoch
- func GetExplorerState(ctx context.Context, key string, returnValue interface{}) (interface{}, error)
- func GetFilteredSlots(ctx context.Context, filter *dbtypes.BlockFilter, firstSlot uint64, ...) []*dbtypes.AssignedSlot
- func GetForkBlockCounts(ctx context.Context, startSlot uint64, endSlot uint64) (map[uint64]uint64, error)
- func GetForkById(ctx context.Context, forkId uint64) *dbtypes.Fork
- func GetForkVisualizationData(ctx context.Context, startSlot uint64, endSlot uint64) ([]*dbtypes.Fork, error)
- func GetHighestMevBlockSlotByRelay(ctx context.Context, relayId uint8) (uint64, error)
- func GetHighestRootBeforeSlot(ctx context.Context, slot uint64, withOrphaned bool) []byte
- func GetLatestBlobAssignment(ctx context.Context, commitment []byte) *dbtypes.BlobAssignment
- func GetLatestElBlockSlot() (uint64, error)
- func GetMaxBuilderIndex(ctx context.Context) (uint64, error)
- func GetMaxValidatorIndex(ctx context.Context) (uint64, error)
- func GetMevBlockByBlockHash(ctx context.Context, blockHash []byte) *dbtypes.MevBlock
- func GetMevBlocksByBlockHashes(ctx context.Context, blockHashes [][]byte) map[string]*dbtypes.MevBlock
- func GetMevBlocksFiltered(ctx context.Context, offset uint64, limit uint32, ...) ([]*dbtypes.MevBlock, uint64, error)
- func GetNewestElBlockUid(ctx context.Context) (uint64, error)
- func GetOldestElBlockUid(ctx context.Context) (uint64, error)
- func GetOldestElBlocksWithData(ctx context.Context, limit uint32) ([]*dbtypes.ElBlock, error)
- func GetOrphanedBlock(ctx context.Context, root []byte) *dbtypes.OrphanedBlock
- func GetOrphanedEpoch(ctx context.Context, epoch uint64, headRoot []byte) *dbtypes.OrphanedEpoch
- func GetPendingFunctionSignatures(ctx context.Context, limit uint64) []*dbtypes.TxPendingFunctionSignature
- func GetSlashingForValidator(ctx context.Context, validator uint64) *dbtypes.Slashing
- func GetSlashingsFiltered(ctx context.Context, offset uint64, limit uint32, finalizedBlock uint64, ...) ([]*dbtypes.Slashing, uint64, error)
- func GetSlotAssignment(ctx context.Context, slot uint64) uint64
- func GetSlotBlobCountByExecutionHashes(ctx context.Context, blockHashes [][]byte) []*dbtypes.BlockBlobCount
- func GetSlotByRoot(ctx context.Context, root []byte) *dbtypes.Slot
- func GetSlotStatus(ctx context.Context, blockRoots [][]byte) []*dbtypes.BlockStatus
- func GetSlotsByBlockHash(ctx context.Context, blockHash []byte) []*dbtypes.Slot
- func GetSlotsByParentRoot(ctx context.Context, parentRoot []byte) []*dbtypes.Slot
- func GetSlotsByRoots(ctx context.Context, roots [][]byte) map[phase0.Root]*dbtypes.Slot
- func GetSlotsRange(ctx context.Context, firstSlot uint64, lastSlot uint64, withMissing bool, ...) []*dbtypes.AssignedSlot
- func GetSyncAssignmentsForPeriod(ctx context.Context, period uint64) []uint64
- func GetSyncCommitteeParticipation(ctx context.Context, slot uint64) (float64, error)
- func GetTotalElBlockDataSize(ctx context.Context) (int64, error)
- func GetTxFunctionSignaturesByBytes(ctx context.Context, sigBytes []types.TxSignatureBytes) []*dbtypes.TxFunctionSignature
- func GetTxUidsByHashPrefix(ctx context.Context, prefix []byte) ([]uint64, error)
- func GetTxUidsByHashPrefixRange(ctx context.Context, lo, hi []byte) ([]uint64, error)
- func GetUnfinalizedBlock(ctx context.Context, root []byte, withHeader bool, withBody bool, ...) *dbtypes.UnfinalizedBlock
- func GetUnfinalizedBlocks(ctx context.Context, filter *dbtypes.UnfinalizedBlockFilter) []*dbtypes.UnfinalizedBlock
- func GetUnfinalizedDuty(ctx context.Context, epoch uint64, dependentRoot []byte) *dbtypes.UnfinalizedDuty
- func GetUnfinalizedEpoch(ctx context.Context, epoch uint64, headRoot []byte) *dbtypes.UnfinalizedEpoch
- func GetUnfinalizedForks(ctx context.Context, finalizedSlot uint64) []*dbtypes.Fork
- func GetUnknownFunctionSignatures(ctx context.Context, sigBytes []types.TxSignatureBytes) []*dbtypes.TxUnknownFunctionSignature
- func GetValidatorByIndex(ctx context.Context, index phase0.ValidatorIndex) *dbtypes.Validator
- func GetValidatorByPubkey(ctx context.Context, pubkey []byte) *dbtypes.Validator
- func GetValidatorIndexesByFilter(ctx context.Context, filter dbtypes.ValidatorFilter, currentEpoch uint64) ([]uint64, error)
- func GetValidatorNames(ctx context.Context, minIdx uint64, maxIdx uint64) []*dbtypes.ValidatorName
- func GetValidatorRange(ctx context.Context, startIndex uint64, endIndex uint64) []*dbtypes.Validator
- func GetVoluntaryExitForValidator(ctx context.Context, validator uint64) *dbtypes.VoluntaryExit
- func GetVoluntaryExitsFiltered(ctx context.Context, offset uint64, limit uint32, finalizedBlock uint64, ...) ([]*dbtypes.VoluntaryExit, uint64, error)
- func GetWithdrawalAmountSum(ctx context.Context, minBlockUid uint64, maxBlockUid uint64) (uint64, error)
- func GetWithdrawalRequestTxsByDequeueRange(ctx context.Context, dequeueFirst uint64, dequeueLast uint64) []*dbtypes.WithdrawalRequestTx
- func GetWithdrawalRequestTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.WithdrawalRequestTx
- func GetWithdrawalRequestTxsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.WithdrawalRequestTx, uint64, error)
- func GetWithdrawalRequestsByElBlockRange(ctx context.Context, firstSlot uint64, lastSlot uint64) []*dbtypes.WithdrawalRequest
- func GetWithdrawalRequestsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.WithdrawalRequest, uint64, error)
- func GetWithdrawalsByAccountID(ctx context.Context, accountID uint64, offset uint64, limit uint32) ([]*dbtypes.Withdrawal, uint64, error)
- func GetWithdrawalsByBlockUid(ctx context.Context, blockUid uint64) ([]*dbtypes.Withdrawal, error)
- func GetWithdrawalsByBlockUidRange(ctx context.Context, minBlockUid uint64, maxBlockUid uint64, typeFilter *uint8) ([]*dbtypes.Withdrawal, error)
- func GetWithdrawalsFiltered(ctx context.Context, offset uint64, limit uint32, finalizedBlock uint64, ...) ([]*dbtypes.Withdrawal, uint64, error)
- func HasBlockFeesByAccountID(ctx context.Context, accountID uint64) (bool, error)
- func HasElTransactionsInternalByAccount(ctx context.Context, accountID uint64) (bool, error)
- func HasWithdrawalsByAccountID(ctx context.Context, accountID uint64) (bool, error)
- func InsertBids(bids []*dbtypes.BlockBid, tx *sqlx.Tx) error
- func InsertBlob(ctx context.Context, tx *sqlx.Tx, blob *dbtypes.Blob) error
- func InsertBlobAssignment(ctx context.Context, tx *sqlx.Tx, blobAssignment *dbtypes.BlobAssignment) error
- func InsertBuilder(builder *dbtypes.Builder, tx *sqlx.Tx) error
- func InsertBuilderBatch(builders []*dbtypes.Builder, tx *sqlx.Tx) error
- func InsertBuilderDepositTxs(ctx context.Context, tx *sqlx.Tx, depositTxs []*dbtypes.BuilderDepositTx) error
- func InsertBuilderDeposits(ctx context.Context, tx *sqlx.Tx, deposits []*dbtypes.BuilderDeposit) error
- func InsertBuilderExitTxs(ctx context.Context, tx *sqlx.Tx, exitTxs []*dbtypes.BuilderExitTx) error
- func InsertBuilderExits(ctx context.Context, tx *sqlx.Tx, exits []*dbtypes.BuilderExit) error
- func InsertConsolidationRequestTxs(ctx context.Context, tx *sqlx.Tx, ...) error
- func InsertConsolidationRequests(ctx context.Context, tx *sqlx.Tx, ...) error
- func InsertDepositTxs(ctx context.Context, tx *sqlx.Tx, depositTxs []*dbtypes.DepositTx) error
- func InsertDeposits(ctx context.Context, tx *sqlx.Tx, deposits []*dbtypes.Deposit) error
- func InsertElAccount(ctx context.Context, dbTx *sqlx.Tx, account *dbtypes.ElAccount) (uint64, error)
- func InsertElBalances(ctx context.Context, dbTx *sqlx.Tx, balances []*dbtypes.ElBalance) error
- func InsertElBlock(ctx context.Context, dbTx *sqlx.Tx, block *dbtypes.ElBlock) error
- func InsertElToken(ctx context.Context, dbTx *sqlx.Tx, token *dbtypes.ElToken) (uint64, error)
- func InsertElTokenTransfers(ctx context.Context, dbTx *sqlx.Tx, transfers []*dbtypes.ElTokenTransfer) error
- func InsertElTransactions(ctx context.Context, dbTx *sqlx.Tx, txs []*dbtypes.ElTransaction) error
- func InsertElTransactionsInternal(ctx context.Context, dbTx *sqlx.Tx, entries []*dbtypes.ElTransactionInternal) error
- func InsertElTxHashes(ctx context.Context, dbTx *sqlx.Tx, entries []dbtypes.ElTxHash) error
- func InsertEpoch(ctx context.Context, tx *sqlx.Tx, epoch *dbtypes.Epoch) error
- func InsertFork(ctx context.Context, tx *sqlx.Tx, fork *dbtypes.Fork) error
- func InsertMevBlocks(ctx context.Context, tx *sqlx.Tx, mevBlocks []*dbtypes.MevBlock) error
- func InsertMissingSlot(ctx context.Context, tx *sqlx.Tx, block *dbtypes.SlotHeader) error
- func InsertOrphanedBlock(ctx context.Context, tx *sqlx.Tx, block *dbtypes.OrphanedBlock) error
- func InsertOrphanedEpoch(ctx context.Context, tx *sqlx.Tx, epoch *dbtypes.OrphanedEpoch) error
- func InsertPendingFunctionSignatures(ctx context.Context, tx *sqlx.Tx, ...) error
- func InsertSlashings(ctx context.Context, tx *sqlx.Tx, slashings []*dbtypes.Slashing) error
- func InsertSlot(ctx context.Context, tx *sqlx.Tx, slot *dbtypes.Slot) error
- func InsertSyncAssignments(ctx context.Context, tx *sqlx.Tx, syncAssignments []*dbtypes.SyncAssignment) error
- func InsertTxFunctionSignature(ctx context.Context, tx *sqlx.Tx, txFuncSig *dbtypes.TxFunctionSignature) error
- func InsertUnfinalizedBlock(ctx context.Context, tx *sqlx.Tx, block *dbtypes.UnfinalizedBlock) error
- func InsertUnfinalizedDuty(ctx context.Context, tx *sqlx.Tx, duty *dbtypes.UnfinalizedDuty) error
- func InsertUnfinalizedEpoch(ctx context.Context, tx *sqlx.Tx, epoch *dbtypes.UnfinalizedEpoch) error
- func InsertUnknownFunctionSignatures(ctx context.Context, tx *sqlx.Tx, ...) error
- func InsertValidator(ctx context.Context, tx *sqlx.Tx, validator *dbtypes.Validator) error
- func InsertValidatorBatch(ctx context.Context, tx *sqlx.Tx, validators []*dbtypes.Validator) error
- func InsertValidatorNames(ctx context.Context, tx *sqlx.Tx, validatorNames []*dbtypes.ValidatorName) error
- func InsertVoluntaryExits(ctx context.Context, tx *sqlx.Tx, voluntaryExits []*dbtypes.VoluntaryExit) error
- func InsertWithdrawalRequestTxs(ctx context.Context, tx *sqlx.Tx, withdrawalTxs []*dbtypes.WithdrawalRequestTx) error
- func InsertWithdrawalRequests(ctx context.Context, tx *sqlx.Tx, elRequests []*dbtypes.WithdrawalRequest) error
- func InsertWithdrawals(ctx context.Context, dbTx *sqlx.Tx, withdrawals []*dbtypes.Withdrawal) error
- func IsEpochSynchronized(ctx context.Context, epoch uint64) bool
- func IsSyncCommitteeSynchronized(ctx context.Context, period uint64) bool
- func MustCloseDB()
- func MustInitDB(dbcfg *types.DatabaseConfig)
- func NewDBTxHashIndex() bdbtypes.TxHashIndex
- func PruneElRevertReasonsBefore(ctx context.Context, txUidThreshold uint64) (int64, error)
- func PruneElTxHashBefore(ctx context.Context, txUidThreshold uint64) (int64, error)
- func ResetElBlockDataStatusBefore(ctx context.Context, dbTx *sqlx.Tx, blockUidThreshold uint64) (int64, error)
- func ResolveElRevertReason(ctx context.Context, dbTx *sqlx.Tx, reason string, reasonHash []byte, ...) (uint32, error)
- func RunDBTransaction(handler func(tx *sqlx.Tx) error) error
- func SetBuilderSuperseded(pubkey []byte, tx *sqlx.Tx) error
- func SetBuildersSuperseded(pubkeys [][]byte, tx *sqlx.Tx) error
- func SetExplorerState(ctx context.Context, tx *sqlx.Tx, key string, value interface{}) error
- func StreamBuildersByIndexes(ctx context.Context, indexes []uint64, cb func(builder *dbtypes.Builder) bool)
- func StreamBuildersByPubkeys(ctx context.Context, pubkeys [][]byte, cb func(builder *dbtypes.Builder) bool) error
- func StreamOrphanedEpochs(ctx context.Context, epoch uint64, cb func(duty *dbtypes.OrphanedEpoch)) error
- func StreamUnfinalizedBlocks(ctx context.Context, slot uint64, cb func(block *dbtypes.UnfinalizedBlock)) error
- func StreamUnfinalizedDuties(ctx context.Context, epoch uint64, cb func(duty *dbtypes.UnfinalizedDuty)) error
- func StreamUnfinalizedEpochs(ctx context.Context, epoch uint64, cb func(duty *dbtypes.UnfinalizedEpoch)) error
- func StreamValidatorsByIndexes(ctx context.Context, indexes []uint64, ...) error
- func UpdateBuilderDepositTxHash(ctx context.Context, tx *sqlx.Tx, slotRoot []byte, slotIndex uint64, ...) error
- func UpdateBuilderExitTxHash(ctx context.Context, tx *sqlx.Tx, slotRoot []byte, slotIndex uint64, ...) error
- func UpdateConsolidationRequestTxHash(ctx context.Context, tx *sqlx.Tx, slotRoot []byte, slotIndex uint64, ...) error
- func UpdateElAccountsLastNonce(ctx context.Context, dbTx *sqlx.Tx, accounts []*dbtypes.ElAccount) error
- func UpdateElBlockDataStatus(ctx context.Context, dbTx *sqlx.Tx, blockUid uint64, dataStatus uint16, ...) error
- func UpdateElToken(ctx context.Context, dbTx *sqlx.Tx, token *dbtypes.ElToken) error
- func UpdateEpochDutiesSize(ctx context.Context, epoch uint64, size uint64) error
- func UpdateFinalizedForkParents(ctx context.Context, tx *sqlx.Tx, finalizedRoots [][]byte) error
- func UpdateForkParent(ctx context.Context, tx *sqlx.Tx, parentRoot []byte, parentForkId uint64) error
- func UpdateMevBlockByEpoch(ctx context.Context, tx *sqlx.Tx, epoch uint64, slotsPerEpoch uint64, ...) error
- func UpdateUnfinalizedBlockExecutionTimes(ctx context.Context, tx *sqlx.Tx, root []byte, minExecTime uint32, ...) error
- func UpdateUnfinalizedBlockForkId(ctx context.Context, tx *sqlx.Tx, roots [][]byte, forkId uint64) error
- func UpdateUnfinalizedBlockPayload(ctx context.Context, tx *sqlx.Tx, root []byte, payloadVer uint64, ...) error
- func UpdateUnfinalizedBlockStatus(ctx context.Context, tx *sqlx.Tx, roots [][]byte, ...) error
- func UpdateWithdrawalRequestTxHash(ctx context.Context, tx *sqlx.Tx, slotRoot []byte, slotIndex uint64, ...) error
- func UpdateWithdrawalsForkId(ctx context.Context, dbTx *sqlx.Tx, blockUid uint64, forkId uint64, ...) error
- type BlobStatistics
- type BlockDbStats
- type CleanupStats
- type EpochParticipation
- type ForkParticipationByEpoch
- type OrphanedEpochParticipation
- type RecentBlockStats
- type TableStats
- type UnfinalizedEpochParticipation
Constants ¶
const ( AccountDirectionAll uint8 = 0 AccountDirectionOut uint8 = 1 // account is sender (from_id) AccountDirectionIn uint8 = 2 // account is recipient (to_id) )
Account transaction direction: which side of the tx the account is on.
const MaxAccountWithdrawalCount = 100000
MaxAccountWithdrawalCount is the maximum count returned for address withdrawal queries.
Variables ¶
var DBPGX *pgxpool.Conn
var DbEngine dbtypes.DBEngineType
DB is a pointer to the explorer-database
var EmbedPgsqlSchema embed.FS
var EmbedSqliteSchema embed.FS
var ReaderDb *sqlx.DB
Functions ¶
func ApplyEmbeddedDbSchema ¶
func ConvertInt64ToUint64 ¶ added in v1.14.0
ConvertInt64ToUint64 converts an int64 to a uint64, supporting the full range of int64, but the value is translated to the range of uint64.
func ConvertUint64ToInt64 ¶ added in v1.14.0
ConvertUint64ToInt64 converts a uint64 to an int64, supporting the full range of uint64, but the value is translated to the range of int64.
func DeleteBidsBeforeSlot ¶ added in v1.21.0
func DeleteElZeroBalances ¶ added in v1.19.9
DeleteElZeroBalances deletes all balance entries with zero balance. Returns the number of deleted rows.
func DeleteFinalizedForks ¶ added in v1.11.0
func DeleteUnfinalizedBlocksBefore ¶ added in v1.11.0
func DeleteUnfinalizedDutiesBefore ¶ added in v1.11.0
func DeleteUnfinalizedEpochsBefore ¶ added in v1.14.0
func DeleteValidatorNames ¶
func DeleteWithdrawalsByBlockUid ¶ added in v1.21.0
func EngineQuery ¶
func EngineQuery(queryMap map[dbtypes.DBEngineType]string) string
func GetActiveBuilderByIndex ¶ added in v1.21.0
GetActiveBuilderByIndex returns the active (non-superseded) builder for a given index
func GetBidsByBlockHashes ¶ added in v1.21.0
func GetBidsByBlockHashes(ctx context.Context, blockHashes [][]byte, builderIndex uint64) map[string]*dbtypes.BlockBid
GetBidsByBlockHashes returns bids for multiple block hashes and a specific builder index Returns a map keyed by block hash (hex string) for easy lookup
func GetBidsByBuilderIndex ¶ added in v1.21.0
func GetBidsByBuilderIndex(ctx context.Context, builderIndex uint64, offset uint64, limit uint32) ([]*dbtypes.BlockBid, uint64)
GetBidsByBuilderIndex returns bids submitted by a specific builder, ordered by slot descending
func GetBidsBySlots ¶ added in v1.21.0
func GetBidsBySlots(ctx context.Context, slots []uint64, builderIndex int64) map[uint64]*dbtypes.BlockBid
GetBidsBySlots returns the highest-value bid for each slot for a specific builder. Returns a map keyed by slot number for easy lookup.
func GetBidsForBlockRoot ¶ added in v1.21.0
func GetBidsForSlotRange ¶ added in v1.21.0
func GetBlockFeesByAccountKeyset ¶ added in v1.24.1
func GetBlockFeesByAccountKeyset(ctx context.Context, accountID uint64, beforeBlockUid uint64, limit uint32) ([]*dbtypes.ElBlock, bool, error)
GetBlockFeesByAccountKeyset returns the account's fee-earning blocks keyset- paginated by block_uid DESC.
func GetBlockFeesByAccountPrevAnchor ¶ added in v1.24.1
func GetBlockFeesByAccountPrevAnchor(ctx context.Context, accountID uint64, afterBlockUid uint64, limit uint32) (uint64, bool, bool, error)
GetBlockFeesByAccountPrevAnchor probes blocks newer than afterBlockUid to drive the First/< controls (see GetElTransactionsByAccountPrevAnchor).
func GetBlockHeadByRoot ¶ added in v1.11.0
func GetBlockHeadBySlot ¶ added in v1.15.0
func GetBlockHeadBySlotRange ¶ added in v1.19.9
func GetBuilderByPubkey ¶ added in v1.21.0
GetBuilderByPubkey returns a builder by pubkey (primary key)
func GetBuilderCount ¶ added in v1.21.0
GetBuilderCount returns the count of builders (optionally only active)
func GetBuilderDepositTxsByDequeueRange ¶ added in v1.24.0
func GetBuilderDepositTxsByTxHashes ¶ added in v1.24.0
func GetBuilderDepositTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.BuilderDepositTx
func GetBuilderDepositTxsFiltered ¶ added in v1.24.0
func GetBuilderDepositTxsFiltered(ctx context.Context, offset uint64, limit uint32, filter *dbtypes.BuilderDepositTxFilter) ([]*dbtypes.BuilderDepositTx, uint64, error)
func GetBuilderDepositsByElBlockRange ¶ added in v1.24.0
func GetBuilderDepositsFiltered ¶ added in v1.24.0
func GetBuilderExitTxsByDequeueRange ¶ added in v1.24.0
func GetBuilderExitTxsByTxHashes ¶ added in v1.24.0
func GetBuilderExitTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.BuilderExitTx
func GetBuilderExitTxsFiltered ¶ added in v1.24.0
func GetBuilderExitTxsFiltered(ctx context.Context, offset uint64, limit uint32, filter *dbtypes.BuilderExitTxFilter) ([]*dbtypes.BuilderExitTx, uint64, error)
func GetBuilderExitsByElBlockRange ¶ added in v1.24.0
func GetBuilderExitsFiltered ¶ added in v1.24.0
func GetBuilderIndexesByFilter ¶ added in v1.21.0
func GetBuilderIndexesByFilter(ctx context.Context, filter dbtypes.BuilderFilter, currentEpoch uint64) ([]uint64, error)
GetBuilderIndexesByFilter returns builder indexes matching a filter
func GetBuilderRange ¶ added in v1.21.0
GetBuilderRange returns builders in a given index range (only active builders)
func GetBuildersByExecutionAddress ¶ added in v1.21.0
GetBuildersByExecutionAddress returns builders with a specific execution address
func GetBuildersByIndex ¶ added in v1.21.0
GetBuildersByIndex returns all builders (including superseded) for a given index
func GetConsolidationRequestTxsByDequeueRange ¶ added in v1.12.1
func GetConsolidationRequestTxsByTxHashes ¶ added in v1.12.1
func GetConsolidationRequestTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.ConsolidationRequestTx
func GetConsolidationRequestTxsFiltered ¶ added in v1.12.1
func GetConsolidationRequestsByElBlockRange ¶ added in v1.12.1
func GetConsolidationRequestsFiltered ¶ added in v1.12.0
func GetDatabaseSize ¶ added in v1.20.4
GetDatabaseSize returns the total database size in bytes.
func GetDepositRequestsBySlots ¶ added in v1.24.0
func GetDepositRequestsBySlots(ctx context.Context, slots []uint64, canonicalForkIds []uint64) ([]*dbtypes.Deposit, error)
GetDepositRequestsBySlots returns canonical deposit request rows whose slot_number is in the given set, ordered by (slot_number, slot_index). It is used to resolve the EL deposit index of queue entries that were reordered (postponed) and can no longer be aligned by queue position, matching them by their PendingDeposit.slot.
func GetDepositTxs ¶
func GetDepositTxsByIndexes ¶ added in v1.15.0
func GetDepositTxsByPublicKeys ¶ added in v1.24.0
func GetDepositTxsFiltered ¶
func GetDepositsFiltered ¶
func GetDepositsFiltered(ctx context.Context, offset uint64, limit uint32, canonicalForkIds []uint64, filter *dbtypes.DepositFilter, txFilter *dbtypes.DepositTxFilter) ([]*dbtypes.DepositWithTx, uint64, error)
func GetElAccountByAddress ¶ added in v1.19.9
func GetElAccountByID ¶ added in v1.19.9
func GetElAccountsByAddresses ¶ added in v1.20.0
func GetElAccountsByAddresses(ctx context.Context, addresses [][]byte) (map[string]*dbtypes.ElAccount, error)
GetElAccountsByAddresses retrieves multiple accounts by their addresses in a single query. Returns a map from address (as hex string) to account for efficient lookup.
func GetElAccountsByIDs ¶ added in v1.19.9
GetElAccountsByIDs retrieves multiple accounts by their IDs in a single query.
func GetElBalance ¶ added in v1.19.9
func GetElBalancesByAccountID ¶ added in v1.19.9
func GetElBlock ¶ added in v1.19.9
func GetElBlockDataSizeBefore ¶ added in v1.24.1
GetElBlockDataSizeBefore returns the summed blockdb exec-data size of blocks with block_uid below the threshold (used to report freed bytes on prune).
func GetElBlocksByUids ¶ added in v1.19.9
func GetElRevertReasonsByIDs ¶ added in v1.24.1
GetElRevertReasonsByIDs batch-loads reason strings for the given ids (for display tooltips). Reserved ids (1-9) resolve through the same table.
func GetElTokenByContract ¶ added in v1.19.9
func GetElTokenByID ¶ added in v1.19.9
func GetElTokenTransferCountByTxUid ¶ added in v1.22.0
GetElTokenTransferCountByTxUid returns the number of token transfers for a given transaction UID.
func GetElTokenTransfersByAccount ¶ added in v1.24.1
func GetElTokenTransfersByAccount(ctx context.Context, accountID uint64, direction uint8, filter *dbtypes.ElTokenTransferFilter, beforeTxUid uint64, beforeTxIdx uint32, limit uint32) ([]*dbtypes.ElTokenTransfer, bool, error)
GetElTokenTransfersByAccount returns the account's token transfers with keyset pagination, restricted by direction and filter. Returns the page (up to limit) and whether more (older) rows exist.
func GetElTokenTransfersByAccountPrevAnchor ¶ added in v1.24.1
func GetElTokenTransfersByAccountPrevAnchor(ctx context.Context, accountID uint64, direction uint8, filter *dbtypes.ElTokenTransferFilter, afterTxUid uint64, afterTxIdx uint32, limit uint32) (uint64, uint32, bool, bool, error)
GetElTokenTransfersByAccountPrevAnchor probes for rows newer than the current page's top to drive the First/< controls. Returns the previous page's boundary cursor (when not atFirst), whether any newer row exists, and whether the previous page is the newest page.
func GetElTokenTransfersByTxUid ¶ added in v1.22.0
func GetElTokenTransfersFiltered ¶ added in v1.19.9
func GetElTokenTransfersFiltered(ctx context.Context, filter *dbtypes.ElTokenTransferFilter, beforeTxUid uint64, beforeTxIdx uint32, limit uint32) ([]*dbtypes.ElTokenTransfer, bool, error)
GetElTokenTransfersFiltered returns token transfers matching the given filter using keyset pagination, ordered by (tx_uid, tx_idx) DESC. Pass beforeTxUid = 0 for the first (newest) page, then the (tx_uid, tx_idx) of the last returned row. Returns the page (up to limit rows) and whether more (older) rows exist.
func GetElTokenTransfersPrevAnchor ¶ added in v1.24.1
func GetElTokenTransfersPrevAnchor(ctx context.Context, filter *dbtypes.ElTokenTransferFilter, afterTxUid uint64, afterTxIdx uint32, limit uint32) (uint64, uint32, bool, bool, error)
GetElTokenTransfersPrevAnchor supports backward navigation for the keyset token-transfers list (global or token-scoped via filter.TokenID). Given the current page's top cursor (afterTxUid, afterTxIdx) it probes the rows immediately newer (ascending) and returns the previous page's boundary cursor, whether any newer row exists (hasPrev), and whether the previous page is the newest page (atFirst).
func GetElTokensByContracts ¶ added in v1.20.0
func GetElTokensByContracts(ctx context.Context, contracts [][]byte) (map[string]*dbtypes.ElToken, error)
GetElTokensByContracts retrieves multiple tokens by their contract addresses in a single query. Returns a map from contract address (as hex string) to token for efficient lookup.
func GetElTokensByIDs ¶ added in v1.19.9
GetElTokensByIDs retrieves multiple tokens by their IDs in a single query.
func GetElTokensFiltered ¶ added in v1.19.9
func GetElTokensFiltered(ctx context.Context, offset uint64, limit uint32, filter *dbtypes.ElTokenFilter) ([]*dbtypes.ElToken, uint64, error)
GetElTokensFiltered returns tokens matching the given filter, paginated and ordered by id ASC. el_tokens is small (~hundreds of thousands of rows) so offset pagination with a total count is acceptable here. The first returned row carries the total count in its ID field.
func GetElTransactionsByAccount ¶ added in v1.24.1
func GetElTransactionsByAccount(ctx context.Context, accountID uint64, direction uint8, filter *dbtypes.ElTransactionFilter, beforeTxUid uint64, limit uint32) ([]*dbtypes.ElTransaction, bool, error)
GetElTransactionsByAccount returns the account's transactions with keyset pagination, restricted by direction and filter. Returns the page (up to limit) and whether more (older) rows exist.
func GetElTransactionsByAccountPrevAnchor ¶ added in v1.24.1
func GetElTransactionsByAccountPrevAnchor(ctx context.Context, accountID uint64, direction uint8, filter *dbtypes.ElTransactionFilter, afterTxUid uint64, limit uint32) (uint64, bool, bool, error)
GetElTransactionsByAccountPrevAnchor probes for rows newer than afterTxUid (the current page's top) to drive the First/< controls. Returns the previous page's boundary cursor (when atFirst is false), whether any newer row exists, and whether the previous page is the newest page.
func GetElTransactionsByBlockUid ¶ added in v1.19.9
func GetElTransactionsByHash ¶ added in v1.19.9
GetElTransactionsByHash resolves transactions by full hash via the tx-hash index (the dedicated tx_hash column index was dropped). The index returns candidate tx_uids for the 10-byte prefix; rows are then filtered by the full hash to discard prefix collisions. Falls back to a direct lookup if no index is available (e.g. blockdb disabled).
func GetElTransactionsByTxUids ¶ added in v1.22.0
func GetElTransactionsByTxUids(ctx context.Context, txUids []uint64) ([]*dbtypes.ElTransaction, error)
GetElTransactionsByTxUids returns all transaction records matching the given tx_uids. Used by handlers to resolve tx_hash and other fields from dependent table results that only store tx_uid.
func GetElTransactionsFiltered ¶ added in v1.19.9
func GetElTransactionsFiltered(ctx context.Context, filter *dbtypes.ElTransactionFilter, beforeTxUid uint64, limit uint32) ([]*dbtypes.ElTransaction, bool, error)
GetElTransactionsFiltered returns transactions matching the given filter using keyset (boundary) pagination, ordered by tx_uid DESC. Pass beforeTxUid = 0 for the first (newest) page, then the tx_uid of the last returned row to fetch the next (older) page. Returns the page (up to limit rows) and whether more (older) rows exist. Fetches limit+1 rows to detect the next page without a separate count scan.
func GetElTransactionsInternalByAccountKeyset ¶ added in v1.24.1
func GetElTransactionsInternalByAccountKeyset(ctx context.Context, accountID uint64, beforeTxUid uint64, limit uint32) ([]*dbtypes.ElTransactionInternal, bool, error)
GetElTransactionsInternalByAccountKeyset returns the account's internal-call aggregates keyset-paginated by tx_uid DESC.
func GetElTransactionsInternalByAccountPrevAnchor ¶ added in v1.24.1
func GetElTransactionsInternalByAccountPrevAnchor(ctx context.Context, accountID uint64, afterTxUid uint64, limit uint32) (uint64, bool, bool, error)
GetElTransactionsInternalByAccountPrevAnchor probes rows newer than afterTxUid to drive the First/< controls (see GetElTransactionsByAccountPrevAnchor).
func GetElTransactionsInternalCountByTxUid ¶ added in v1.22.0
GetElTransactionsInternalCountByTxUid returns the number of distinct accounts touched by the transaction's internal calls.
func GetElTransactionsPrevAnchor ¶ added in v1.24.1
func GetElTransactionsPrevAnchor(ctx context.Context, filter *dbtypes.ElTransactionFilter, afterTxUid uint64, limit uint32) (uint64, bool, bool, error)
GetElTransactionsPrevAnchor supports backward navigation for the keyset transactions list. Given afterTxUid (the tx_uid of the current page's top row), it probes for the rows immediately newer (ascending) and returns:
- prevBeforeTxUid: the boundary cursor for the previous page (the (limit+1)-th newer row), valid only when atFirst is false;
- hasPrev: whether any newer row exists at all (drives enabling First/<);
- atFirst: true when fewer than limit+1 newer rows exist, i.e. the previous page is the newest page.
func GetElTxHashStats ¶ added in v1.24.1
GetElTxHashStats returns an approximate entry count and the table's on-disk size (bytes) for the relational tx-hash index, for debug display. The count is an estimate on Postgres (planner statistics) to avoid a full scan; size is only available on Postgres.
func GetExplorerState ¶
func GetFilteredSlots ¶
func GetFilteredSlots(ctx context.Context, filter *dbtypes.BlockFilter, firstSlot uint64, offset uint64, limit uint32) []*dbtypes.AssignedSlot
func GetForkBlockCounts ¶ added in v1.18.3
func GetForkBlockCounts(ctx context.Context, startSlot uint64, endSlot uint64) (map[uint64]uint64, error)
GetForkBlockCounts returns the number of blocks for each fork ID
func GetForkById ¶ added in v1.12.1
func GetForkVisualizationData ¶ added in v1.18.3
func GetLatestBlobAssignment ¶
func GetLatestBlobAssignment(ctx context.Context, commitment []byte) *dbtypes.BlobAssignment
func GetLatestElBlockSlot ¶ added in v1.20.4
GetLatestElBlockSlot returns the slot of the most recently indexed EL block.
func GetMaxBuilderIndex ¶ added in v1.21.0
GetMaxBuilderIndex returns the highest builder index in the database
func GetMaxValidatorIndex ¶ added in v1.14.0
GetMaxValidatorIndex returns the highest validator index in the database
func GetMevBlockByBlockHash ¶
func GetMevBlocksByBlockHashes ¶ added in v1.16.0
func GetMevBlocksByBlockHashes(ctx context.Context, blockHashes [][]byte) map[string]*dbtypes.MevBlock
GetMevBlocksByBlockHashes retrieves multiple MEV blocks in a single database query for better performance
func GetMevBlocksFiltered ¶
func GetNewestElBlockUid ¶ added in v1.19.9
GetNewestElBlockUid returns the newest (maximum) block_uid in the el_blocks table. Returns 0 if no blocks exist.
func GetOldestElBlockUid ¶ added in v1.19.9
GetOldestElBlockUid returns the oldest (minimum) block_uid in the el_blocks table. Returns 0 if no blocks exist.
func GetOldestElBlocksWithData ¶ added in v1.20.3
GetOldestElBlocksWithData returns the oldest blocks that have blockdb data, ordered by block_uid ascending.
func GetOrphanedBlock ¶
func GetOrphanedBlock(ctx context.Context, root []byte) *dbtypes.OrphanedBlock
func GetOrphanedEpoch ¶ added in v1.18.3
func GetPendingFunctionSignatures ¶
func GetPendingFunctionSignatures(ctx context.Context, limit uint64) []*dbtypes.TxPendingFunctionSignature
func GetSlashingForValidator ¶
func GetSlashingsFiltered ¶
func GetSlotBlobCountByExecutionHashes ¶ added in v1.18.3
func GetSlotBlobCountByExecutionHashes(ctx context.Context, blockHashes [][]byte) []*dbtypes.BlockBlobCount
func GetSlotStatus ¶
func GetSlotStatus(ctx context.Context, blockRoots [][]byte) []*dbtypes.BlockStatus
func GetSlotsByBlockHash ¶
func GetSlotsByParentRoot ¶
func GetSlotsByRoots ¶ added in v1.11.1
func GetSlotsRange ¶
func GetSyncCommitteeParticipation ¶ added in v1.18.3
func GetTotalElBlockDataSize ¶ added in v1.20.3
GetTotalElBlockDataSize returns the total data_size across all el_blocks.
func GetTxFunctionSignaturesByBytes ¶
func GetTxFunctionSignaturesByBytes(ctx context.Context, sigBytes []types.TxSignatureBytes) []*dbtypes.TxFunctionSignature
func GetTxUidsByHashPrefix ¶ added in v1.24.1
GetTxUidsByHashPrefix returns all candidate tx_uids for an exact 10-byte prefix. Multiple results indicate a prefix collision (disambiguate by full hash) or the same tx across reorged blocks.
func GetTxUidsByHashPrefixRange ¶ added in v1.24.1
GetTxUidsByHashPrefixRange returns candidate tx_uids for prefixes in [lo, hi), used for partial-hash (search-ahead) lookups. Capped to a small result set.
func GetUnfinalizedBlock ¶
func GetUnfinalizedBlocks ¶
func GetUnfinalizedBlocks(ctx context.Context, filter *dbtypes.UnfinalizedBlockFilter) []*dbtypes.UnfinalizedBlock
func GetUnfinalizedDuty ¶ added in v1.11.0
func GetUnfinalizedEpoch ¶
func GetUnfinalizedForks ¶ added in v1.11.0
func GetUnknownFunctionSignatures ¶
func GetUnknownFunctionSignatures(ctx context.Context, sigBytes []types.TxSignatureBytes) []*dbtypes.TxUnknownFunctionSignature
func GetValidatorByIndex ¶ added in v1.14.0
GetValidatorByIndex returns a validator by index
func GetValidatorByPubkey ¶ added in v1.14.0
GetValidatorByPubkey returns a validator by pubkey
func GetValidatorIndexesByFilter ¶ added in v1.14.0
func GetValidatorIndexesByFilter(ctx context.Context, filter dbtypes.ValidatorFilter, currentEpoch uint64) ([]uint64, error)
GetValidatorIndexesByFilter returns validator indexes matching a filter
func GetValidatorNames ¶
func GetValidatorRange ¶ added in v1.14.0
func GetValidatorRange(ctx context.Context, startIndex uint64, endIndex uint64) []*dbtypes.Validator
GetValidatorRange returns validators in a given index range
func GetVoluntaryExitForValidator ¶
func GetVoluntaryExitForValidator(ctx context.Context, validator uint64) *dbtypes.VoluntaryExit
func GetWithdrawalAmountSum ¶ added in v1.21.0
func GetWithdrawalAmountSum(ctx context.Context, minBlockUid uint64, maxBlockUid uint64) (uint64, error)
GetWithdrawalAmountSum returns the total withdrawal amount (Gwei) for all withdrawals in the given block_uid range, excluding orphaned entries.
func GetWithdrawalRequestTxsByDequeueRange ¶ added in v1.12.1
func GetWithdrawalRequestTxsByTxHashes ¶ added in v1.12.1
func GetWithdrawalRequestTxsByTxHashes(ctx context.Context, txHashes [][]byte) []*dbtypes.WithdrawalRequestTx
func GetWithdrawalRequestTxsFiltered ¶ added in v1.12.1
func GetWithdrawalRequestsByElBlockRange ¶ added in v1.12.1
func GetWithdrawalRequestsFiltered ¶ added in v1.11.0
func GetWithdrawalsByAccountID ¶ added in v1.21.0
func GetWithdrawalsByBlockUid ¶ added in v1.21.0
func GetWithdrawalsByBlockUidRange ¶ added in v1.21.0
func GetWithdrawalsFiltered ¶ added in v1.21.0
func HasBlockFeesByAccountID ¶ added in v1.21.0
HasBlockFeesByAccountID returns true if the given account has any block fee rewards.
func HasElTransactionsInternalByAccount ¶ added in v1.20.4
HasElTransactionsInternalByAccount returns true if the given account has any internal-tx aggregate rows. EXISTS scan on the (account_id, tx_uid DESC) idx.
func HasWithdrawalsByAccountID ¶ added in v1.21.0
HasWithdrawalsByAccountID returns true if the given account has any withdrawals.
func InsertBlobAssignment ¶
func InsertBuilder ¶ added in v1.21.0
InsertBuilder inserts a single builder into the database
func InsertBuilderBatch ¶ added in v1.21.0
InsertBuilderBatch inserts multiple builders in a batch
func InsertBuilderDepositTxs ¶ added in v1.24.0
func InsertBuilderDeposits ¶ added in v1.24.0
func InsertBuilderExitTxs ¶ added in v1.24.0
func InsertBuilderExits ¶ added in v1.24.0
func InsertConsolidationRequestTxs ¶ added in v1.12.1
func InsertConsolidationRequests ¶ added in v1.11.0
func InsertDepositTxs ¶
func InsertDeposits ¶
func InsertElAccount ¶ added in v1.19.9
func InsertElBalances ¶ added in v1.19.9
func InsertElBlock ¶ added in v1.19.9
func InsertElToken ¶ added in v1.19.9
func InsertElTokenTransfers ¶ added in v1.19.9
func InsertElTransactions ¶ added in v1.19.9
func InsertElTransactionsInternal ¶ added in v1.20.3
func InsertElTransactionsInternal(ctx context.Context, dbTx *sqlx.Tx, entries []*dbtypes.ElTransactionInternal) error
InsertElTransactionsInternal inserts per-account internal-tx aggregates in batch. Each entry is one (tx_uid, account_id) row.
func InsertElTxHashes ¶ added in v1.24.1
InsertElTxHashes inserts tx-hash index entries within the caller's transaction (so the relational store stays atomic with el_transactions). Idempotent: duplicate (hash10, tx_uid) pairs are ignored.
func InsertFork ¶ added in v1.11.0
func InsertMevBlocks ¶
func InsertMissingSlot ¶
func InsertOrphanedBlock ¶
func InsertOrphanedEpoch ¶ added in v1.18.3
func InsertSlashings ¶
func InsertSyncAssignments ¶
func InsertUnfinalizedBlock ¶
func InsertUnfinalizedDuty ¶ added in v1.11.0
func InsertUnfinalizedEpoch ¶
func InsertValidator ¶ added in v1.14.0
InsertValidator inserts a single validator into the database
func InsertValidatorBatch ¶ added in v1.14.0
InsertValidatorBatch inserts multiple validators in a batch
func InsertValidatorNames ¶
func InsertVoluntaryExits ¶
func InsertWithdrawalRequestTxs ¶ added in v1.12.1
func InsertWithdrawalRequests ¶ added in v1.11.0
func InsertWithdrawals ¶ added in v1.21.0
func MustCloseDB ¶
func MustCloseDB()
func MustInitDB ¶
func MustInitDB(dbcfg *types.DatabaseConfig)
func NewDBTxHashIndex ¶ added in v1.24.1
func NewDBTxHashIndex() bdbtypes.TxHashIndex
NewDBTxHashIndex returns a relational tx-hash index backed by el_txhash.
func PruneElRevertReasonsBefore ¶ added in v1.24.1
PruneElRevertReasonsBefore deletes dynamic reasons (id >= 10) whose most recent reference is below the threshold — i.e. no surviving transaction references them. Reserved sentinels (id < 10) are never removed. The table is tiny, so this is a single delete (no batching).
func PruneElTxHashBefore ¶ added in v1.24.1
PruneElTxHashBefore deletes index entries for tx_uids below the threshold (= maxSlot<<32), batched like the other EL cleanup deletes.
func ResetElBlockDataStatusBefore ¶ added in v1.20.3
func ResetElBlockDataStatusBefore(ctx context.Context, dbTx *sqlx.Tx, blockUidThreshold uint64) (int64, error)
ResetElBlockDataStatusBefore resets data_status and data_size for all blocks with block_uid below the given threshold (used for time-based pruning).
func ResolveElRevertReason ¶ added in v1.24.1
func ResolveElRevertReason(ctx context.Context, dbTx *sqlx.Tx, reason string, reasonHash []byte, lastTxUid uint64) (uint32, error)
ResolveElRevertReason bumps an existing reason's last_tx_uid to the highest referencing tx_uid, or inserts it if new (id assigned >= 10), then returns its id. Runs in the caller's tx and is self-healing across reclaim.
The bump is an UPDATE keyed by reason_hash, which does NOT allocate an id; only a genuinely new reason consumes one (via the insert below). So the id sequence advances per distinct reason, not per reference — keeping it far below the int limit even on busy chains. (An ON CONFLICT upsert, by contrast, burns a sequence value on every reference because the id default is evaluated before the conflict is detected, on both Postgres and SQLite.)
func SetBuilderSuperseded ¶ added in v1.21.0
SetBuilderSuperseded marks a builder as superseded
func SetBuildersSuperseded ¶ added in v1.21.0
SetBuildersSuperseded marks multiple builders as superseded in a batch
func SetExplorerState ¶
func StreamBuildersByIndexes ¶ added in v1.21.0
func StreamBuildersByIndexes(ctx context.Context, indexes []uint64, cb func(builder *dbtypes.Builder) bool)
StreamBuildersByIndexes streams builders by indexes
func StreamBuildersByPubkeys ¶ added in v1.21.0
func StreamBuildersByPubkeys(ctx context.Context, pubkeys [][]byte, cb func(builder *dbtypes.Builder) bool) error
StreamBuildersByPubkeys streams builders by pubkeys in batches
func StreamOrphanedEpochs ¶ added in v1.18.3
func StreamUnfinalizedBlocks ¶ added in v1.11.0
func StreamUnfinalizedDuties ¶ added in v1.11.0
func StreamUnfinalizedEpochs ¶ added in v1.11.0
func StreamValidatorsByIndexes ¶ added in v1.14.0
func UpdateBuilderDepositTxHash ¶ added in v1.24.0
func UpdateBuilderExitTxHash ¶ added in v1.24.0
func UpdateConsolidationRequestTxHash ¶ added in v1.12.1
func UpdateElAccountsLastNonce ¶ added in v1.19.9
func UpdateElAccountsLastNonce(ctx context.Context, dbTx *sqlx.Tx, accounts []*dbtypes.ElAccount) error
UpdateElAccountsLastNonce batch updates last_nonce and last_block_uid for multiple accounts by ID. Uses VALUES clause for efficient batch update - 10-50x faster than individual updates.
func UpdateElBlockDataStatus ¶ added in v1.20.3
func UpdateElBlockDataStatus(ctx context.Context, dbTx *sqlx.Tx, blockUid uint64, dataStatus uint16, dataSize int64) error
UpdateElBlockDataStatus updates the data_status and data_size for a block after writing execution data to blockdb.
func UpdateElToken ¶ added in v1.19.9
func UpdateEpochDutiesSize ¶ added in v1.24.0
UpdateEpochDutiesSize records the stored size of an epoch's duties object.
func UpdateFinalizedForkParents ¶ added in v1.11.0
func UpdateForkParent ¶ added in v1.11.1
func UpdateMevBlockByEpoch ¶
func UpdateUnfinalizedBlockExecutionTimes ¶ added in v1.17.0
func UpdateUnfinalizedBlockForkId ¶ added in v1.11.0
func UpdateUnfinalizedBlockPayload ¶ added in v1.21.0
func UpdateUnfinalizedBlockStatus ¶ added in v1.11.0
func UpdateWithdrawalRequestTxHash ¶ added in v1.12.1
Types ¶
type BlobStatistics ¶ added in v1.19.5
type BlobStatistics struct {
BlobsLast1h uint64
BlobsLast24h uint64
BlobsLast7d uint64
BlobsLast18d uint64
BlocksWithBlobsLast1h uint64
BlocksWithBlobsLast24h uint64
BlocksWithBlobsLast7d uint64
BlocksWithBlobsLast18d uint64
BlobGasLast1h uint64
BlobGasLast24h uint64
BlobGasLast7d uint64
BlobGasLast18d uint64
}
func GetBlobStatistics ¶ added in v1.19.5
func GetBlobStatistics(ctx context.Context, currentSlot uint64) (*BlobStatistics, error)
type BlockDbStats ¶ added in v1.20.4
type BlockDbStats struct {
BeaconBlockCount int64
BeaconBlockSize int64
ExecDataCount int64
ExecDataSize int64
DutiesCount int64
DutiesSize int64
}
BlockDbStats holds aggregate stats about data stored in the block database.
func GetBlockDbStats ¶ added in v1.20.4
func GetBlockDbStats() (*BlockDbStats, error)
GetBlockDbStats returns counts and sizes for beacon blocks and execution data tracked in the database, avoiding expensive S3/Pebble listing.
type CleanupStats ¶ added in v1.19.9
type CleanupStats struct {
ZeroBalancesDeleted int64
TransactionsDeleted int64
InternalTxsDeleted int64
TokenTransfersDeleted int64
BlocksDeleted int64
RevertReasonsDeleted int64
}
CleanupStats holds statistics from cleanup operations.
func DeleteElDataBeforeBlockUid ¶ added in v1.19.9
func DeleteElDataBeforeBlockUid(ctx context.Context, blockUidThreshold uint64, _ *sqlx.Tx) (*CleanupStats, error)
DeleteElDataBeforeBlockUid deletes the relational EL data (transactions, internal txs, transfers, blocks) with block_uid less than the specified threshold. This is the short (relational) retention boundary.
It intentionally does NOT touch the el_txhash index: that index lives with the longer blockdb (details) retention and is pruned separately by the indexer's cleanupBlockdbRetention, so /tx/{hash} can resolve pruned transactions from blockdb after their relational rows are gone.
Returns statistics about deleted rows. Uses batched deletes to avoid long locks - deletes in chunks and commits between batches. Uses default batch size of 50000 rows per batch.
type EpochParticipation ¶ added in v1.18.3
type EpochParticipation struct {
Epoch uint64 `db:"epoch"`
BlockCount uint64 `db:"block_count"`
Eligible uint64 `db:"eligible"`
VotedTarget uint64 `db:"voted_target"`
VotedHead uint64 `db:"voted_head"`
VotedTotal uint64 `db:"voted_total"`
}
EpochParticipation represents participation data for a finalized canonical epoch
func GetFinalizedEpochParticipation ¶ added in v1.18.3
func GetFinalizedEpochParticipation(ctx context.Context, startEpoch, endEpoch uint64) ([]*EpochParticipation, error)
GetFinalizedEpochParticipation gets participation data for finalized canonical epochs in the given range
type ForkParticipationByEpoch ¶ added in v1.18.3
type ForkParticipationByEpoch struct {
ForkId uint64 `db:"fork_id"`
Epoch uint64 `db:"epoch"`
Participation float64 `db:"avg_participation"`
SlotCount uint64 `db:"slot_count"`
}
ForkParticipationByEpoch represents participation data for a fork in a specific epoch
func GetForkParticipationByEpoch ¶ added in v1.18.3
func GetForkParticipationByEpoch(ctx context.Context, startEpoch, endEpoch uint64, forkIds []uint64) ([]*ForkParticipationByEpoch, error)
GetForkParticipationByEpoch gets average participation per fork per epoch for the given epoch range This is optimized to fetch all data in one query to avoid expensive repeated queries
type OrphanedEpochParticipation ¶ added in v1.18.3
type OrphanedEpochParticipation struct {
Epoch uint64 `db:"epoch"`
HeadForkId uint64 `db:"epoch_head_fork_id"`
BlockCount uint64 `db:"block_count"`
Eligible uint64 `db:"eligible"`
VotedTarget uint64 `db:"voted_target"`
VotedHead uint64 `db:"voted_head"`
VotedTotal uint64 `db:"voted_total"`
}
OrphanedEpochParticipation represents participation data for an orphaned epoch
func GetOrphanedEpochParticipation ¶ added in v1.18.3
func GetOrphanedEpochParticipation(ctx context.Context, startEpoch, endEpoch uint64) ([]*OrphanedEpochParticipation, error)
GetOrphanedEpochParticipation gets participation data for orphaned epochs in the given range
type RecentBlockStats ¶ added in v1.20.4
type RecentBlockStats struct {
BlockCount int64
Transactions int64
Events int64
Transfers int64
ExecData int64
ExecDataSize int64
}
RecentBlockStats holds aggregate stats for a range of recent EL blocks.
func GetRecentElBlockStats ¶ added in v1.20.4
func GetRecentElBlockStats(lastN int64) (*RecentBlockStats, error)
GetRecentElBlockStats returns aggregate stats for the most recent N EL blocks.
type TableStats ¶ added in v1.20.4
TableStats holds size information for a database table.
func GetTableStats ¶ added in v1.20.4
func GetTableStats() ([]*TableStats, error)
GetTableStats returns estimated row counts and sizes for all known tables. For PostgreSQL it uses catalog statistics (pg_class.reltuples) to avoid expensive full table scans. For SQLite it batches the dbstat query.
type UnfinalizedEpochParticipation ¶ added in v1.18.3
type UnfinalizedEpochParticipation struct {
Epoch uint64 `db:"epoch"`
HeadForkId uint64 `db:"epoch_head_fork_id"`
BlockCount uint64 `db:"block_count"`
Eligible uint64 `db:"eligible"`
VotedTarget uint64 `db:"voted_target"`
VotedHead uint64 `db:"voted_head"`
VotedTotal uint64 `db:"voted_total"`
}
UnfinalizedEpochParticipation represents participation data for an unfinalized epoch
func GetUnfinalizedEpochParticipation ¶ added in v1.18.3
func GetUnfinalizedEpochParticipation(ctx context.Context, startEpoch, endEpoch uint64) ([]*UnfinalizedEpochParticipation, error)
GetUnfinalizedEpochParticipation gets participation data for unfinalized epochs in the given range This is used for pruned epochs that are stored in the database
Source Files
¶
- blobs.go
- block_bids.go
- builder_deposit_request_txs.go
- builder_deposits.go
- builder_exit_request_txs.go
- builder_exits.go
- builders.go
- common.go
- consolidation_request_txs.go
- consolidation_requests.go
- convert.go
- debug_stats.go
- deposit_txs.go
- deposits.go
- el_accounts.go
- el_balances.go
- el_blocks.go
- el_cleanup.go
- el_revert_reason.go
- el_token_transfers.go
- el_tokens.go
- el_transactions.go
- el_transactions_internal.go
- el_txhash.go
- epochs.go
- explorer_state.go
- forks.go
- mev_blocks.go
- orphaned_blocks.go
- orphaned_epochs.go
- query_helpers.go
- slashings.go
- slots.go
- sync_assignments.go
- txsignatures.go
- unfinalized_blocks.go
- unfinalized_duties.go
- unfinalized_epochs.go
- validator_names.go
- validators.go
- voluntary_exits.go
- withdrawal_request_txs.go
- withdrawal_requests.go
- withdrawals.go