Documentation
¶
Index ¶
- func NewS3Engine(config dtypes.S3BlockDBConfig) (types.BlockDbEngine, error)
- type S3Engine
- func (e *S3Engine) AddBlock(ctx context.Context, slot uint64, root []byte, ...) (bool, bool, error)
- func (e *S3Engine) AddDivergingEpochDuties(ctx context.Context, duties *types.EpochDuties) (int64, error)
- func (e *S3Engine) AddEpochDuties(ctx context.Context, duties *types.EpochDuties) (int64, error)
- func (e *S3Engine) AddExecData(ctx context.Context, slot uint64, blockHash []byte, data []byte) (int64, error)
- func (e *S3Engine) AddSlotBids(ctx context.Context, bids *types.SlotBids) (int64, error)
- func (e *S3Engine) Close() error
- func (e *S3Engine) DeleteExecData(ctx context.Context, slot uint64, blockHash []byte) error
- func (e *S3Engine) GetBlock(ctx context.Context, slot uint64, root []byte, flags types.BlockDataFlags, ...) (*types.BlockData, error)
- func (e *S3Engine) GetEpochDuties(ctx context.Context, firstSlot uint64) (*types.EpochDuties, error)
- func (e *S3Engine) GetEpochDutiesForRoot(ctx context.Context, firstSlot uint64, depRoot [32]byte) (*types.EpochDuties, error)
- func (e *S3Engine) GetExecData(ctx context.Context, slot uint64, blockHash []byte) ([]byte, error)
- func (e *S3Engine) GetExecDataRange(ctx context.Context, slot uint64, blockHash []byte, offset int64, length int64) ([]byte, error)
- func (e *S3Engine) GetExecDataTxSections(ctx context.Context, slot uint64, blockHash []byte, txHash []byte, ...) (*types.ExecDataTxSections, error)
- func (e *S3Engine) GetSlotBids(ctx context.Context, slot uint64) (*types.SlotBids, error)
- func (e *S3Engine) GetSlotCommittees(ctx context.Context, firstSlot uint64, slot uint64) ([][]uint64, error)
- func (e *S3Engine) GetSlotCommitteesForRoot(ctx context.Context, firstSlot uint64, slot uint64, depRoot [32]byte) ([][]uint64, error)
- func (e *S3Engine) GetSlotPtc(ctx context.Context, firstSlot uint64, slot uint64) ([]uint64, error)
- func (e *S3Engine) GetSlotPtcForRoot(ctx context.Context, firstSlot uint64, slot uint64, depRoot [32]byte) ([]uint64, error)
- func (e *S3Engine) GetStats() *S3Stats
- func (e *S3Engine) GetStoredComponents(ctx context.Context, slot uint64, root []byte) (types.BlockDataFlags, error)
- func (e *S3Engine) HasEpochDuties(ctx context.Context, firstSlot uint64) (bool, error)
- func (e *S3Engine) HasExecData(ctx context.Context, slot uint64, blockHash []byte) (bool, error)
- func (e *S3Engine) PruneEpochDutiesBefore(ctx context.Context, maxFirstSlot uint64) (int64, error)
- func (e *S3Engine) PruneExecDataBefore(ctx context.Context, maxSlot uint64) (int64, error)
- func (e *S3Engine) PruneSlotBidsBefore(ctx context.Context, maxSlot uint64) (int64, error)
- type S3Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewS3Engine ¶
func NewS3Engine(config dtypes.S3BlockDBConfig) (types.BlockDbEngine, error)
Types ¶
type S3Engine ¶
type S3Engine struct {
// contains filtered or unexported fields
}
func (*S3Engine) AddBlock ¶
func (e *S3Engine) AddBlock( ctx context.Context, slot uint64, root []byte, dataCb func() (*types.BlockData, error), ) (bool, bool, error)
AddBlock stores block data. Returns (added, updated, error).
func (*S3Engine) AddDivergingEpochDuties ¶ added in v1.24.4
func (e *S3Engine) AddDivergingEpochDuties(ctx context.Context, duties *types.EpochDuties) (int64, error)
AddDivergingEpochDuties stores a diverging fork's duties object keyed by its dependent root.
func (*S3Engine) AddEpochDuties ¶ added in v1.24.0
AddEpochDuties packs the resolved duties into a single DUTY object and stores it.
func (*S3Engine) AddExecData ¶ added in v1.20.3
func (e *S3Engine) AddExecData(ctx context.Context, slot uint64, blockHash []byte, data []byte) (int64, error)
AddExecData stores execution data for a block. Returns stored size.
func (*S3Engine) AddSlotBids ¶ added in v1.24.4
AddSlotBids packs the slot's bids into a single BIDS object and stores it.
func (*S3Engine) DeleteExecData ¶ added in v1.20.3
DeleteExecData deletes execution data for a specific block.
func (*S3Engine) GetBlock ¶
func (e *S3Engine) GetBlock( ctx context.Context, slot uint64, root []byte, flags types.BlockDataFlags, parseBlock func(uint64, []byte) (any, error), parsePayload func(uint64, []byte) (any, error), ) (*types.BlockData, error)
GetBlock retrieves block data with selective loading based on flags.
func (*S3Engine) GetEpochDuties ¶ added in v1.24.0
func (e *S3Engine) GetEpochDuties(ctx context.Context, firstSlot uint64) (*types.EpochDuties, error)
GetEpochDuties retrieves and decodes the full duties object for an epoch.
func (*S3Engine) GetEpochDutiesForRoot ¶ added in v1.24.4
func (e *S3Engine) GetEpochDutiesForRoot(ctx context.Context, firstSlot uint64, depRoot [32]byte) (*types.EpochDuties, error)
GetEpochDutiesForRoot retrieves and decodes the diverging-fork duties object for an epoch under the given dependent root. Returns nil, nil if not found.
func (*S3Engine) GetExecData ¶ added in v1.20.3
GetExecData retrieves full execution data for a block.
func (*S3Engine) GetExecDataRange ¶ added in v1.20.3
func (e *S3Engine) GetExecDataRange(ctx context.Context, slot uint64, blockHash []byte, offset int64, length int64) ([]byte, error)
GetExecDataRange retrieves a byte range of execution data using S3 Range header.
func (*S3Engine) GetExecDataTxSections ¶ added in v1.20.3
func (e *S3Engine) GetExecDataTxSections(ctx context.Context, slot uint64, blockHash []byte, txHash []byte, sections uint32) (*types.ExecDataTxSections, error)
GetExecDataTxSections retrieves all requested compressed sections for a single transaction using range reads. Three requests total:
- Read first 28 bytes (header + tx count)
- Read full index (tx count * 100 bytes)
- Read contiguous data range covering all requested sections
func (*S3Engine) GetSlotBids ¶ added in v1.24.4
GetSlotBids retrieves and decodes the bids object for a slot.
func (*S3Engine) GetSlotCommittees ¶ added in v1.24.0
func (e *S3Engine) GetSlotCommittees(ctx context.Context, firstSlot uint64, slot uint64) ([][]uint64, error)
GetSlotCommittees reads only the requested slot's attester committees using two range reads (header + slot span).
func (*S3Engine) GetSlotCommitteesForRoot ¶ added in v1.24.4
func (e *S3Engine) GetSlotCommitteesForRoot(ctx context.Context, firstSlot uint64, slot uint64, depRoot [32]byte) ([][]uint64, error)
GetSlotCommitteesForRoot reads a single slot's attester committees from a diverging-fork duties object.
func (*S3Engine) GetSlotPtc ¶ added in v1.24.0
GetSlotPtc reads only the requested slot's PTC members.
func (*S3Engine) GetSlotPtcForRoot ¶ added in v1.24.4
func (e *S3Engine) GetSlotPtcForRoot(ctx context.Context, firstSlot uint64, slot uint64, depRoot [32]byte) ([]uint64, error)
GetSlotPtcForRoot reads a single slot's PTC members from a diverging-fork duties object.
func (*S3Engine) GetStoredComponents ¶ added in v1.21.0
func (e *S3Engine) GetStoredComponents(ctx context.Context, slot uint64, root []byte) (types.BlockDataFlags, error)
GetStoredComponents returns which components exist for a block by reading metadata.
func (*S3Engine) HasEpochDuties ¶ added in v1.24.0
HasEpochDuties checks if a duties object exists for an epoch.
func (*S3Engine) HasExecData ¶ added in v1.20.3
HasExecData checks if execution data exists for a block.
func (*S3Engine) PruneEpochDutiesBefore ¶ added in v1.24.0
PruneEpochDutiesBefore deletes duties objects for all epochs whose first slot is before maxFirstSlot, filtering on the _duties suffix. Diverging-fork objects ({firstSlot}_{depRoot}_duties) also end in _duties and expose their firstSlot before the first underscore, so they are pruned by the same pass.
func (*S3Engine) PruneExecDataBefore ¶ added in v1.20.3
PruneExecDataBefore deletes execution data for all slots before maxSlot. Uses the shared tier prefix, filtering for _exec suffix.