Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyEmbeddedDbSchema(version int64) error
- func ConvertInt64ToUint64(i int64) uint64
- func ConvertUint64ToInt64(u uint64) int64
- func DeleteElAccount(id uint64, dbTx *sqlx.Tx) error
- func DeleteElBalance(accountID uint64, tokenID uint64, dbTx *sqlx.Tx) error
- func DeleteElBalancesByAccountID(accountID uint64, dbTx *sqlx.Tx) error
- func DeleteElBalancesByTokenID(tokenID uint64, dbTx *sqlx.Tx) error
- func DeleteElBlock(blockUid uint64, dbTx *sqlx.Tx) error
- func DeleteElToken(id uint64, dbTx *sqlx.Tx) error
- func DeleteElTokenTransfer(blockUid uint64, txHash []byte, txIdx uint32, dbTx *sqlx.Tx) error
- func DeleteElTokenTransfersByBlockUid(blockUid uint64, dbTx *sqlx.Tx) error
- func DeleteElTokenTransfersByTokenID(tokenID uint64, dbTx *sqlx.Tx) error
- func DeleteElTokenTransfersByTxHash(txHash []byte, dbTx *sqlx.Tx) error
- func DeleteElTransaction(blockUid uint64, txHash []byte, dbTx *sqlx.Tx) error
- func DeleteElTransactionsByBlockUid(blockUid uint64, dbTx *sqlx.Tx) error
- func DeleteElTxEvent(blockUid uint64, txHash []byte, eventIndex uint32, dbTx *sqlx.Tx) error
- func DeleteElTxEventsByBlockUid(blockUid uint64, dbTx *sqlx.Tx) error
- func DeleteElTxEventsByTxHash(txHash []byte, dbTx *sqlx.Tx) error
- func DeleteElWithdrawal(blockUid uint64, accountID uint64, withdrawalType uint8, dbTx *sqlx.Tx) error
- func DeleteElWithdrawalsByBlockUid(blockUid uint64, dbTx *sqlx.Tx) error
- func DeleteElZeroBalances(dbTx *sqlx.Tx) (int64, error)
- func DeleteFinalizedForks(finalizedRoots [][]byte, tx *sqlx.Tx) error
- func DeletePendingFunctionSignatures(sigBytes []types.TxSignatureBytes, tx *sqlx.Tx) error
- func DeleteUnfinalizedBlocksBefore(slot uint64, tx *sqlx.Tx) error
- func DeleteUnfinalizedDutiesBefore(epoch uint64, tx *sqlx.Tx) error
- func DeleteUnfinalizedEpochsBefore(epoch uint64, tx *sqlx.Tx) error
- func DeleteValidatorNames(validatorNames []uint64, tx *sqlx.Tx) error
- func EngineQuery(queryMap map[dbtypes.DBEngineType]string) string
- func GetBlob(commitment []byte, withData bool) *dbtypes.Blob
- func GetBlockHeadByRoot(root []byte) *dbtypes.BlockHead
- func GetBlockHeadBySlot(slot uint64) *dbtypes.BlockHead
- func GetBlockHeadBySlotRange(startSlot uint64, endSlot uint64) []*dbtypes.BlockHead
- func GetConsolidationRequestTxsByDequeueRange(dequeueFirst uint64, dequeueLast uint64) []*dbtypes.ConsolidationRequestTx
- func GetConsolidationRequestTxsByTxHashes(txHashes [][]byte) []*dbtypes.ConsolidationRequestTx
- func GetConsolidationRequestTxsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.ConsolidationRequestTx, uint64, error)
- func GetConsolidationRequestsByElBlockRange(firstSlot uint64, lastSlot uint64) []*dbtypes.ConsolidationRequest
- func GetConsolidationRequestsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.ConsolidationRequest, uint64, error)
- func GetDepositTxs(firstIndex uint64, limit uint32) []*dbtypes.DepositTx
- func GetDepositTxsByIndexes(indexes []uint64) []*dbtypes.DepositTx
- func GetDepositTxsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.DepositTx, uint64, error)
- func GetDepositsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.DepositWithTx, uint64, error)
- func GetElAccountByAddress(address []byte) (*dbtypes.ElAccount, error)
- func GetElAccountByID(id uint64) (*dbtypes.ElAccount, error)
- func GetElAccountsByFunder(funderID uint64, offset uint64, limit uint32) ([]*dbtypes.ElAccount, uint64, error)
- func GetElAccountsByIDs(ids []uint64) ([]*dbtypes.ElAccount, error)
- func GetElAccountsFiltered(offset uint64, limit uint32, filter *dbtypes.ElAccountFilter) ([]*dbtypes.ElAccount, uint64, error)
- func GetElBalance(accountID uint64, tokenID uint64) (*dbtypes.ElBalance, error)
- func GetElBalancesByAccountID(accountID uint64, offset uint64, limit uint32) ([]*dbtypes.ElBalance, uint64, error)
- func GetElBalancesByTokenID(tokenID uint64, offset uint64, limit uint32) ([]*dbtypes.ElBalance, uint64, error)
- func GetElBalancesFiltered(offset uint64, limit uint32, accountID uint64, filter *dbtypes.ElBalanceFilter) ([]*dbtypes.ElBalance, uint64, error)
- func GetElBlock(blockUid uint64) (*dbtypes.ElBlock, error)
- func GetElBlocksByUids(blockUids []uint64) ([]*dbtypes.ElBlock, error)
- func GetElTokenByContract(contract []byte) (*dbtypes.ElToken, error)
- func GetElTokenByID(id uint64) (*dbtypes.ElToken, error)
- func GetElTokenTransfer(blockUid uint64, txHash []byte, txIdx uint32) (*dbtypes.ElTokenTransfer, error)
- func GetElTokenTransfersByAccountID(accountID uint64, isFrom bool, offset uint64, limit uint32) ([]*dbtypes.ElTokenTransfer, uint64, error)
- func GetElTokenTransfersByAccountIDCombined(accountID uint64, tokenTypes []uint8, offset uint64, limit uint32) ([]*dbtypes.ElTokenTransfer, uint64, bool, error)
- func GetElTokenTransfersByBlockUid(blockUid uint64) ([]*dbtypes.ElTokenTransfer, error)
- func GetElTokenTransfersByBlockUidAndTxHash(blockUid uint64, txHash []byte) ([]*dbtypes.ElTokenTransfer, error)
- func GetElTokenTransfersByTokenID(tokenID uint64, offset uint64, limit uint32) ([]*dbtypes.ElTokenTransfer, uint64, error)
- func GetElTokenTransfersByTxHash(txHash []byte) ([]*dbtypes.ElTokenTransfer, error)
- func GetElTokenTransfersFiltered(offset uint64, limit uint32, filter *dbtypes.ElTokenTransferFilter) ([]*dbtypes.ElTokenTransfer, uint64, error)
- func GetElTokens(offset uint64, limit uint32) ([]*dbtypes.ElToken, uint64, error)
- func GetElTokensByIDs(ids []uint64) ([]*dbtypes.ElToken, error)
- func GetElTokensFiltered(offset uint64, limit uint32, filter *dbtypes.ElTokenFilter) ([]*dbtypes.ElToken, uint64, error)
- func GetElTransaction(blockUid uint64, txHash []byte) (*dbtypes.ElTransaction, error)
- func GetElTransactionsByAccountID(accountID uint64, isFrom bool, offset uint64, limit uint32) ([]*dbtypes.ElTransaction, uint64, error)
- func GetElTransactionsByAccountIDCombined(accountID uint64, offset uint64, limit uint32) ([]*dbtypes.ElTransaction, uint64, bool, error)
- func GetElTransactionsByBlockUid(blockUid uint64) ([]*dbtypes.ElTransaction, error)
- func GetElTransactionsByHash(txHash []byte) ([]*dbtypes.ElTransaction, error)
- func GetElTransactionsFiltered(offset uint64, limit uint32, filter *dbtypes.ElTransactionFilter) ([]*dbtypes.ElTransaction, uint64, error)
- func GetElTxEvent(blockUid uint64, txHash []byte, eventIndex uint32) (*dbtypes.ElTxEvent, error)
- func GetElTxEventsByBlockUid(blockUid uint64) ([]*dbtypes.ElTxEvent, error)
- func GetElTxEventsByBlockUidAndTxHash(blockUid uint64, txHash []byte) ([]*dbtypes.ElTxEvent, error)
- func GetElTxEventsByTopic1(topic1 []byte, offset uint64, limit uint32) ([]*dbtypes.ElTxEvent, uint64, error)
- func GetElTxEventsByTxHash(txHash []byte) ([]*dbtypes.ElTxEvent, error)
- func GetElTxEventsFiltered(offset uint64, limit uint32, filter *dbtypes.ElTxEventFilter) ([]*dbtypes.ElTxEvent, uint64, error)
- func GetElWithdrawal(blockUid uint64, accountID uint64, withdrawalType uint8) (*dbtypes.ElWithdrawal, error)
- func GetElWithdrawalsByAccountID(accountID uint64, offset uint64, limit uint32) ([]*dbtypes.ElWithdrawal, uint64, error)
- func GetElWithdrawalsByBlockUid(blockUid uint64) ([]*dbtypes.ElWithdrawal, error)
- func GetElWithdrawalsFiltered(offset uint64, limit uint32, filter *dbtypes.ElWithdrawalFilter) ([]*dbtypes.ElWithdrawal, uint64, error)
- func GetEpochs(firstEpoch uint64, limit uint32) []*dbtypes.Epoch
- func GetExplorerState(key string, returnValue interface{}) (interface{}, error)
- func GetFilteredSlots(filter *dbtypes.BlockFilter, firstSlot uint64, offset uint64, limit uint32) []*dbtypes.AssignedSlot
- func GetForkBlockCounts(startSlot uint64, endSlot uint64) (map[uint64]uint64, error)
- func GetForkById(forkId uint64) *dbtypes.Fork
- func GetForkVisualizationData(startSlot uint64, endSlot uint64) ([]*dbtypes.Fork, error)
- func GetHighestMevBlockSlotByRelay(relayId uint8) (uint64, error)
- func GetHighestRootBeforeSlot(slot uint64, withOrphaned bool) []byte
- func GetLatestBlobAssignment(commitment []byte) *dbtypes.BlobAssignment
- func GetMaxValidatorIndex() (uint64, error)
- func GetMevBlockByBlockHash(blockHash []byte) *dbtypes.MevBlock
- func GetMevBlocksByBlockHashes(blockHashes [][]byte) map[string]*dbtypes.MevBlock
- func GetMevBlocksFiltered(offset uint64, limit uint32, filter *dbtypes.MevBlockFilter) ([]*dbtypes.MevBlock, uint64, error)
- func GetNewestElBlockUid() (uint64, error)
- func GetOldestElBlockUid() (uint64, error)
- func GetOrphanedBlock(root []byte) *dbtypes.OrphanedBlock
- func GetOrphanedEpoch(epoch uint64, headRoot []byte) *dbtypes.OrphanedEpoch
- func GetPendingFunctionSignatures(limit uint64) []*dbtypes.TxPendingFunctionSignature
- func GetSlashingForValidator(validator uint64) *dbtypes.Slashing
- func GetSlashingsFiltered(offset uint64, limit uint32, finalizedBlock uint64, ...) ([]*dbtypes.Slashing, uint64, error)
- func GetSlotAssignment(slot uint64) uint64
- func GetSlotBlobCountByExecutionHashes(blockHashes [][]byte) []*dbtypes.BlockBlobCount
- func GetSlotByRoot(root []byte) *dbtypes.Slot
- func GetSlotStatus(blockRoots [][]byte) []*dbtypes.BlockStatus
- func GetSlotsByBlockHash(blockHash []byte) []*dbtypes.Slot
- func GetSlotsByParentRoot(parentRoot []byte) []*dbtypes.Slot
- func GetSlotsByRoots(roots [][]byte) map[phase0.Root]*dbtypes.Slot
- func GetSlotsRange(firstSlot uint64, lastSlot uint64, withMissing bool, withOrphaned bool) []*dbtypes.AssignedSlot
- func GetSyncAssignmentsForPeriod(period uint64) []uint64
- func GetSyncCommitteeParticipation(slot uint64) (float64, error)
- func GetTxFunctionSignaturesByBytes(sigBytes []types.TxSignatureBytes) []*dbtypes.TxFunctionSignature
- func GetUnfinalizedBlock(root []byte) *dbtypes.UnfinalizedBlock
- func GetUnfinalizedBlocks(filter *dbtypes.UnfinalizedBlockFilter) []*dbtypes.UnfinalizedBlock
- func GetUnfinalizedDuty(epoch uint64, dependentRoot []byte) *dbtypes.UnfinalizedDuty
- func GetUnfinalizedEpoch(epoch uint64, headRoot []byte) *dbtypes.UnfinalizedEpoch
- func GetUnfinalizedForks(finalizedSlot uint64) []*dbtypes.Fork
- func GetUnknownFunctionSignatures(sigBytes []types.TxSignatureBytes) []*dbtypes.TxUnknownFunctionSignature
- func GetValidatorByIndex(index phase0.ValidatorIndex) *dbtypes.Validator
- func GetValidatorByPubkey(pubkey []byte) *dbtypes.Validator
- func GetValidatorIndexesByFilter(filter dbtypes.ValidatorFilter, currentEpoch uint64) ([]uint64, error)
- func GetValidatorNames(minIdx uint64, maxIdx uint64) []*dbtypes.ValidatorName
- func GetValidatorRange(startIndex uint64, endIndex uint64) []*dbtypes.Validator
- func GetVoluntaryExitForValidator(validator uint64) *dbtypes.VoluntaryExit
- func GetVoluntaryExitsFiltered(offset uint64, limit uint32, finalizedBlock uint64, ...) ([]*dbtypes.VoluntaryExit, uint64, error)
- func GetWithdrawalRequestTxsByDequeueRange(dequeueFirst uint64, dequeueLast uint64) []*dbtypes.WithdrawalRequestTx
- func GetWithdrawalRequestTxsByTxHashes(txHashes [][]byte) []*dbtypes.WithdrawalRequestTx
- func GetWithdrawalRequestTxsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.WithdrawalRequestTx, uint64, error)
- func GetWithdrawalRequestsByElBlockRange(firstSlot uint64, lastSlot uint64) []*dbtypes.WithdrawalRequest
- func GetWithdrawalRequestsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, ...) ([]*dbtypes.WithdrawalRequest, uint64, error)
- func InsertBlob(blob *dbtypes.Blob, tx *sqlx.Tx) error
- func InsertBlobAssignment(blobAssignment *dbtypes.BlobAssignment, tx *sqlx.Tx) error
- func InsertConsolidationRequestTxs(consolidationTxs []*dbtypes.ConsolidationRequestTx, tx *sqlx.Tx) error
- func InsertConsolidationRequests(consolidations []*dbtypes.ConsolidationRequest, tx *sqlx.Tx) error
- func InsertDepositTxs(depositTxs []*dbtypes.DepositTx, tx *sqlx.Tx) error
- func InsertDeposits(deposits []*dbtypes.Deposit, tx *sqlx.Tx) error
- func InsertElAccount(account *dbtypes.ElAccount, dbTx *sqlx.Tx) (uint64, error)
- func InsertElBalances(balances []*dbtypes.ElBalance, dbTx *sqlx.Tx) error
- func InsertElBlock(block *dbtypes.ElBlock, dbTx *sqlx.Tx) error
- func InsertElToken(token *dbtypes.ElToken, dbTx *sqlx.Tx) (uint64, error)
- func InsertElTokenTransfers(transfers []*dbtypes.ElTokenTransfer, dbTx *sqlx.Tx) error
- func InsertElTransactions(txs []*dbtypes.ElTransaction, dbTx *sqlx.Tx) error
- func InsertElTxEvents(events []*dbtypes.ElTxEvent, dbTx *sqlx.Tx) error
- func InsertElWithdrawals(withdrawals []*dbtypes.ElWithdrawal, dbTx *sqlx.Tx) error
- func InsertEpoch(epoch *dbtypes.Epoch, tx *sqlx.Tx) error
- func InsertFork(fork *dbtypes.Fork, tx *sqlx.Tx) error
- func InsertMevBlocks(mevBlocks []*dbtypes.MevBlock, tx *sqlx.Tx) error
- func InsertMissingSlot(block *dbtypes.SlotHeader, tx *sqlx.Tx) error
- func InsertOrphanedBlock(block *dbtypes.OrphanedBlock, tx *sqlx.Tx) error
- func InsertOrphanedEpoch(epoch *dbtypes.OrphanedEpoch, tx *sqlx.Tx) error
- func InsertPendingFunctionSignatures(txPendingSigs []*dbtypes.TxPendingFunctionSignature, tx *sqlx.Tx) error
- func InsertSlashings(slashings []*dbtypes.Slashing, tx *sqlx.Tx) error
- func InsertSlot(slot *dbtypes.Slot, tx *sqlx.Tx) error
- func InsertSyncAssignments(syncAssignments []*dbtypes.SyncAssignment, tx *sqlx.Tx) error
- func InsertTxFunctionSignature(txFuncSig *dbtypes.TxFunctionSignature, tx *sqlx.Tx) error
- func InsertUnfinalizedBlock(block *dbtypes.UnfinalizedBlock, tx *sqlx.Tx) error
- func InsertUnfinalizedDuty(duty *dbtypes.UnfinalizedDuty, tx *sqlx.Tx) error
- func InsertUnfinalizedEpoch(epoch *dbtypes.UnfinalizedEpoch, tx *sqlx.Tx) error
- func InsertUnknownFunctionSignatures(txUnknownSigs []*dbtypes.TxUnknownFunctionSignature, tx *sqlx.Tx) error
- func InsertValidator(validator *dbtypes.Validator, tx *sqlx.Tx) error
- func InsertValidatorBatch(validators []*dbtypes.Validator, tx *sqlx.Tx) error
- func InsertValidatorNames(validatorNames []*dbtypes.ValidatorName, tx *sqlx.Tx) error
- func InsertVoluntaryExits(voluntaryExits []*dbtypes.VoluntaryExit, tx *sqlx.Tx) error
- func InsertWithdrawalRequestTxs(withdrawalTxs []*dbtypes.WithdrawalRequestTx, tx *sqlx.Tx) error
- func InsertWithdrawalRequests(elRequests []*dbtypes.WithdrawalRequest, tx *sqlx.Tx) error
- func IsEpochSynchronized(epoch uint64) bool
- func IsSyncCommitteeSynchronized(period uint64) bool
- func MustCloseDB()
- func MustInitDB(dbcfg *types.DatabaseConfig)
- func RunDBTransaction(handler func(tx *sqlx.Tx) error) error
- func SetExplorerState(key string, value interface{}, tx *sqlx.Tx) error
- func StreamOrphanedEpochs(epoch uint64, cb func(duty *dbtypes.OrphanedEpoch)) error
- func StreamUnfinalizedBlocks(slot uint64, cb func(block *dbtypes.UnfinalizedBlock)) error
- func StreamUnfinalizedDuties(epoch uint64, cb func(duty *dbtypes.UnfinalizedDuty)) error
- func StreamUnfinalizedEpochs(epoch uint64, cb func(duty *dbtypes.UnfinalizedEpoch)) error
- func StreamValidatorsByIndexes(indexes []uint64, cb func(validator *dbtypes.Validator) bool) error
- func UpdateConsolidationRequestTxHash(slotRoot []byte, slotIndex uint64, txHash []byte, tx *sqlx.Tx) error
- func UpdateElAccount(account *dbtypes.ElAccount, dbTx *sqlx.Tx) error
- func UpdateElAccountsLastNonce(accounts []*dbtypes.ElAccount, dbTx *sqlx.Tx) error
- func UpdateElBalance(balance *dbtypes.ElBalance, dbTx *sqlx.Tx) error
- func UpdateElToken(token *dbtypes.ElToken, dbTx *sqlx.Tx) error
- func UpdateFinalizedForkParents(finalizedRoots [][]byte, tx *sqlx.Tx) error
- func UpdateForkParent(parentRoot []byte, parentForkId uint64, tx *sqlx.Tx) error
- func UpdateMevBlockByEpoch(epoch uint64, slotsPerEpoch uint64, canonicalHashes [][]byte, tx *sqlx.Tx) error
- func UpdateUnfinalizedBlockExecutionTimes(root []byte, minExecTime uint32, maxExecTime uint32, execTimes []byte, ...) error
- func UpdateUnfinalizedBlockForkId(roots [][]byte, forkId uint64, tx *sqlx.Tx) error
- func UpdateUnfinalizedBlockStatus(roots [][]byte, blockStatus dbtypes.UnfinalizedBlockStatus, tx *sqlx.Tx) error
- func UpdateWithdrawalRequestTxHash(slotRoot []byte, slotIndex uint64, txHash []byte, tx *sqlx.Tx) error
- type BlobStatistics
- type CleanupStats
- type EpochParticipation
- type ForkParticipationByEpoch
- type OrphanedEpochParticipation
- type UnfinalizedEpochParticipation
Constants ¶
const MaxAccountTokenTransferCount = 100000
MaxAccountTokenTransferCount is the maximum count returned for address token transfer queries. If the actual count exceeds this, the query returns this limit and sets the "more" flag.
const MaxAccountTransactionCount = 100000
MaxAccountTransactionCount is the maximum count returned for address transaction queries. If the actual count exceeds this, the query returns this limit and sets the "more" flag.
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 DeleteElBalance ¶ added in v1.19.9
func DeleteElBalancesByAccountID ¶ added in v1.19.9
func DeleteElBalancesByTokenID ¶ added in v1.19.9
func DeleteElTokenTransfer ¶ added in v1.19.9
func DeleteElTokenTransfersByBlockUid ¶ added in v1.19.9
func DeleteElTokenTransfersByTokenID ¶ added in v1.19.9
func DeleteElTokenTransfersByTxHash ¶ added in v1.19.9
func DeleteElTransaction ¶ added in v1.19.9
func DeleteElTransactionsByBlockUid ¶ added in v1.19.9
func DeleteElTxEvent ¶ added in v1.19.9
func DeleteElTxEventsByBlockUid ¶ added in v1.19.9
func DeleteElTxEventsByTxHash ¶ added in v1.19.9
func DeleteElWithdrawal ¶ added in v1.19.9
func DeleteElWithdrawalsByBlockUid ¶ added in v1.19.9
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 DeletePendingFunctionSignatures ¶
func DeletePendingFunctionSignatures(sigBytes []types.TxSignatureBytes, tx *sqlx.Tx) error
func DeleteUnfinalizedBlocksBefore ¶ added in v1.11.0
func DeleteUnfinalizedDutiesBefore ¶ added in v1.11.0
func DeleteUnfinalizedEpochsBefore ¶ added in v1.14.0
func EngineQuery ¶
func EngineQuery(queryMap map[dbtypes.DBEngineType]string) string
func GetBlockHeadByRoot ¶ added in v1.11.0
func GetBlockHeadBySlot ¶ added in v1.15.0
func GetBlockHeadBySlotRange ¶ added in v1.19.9
func GetConsolidationRequestTxsByDequeueRange ¶ added in v1.12.1
func GetConsolidationRequestTxsByDequeueRange(dequeueFirst uint64, dequeueLast uint64) []*dbtypes.ConsolidationRequestTx
func GetConsolidationRequestTxsByTxHashes ¶ added in v1.12.1
func GetConsolidationRequestTxsByTxHashes(txHashes [][]byte) []*dbtypes.ConsolidationRequestTx
func GetConsolidationRequestTxsFiltered ¶ added in v1.12.1
func GetConsolidationRequestTxsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, filter *dbtypes.ConsolidationRequestTxFilter) ([]*dbtypes.ConsolidationRequestTx, uint64, error)
func GetConsolidationRequestsByElBlockRange ¶ added in v1.12.1
func GetConsolidationRequestsByElBlockRange(firstSlot uint64, lastSlot uint64) []*dbtypes.ConsolidationRequest
func GetConsolidationRequestsFiltered ¶ added in v1.12.0
func GetConsolidationRequestsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, filter *dbtypes.ConsolidationRequestFilter) ([]*dbtypes.ConsolidationRequest, uint64, error)
func GetDepositTxsByIndexes ¶ added in v1.15.0
func GetDepositTxsFiltered ¶
func GetDepositsFiltered ¶
func GetDepositsFiltered(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 GetElAccountsByFunder ¶ added in v1.19.9
func GetElAccountsByIDs ¶ added in v1.19.9
GetElAccountsByIDs retrieves multiple accounts by their IDs in a single query.
func GetElAccountsFiltered ¶ added in v1.19.9
func GetElBalance ¶ added in v1.19.9
func GetElBalancesByAccountID ¶ added in v1.19.9
func GetElBalancesByTokenID ¶ added in v1.19.9
func GetElBalancesFiltered ¶ added in v1.19.9
func GetElBlocksByUids ¶ added in v1.19.9
func GetElTokenByContract ¶ added in v1.19.9
func GetElTokenTransfer ¶ added in v1.19.9
func GetElTokenTransfersByAccountID ¶ added in v1.19.9
func GetElTokenTransfersByAccountIDCombined ¶ added in v1.19.9
func GetElTokenTransfersByAccountIDCombined(accountID uint64, tokenTypes []uint8, offset uint64, limit uint32) ([]*dbtypes.ElTokenTransfer, uint64, bool, error)
GetElTokenTransfersByAccountIDCombined returns all token transfers where the account is either sender or receiver. Results are sorted by block_uid DESC, tx_pos DESC, tx_idx DESC. tokenTypes filters by token type (empty = all types). Returns transfers, total count (capped at MaxAccountTokenTransferCount), whether count is capped, and error.
func GetElTokenTransfersByBlockUid ¶ added in v1.19.9
func GetElTokenTransfersByBlockUid(blockUid uint64) ([]*dbtypes.ElTokenTransfer, error)
func GetElTokenTransfersByBlockUidAndTxHash ¶ added in v1.19.9
func GetElTokenTransfersByBlockUidAndTxHash(blockUid uint64, txHash []byte) ([]*dbtypes.ElTokenTransfer, error)
func GetElTokenTransfersByTokenID ¶ added in v1.19.9
func GetElTokenTransfersByTxHash ¶ added in v1.19.9
func GetElTokenTransfersByTxHash(txHash []byte) ([]*dbtypes.ElTokenTransfer, error)
func GetElTokenTransfersFiltered ¶ added in v1.19.9
func GetElTokenTransfersFiltered(offset uint64, limit uint32, filter *dbtypes.ElTokenTransferFilter) ([]*dbtypes.ElTokenTransfer, uint64, error)
func GetElTokens ¶ added in v1.19.9
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 GetElTransaction ¶ added in v1.19.9
func GetElTransaction(blockUid uint64, txHash []byte) (*dbtypes.ElTransaction, error)
func GetElTransactionsByAccountID ¶ added in v1.19.9
func GetElTransactionsByAccountIDCombined ¶ added in v1.19.9
func GetElTransactionsByAccountIDCombined(accountID uint64, offset uint64, limit uint32) ([]*dbtypes.ElTransaction, uint64, bool, error)
GetElTransactionsByAccountIDCombined fetches transactions where the account is either sender (from_id) or receiver (to_id). Results are sorted by block_uid DESC, tx_index DESC. Returns transactions, total count (capped at MaxAccountTransactionCount), whether count is capped, and error.
func GetElTransactionsByBlockUid ¶ added in v1.19.9
func GetElTransactionsByBlockUid(blockUid uint64) ([]*dbtypes.ElTransaction, error)
func GetElTransactionsByHash ¶ added in v1.19.9
func GetElTransactionsByHash(txHash []byte) ([]*dbtypes.ElTransaction, error)
func GetElTransactionsFiltered ¶ added in v1.19.9
func GetElTransactionsFiltered(offset uint64, limit uint32, filter *dbtypes.ElTransactionFilter) ([]*dbtypes.ElTransaction, uint64, error)
func GetElTxEvent ¶ added in v1.19.9
func GetElTxEventsByBlockUid ¶ added in v1.19.9
func GetElTxEventsByBlockUidAndTxHash ¶ added in v1.19.9
func GetElTxEventsByTopic1 ¶ added in v1.19.9
func GetElTxEventsByTxHash ¶ added in v1.19.9
func GetElTxEventsFiltered ¶ added in v1.19.9
func GetElWithdrawal ¶ added in v1.19.9
func GetElWithdrawalsByAccountID ¶ added in v1.19.9
func GetElWithdrawalsByBlockUid ¶ added in v1.19.9
func GetElWithdrawalsByBlockUid(blockUid uint64) ([]*dbtypes.ElWithdrawal, error)
func GetElWithdrawalsFiltered ¶ added in v1.19.9
func GetElWithdrawalsFiltered(offset uint64, limit uint32, filter *dbtypes.ElWithdrawalFilter) ([]*dbtypes.ElWithdrawal, uint64, error)
func GetExplorerState ¶
func GetFilteredSlots ¶
func GetFilteredSlots(filter *dbtypes.BlockFilter, firstSlot uint64, offset uint64, limit uint32) []*dbtypes.AssignedSlot
func GetForkBlockCounts ¶ added in v1.18.3
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(commitment []byte) *dbtypes.BlobAssignment
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
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 GetOrphanedBlock ¶
func GetOrphanedBlock(root []byte) *dbtypes.OrphanedBlock
func GetOrphanedEpoch ¶ added in v1.18.3
func GetOrphanedEpoch(epoch uint64, headRoot []byte) *dbtypes.OrphanedEpoch
func GetPendingFunctionSignatures ¶
func GetPendingFunctionSignatures(limit uint64) []*dbtypes.TxPendingFunctionSignature
func GetSlashingForValidator ¶
func GetSlashingsFiltered ¶
func GetSlotAssignment ¶
func GetSlotBlobCountByExecutionHashes ¶ added in v1.18.3
func GetSlotBlobCountByExecutionHashes(blockHashes [][]byte) []*dbtypes.BlockBlobCount
func GetSlotByRoot ¶
func GetSlotStatus ¶
func GetSlotStatus(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 GetTxFunctionSignaturesByBytes ¶
func GetTxFunctionSignaturesByBytes(sigBytes []types.TxSignatureBytes) []*dbtypes.TxFunctionSignature
func GetUnfinalizedBlock ¶
func GetUnfinalizedBlock(root []byte) *dbtypes.UnfinalizedBlock
func GetUnfinalizedBlocks ¶
func GetUnfinalizedBlocks(filter *dbtypes.UnfinalizedBlockFilter) []*dbtypes.UnfinalizedBlock
func GetUnfinalizedDuty ¶ added in v1.11.0
func GetUnfinalizedDuty(epoch uint64, dependentRoot []byte) *dbtypes.UnfinalizedDuty
func GetUnfinalizedEpoch ¶
func GetUnfinalizedEpoch(epoch uint64, headRoot []byte) *dbtypes.UnfinalizedEpoch
func GetUnfinalizedForks ¶ added in v1.11.0
func GetUnknownFunctionSignatures ¶
func GetUnknownFunctionSignatures(sigBytes []types.TxSignatureBytes) []*dbtypes.TxUnknownFunctionSignature
func GetValidatorByIndex ¶ added in v1.14.0
func GetValidatorByIndex(index phase0.ValidatorIndex) *dbtypes.Validator
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(filter dbtypes.ValidatorFilter, currentEpoch uint64) ([]uint64, error)
GetValidatorIndexesByFilter returns validator indexes matching a filter
func GetValidatorNames ¶
func GetValidatorNames(minIdx uint64, maxIdx uint64) []*dbtypes.ValidatorName
func GetValidatorRange ¶ added in v1.14.0
GetValidatorRange returns validators in a given index range
func GetVoluntaryExitForValidator ¶
func GetVoluntaryExitForValidator(validator uint64) *dbtypes.VoluntaryExit
func GetVoluntaryExitsFiltered ¶
func GetVoluntaryExitsFiltered(offset uint64, limit uint32, finalizedBlock uint64, filter *dbtypes.VoluntaryExitFilter) ([]*dbtypes.VoluntaryExit, uint64, error)
func GetWithdrawalRequestTxsByDequeueRange ¶ added in v1.12.1
func GetWithdrawalRequestTxsByDequeueRange(dequeueFirst uint64, dequeueLast uint64) []*dbtypes.WithdrawalRequestTx
func GetWithdrawalRequestTxsByTxHashes ¶ added in v1.12.1
func GetWithdrawalRequestTxsByTxHashes(txHashes [][]byte) []*dbtypes.WithdrawalRequestTx
func GetWithdrawalRequestTxsFiltered ¶ added in v1.12.1
func GetWithdrawalRequestTxsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, filter *dbtypes.WithdrawalRequestTxFilter) ([]*dbtypes.WithdrawalRequestTx, uint64, error)
func GetWithdrawalRequestsByElBlockRange ¶ added in v1.12.1
func GetWithdrawalRequestsByElBlockRange(firstSlot uint64, lastSlot uint64) []*dbtypes.WithdrawalRequest
func GetWithdrawalRequestsFiltered ¶ added in v1.11.0
func GetWithdrawalRequestsFiltered(offset uint64, limit uint32, canonicalForkIds []uint64, filter *dbtypes.WithdrawalRequestFilter) ([]*dbtypes.WithdrawalRequest, uint64, error)
func InsertBlobAssignment ¶
func InsertBlobAssignment(blobAssignment *dbtypes.BlobAssignment, tx *sqlx.Tx) error
func InsertConsolidationRequestTxs ¶ added in v1.12.1
func InsertConsolidationRequestTxs(consolidationTxs []*dbtypes.ConsolidationRequestTx, tx *sqlx.Tx) error
func InsertConsolidationRequests ¶ added in v1.11.0
func InsertConsolidationRequests(consolidations []*dbtypes.ConsolidationRequest, tx *sqlx.Tx) error
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 InsertElTokenTransfers(transfers []*dbtypes.ElTokenTransfer, dbTx *sqlx.Tx) error
func InsertElTransactions ¶ added in v1.19.9
func InsertElTransactions(txs []*dbtypes.ElTransaction, dbTx *sqlx.Tx) error
func InsertElTxEvents ¶ added in v1.19.9
func InsertElWithdrawals ¶ added in v1.19.9
func InsertElWithdrawals(withdrawals []*dbtypes.ElWithdrawal, dbTx *sqlx.Tx) error
func InsertMissingSlot ¶
func InsertMissingSlot(block *dbtypes.SlotHeader, tx *sqlx.Tx) error
func InsertOrphanedBlock ¶
func InsertOrphanedBlock(block *dbtypes.OrphanedBlock, tx *sqlx.Tx) error
func InsertOrphanedEpoch ¶ added in v1.18.3
func InsertOrphanedEpoch(epoch *dbtypes.OrphanedEpoch, tx *sqlx.Tx) error
func InsertPendingFunctionSignatures ¶
func InsertPendingFunctionSignatures(txPendingSigs []*dbtypes.TxPendingFunctionSignature, tx *sqlx.Tx) error
func InsertSyncAssignments ¶
func InsertSyncAssignments(syncAssignments []*dbtypes.SyncAssignment, tx *sqlx.Tx) error
func InsertTxFunctionSignature ¶
func InsertTxFunctionSignature(txFuncSig *dbtypes.TxFunctionSignature, tx *sqlx.Tx) error
func InsertUnfinalizedBlock ¶
func InsertUnfinalizedBlock(block *dbtypes.UnfinalizedBlock, tx *sqlx.Tx) error
func InsertUnfinalizedDuty ¶ added in v1.11.0
func InsertUnfinalizedDuty(duty *dbtypes.UnfinalizedDuty, tx *sqlx.Tx) error
func InsertUnfinalizedEpoch ¶
func InsertUnfinalizedEpoch(epoch *dbtypes.UnfinalizedEpoch, tx *sqlx.Tx) error
func InsertUnknownFunctionSignatures ¶
func InsertUnknownFunctionSignatures(txUnknownSigs []*dbtypes.TxUnknownFunctionSignature, tx *sqlx.Tx) error
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 InsertValidatorNames(validatorNames []*dbtypes.ValidatorName, tx *sqlx.Tx) error
func InsertVoluntaryExits ¶
func InsertVoluntaryExits(voluntaryExits []*dbtypes.VoluntaryExit, tx *sqlx.Tx) error
func InsertWithdrawalRequestTxs ¶ added in v1.12.1
func InsertWithdrawalRequestTxs(withdrawalTxs []*dbtypes.WithdrawalRequestTx, tx *sqlx.Tx) error
func InsertWithdrawalRequests ¶ added in v1.11.0
func InsertWithdrawalRequests(elRequests []*dbtypes.WithdrawalRequest, tx *sqlx.Tx) error
func IsEpochSynchronized ¶
func MustCloseDB ¶
func MustCloseDB()
func MustInitDB ¶
func MustInitDB(dbcfg *types.DatabaseConfig)
func StreamOrphanedEpochs ¶ added in v1.18.3
func StreamOrphanedEpochs(epoch uint64, cb func(duty *dbtypes.OrphanedEpoch)) error
func StreamUnfinalizedBlocks ¶ added in v1.11.0
func StreamUnfinalizedBlocks(slot uint64, cb func(block *dbtypes.UnfinalizedBlock)) error
func StreamUnfinalizedDuties ¶ added in v1.11.0
func StreamUnfinalizedDuties(epoch uint64, cb func(duty *dbtypes.UnfinalizedDuty)) error
func StreamUnfinalizedEpochs ¶ added in v1.11.0
func StreamUnfinalizedEpochs(epoch uint64, cb func(duty *dbtypes.UnfinalizedEpoch)) error
func StreamValidatorsByIndexes ¶ added in v1.14.0
func UpdateConsolidationRequestTxHash ¶ added in v1.12.1
func UpdateElAccount ¶ added in v1.19.9
func UpdateElAccountsLastNonce ¶ added in v1.19.9
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 UpdateElBalance ¶ added in v1.19.9
func UpdateElToken ¶ added in v1.19.9
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 UpdateUnfinalizedBlockStatus ¶ added in v1.11.0
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(currentSlot uint64) (*BlobStatistics, error)
type CleanupStats ¶ added in v1.19.9
type CleanupStats struct {
ZeroBalancesDeleted int64
TransactionsDeleted int64
EventsDeleted int64
TokenTransfersDeleted int64
WithdrawalsDeleted int64
BlocksDeleted int64
}
CleanupStats holds statistics from cleanup operations.
func DeleteElDataBeforeBlockUid ¶ added in v1.19.9
func DeleteElDataBeforeBlockUid(blockUidThreshold uint64, dbTx *sqlx.Tx) (*CleanupStats, error)
DeleteElDataBeforeBlockUid deletes all EL data (transactions, events, transfers, blocks) with block_uid less than the specified threshold. Returns statistics about deleted rows. Uses batched deletes to avoid long locks - deletes in chunks and commits between batches. Note: dbTx parameter is ignored as batching requires managing its own transactions. 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(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(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(startEpoch, endEpoch uint64) ([]*OrphanedEpochParticipation, error)
GetOrphanedEpochParticipation gets participation data for orphaned epochs in the given range
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(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
- common.go
- consolidation_request_txs.go
- consolidation_requests.go
- convert.go
- deposit_txs.go
- deposits.go
- el_accounts.go
- el_balances.go
- el_blocks.go
- el_cleanup.go
- el_token_transfers.go
- el_tokens.go
- el_transactions.go
- el_tx_events.go
- el_withdrawals.go
- epochs.go
- explorer_state.go
- forks.go
- mev_blocks.go
- orphaned_blocks.go
- orphaned_epochs.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