Documentation ¶
Overview ¶
Package database exposes the postgres database
Index ¶
- Variables
- func NewNullInt64(i int64) sql.NullInt64
- func NewNullString(s string) sql.NullString
- type BlockBuilderEntry
- type BuilderBlockSubmissionEntry
- type DatabaseService
- func (s *DatabaseService) Close() error
- func (s *DatabaseService) GetBlockBuilderByPubkey(pubkey string) (*BlockBuilderEntry, error)
- func (s *DatabaseService) GetBlockBuilders() ([]*BlockBuilderEntry, error)
- func (s *DatabaseService) GetBlockSubmissionEntry(slot uint64, proposerPubkey, blockHash string) (entry *BuilderBlockSubmissionEntry, err error)
- func (s *DatabaseService) GetBuilderSubmissions(filters GetBuilderSubmissionsFilters) ([]*BuilderBlockSubmissionEntry, error)
- func (s *DatabaseService) GetExecutionPayloadEntryByID(executionPayloadID int64) (entry *ExecutionPayloadEntry, err error)
- func (s *DatabaseService) GetExecutionPayloadEntryBySlotPkHash(slot uint64, proposerPubkey, blockHash string) (entry *ExecutionPayloadEntry, err error)
- func (s *DatabaseService) GetNumDeliveredPayloads() (uint64, error)
- func (s *DatabaseService) GetRecentDeliveredPayloads(filters GetPayloadsFilters) ([]*DeliveredPayloadEntry, error)
- func (s *DatabaseService) IncBlockBuilderStatsAfterGetHeader(slot uint64, blockhash string) error
- func (s *DatabaseService) IncBlockBuilderStatsAfterGetPayload(slot uint64, blockhash string) error
- func (s *DatabaseService) SaveBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest, simError error, ...) (entry *BuilderBlockSubmissionEntry, err error)
- func (s *DatabaseService) SaveDeliveredPayload(slot uint64, proposerPubkey types.PubkeyHex, blockHash types.Hash, ...) error
- func (s *DatabaseService) SaveValidatorRegistration(registration types.SignedValidatorRegistration) error
- func (s *DatabaseService) SetBlockBuilderStatus(pubkey string, isHighPrio, isBlacklisted bool) error
- func (s *DatabaseService) UpsertBlockBuilderEntryAfterSubmission(lastSubmission *BuilderBlockSubmissionEntry, isError, isTopbid bool) error
- type DeliveredPayloadEntry
- type ExecutionPayloadEntry
- type GetBuilderSubmissionsFilters
- type GetPayloadsFilters
- type IDatabaseService
- type MockDB
- func (db MockDB) GetBlockBuilderByPubkey(pubkey string) (*BlockBuilderEntry, error)
- func (db MockDB) GetBlockBuilders() ([]*BlockBuilderEntry, error)
- func (db MockDB) GetBlockSubmissionEntry(slot uint64, proposerPubkey, blockHash string) (entry *BuilderBlockSubmissionEntry, err error)
- func (db MockDB) GetBuilderSubmissions(filters GetBuilderSubmissionsFilters) ([]*BuilderBlockSubmissionEntry, error)
- func (db MockDB) GetExecutionPayloadEntryByID(executionPayloadID int64) (entry *ExecutionPayloadEntry, err error)
- func (db MockDB) GetExecutionPayloadEntryBySlotPkHash(slot uint64, proposerPubkey, blockHash string) (entry *ExecutionPayloadEntry, err error)
- func (db MockDB) GetNumDeliveredPayloads() (uint64, error)
- func (db MockDB) GetRecentDeliveredPayloads(filters GetPayloadsFilters) ([]*DeliveredPayloadEntry, error)
- func (db MockDB) IncBlockBuilderStatsAfterGetHeader(slot uint64, blockhash string) error
- func (db MockDB) IncBlockBuilderStatsAfterGetPayload(slot uint64, blockhash string) error
- func (db MockDB) SaveBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest, simError error, ...) (entry *BuilderBlockSubmissionEntry, err error)
- func (db MockDB) SaveDeliveredPayload(slot uint64, proposerPubkey types.PubkeyHex, blockHash types.Hash, ...) error
- func (db MockDB) SaveValidatorRegistration(registration types.SignedValidatorRegistration) error
- func (db MockDB) SetBlockBuilderStatus(pubkey string, isHighPrio, isBlacklisted bool) error
- func (db MockDB) UpsertBlockBuilderEntryAfterSubmission(lastSubmission *BuilderBlockSubmissionEntry, isError, isTopbid bool) error
- type ValidatorRegistrationEntry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TableValidatorRegistration = tableBase + "_validator_registration" TableExecutionPayload = tableBase + "_execution_payload" TableBuilderBlockSubmission = tableBase + "_builder_block_submission" TableDeliveredPayload = tableBase + "_payload_delivered" TableBlockBuilder = tableBase + "_blockbuilder" )
Functions ¶
func NewNullInt64 ¶
func NewNullString ¶
func NewNullString(s string) sql.NullString
Types ¶
type BlockBuilderEntry ¶ added in v0.7.0
type BlockBuilderEntry struct { ID int64 `db:"id" json:"id"` InsertedAt time.Time `db:"inserted_at" json:"inserted_at"` BuilderPubkey string `db:"builder_pubkey" json:"builder_pubkey"` Description string `db:"description" json:"description"` IsHighPrio bool `db:"is_high_prio" json:"is_high_prio"` IsBlacklisted bool `db:"is_blacklisted" json:"is_blacklisted"` LastSubmissionID sql.NullInt64 `db:"last_submission_id" json:"last_submission_id"` LastSubmissionSlot uint64 `db:"last_submission_slot" json:"last_submission_slot"` NumSubmissionsTotal uint64 `db:"num_submissions_total" json:"num_submissions_total"` NumSubmissionsSimError uint64 `db:"num_submissions_simerror" json:"num_submissions_simerror"` NumSubmissionsTopBid uint64 `db:"num_submissions_topbid" json:"num_submissions_topbid"` NumSentGetHeader uint64 `db:"num_sent_getheader" json:"num_sent_getheader"` NumSentGetPayload uint64 `db:"num_sent_getpayload" json:"num_sent_getpayload"` }
type BuilderBlockSubmissionEntry ¶
type BuilderBlockSubmissionEntry struct { ID int64 `db:"id"` InsertedAt time.Time `db:"inserted_at"` // Delivered ExecutionPayload ExecutionPayloadID sql.NullInt64 `db:"execution_payload_id"` // Sim Result SimSuccess bool `db:"sim_success"` SimError string `db:"sim_error"` // BidTrace data Signature string `db:"signature"` Slot uint64 `db:"slot"` ParentHash string `db:"parent_hash"` BlockHash string `db:"block_hash"` BuilderPubkey string `db:"builder_pubkey"` ProposerPubkey string `db:"proposer_pubkey"` ProposerFeeRecipient string `db:"proposer_fee_recipient"` GasUsed uint64 `db:"gas_used"` GasLimit uint64 `db:"gas_limit"` NumTx int `db:"num_tx"` Value string `db:"value"` // Helpers Epoch uint64 `db:"epoch"` BlockNumber uint64 `db:"block_number"` WasMostProfitable bool `db:"was_most_profitable"` }
type DatabaseService ¶
func NewDatabaseService ¶
func NewDatabaseService(dsn string) (*DatabaseService, error)
func (*DatabaseService) Close ¶
func (s *DatabaseService) Close() error
func (*DatabaseService) GetBlockBuilderByPubkey ¶ added in v0.7.0
func (s *DatabaseService) GetBlockBuilderByPubkey(pubkey string) (*BlockBuilderEntry, error)
func (*DatabaseService) GetBlockBuilders ¶ added in v0.7.0
func (s *DatabaseService) GetBlockBuilders() ([]*BlockBuilderEntry, error)
func (*DatabaseService) GetBlockSubmissionEntry ¶
func (s *DatabaseService) GetBlockSubmissionEntry(slot uint64, proposerPubkey, blockHash string) (entry *BuilderBlockSubmissionEntry, err error)
func (*DatabaseService) GetBuilderSubmissions ¶ added in v0.5.1
func (s *DatabaseService) GetBuilderSubmissions(filters GetBuilderSubmissionsFilters) ([]*BuilderBlockSubmissionEntry, error)
func (*DatabaseService) GetExecutionPayloadEntryByID ¶
func (s *DatabaseService) GetExecutionPayloadEntryByID(executionPayloadID int64) (entry *ExecutionPayloadEntry, err error)
func (*DatabaseService) GetExecutionPayloadEntryBySlotPkHash ¶
func (s *DatabaseService) GetExecutionPayloadEntryBySlotPkHash(slot uint64, proposerPubkey, blockHash string) (entry *ExecutionPayloadEntry, err error)
func (*DatabaseService) GetNumDeliveredPayloads ¶
func (s *DatabaseService) GetNumDeliveredPayloads() (uint64, error)
func (*DatabaseService) GetRecentDeliveredPayloads ¶
func (s *DatabaseService) GetRecentDeliveredPayloads(filters GetPayloadsFilters) ([]*DeliveredPayloadEntry, error)
func (*DatabaseService) IncBlockBuilderStatsAfterGetHeader ¶ added in v0.7.0
func (s *DatabaseService) IncBlockBuilderStatsAfterGetHeader(slot uint64, blockhash string) error
func (*DatabaseService) IncBlockBuilderStatsAfterGetPayload ¶ added in v0.7.0
func (s *DatabaseService) IncBlockBuilderStatsAfterGetPayload(slot uint64, blockhash string) error
func (*DatabaseService) SaveBuilderBlockSubmission ¶
func (s *DatabaseService) SaveBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest, simError error, isMostProfitable bool) (entry *BuilderBlockSubmissionEntry, err error)
func (*DatabaseService) SaveDeliveredPayload ¶
func (s *DatabaseService) SaveDeliveredPayload(slot uint64, proposerPubkey types.PubkeyHex, blockHash types.Hash, signedBlindedBeaconBlock *types.SignedBlindedBeaconBlock) error
func (*DatabaseService) SaveValidatorRegistration ¶
func (s *DatabaseService) SaveValidatorRegistration(registration types.SignedValidatorRegistration) error
func (*DatabaseService) SetBlockBuilderStatus ¶ added in v0.7.0
func (s *DatabaseService) SetBlockBuilderStatus(pubkey string, isHighPrio, isBlacklisted bool) error
func (*DatabaseService) UpsertBlockBuilderEntryAfterSubmission ¶ added in v0.7.0
func (s *DatabaseService) UpsertBlockBuilderEntryAfterSubmission(lastSubmission *BuilderBlockSubmissionEntry, isError, isTopbid bool) error
type DeliveredPayloadEntry ¶
type DeliveredPayloadEntry struct { ID int64 `db:"id"` InsertedAt time.Time `db:"inserted_at"` ExecutionPayloadID sql.NullInt64 `db:"execution_payload_id"` SignedBlindedBeaconBlock sql.NullString `db:"signed_blinded_beacon_block"` Slot uint64 `db:"slot"` Epoch uint64 `db:"epoch"` BuilderPubkey string `db:"builder_pubkey"` ProposerPubkey string `db:"proposer_pubkey"` ProposerFeeRecipient string `db:"proposer_fee_recipient"` ParentHash string `db:"parent_hash"` BlockHash string `db:"block_hash"` BlockNumber uint64 `db:"block_number"` GasUsed uint64 `db:"gas_used"` GasLimit uint64 `db:"gas_limit"` NumTx int `db:"num_tx"` Value string `db:"value"` }
type ExecutionPayloadEntry ¶
type ExecutionPayloadEntry struct { ID int64 `db:"id"` InsertedAt time.Time `db:"inserted_at"` Slot uint64 `db:"slot"` ProposerPubkey string `db:"proposer_pubkey"` BlockHash string `db:"block_hash"` Version string `db:"version"` Payload string `db:"payload"` }
func PayloadToExecPayloadEntry ¶
func PayloadToExecPayloadEntry(payload *types.BuilderSubmitBlockRequest) (*ExecutionPayloadEntry, error)
type GetBuilderSubmissionsFilters ¶ added in v0.5.1
type GetPayloadsFilters ¶
type IDatabaseService ¶
type IDatabaseService interface { SaveValidatorRegistration(registration types.SignedValidatorRegistration) error SaveBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest, simError error, isMostProfitable bool) (entry *BuilderBlockSubmissionEntry, err error) SaveDeliveredPayload(slot uint64, proposerPubkey types.PubkeyHex, blockHash types.Hash, signedBlindedBeaconBlock *types.SignedBlindedBeaconBlock) error GetBlockSubmissionEntry(slot uint64, proposerPubkey, blockHash string) (entry *BuilderBlockSubmissionEntry, err error) GetExecutionPayloadEntryByID(executionPayloadID int64) (entry *ExecutionPayloadEntry, err error) GetExecutionPayloadEntryBySlotPkHash(slot uint64, proposerPubkey, blockHash string) (entry *ExecutionPayloadEntry, err error) GetRecentDeliveredPayloads(filters GetPayloadsFilters) ([]*DeliveredPayloadEntry, error) GetNumDeliveredPayloads() (uint64, error) GetBuilderSubmissions(filters GetBuilderSubmissionsFilters) ([]*BuilderBlockSubmissionEntry, error) GetBlockBuilders() ([]*BlockBuilderEntry, error) GetBlockBuilderByPubkey(pubkey string) (*BlockBuilderEntry, error) SetBlockBuilderStatus(pubkey string, isHighPrio, isBlacklisted bool) error UpsertBlockBuilderEntryAfterSubmission(lastSubmission *BuilderBlockSubmissionEntry, isError, isTopbid bool) error IncBlockBuilderStatsAfterGetHeader(slot uint64, blockhash string) error IncBlockBuilderStatsAfterGetPayload(slot uint64, blockhash string) error }
type MockDB ¶
type MockDB struct{}
func (MockDB) GetBlockBuilderByPubkey ¶ added in v0.7.0
func (db MockDB) GetBlockBuilderByPubkey(pubkey string) (*BlockBuilderEntry, error)
func (MockDB) GetBlockBuilders ¶ added in v0.7.0
func (db MockDB) GetBlockBuilders() ([]*BlockBuilderEntry, error)
func (MockDB) GetBlockSubmissionEntry ¶
func (db MockDB) GetBlockSubmissionEntry(slot uint64, proposerPubkey, blockHash string) (entry *BuilderBlockSubmissionEntry, err error)
func (MockDB) GetBuilderSubmissions ¶ added in v0.5.1
func (db MockDB) GetBuilderSubmissions(filters GetBuilderSubmissionsFilters) ([]*BuilderBlockSubmissionEntry, error)
func (MockDB) GetExecutionPayloadEntryByID ¶
func (db MockDB) GetExecutionPayloadEntryByID(executionPayloadID int64) (entry *ExecutionPayloadEntry, err error)
func (MockDB) GetExecutionPayloadEntryBySlotPkHash ¶
func (db MockDB) GetExecutionPayloadEntryBySlotPkHash(slot uint64, proposerPubkey, blockHash string) (entry *ExecutionPayloadEntry, err error)
func (MockDB) GetNumDeliveredPayloads ¶
func (MockDB) GetRecentDeliveredPayloads ¶
func (db MockDB) GetRecentDeliveredPayloads(filters GetPayloadsFilters) ([]*DeliveredPayloadEntry, error)
func (MockDB) IncBlockBuilderStatsAfterGetHeader ¶ added in v0.7.0
func (MockDB) IncBlockBuilderStatsAfterGetPayload ¶ added in v0.7.0
func (MockDB) SaveBuilderBlockSubmission ¶
func (db MockDB) SaveBuilderBlockSubmission(payload *types.BuilderSubmitBlockRequest, simError error, isMostProfitable bool) (entry *BuilderBlockSubmissionEntry, err error)
func (MockDB) SaveDeliveredPayload ¶
func (MockDB) SaveValidatorRegistration ¶
func (db MockDB) SaveValidatorRegistration(registration types.SignedValidatorRegistration) error
func (MockDB) SetBlockBuilderStatus ¶ added in v0.7.0
func (MockDB) UpsertBlockBuilderEntryAfterSubmission ¶ added in v0.7.0
func (db MockDB) UpsertBlockBuilderEntryAfterSubmission(lastSubmission *BuilderBlockSubmissionEntry, isError, isTopbid bool) error
Click to show internal directories.
Click to hide internal directories.