Documentation ¶
Index ¶
- Variables
- func BeaconSimpleIdx(ctx context.Context, sn snaptype.FileInfo, salt uint32, tmpDir string, ...) (err error)
- func CanDeleteTo(curBlockNum uint64, blocksInSnapshots uint64) (blockTo uint64)
- func CanRetire(curBlockNum uint64, blocksInSnapshots uint64, snapType snaptype.Enum, ...) (blockFrom, blockTo uint64, can bool)
- func DumpBeaconBlocks(ctx context.Context, db kv.RoDB, fromSlot, toSlot uint64, salt uint32, ...) error
- func DumpBlobSidecarsRange(ctx context.Context, db kv.RoDB, storage blob_storage.BlobStorage, ...) error
- func DumpBlobsSidecar(ctx context.Context, blobStorage blob_storage.BlobStorage, db kv.RoDB, ...) error
- func DumpBlocks(ctx context.Context, blockFrom, blockTo uint64, chainConfig *chain.Config, ...) error
- func DumpBodies(ctx context.Context, db kv.RoDB, _ *chain.Config, blockFrom, blockTo uint64, ...) (uint64, error)
- func DumpHeaders(ctx context.Context, db kv.RoDB, _ *chain.Config, blockFrom, blockTo uint64, ...) (uint64, error)
- func DumpTxs(ctx context.Context, db kv.RoDB, chainConfig *chain.Config, ...) (lastTx uint64, err error)
- func ForEachHeader(ctx context.Context, s *RoSnapshots, walker func(header *types.Header) error) error
- func ReadTxNumFuncFromBlockReader(ctx context.Context, r services.FullBlockReader) rawdbv3.ReadTxNumFunc
- func RemoveIncompatibleIndices(dirs datadir.Dirs) error
- func Segments(dir string, minBlock uint64) (res []snaptype.FileInfo, missingSnapshots []snapshotsync.Range, err error)
- func SegmentsCaplin(dir string, minBlock uint64) (res []snaptype.FileInfo, missingSnapshots []snapshotsync.Range, err error)
- func Sqeeze(ctx context.Context, dirs datadir.Dirs, from, to string, logger log.Logger) error
- type BeaconSnapshotReader
- type BlobCountBySlotFn
- type BlockReader
- func (r *BlockReader) AllTypes() []snaptype.Type
- func (r *BlockReader) BadHeaderNumber(ctx context.Context, tx kv.Getter, hash common.Hash) (blockHeight *uint64, err error)
- func (r *BlockReader) BlockByHash(ctx context.Context, db kv.Tx, hash common.Hash) (*types.Block, error)
- func (r *BlockReader) BlockByNumber(ctx context.Context, db kv.Tx, number uint64) (*types.Block, error)
- func (r *BlockReader) BlockWithSenders(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (block *types.Block, senders []common.Address, err error)
- func (r *BlockReader) Body(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (body *types.Body, txCount uint32, err error)
- func (r *BlockReader) BodyRlp(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (bodyRlp rlp.RawValue, err error)
- func (r *BlockReader) BodyWithTransactions(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (body *types.Body, err error)
- func (r *BlockReader) BorSnapshots() snapshotsync.BlockSnapshots
- func (r *BlockReader) BorStartEventId(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) (uint64, error)
- func (r *BlockReader) CanPruneTo(currentBlockInDB uint64) uint64
- func (r *BlockReader) CanonicalBodyForStorage(ctx context.Context, tx kv.Getter, blockNum uint64) (body *types.BodyForStorage, err error)
- func (r *BlockReader) CanonicalHash(ctx context.Context, tx kv.Getter, blockHeight uint64) (h common.Hash, ok bool, err error)
- func (r *BlockReader) Checkpoint(ctx context.Context, tx kv.Tx, checkpointId uint64) (*heimdall.Checkpoint, bool, error)
- func (r *BlockReader) CurrentBlock(db kv.Tx) (*types.Block, error)
- func (r *BlockReader) EventLookup(ctx context.Context, tx kv.Tx, txnHash common.Hash) (uint64, bool, error)
- func (r *BlockReader) EventsByBlock(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) ([]rlp.RawValue, error)
- func (r *BlockReader) EventsByIdFromSnapshot(from uint64, to time.Time, limit int) ([]*heimdall.EventRecordWithTime, bool, error)
- func (r *BlockReader) FirstTxnNumNotInSnapshots() uint64
- func (r *BlockReader) FreezingCfg() ethconfig.BlocksFreezing
- func (r *BlockReader) FrozenBlocks() uint64
- func (r *BlockReader) FrozenBorBlocks() uint64
- func (r *BlockReader) FrozenFiles() []string
- func (r *BlockReader) HasSenders(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (bool, error)
- func (r *BlockReader) Header(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (h *types.Header, err error)
- func (r *BlockReader) HeaderByHash(ctx context.Context, tx kv.Getter, hash common.Hash) (h *types.Header, err error)
- func (r *BlockReader) HeaderByNumber(ctx context.Context, tx kv.Getter, blockHeight uint64) (h *types.Header, err error)
- func (r *BlockReader) HeaderNumber(ctx context.Context, tx kv.Getter, hash common.Hash) (*uint64, error)
- func (r *BlockReader) HeadersRange(ctx context.Context, walker func(header *types.Header) error) error
- func (r *BlockReader) Integrity(ctx context.Context) error
- func (r *BlockReader) IntegrityTxnID(failFast bool) error
- func (r *BlockReader) IsCanonical(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (bool, error)
- func (r *BlockReader) IterateFrozenBodies(f func(blockNum, baseTxNum, txCount uint64) error) error
- func (r *BlockReader) LastCheckpointId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *BlockReader) LastEventId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *BlockReader) LastFrozenCheckpointId() uint64
- func (r *BlockReader) LastFrozenEventBlockNum() uint64
- func (r *BlockReader) LastFrozenEventId() uint64
- func (r *BlockReader) LastFrozenSpanId() uint64
- func (r *BlockReader) LastMilestoneId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *BlockReader) LastSpanId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *BlockReader) Milestone(ctx context.Context, tx kv.Tx, milestoneId uint64) (*heimdall.Milestone, bool, error)
- func (r *BlockReader) RawTransactions(ctx context.Context, tx kv.Getter, fromBlock, toBlock uint64) (txs [][]byte, err error)
- func (r *BlockReader) ReadAncestor(db kv.Getter, hash common.Hash, number, ancestor uint64, ...) (common.Hash, uint64)
- func (r *BlockReader) Ready(ctx context.Context) <-chan error
- func (r *BlockReader) Snapshots() snapshotsync.BlockSnapshots
- func (r *BlockReader) Span(ctx context.Context, tx kv.Tx, spanId uint64) (*heimdall.Span, bool, error)
- func (r *BlockReader) TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, txIdxInBlock int) (txn types.Transaction, err error)
- func (r *BlockReader) TxnLookup(_ context.Context, tx kv.Getter, txnHash common.Hash) (uint64, bool, error)
- type BlockRetire
- func (br *BlockRetire) BuildMissedIndicesIfNeed(ctx context.Context, logPrefix string, notifier services.DBEventNotifier, ...) error
- func (br *BlockRetire) GetWorkers() int
- func (br *BlockRetire) IO() (services.FullBlockReader, *blockio.BlockWriter)
- func (br *BlockRetire) PruneAncientBlocks(tx kv.RwTx, limit int) (deleted int, err error)
- func (br *BlockRetire) RetireBlocks(ctx context.Context, requestedMinBlockNum uint64, requestedMaxBlockNum uint64, ...) error
- func (br *BlockRetire) RetireBlocksInBackground(ctx context.Context, minBlockNum, maxBlockNum uint64, lvl log.Lvl, ...)
- func (br *BlockRetire) SetWorkers(workers int)
- func (br *BlockRetire) Writer() *RoSnapshots
- type CaplinSnapshots
- func (s *CaplinSnapshots) BlocksAvailable() uint64
- func (s *CaplinSnapshots) BuildMissingIndices(ctx context.Context, logger log.Logger) error
- func (s *CaplinSnapshots) Close()
- func (s *CaplinSnapshots) FrozenBlobs() uint64
- func (s *CaplinSnapshots) IndicesMax() uint64
- func (s *CaplinSnapshots) LS()
- func (s *CaplinSnapshots) LogStat(str string)
- func (s *CaplinSnapshots) OpenFolder() error
- func (s *CaplinSnapshots) OpenList(fileNames []string, optimistic bool) error
- func (s *CaplinSnapshots) ReadBlobSidecars(slot uint64) ([]*cltypes.BlobSidecar, error)
- func (s *CaplinSnapshots) ReadHeader(slot uint64) (*cltypes.SignedBeaconBlockHeader, uint64, libcommon.Hash, error)
- func (s *CaplinSnapshots) SegFileNames(from, to uint64) []string
- func (s *CaplinSnapshots) SegmentsMax() uint64
- func (s *CaplinSnapshots) View() *CaplinView
- type CaplinView
- func (v *CaplinView) BeaconBlocks() []*snapshotsync.VisibleSegment
- func (v *CaplinView) BeaconBlocksSegment(slot uint64) (*snapshotsync.VisibleSegment, bool)
- func (v *CaplinView) BlobSidecars() []*snapshotsync.VisibleSegment
- func (v *CaplinView) BlobSidecarsSegment(slot uint64) (*snapshotsync.VisibleSegment, bool)
- func (v *CaplinView) Close()
- type RemoteBlockReader
- func (r *RemoteBlockReader) AllTypes() []snaptype.Type
- func (r *RemoteBlockReader) BadHeaderNumber(ctx context.Context, tx kv.Getter, hash common.Hash) (blockHeight *uint64, err error)
- func (r *RemoteBlockReader) BlockByHash(ctx context.Context, db kv.Tx, hash common.Hash) (*types.Block, error)
- func (r *RemoteBlockReader) BlockByNumber(ctx context.Context, db kv.Tx, number uint64) (*types.Block, error)
- func (r *RemoteBlockReader) BlockWithSenders(ctx context.Context, _ kv.Getter, hash common.Hash, blockHeight uint64) (block *types.Block, senders []common.Address, err error)
- func (r *RemoteBlockReader) Body(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (body *types.Body, txCount uint32, err error)
- func (r *RemoteBlockReader) BodyRlp(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (bodyRlp rlp.RawValue, err error)
- func (r *RemoteBlockReader) BodyWithTransactions(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (body *types.Body, err error)
- func (r *RemoteBlockReader) BorSnapshots() snapshotsync.BlockSnapshots
- func (r *RemoteBlockReader) BorStartEventId(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) (uint64, error)
- func (r *RemoteBlockReader) CanPruneTo(uint64) uint64
- func (r *RemoteBlockReader) CanonicalBodyForStorage(ctx context.Context, tx kv.Getter, blockNum uint64) (body *types.BodyForStorage, err error)
- func (r *RemoteBlockReader) CanonicalHash(ctx context.Context, tx kv.Getter, blockHeight uint64) (h common.Hash, ok bool, err error)
- func (r *RemoteBlockReader) Checkpoint(ctx context.Context, tx kv.Tx, spanId uint64) (*heimdall.Checkpoint, bool, error)
- func (r *RemoteBlockReader) CurrentBlock(db kv.Tx) (*types.Block, error)
- func (r *RemoteBlockReader) EventLookup(ctx context.Context, tx kv.Tx, borTxnHash common.Hash) (uint64, bool, error)
- func (r *RemoteBlockReader) EventsByBlock(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) ([]rlp.RawValue, error)
- func (r *RemoteBlockReader) FirstTxnNumNotInSnapshots() uint64
- func (r *RemoteBlockReader) FreezingCfg() ethconfig.BlocksFreezing
- func (r *RemoteBlockReader) FrozenBlocks() uint64
- func (r *RemoteBlockReader) FrozenBorBlocks() uint64
- func (r *RemoteBlockReader) FrozenFiles() (list []string)
- func (r *RemoteBlockReader) HasSenders(ctx context.Context, _ kv.Getter, hash common.Hash, blockHeight uint64) (bool, error)
- func (r *RemoteBlockReader) Header(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (*types.Header, error)
- func (r *RemoteBlockReader) HeaderByHash(ctx context.Context, tx kv.Getter, hash common.Hash) (*types.Header, error)
- func (r *RemoteBlockReader) HeaderByNumber(ctx context.Context, tx kv.Getter, blockHeight uint64) (*types.Header, error)
- func (r *RemoteBlockReader) HeaderNumber(ctx context.Context, tx kv.Getter, hash common.Hash) (*uint64, error)
- func (r *RemoteBlockReader) HeadersRange(ctx context.Context, walker func(header *types.Header) error) error
- func (r *RemoteBlockReader) Integrity(_ context.Context) error
- func (r *RemoteBlockReader) IsCanonical(ctx context.Context, tx kv.Getter, hash common.Hash, blockHeight uint64) (bool, error)
- func (r *RemoteBlockReader) IterateFrozenBodies(_ func(blockNum uint64, baseTxNum uint64, txCount uint64) error) error
- func (r *RemoteBlockReader) LastCheckpointId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *RemoteBlockReader) LastEventId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *RemoteBlockReader) LastFrozenEventBlockNum() uint64
- func (r *RemoteBlockReader) LastFrozenEventId() uint64
- func (r *RemoteBlockReader) LastFrozenSpanId() uint64
- func (r *RemoteBlockReader) LastMilestoneId(ctx context.Context, tx kv.Tx) (uint64, bool, error)
- func (r *RemoteBlockReader) LastSpanId(_ context.Context, _ kv.Tx) (uint64, bool, error)
- func (r *RemoteBlockReader) Milestone(ctx context.Context, tx kv.Tx, spanId uint64) (*heimdall.Milestone, bool, error)
- func (r *RemoteBlockReader) RawTransactions(ctx context.Context, tx kv.Getter, fromBlock, toBlock uint64) (txs [][]byte, err error)
- func (r *RemoteBlockReader) ReadAncestor(db kv.Getter, hash common.Hash, number, ancestor uint64, ...) (common.Hash, uint64)
- func (r *RemoteBlockReader) Ready(ctx context.Context) <-chan error
- func (r *RemoteBlockReader) Snapshots() snapshotsync.BlockSnapshots
- func (r *RemoteBlockReader) Span(_ context.Context, _ kv.Tx, _ uint64) (*heimdall.Span, bool, error)
- func (r *RemoteBlockReader) TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, i int) (txn types.Transaction, err error)
- func (r *RemoteBlockReader) TxnLookup(ctx context.Context, tx kv.Getter, txnHash common.Hash) (uint64, bool, error)
- type RoSnapshots
- type View
- func (v *View) Bodies() []*snapshotsync.VisibleSegment
- func (v *View) BodiesSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
- func (v *View) Close()
- func (v *View) Headers() []*snapshotsync.VisibleSegment
- func (v *View) HeadersSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
- func (v *View) Txs() []*snapshotsync.VisibleSegment
- func (v *View) TxsSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
Constants ¶
This section is empty.
Variables ¶
var BlockCompressCfg = seg.Cfg{
MinPatternScore: 1_000,
MinPatternLen: 8,
MaxPatternLen: 128,
SamplingFactor: 4,
MaxDictPatterns: 16 * 1024,
DictReducerSoftLimit: 1_000_000,
Workers: 1,
}
var ErrNothingToPrune = errors.New("nothing to prune")
Functions ¶
func BeaconSimpleIdx ¶
func CanDeleteTo ¶
func DumpBeaconBlocks ¶
func DumpBlobSidecarsRange ¶
func DumpBlobSidecarsRange(ctx context.Context, db kv.RoDB, storage blob_storage.BlobStorage, fromSlot uint64, toSlot uint64, salt uint32, dirs datadir.Dirs, workers int, blobCountFn BlobCountBySlotFn, lvl log.Lvl, logger log.Logger) error
func DumpBlobsSidecar ¶
func DumpBlobsSidecar(ctx context.Context, blobStorage blob_storage.BlobStorage, db kv.RoDB, fromSlot, toSlot uint64, salt uint32, dirs datadir.Dirs, compressWorkers int, blobCountFn BlobCountBySlotFn, lvl log.Lvl, logger log.Logger) error
func DumpBlocks ¶
func DumpBodies ¶
func DumpBodies(ctx context.Context, db kv.RoDB, _ *chain.Config, blockFrom, blockTo uint64, firstTxNum firstKeyGetter, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (uint64, error)
DumpBodies - [from, to)
func DumpHeaders ¶
func DumpHeaders(ctx context.Context, db kv.RoDB, _ *chain.Config, blockFrom, blockTo uint64, _ firstKeyGetter, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (uint64, error)
DumpHeaders - [from, to)
func DumpTxs ¶
func DumpTxs(ctx context.Context, db kv.RoDB, chainConfig *chain.Config, blockFrom, blockTo uint64, _ firstKeyGetter, collect func([]byte) error, workers int, lvl log.Lvl, logger log.Logger) (lastTx uint64, err error)
DumpTxs - [from, to) Format: hash[0]_1byte + sender_address_2bytes + txnRlp
func ForEachHeader ¶
func ReadTxNumFuncFromBlockReader ¶
func ReadTxNumFuncFromBlockReader(ctx context.Context, r services.FullBlockReader) rawdbv3.ReadTxNumFunc
func SegmentsCaplin ¶
Types ¶
type BeaconSnapshotReader ¶
type BeaconSnapshotReader interface { // ReadBlock reads the block at the given slot. // If the block is not present, it returns nil. ReadBlockBySlot(ctx context.Context, tx kv.Tx, slot uint64) (*cltypes.SignedBeaconBlock, error) ReadBlockByRoot(ctx context.Context, tx kv.Tx, blockRoot libcommon.Hash) (*cltypes.SignedBeaconBlock, error) ReadHeaderByRoot(ctx context.Context, tx kv.Tx, blockRoot libcommon.Hash) (*cltypes.SignedBeaconBlockHeader, error) ReadBlindedBlockBySlot(ctx context.Context, tx kv.Tx, slot uint64) (*cltypes.SignedBlindedBeaconBlock, error) FrozenSlots() uint64 }
func NewBeaconSnapshotReader ¶
func NewBeaconSnapshotReader(snapshots *CaplinSnapshots, eth1Getter snapshot_format.ExecutionBlockReaderByNumber, cfg *clparams.BeaconChainConfig) BeaconSnapshotReader
type BlobCountBySlotFn ¶
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
BlockReader can read blocks from db and snapshots
func NewBlockReader ¶
func NewBlockReader(snapshots snapshotsync.BlockSnapshots, borSnapshots snapshotsync.BlockSnapshots, heimdallStore heimdall.Store, borBridge bridge.Store) *BlockReader
func (*BlockReader) AllTypes ¶
func (r *BlockReader) AllTypes() []snaptype.Type
func (*BlockReader) BadHeaderNumber ¶
func (*BlockReader) BlockByHash ¶
func (*BlockReader) BlockByNumber ¶
func (*BlockReader) BlockWithSenders ¶
func (*BlockReader) BodyWithTransactions ¶
func (*BlockReader) BorSnapshots ¶
func (r *BlockReader) BorSnapshots() snapshotsync.BlockSnapshots
func (*BlockReader) BorStartEventId ¶
func (*BlockReader) CanPruneTo ¶
func (r *BlockReader) CanPruneTo(currentBlockInDB uint64) uint64
func (*BlockReader) CanonicalBodyForStorage ¶
func (r *BlockReader) CanonicalBodyForStorage(ctx context.Context, tx kv.Getter, blockNum uint64) (body *types.BodyForStorage, err error)
func (*BlockReader) CanonicalHash ¶
func (*BlockReader) Checkpoint ¶
func (r *BlockReader) Checkpoint(ctx context.Context, tx kv.Tx, checkpointId uint64) (*heimdall.Checkpoint, bool, error)
func (*BlockReader) CurrentBlock ¶
func (*BlockReader) EventLookup ¶
func (*BlockReader) EventsByBlock ¶
func (*BlockReader) EventsByIdFromSnapshot ¶
func (r *BlockReader) EventsByIdFromSnapshot(from uint64, to time.Time, limit int) ([]*heimdall.EventRecordWithTime, bool, error)
EventsByIdFromSnapshot returns the list of records limited by time, or the number of records along with a bool value to signify if the records were limited by time
func (*BlockReader) FirstTxnNumNotInSnapshots ¶
func (r *BlockReader) FirstTxnNumNotInSnapshots() uint64
func (*BlockReader) FreezingCfg ¶
func (r *BlockReader) FreezingCfg() ethconfig.BlocksFreezing
func (*BlockReader) FrozenBlocks ¶
func (r *BlockReader) FrozenBlocks() uint64
func (*BlockReader) FrozenBorBlocks ¶
func (r *BlockReader) FrozenBorBlocks() uint64
func (*BlockReader) FrozenFiles ¶
func (r *BlockReader) FrozenFiles() []string
func (*BlockReader) HasSenders ¶
func (*BlockReader) HeaderByHash ¶
func (r *BlockReader) HeaderByHash(ctx context.Context, tx kv.Getter, hash common.Hash) (h *types.Header, err error)
HeaderByHash - will search header in all snapshots starting from recent
func (*BlockReader) HeaderByNumber ¶
func (*BlockReader) HeaderNumber ¶
func (*BlockReader) HeadersRange ¶
func (*BlockReader) IntegrityTxnID ¶
func (r *BlockReader) IntegrityTxnID(failFast bool) error
func (*BlockReader) IsCanonical ¶
func (*BlockReader) IterateFrozenBodies ¶
func (r *BlockReader) IterateFrozenBodies(f func(blockNum, baseTxNum, txCount uint64) error) error
func (*BlockReader) LastCheckpointId ¶
func (*BlockReader) LastEventId ¶
func (*BlockReader) LastFrozenCheckpointId ¶
func (r *BlockReader) LastFrozenCheckpointId() uint64
func (*BlockReader) LastFrozenEventBlockNum ¶
func (r *BlockReader) LastFrozenEventBlockNum() uint64
func (*BlockReader) LastFrozenEventId ¶
func (r *BlockReader) LastFrozenEventId() uint64
func (*BlockReader) LastFrozenSpanId ¶
func (r *BlockReader) LastFrozenSpanId() uint64
func (*BlockReader) LastMilestoneId ¶
func (*BlockReader) LastSpanId ¶
func (*BlockReader) RawTransactions ¶
func (*BlockReader) ReadAncestor ¶
func (*BlockReader) Snapshots ¶
func (r *BlockReader) Snapshots() snapshotsync.BlockSnapshots
func (*BlockReader) TxnByIdxInBlock ¶
func (r *BlockReader) TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, txIdxInBlock int) (txn types.Transaction, err error)
TxnByIdxInBlock - doesn't include system-transactions in the begin/end of block return nil if 0 < i < body.txCount
type BlockRetire ¶
type BlockRetire struct {
// contains filtered or unexported fields
}
func NewBlockRetire ¶
func NewBlockRetire( compressWorkers int, dirs datadir.Dirs, blockReader services.FullBlockReader, blockWriter *blockio.BlockWriter, db kv.RoDB, heimdallStore heimdall.Store, bridgeStore bridge.Store, chainConfig *chain.Config, config *ethconfig.Config, notifier services.DBEventNotifier, snBuildAllowed *semaphore.Weighted, logger log.Logger, ) *BlockRetire
func (*BlockRetire) BuildMissedIndicesIfNeed ¶
func (br *BlockRetire) BuildMissedIndicesIfNeed(ctx context.Context, logPrefix string, notifier services.DBEventNotifier, cc *chain.Config) error
func (*BlockRetire) GetWorkers ¶
func (br *BlockRetire) GetWorkers() int
func (*BlockRetire) IO ¶
func (br *BlockRetire) IO() (services.FullBlockReader, *blockio.BlockWriter)
func (*BlockRetire) PruneAncientBlocks ¶
func (*BlockRetire) RetireBlocks ¶
func (br *BlockRetire) RetireBlocks(ctx context.Context, requestedMinBlockNum uint64, requestedMaxBlockNum uint64, lvl log.Lvl, seedNewSnapshots func(downloadRequest []snapshotsync.DownloadRequest) error, onDeleteSnapshots func(l []string) error, onFinish func() error) error
func (*BlockRetire) RetireBlocksInBackground ¶
func (br *BlockRetire) RetireBlocksInBackground(ctx context.Context, minBlockNum, maxBlockNum uint64, lvl log.Lvl, seedNewSnapshots func(downloadRequest []snapshotsync.DownloadRequest) error, onDeleteSnapshots func(l []string) error, onFinishRetire func() error)
func (*BlockRetire) SetWorkers ¶
func (br *BlockRetire) SetWorkers(workers int)
func (*BlockRetire) Writer ¶
func (br *BlockRetire) Writer() *RoSnapshots
type CaplinSnapshots ¶
type CaplinSnapshots struct { Salt uint32 // contains filtered or unexported fields }
func NewCaplinSnapshots ¶
func NewCaplinSnapshots(cfg ethconfig.BlocksFreezing, beaconCfg *clparams.BeaconChainConfig, dirs datadir.Dirs, logger log.Logger) *CaplinSnapshots
NewCaplinSnapshots - opens all snapshots. But to simplify everything:
- it opens snapshots only on App start and immutable after
- all snapshots of given blocks range must exist - to make this blocks range available
- gaps are not allowed
- segment have [from:to) semantic
func (*CaplinSnapshots) BlocksAvailable ¶
func (s *CaplinSnapshots) BlocksAvailable() uint64
func (*CaplinSnapshots) BuildMissingIndices ¶
func (s *CaplinSnapshots) BuildMissingIndices(ctx context.Context, logger log.Logger) error
func (*CaplinSnapshots) Close ¶
func (s *CaplinSnapshots) Close()
func (*CaplinSnapshots) FrozenBlobs ¶
func (s *CaplinSnapshots) FrozenBlobs() uint64
func (*CaplinSnapshots) IndicesMax ¶
func (s *CaplinSnapshots) IndicesMax() uint64
func (*CaplinSnapshots) LS ¶
func (s *CaplinSnapshots) LS()
func (*CaplinSnapshots) LogStat ¶
func (s *CaplinSnapshots) LogStat(str string)
func (*CaplinSnapshots) OpenFolder ¶
func (s *CaplinSnapshots) OpenFolder() error
func (*CaplinSnapshots) OpenList ¶
func (s *CaplinSnapshots) OpenList(fileNames []string, optimistic bool) error
OpenList stops on optimistic=false, continue opening files on optimistic=true
func (*CaplinSnapshots) ReadBlobSidecars ¶
func (s *CaplinSnapshots) ReadBlobSidecars(slot uint64) ([]*cltypes.BlobSidecar, error)
func (*CaplinSnapshots) ReadHeader ¶
func (s *CaplinSnapshots) ReadHeader(slot uint64) (*cltypes.SignedBeaconBlockHeader, uint64, libcommon.Hash, error)
func (*CaplinSnapshots) SegFileNames ¶
func (s *CaplinSnapshots) SegFileNames(from, to uint64) []string
func (*CaplinSnapshots) SegmentsMax ¶
func (s *CaplinSnapshots) SegmentsMax() uint64
func (*CaplinSnapshots) View ¶
func (s *CaplinSnapshots) View() *CaplinView
type CaplinView ¶
type CaplinView struct { BeaconBlockRotx *snapshotsync.RoTx BlobSidecarRotx *snapshotsync.RoTx // contains filtered or unexported fields }
func (*CaplinView) BeaconBlocks ¶
func (v *CaplinView) BeaconBlocks() []*snapshotsync.VisibleSegment
func (*CaplinView) BeaconBlocksSegment ¶
func (v *CaplinView) BeaconBlocksSegment(slot uint64) (*snapshotsync.VisibleSegment, bool)
func (*CaplinView) BlobSidecars ¶
func (v *CaplinView) BlobSidecars() []*snapshotsync.VisibleSegment
func (*CaplinView) BlobSidecarsSegment ¶
func (v *CaplinView) BlobSidecarsSegment(slot uint64) (*snapshotsync.VisibleSegment, bool)
func (*CaplinView) Close ¶
func (v *CaplinView) Close()
type RemoteBlockReader ¶
type RemoteBlockReader struct {
// contains filtered or unexported fields
}
func NewRemoteBlockReader ¶
func NewRemoteBlockReader(client remote.ETHBACKENDClient) *RemoteBlockReader
func (*RemoteBlockReader) AllTypes ¶
func (r *RemoteBlockReader) AllTypes() []snaptype.Type
func (*RemoteBlockReader) BadHeaderNumber ¶
func (*RemoteBlockReader) BlockByHash ¶
func (*RemoteBlockReader) BlockByNumber ¶
func (*RemoteBlockReader) BlockWithSenders ¶
func (*RemoteBlockReader) BodyWithTransactions ¶
func (*RemoteBlockReader) BorSnapshots ¶
func (r *RemoteBlockReader) BorSnapshots() snapshotsync.BlockSnapshots
func (*RemoteBlockReader) BorStartEventId ¶
func (*RemoteBlockReader) CanPruneTo ¶
func (r *RemoteBlockReader) CanPruneTo(uint64) uint64
func (*RemoteBlockReader) CanonicalBodyForStorage ¶
func (r *RemoteBlockReader) CanonicalBodyForStorage(ctx context.Context, tx kv.Getter, blockNum uint64) (body *types.BodyForStorage, err error)
func (*RemoteBlockReader) CanonicalHash ¶
func (*RemoteBlockReader) Checkpoint ¶
func (r *RemoteBlockReader) Checkpoint(ctx context.Context, tx kv.Tx, spanId uint64) (*heimdall.Checkpoint, bool, error)
func (*RemoteBlockReader) CurrentBlock ¶
func (*RemoteBlockReader) EventLookup ¶
func (*RemoteBlockReader) EventsByBlock ¶
func (*RemoteBlockReader) FirstTxnNumNotInSnapshots ¶
func (r *RemoteBlockReader) FirstTxnNumNotInSnapshots() uint64
func (*RemoteBlockReader) FreezingCfg ¶
func (r *RemoteBlockReader) FreezingCfg() ethconfig.BlocksFreezing
func (*RemoteBlockReader) FrozenBlocks ¶
func (r *RemoteBlockReader) FrozenBlocks() uint64
func (*RemoteBlockReader) FrozenBorBlocks ¶
func (r *RemoteBlockReader) FrozenBorBlocks() uint64
func (*RemoteBlockReader) FrozenFiles ¶
func (r *RemoteBlockReader) FrozenFiles() (list []string)
func (*RemoteBlockReader) HasSenders ¶
func (*RemoteBlockReader) HeaderByHash ¶
func (*RemoteBlockReader) HeaderByNumber ¶
func (*RemoteBlockReader) HeaderNumber ¶
func (*RemoteBlockReader) HeadersRange ¶
func (*RemoteBlockReader) Integrity ¶
func (r *RemoteBlockReader) Integrity(_ context.Context) error
func (*RemoteBlockReader) IsCanonical ¶
func (*RemoteBlockReader) IterateFrozenBodies ¶
func (*RemoteBlockReader) LastCheckpointId ¶
func (*RemoteBlockReader) LastEventId ¶
func (*RemoteBlockReader) LastFrozenEventBlockNum ¶
func (r *RemoteBlockReader) LastFrozenEventBlockNum() uint64
func (*RemoteBlockReader) LastFrozenEventId ¶
func (r *RemoteBlockReader) LastFrozenEventId() uint64
func (*RemoteBlockReader) LastFrozenSpanId ¶
func (r *RemoteBlockReader) LastFrozenSpanId() uint64
func (*RemoteBlockReader) LastMilestoneId ¶
func (*RemoteBlockReader) LastSpanId ¶
func (*RemoteBlockReader) RawTransactions ¶
func (*RemoteBlockReader) ReadAncestor ¶
func (*RemoteBlockReader) Ready ¶
func (r *RemoteBlockReader) Ready(ctx context.Context) <-chan error
func (*RemoteBlockReader) Snapshots ¶
func (r *RemoteBlockReader) Snapshots() snapshotsync.BlockSnapshots
func (*RemoteBlockReader) TxnByIdxInBlock ¶
func (r *RemoteBlockReader) TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, i int) (txn types.Transaction, err error)
type RoSnapshots ¶
type RoSnapshots struct {
snapshotsync.RoSnapshots
}
func NewRoSnapshots ¶
func NewRoSnapshots(cfg ethconfig.BlocksFreezing, snapDir string, segmentsMin uint64, logger log.Logger) *RoSnapshots
NewRoSnapshots - opens all snapshots. But to simplify everything:
- it opens snapshots only on App start and immutable after
- all snapshots of given blocks range must exist - to make this blocks range available
- gaps are not allowed
- segment have [from:to) semantic
func (*RoSnapshots) View ¶
func (s *RoSnapshots) View() *View
type View ¶
type View struct {
// contains filtered or unexported fields
}
func (*View) Bodies ¶
func (v *View) Bodies() []*snapshotsync.VisibleSegment
func (*View) BodiesSegment ¶
func (v *View) BodiesSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
func (*View) Headers ¶
func (v *View) Headers() []*snapshotsync.VisibleSegment
func (*View) HeadersSegment ¶
func (v *View) HeadersSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)
func (*View) Txs ¶
func (v *View) Txs() []*snapshotsync.VisibleSegment
func (*View) TxsSegment ¶
func (v *View) TxsSegment(blockNum uint64) (*snapshotsync.VisibleSegment, bool)