Documentation ¶
Index ¶
- Variables
- func BeaconBlocksIdx(ctx context.Context, sn snaptype.FileInfo, segmentFilePath string, ...) (err error)
- func BodiesIdx(ctx context.Context, segmentFilePath string, firstBlockNumInSegment uint64, ...) (err error)
- func BorEventsIdx(ctx context.Context, segmentFilePath string, blockFrom, blockTo uint64, ...) (err error)
- func BorSpansIdx(ctx context.Context, segmentFilePath string, blockFrom, blockTo uint64, ...) (err error)
- func BuildBorMissedIndices(logPrefix string, ctx context.Context, dirs datadir.Dirs, ...) error
- func BuildMissedIndices(logPrefix string, ctx context.Context, dirs datadir.Dirs, ...) error
- func CanDeleteTo(curBlockNum uint64, blocksInSnapshots uint64) (blockTo uint64)
- func CanRetire(curBlockNum uint64, blocksInSnapshots uint64) (blockFrom, blockTo uint64, can bool)
- func DumpBeaconBlocks(ctx context.Context, db kv.RoDB, b persistence.BlockSource, ...) error
- func DumpBlocks(ctx context.Context, blockFrom, blockTo, blocksPerFile uint64, ...) error
- func DumpBodies(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, firstTxNum uint64, ...) error
- func DumpBorBlocks(ctx context.Context, chainConfig *chain.Config, ...) error
- func DumpBorEvents(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, ...) error
- func DumpBorSpans(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, ...) error
- func DumpHeaders(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, ...) error
- func DumpTxs(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, ...) (expectedCount int, err error)
- func ForEachHeader(ctx context.Context, s *RoSnapshots, walker func(header *types.Header) error) error
- func HeadersIdx(ctx context.Context, chainConfig *chain.Config, segmentFilePath string, ...) (err error)
- func Idx(ctx context.Context, d *compress.Decompressor, firstDataID uint64, ...) error
- func TransactionsIdx(ctx context.Context, chainConfig *chain.Config, blockFrom, blockTo uint64, ...) (err error)
- type BeaconBlockSegment
- type BeaconSnapshotReader
- type BlockReader
- 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, txAmount 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() services.BlockSnapshots
- func (r *BlockReader) CanPruneTo(currentBlockInDB uint64) uint64
- func (r *BlockReader) CanonicalHash(ctx context.Context, tx kv.Getter, blockHeight uint64) (h common.Hash, err error)
- func (r *BlockReader) CurrentBlock(db kv.Tx) (*types.Block, error)
- func (r *BlockReader) EventLookup(ctx context.Context, tx kv.Getter, 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) FirstTxNumNotInSnapshots() 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) HeadersRange(ctx context.Context, walker func(header *types.Header) error) error
- func (r *BlockReader) Integrity(ctx context.Context) error
- func (r *BlockReader) IterateFrozenBodies(f func(blockNum, baseTxNum, txAmount uint64) error) error
- func (r *BlockReader) LastFrozenEventID() uint64
- func (r *BlockReader) LastFrozenSpanID() uint64
- 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) Snapshots() services.BlockSnapshots
- func (r *BlockReader) Span(ctx context.Context, tx kv.Getter, spanId uint64) ([]byte, error)
- func (r *BlockReader) TxnByIdxInBlock(ctx context.Context, tx kv.Getter, blockNum uint64, txIdxInBlock int) (txn types.Transaction, err error)
- func (r *BlockReader) TxnLookup(ctx 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) HasNewFrozenFiles() bool
- func (br *BlockRetire) PruneAncientBlocks(tx kv.RwTx, limit int, includeBor bool) error
- func (br *BlockRetire) RetireBlocks(ctx context.Context, blockFrom, blockTo uint64, lvl log.Lvl, ...) error
- func (br *BlockRetire) RetireBlocksInBackground(ctx context.Context, forwardProgress uint64, includeBor bool, lvl log.Lvl, ...)
- func (br *BlockRetire) RetireBorBlocks(ctx context.Context, blockFrom, blockTo uint64, lvl log.Lvl, ...) error
- type BodySegment
- type BorEventSegment
- type BorMerger
- type BorRoSnapshots
- func (s *BorRoSnapshots) BlocksAvailable() uint64
- func (s *BorRoSnapshots) Cfg() ethconfig.BlocksFreezing
- func (s *BorRoSnapshots) Close()
- func (s *BorRoSnapshots) Dir() string
- func (s *BorRoSnapshots) DisableReadAhead()
- func (s *BorRoSnapshots) EnableMadvNormal() *BorRoSnapshots
- func (s *BorRoSnapshots) EnableMadvWillNeed() *BorRoSnapshots
- func (s *BorRoSnapshots) EnableReadAhead() *BorRoSnapshots
- func (s *BorRoSnapshots) EnsureExpectedBlocksAreAvailable(cfg *snapcfg.Cfg) error
- func (s *BorRoSnapshots) Files() (list []string)
- func (s *BorRoSnapshots) IndicesMax() uint64
- func (s *BorRoSnapshots) IndicesReady() bool
- func (s *BorRoSnapshots) LogStat()
- func (s *BorRoSnapshots) OptimisticReopenWithDB(db kv.RoDB)
- func (s *BorRoSnapshots) OptimisticalyReopenFolder()
- func (s *BorRoSnapshots) OptimisticalyReopenWithDB(db kv.RoDB)
- func (s *BorRoSnapshots) PrintDebug()
- func (s *BorRoSnapshots) Ranges() (ranges []Range)
- func (s *BorRoSnapshots) ReopenFolder() error
- func (s *BorRoSnapshots) ReopenList(fileNames []string, optimistic bool) error
- func (s *BorRoSnapshots) ReopenWithDB(db kv.RoDB) error
- func (s *BorRoSnapshots) ScanDir() (map[string]struct{}, []*services.Range, error)
- func (s *BorRoSnapshots) SegmentsMax() uint64
- func (s *BorRoSnapshots) SegmentsReady() bool
- func (s *BorRoSnapshots) View() *BorView
- type BorSpanSegment
- type BorView
- type CaplinSnapshots
- func (s *CaplinSnapshots) BlocksAvailable() uint64
- func (s *CaplinSnapshots) BuildMissingIndices(ctx context.Context, logger log.Logger, lvl log.Lvl) error
- func (s *CaplinSnapshots) IndicesMax() uint64
- func (s *CaplinSnapshots) ReadHeader(slot uint64) (*cltypes.SignedBeaconBlockHeader, uint64, libcommon.Hash, error)
- func (s *CaplinSnapshots) ReopenFolder() error
- func (s *CaplinSnapshots) ReopenList(fileNames []string, optimistic bool) error
- func (s *CaplinSnapshots) SegFilePaths(from, to uint64) []string
- func (s *CaplinSnapshots) SegmentsMax() uint64
- func (s *CaplinSnapshots) View() *CaplinView
- type CaplinView
- type HeaderSegment
- type Merger
- type Range
- type Ranges
- type RemoteBlockReader
- 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, txAmount 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() services.BlockSnapshots
- func (r *RemoteBlockReader) CanPruneTo(uint64) uint64
- func (r *RemoteBlockReader) CanonicalHash(ctx context.Context, tx kv.Getter, blockHeight uint64) (common.Hash, error)
- func (r *RemoteBlockReader) CurrentBlock(db kv.Tx) (*types.Block, error)
- func (r *RemoteBlockReader) EventLookup(ctx context.Context, tx kv.Getter, txnHash 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) 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) HeadersRange(ctx context.Context, walker func(header *types.Header) error) 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) Snapshots() services.BlockSnapshots
- func (r *RemoteBlockReader) Span(ctx context.Context, tx kv.Getter, spanId uint64) ([]byte, 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
- func (s *RoSnapshots) AddSnapshotsToSilkworm(silkwormInstance *silkworm.Silkworm) error
- func (s *RoSnapshots) BlocksAvailable() uint64
- func (s *RoSnapshots) Cfg() ethconfig.BlocksFreezing
- func (s *RoSnapshots) Close()
- func (s *RoSnapshots) Dir() string
- func (s *RoSnapshots) DisableReadAhead()
- func (s *RoSnapshots) EnableMadvNormal() *RoSnapshots
- func (s *RoSnapshots) EnableMadvWillNeed() *RoSnapshots
- func (s *RoSnapshots) EnableReadAhead() *RoSnapshots
- func (s *RoSnapshots) EnsureExpectedBlocksAreAvailable(cfg *snapcfg.Cfg) error
- func (s *RoSnapshots) Files() (list []string)
- func (s *RoSnapshots) IndicesMax() uint64
- func (s *RoSnapshots) IndicesReady() bool
- func (s *RoSnapshots) LogStat()
- func (s *RoSnapshots) OptimisticReopenWithDB(db kv.RoDB)
- func (s *RoSnapshots) OptimisticalyReopenFolder()
- func (s *RoSnapshots) OptimisticalyReopenWithDB(db kv.RoDB)
- func (s *RoSnapshots) PrintDebug()
- func (s *RoSnapshots) Ranges() (ranges []Range)
- func (s *RoSnapshots) ReopenFolder() error
- func (s *RoSnapshots) ReopenList(fileNames []string, optimistic bool) error
- func (s *RoSnapshots) ReopenWithDB(db kv.RoDB) error
- func (s *RoSnapshots) ScanDir() (map[string]struct{}, []*services.Range, error)
- func (s *RoSnapshots) SegmentsMax() uint64
- func (s *RoSnapshots) SegmentsReady() bool
- func (s *RoSnapshots) View() *View
- type TxnSegment
- type View
- func (v *View) Bodies() []*BodySegment
- func (v *View) BodiesSegment(blockNum uint64) (*BodySegment, bool)
- func (v *View) Close()
- func (v *View) Headers() []*HeaderSegment
- func (v *View) HeadersSegment(blockNum uint64) (*HeaderSegment, bool)
- func (v *View) Txs() []*TxnSegment
- func (v *View) TxsSegment(blockNum uint64) (*TxnSegment, bool)
Constants ¶
This section is empty.
Variables ¶
var EmptyTxHash = common2.Hash{}
var MergeSteps = []uint64{500_000, 100_000, 10_000}
var RecentMergeSteps = []uint64{100_000, 10_000}
Functions ¶
func BeaconBlocksIdx ¶
func BorEventsIdx ¶
func BorSpansIdx ¶
func BuildBorMissedIndices ¶
func BuildMissedIndices ¶
func CanDeleteTo ¶
func DumpBeaconBlocks ¶
func DumpBeaconBlocks(ctx context.Context, db kv.RoDB, b persistence.BlockSource, fromSlot, toSlot, blocksPerFile uint64, tmpDir, snapDir string, workers int, lvl log.Lvl, logger log.Logger) error
func DumpBlocks ¶
func DumpBodies ¶
func DumpBodies(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, firstTxNum uint64, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) error
DumpBodies - [from, to)
func DumpBorBlocks ¶
func DumpBorEvents ¶
func DumpBorEvents(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) error
DumpBorEvents - [from, to)
func DumpBorSpans ¶
func DumpBorSpans(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) error
DumpBorSpans - [from, to)
func DumpHeaders ¶
func DumpHeaders(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) error
DumpHeaders - [from, to)
func DumpTxs ¶
func DumpTxs(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, chainConfig *chain.Config, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) (expectedCount int, err error)
DumpTxs - [from, to) Format: hash[0]_1byte + sender_address_2bytes + txnRlp
func ForEachHeader ¶
func HeadersIdx ¶
func HeadersIdx(ctx context.Context, chainConfig *chain.Config, segmentFilePath string, firstBlockNumInSegment uint64, tmpDir string, p *background.Progress, lvl log.Lvl, logger log.Logger) (err error)
HeadersIdx - headerHash -> offset (analog of kv.HeaderNumber)
Types ¶
type BeaconBlockSegment ¶
type BeaconBlockSegment struct {
// contains filtered or unexported fields
}
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) FrozenSlots() uint64 }
func NewBeaconSnapshotReader ¶
func NewBeaconSnapshotReader(snapshots *CaplinSnapshots, eth1Getter snapshot_format.ExecutionBlockReaderByNumber, beaconDB persistence.BlockSource, cfg *clparams.BeaconChainConfig) BeaconSnapshotReader
type BlockReader ¶
type BlockReader struct {
// contains filtered or unexported fields
}
BlockReader can read blocks from db and snapshots
func NewBlockReader ¶
func NewBlockReader(snapshots services.BlockSnapshots, borSnapshots services.BlockSnapshots) *BlockReader
func (*BlockReader) BadHeaderNumber ¶
func (*BlockReader) BlockByHash ¶
func (*BlockReader) BlockByNumber ¶
func (*BlockReader) BlockWithSenders ¶
func (*BlockReader) BodyWithTransactions ¶
func (*BlockReader) BorSnapshots ¶
func (r *BlockReader) BorSnapshots() services.BlockSnapshots
func (*BlockReader) CanPruneTo ¶
func (r *BlockReader) CanPruneTo(currentBlockInDB uint64) uint64
func (*BlockReader) CanonicalHash ¶
func (*BlockReader) CurrentBlock ¶
func (*BlockReader) EventLookup ¶
func (*BlockReader) EventsByBlock ¶
func (*BlockReader) FirstTxNumNotInSnapshots ¶
func (r *BlockReader) FirstTxNumNotInSnapshots() 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) HeadersRange ¶
func (*BlockReader) IterateFrozenBodies ¶
func (r *BlockReader) IterateFrozenBodies(f func(blockNum, baseTxNum, txAmount uint64) error) error
func (*BlockReader) LastFrozenEventID ¶
func (r *BlockReader) LastFrozenEventID() uint64
func (*BlockReader) LastFrozenSpanID ¶
func (r *BlockReader) LastFrozenSpanID() uint64
func (*BlockReader) RawTransactions ¶
func (*BlockReader) ReadAncestor ¶
func (*BlockReader) Snapshots ¶
func (r *BlockReader) Snapshots() services.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.TxAmount
type BlockRetire ¶
type BlockRetire struct {
// contains filtered or unexported fields
}
func NewBlockRetire ¶
func NewBlockRetire(workers int, dirs datadir.Dirs, blockReader services.FullBlockReader, blockWriter *blockio.BlockWriter, db kv.RoDB, notifier services.DBEventNotifier, 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) HasNewFrozenFiles ¶
func (br *BlockRetire) HasNewFrozenFiles() bool
func (*BlockRetire) PruneAncientBlocks ¶
func (*BlockRetire) RetireBlocks ¶
func (br *BlockRetire) RetireBlocks(ctx context.Context, blockFrom, blockTo uint64, lvl log.Lvl, seedNewSnapshots func(downloadRequest []services.DownloadRequest) error, onDelete func(l []string) error) error
func (*BlockRetire) RetireBlocksInBackground ¶
func (br *BlockRetire) RetireBlocksInBackground(ctx context.Context, forwardProgress uint64, includeBor bool, lvl log.Lvl, seedNewSnapshots func(downloadRequest []services.DownloadRequest) error, onDeleteSnapshots func(l []string) error)
func (*BlockRetire) RetireBorBlocks ¶
func (br *BlockRetire) RetireBorBlocks(ctx context.Context, blockFrom, blockTo uint64, lvl log.Lvl, seedNewSnapshots func(downloadRequest []services.DownloadRequest) error) error
type BodySegment ¶
type BodySegment struct {
// contains filtered or unexported fields
}
type BorEventSegment ¶
type BorMerger ¶
type BorMerger struct {
// contains filtered or unexported fields
}
func NewBorMerger ¶
func (*BorMerger) FindMergeRanges ¶
type BorRoSnapshots ¶
type BorRoSnapshots struct { Events *borEventSegments Spans *borSpanSegments // contains filtered or unexported fields }
func NewBorRoSnapshots ¶
func NewBorRoSnapshots(cfg ethconfig.BlocksFreezing, snapDir string, logger log.Logger) *BorRoSnapshots
NewBorRoSnapshots - opens all bor 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 (*BorRoSnapshots) BlocksAvailable ¶
func (s *BorRoSnapshots) BlocksAvailable() uint64
func (*BorRoSnapshots) Cfg ¶
func (s *BorRoSnapshots) Cfg() ethconfig.BlocksFreezing
func (*BorRoSnapshots) Close ¶
func (s *BorRoSnapshots) Close()
func (*BorRoSnapshots) Dir ¶
func (s *BorRoSnapshots) Dir() string
func (*BorRoSnapshots) DisableReadAhead ¶
func (s *BorRoSnapshots) DisableReadAhead()
DisableReadAhead - usage: `defer d.EnableReadAhead().DisableReadAhead()`. Please don't use this funcs without `defer` to avoid leak.
func (*BorRoSnapshots) EnableMadvNormal ¶
func (s *BorRoSnapshots) EnableMadvNormal() *BorRoSnapshots
func (*BorRoSnapshots) EnableMadvWillNeed ¶
func (s *BorRoSnapshots) EnableMadvWillNeed() *BorRoSnapshots
func (*BorRoSnapshots) EnableReadAhead ¶
func (s *BorRoSnapshots) EnableReadAhead() *BorRoSnapshots
func (*BorRoSnapshots) EnsureExpectedBlocksAreAvailable ¶
func (s *BorRoSnapshots) EnsureExpectedBlocksAreAvailable(cfg *snapcfg.Cfg) error
func (*BorRoSnapshots) Files ¶
func (s *BorRoSnapshots) Files() (list []string)
func (*BorRoSnapshots) IndicesMax ¶
func (s *BorRoSnapshots) IndicesMax() uint64
func (*BorRoSnapshots) IndicesReady ¶
func (s *BorRoSnapshots) IndicesReady() bool
func (*BorRoSnapshots) LogStat ¶
func (s *BorRoSnapshots) LogStat()
func (*BorRoSnapshots) OptimisticReopenWithDB ¶
func (s *BorRoSnapshots) OptimisticReopenWithDB(db kv.RoDB)
OptimisticReopenWithDB - optimistically open snapshots (ignoring error), useful at App startup because: - user must be able: delete any snapshot file and Erigon will self-heal by re-downloading - RPC return Nil for historical blocks if snapshots are not open
func (*BorRoSnapshots) OptimisticalyReopenFolder ¶
func (s *BorRoSnapshots) OptimisticalyReopenFolder()
func (*BorRoSnapshots) OptimisticalyReopenWithDB ¶
func (s *BorRoSnapshots) OptimisticalyReopenWithDB(db kv.RoDB)
func (*BorRoSnapshots) PrintDebug ¶
func (s *BorRoSnapshots) PrintDebug()
func (*BorRoSnapshots) Ranges ¶
func (s *BorRoSnapshots) Ranges() (ranges []Range)
func (*BorRoSnapshots) ReopenFolder ¶
func (s *BorRoSnapshots) ReopenFolder() error
func (*BorRoSnapshots) ReopenList ¶
func (s *BorRoSnapshots) ReopenList(fileNames []string, optimistic bool) error
ReopenList stops on optimistic=false, continue opening files on optimistic=true
func (*BorRoSnapshots) ReopenWithDB ¶
func (s *BorRoSnapshots) ReopenWithDB(db kv.RoDB) error
func (*BorRoSnapshots) ScanDir ¶
func (s *BorRoSnapshots) ScanDir() (map[string]struct{}, []*services.Range, error)
func (*BorRoSnapshots) SegmentsMax ¶
func (s *BorRoSnapshots) SegmentsMax() uint64
func (*BorRoSnapshots) SegmentsReady ¶
func (s *BorRoSnapshots) SegmentsReady() bool
func (*BorRoSnapshots) View ¶
func (s *BorRoSnapshots) View() *BorView
type BorSpanSegment ¶
type BorSpanSegment struct {
// contains filtered or unexported fields
}
type BorView ¶
type BorView struct {
// contains filtered or unexported fields
}
func (*BorView) Events ¶
func (v *BorView) Events() []*BorEventSegment
func (*BorView) EventsSegment ¶
func (v *BorView) EventsSegment(blockNum uint64) (*BorEventSegment, bool)
func (*BorView) Spans ¶
func (v *BorView) Spans() []*BorSpanSegment
func (*BorView) SpansSegment ¶
func (v *BorView) SpansSegment(blockNum uint64) (*BorSpanSegment, bool)
type CaplinSnapshots ¶
type CaplinSnapshots struct { BeaconBlocks *beaconBlockSegments // contains filtered or unexported fields }
func NewCaplinSnapshots ¶
func NewCaplinSnapshots(cfg ethconfig.BlocksFreezing, snapDir string, 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, lvl log.Lvl) error
func (*CaplinSnapshots) IndicesMax ¶
func (s *CaplinSnapshots) IndicesMax() uint64
func (*CaplinSnapshots) ReadHeader ¶
func (s *CaplinSnapshots) ReadHeader(slot uint64) (*cltypes.SignedBeaconBlockHeader, uint64, libcommon.Hash, error)
func (*CaplinSnapshots) ReopenFolder ¶
func (s *CaplinSnapshots) ReopenFolder() error
func (*CaplinSnapshots) ReopenList ¶
func (s *CaplinSnapshots) ReopenList(fileNames []string, optimistic bool) error
ReopenList stops on optimistic=false, continue opening files on optimistic=true
func (*CaplinSnapshots) SegFilePaths ¶
func (s *CaplinSnapshots) SegFilePaths(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 {
// contains filtered or unexported fields
}
func (*CaplinView) BeaconBlocks ¶
func (v *CaplinView) BeaconBlocks() []*BeaconBlockSegment
func (*CaplinView) BeaconBlocksSegment ¶
func (v *CaplinView) BeaconBlocksSegment(slot uint64) (*BeaconBlockSegment, bool)
func (*CaplinView) Close ¶
func (v *CaplinView) Close()
type HeaderSegment ¶
type HeaderSegment struct {
// contains filtered or unexported fields
}
type Merger ¶
type Merger struct {
// contains filtered or unexported fields
}
func (*Merger) FindMergeRanges ¶
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
func BorSegments ¶
func SegmentsCaplin ¶
type RemoteBlockReader ¶
type RemoteBlockReader struct {
// contains filtered or unexported fields
}
func NewRemoteBlockReader ¶
func NewRemoteBlockReader(client remote.ETHBACKENDClient) *RemoteBlockReader
func (*RemoteBlockReader) BadHeaderNumber ¶
func (*RemoteBlockReader) BlockByHash ¶
func (*RemoteBlockReader) BlockByNumber ¶
func (*RemoteBlockReader) BlockWithSenders ¶
func (*RemoteBlockReader) BodyWithTransactions ¶
func (*RemoteBlockReader) BorSnapshots ¶
func (r *RemoteBlockReader) BorSnapshots() services.BlockSnapshots
func (*RemoteBlockReader) CanPruneTo ¶
func (r *RemoteBlockReader) CanPruneTo(uint64) uint64
func (*RemoteBlockReader) CanonicalHash ¶
func (*RemoteBlockReader) CurrentBlock ¶
func (*RemoteBlockReader) EventLookup ¶
func (*RemoteBlockReader) EventsByBlock ¶
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) HeadersRange ¶
func (*RemoteBlockReader) RawTransactions ¶
func (*RemoteBlockReader) ReadAncestor ¶
func (*RemoteBlockReader) Snapshots ¶
func (r *RemoteBlockReader) Snapshots() services.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 { Headers *headerSegments Bodies *bodySegments Txs *txnSegments // contains filtered or unexported fields }
func NewRoSnapshots ¶
func NewRoSnapshots(cfg ethconfig.BlocksFreezing, snapDir string, 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) AddSnapshotsToSilkworm ¶
func (s *RoSnapshots) AddSnapshotsToSilkworm(silkwormInstance *silkworm.Silkworm) error
func (*RoSnapshots) BlocksAvailable ¶
func (s *RoSnapshots) BlocksAvailable() uint64
func (*RoSnapshots) Cfg ¶
func (s *RoSnapshots) Cfg() ethconfig.BlocksFreezing
func (*RoSnapshots) Close ¶
func (s *RoSnapshots) Close()
func (*RoSnapshots) Dir ¶
func (s *RoSnapshots) Dir() string
func (*RoSnapshots) DisableReadAhead ¶
func (s *RoSnapshots) DisableReadAhead()
DisableReadAhead - usage: `defer d.EnableReadAhead().DisableReadAhead()`. Please don't use this funcs without `defer` to avoid leak.
func (*RoSnapshots) EnableMadvNormal ¶
func (s *RoSnapshots) EnableMadvNormal() *RoSnapshots
func (*RoSnapshots) EnableMadvWillNeed ¶
func (s *RoSnapshots) EnableMadvWillNeed() *RoSnapshots
func (*RoSnapshots) EnableReadAhead ¶
func (s *RoSnapshots) EnableReadAhead() *RoSnapshots
func (*RoSnapshots) EnsureExpectedBlocksAreAvailable ¶
func (s *RoSnapshots) EnsureExpectedBlocksAreAvailable(cfg *snapcfg.Cfg) error
func (*RoSnapshots) Files ¶
func (s *RoSnapshots) Files() (list []string)
func (*RoSnapshots) IndicesMax ¶
func (s *RoSnapshots) IndicesMax() uint64
func (*RoSnapshots) IndicesReady ¶
func (s *RoSnapshots) IndicesReady() bool
func (*RoSnapshots) LogStat ¶
func (s *RoSnapshots) LogStat()
func (*RoSnapshots) OptimisticReopenWithDB ¶
func (s *RoSnapshots) OptimisticReopenWithDB(db kv.RoDB)
OptimisticReopenWithDB - optimistically open snapshots (ignoring error), useful at App startup because: - user must be able: delete any snapshot file and Erigon will self-heal by re-downloading - RPC return Nil for historical blocks if snapshots are not open
func (*RoSnapshots) OptimisticalyReopenFolder ¶
func (s *RoSnapshots) OptimisticalyReopenFolder()
func (*RoSnapshots) OptimisticalyReopenWithDB ¶
func (s *RoSnapshots) OptimisticalyReopenWithDB(db kv.RoDB)
func (*RoSnapshots) PrintDebug ¶
func (s *RoSnapshots) PrintDebug()
func (*RoSnapshots) Ranges ¶
func (s *RoSnapshots) Ranges() (ranges []Range)
func (*RoSnapshots) ReopenFolder ¶
func (s *RoSnapshots) ReopenFolder() error
func (*RoSnapshots) ReopenList ¶
func (s *RoSnapshots) ReopenList(fileNames []string, optimistic bool) error
ReopenList stops on optimistic=false, continue opening files on optimistic=true
func (*RoSnapshots) ReopenWithDB ¶
func (s *RoSnapshots) ReopenWithDB(db kv.RoDB) error
func (*RoSnapshots) ScanDir ¶
func (s *RoSnapshots) ScanDir() (map[string]struct{}, []*services.Range, error)
func (*RoSnapshots) SegmentsMax ¶
func (s *RoSnapshots) SegmentsMax() uint64
func (*RoSnapshots) SegmentsReady ¶
func (s *RoSnapshots) SegmentsReady() bool
func (*RoSnapshots) View ¶
func (s *RoSnapshots) View() *View
type TxnSegment ¶
type TxnSegment struct { Seg *compress.Decompressor // value: first_byte_of_transaction_hash + sender_address + transaction_rlp IdxTxnHash *recsplit.Index // transaction_hash -> transactions_segment_offset IdxTxnHash2BlockNum *recsplit.Index // transaction_hash -> block_number // contains filtered or unexported fields }
type View ¶
type View struct {
// contains filtered or unexported fields
}
func (*View) Bodies ¶
func (v *View) Bodies() []*BodySegment
func (*View) BodiesSegment ¶
func (v *View) BodiesSegment(blockNum uint64) (*BodySegment, bool)
func (*View) Headers ¶
func (v *View) Headers() []*HeaderSegment
func (*View) HeadersSegment ¶
func (v *View) HeadersSegment(blockNum uint64) (*HeaderSegment, bool)
func (*View) Txs ¶
func (v *View) Txs() []*TxnSegment
func (*View) TxsSegment ¶
func (v *View) TxsSegment(blockNum uint64) (*TxnSegment, bool)