Documentation ¶
Index ¶
- Constants
- Variables
- func BuildBtreeIndex(dataPath, indexPath string) error
- func BuildBtreeIndexWithDecompressor(indexPath string, kv *compress.Decompressor, p *background.Progress) error
- func DecodeAccountBytes(enc []byte) (nonce uint64, balance *uint256.Int, hash []byte)
- func EncodeAccountBytes(nonce uint64, balance *uint256.Int, hash []byte, incarnation uint64) []byte
- type AggV3Collation
- type AggV3StaticFiles
- type Aggregator
- func (a *Aggregator) AddLogAddr(addr []byte) error
- func (a *Aggregator) AddLogTopic(topic []byte) error
- func (a *Aggregator) AddTraceFrom(addr []byte) error
- func (a *Aggregator) AddTraceTo(addr []byte) error
- func (a *Aggregator) AggregatedRoots() chan [length.Hash]byte
- func (a *Aggregator) Close()
- func (a *Aggregator) ComputeCommitment(saveStateAfter, trace bool) (rootHash []byte, err error)
- func (a *Aggregator) DeleteAccount(addr []byte) error
- func (a *Aggregator) DomainEndTxNumMinimax() uint64
- func (a *Aggregator) EndTxNumMinimax() uint64
- func (a *Aggregator) FinishTx() (err error)
- func (a *Aggregator) FinishWrites()
- func (a *Aggregator) Flush(ctx context.Context) error
- func (a *Aggregator) GetAndResetStats() DomainStats
- func (a *Aggregator) MakeContext() *AggregatorContext
- func (a *Aggregator) ReadyToFinishTx() bool
- func (a *Aggregator) ReopenFolder() (err error)
- func (a *Aggregator) ReopenList(fNames []string) error
- func (a *Aggregator) SeekCommitment() (blockNum, txNum uint64, err error)
- func (a *Aggregator) SetBlockNum(blockNum uint64)
- func (a *Aggregator) SetCommitmentMode(mode CommitmentMode)
- func (a *Aggregator) SetDB(db kv.RwDB)
- func (a *Aggregator) SetTx(tx kv.RwTx)
- func (a *Aggregator) SetTxNum(txNum uint64)
- func (a *Aggregator) SetWorkers(i int)
- func (a *Aggregator) StartWrites() *Aggregator
- func (a *Aggregator) Stats() FilesStats
- func (a *Aggregator) UpdateAccountCode(addr []byte, code []byte) error
- func (a *Aggregator) UpdateAccountData(addr []byte, account []byte) error
- func (a *Aggregator) UpdateCommitmentData(prefix []byte, code []byte) error
- func (a *Aggregator) WriteAccountStorage(addr, loc []byte, value []byte) error
- type AggregatorContext
- func (ac *AggregatorContext) Close()
- func (ac *AggregatorContext) LogAddrIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)
- func (ac *AggregatorContext) LogTopicIterator(topic []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)
- func (ac *AggregatorContext) ReadAccountCode(addr []byte, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadAccountCodeBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadAccountCodeSize(addr []byte, roTx kv.Tx) (int, error)
- func (ac *AggregatorContext) ReadAccountCodeSizeBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) (int, error)
- func (ac *AggregatorContext) ReadAccountData(addr []byte, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadAccountDataBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadAccountStorage(addr []byte, loc []byte, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadAccountStorageBeforeTxNum(addr []byte, loc []byte, txNum uint64, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadCommitment(addr []byte, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) ReadCommitmentBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)
- func (ac *AggregatorContext) TraceFromIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)
- func (ac *AggregatorContext) TraceToIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)
- type AggregatorStep
- func (as *AggregatorStep) Clone() *AggregatorStep
- func (as *AggregatorStep) IterateAccountsHistory(txNum uint64) *HistoryIteratorInc
- func (as *AggregatorStep) IterateAccountsTxs() *ScanIteratorInc
- func (as *AggregatorStep) IterateCodeHistory(txNum uint64) *HistoryIteratorInc
- func (as *AggregatorStep) IterateCodeTxs() *ScanIteratorInc
- func (as *AggregatorStep) IterateStorageHistory(txNum uint64) *HistoryIteratorInc
- func (as *AggregatorStep) IterateStorageTxs() *ScanIteratorInc
- func (as *AggregatorStep) MaxTxNumAccounts(addr []byte) (bool, uint64)
- func (as *AggregatorStep) MaxTxNumCode(addr []byte) (bool, uint64)
- func (as *AggregatorStep) MaxTxNumStorage(addr []byte, loc []byte) (bool, uint64)
- func (as *AggregatorStep) ReadAccountCodeNoState(addr []byte, txNum uint64) ([]byte, bool, uint64)
- func (as *AggregatorStep) ReadAccountCodeSizeNoState(addr []byte, txNum uint64) (int, bool, uint64)
- func (as *AggregatorStep) ReadAccountDataNoState(addr []byte, txNum uint64) ([]byte, bool, uint64)
- func (as *AggregatorStep) ReadAccountStorageNoState(addr []byte, loc []byte, txNum uint64) ([]byte, bool, uint64)
- func (as *AggregatorStep) TxNumRange() (uint64, uint64)
- type AggregatorV3
- func (a *AggregatorV3) Accounts() *History
- func (a *AggregatorV3) AddAccountPrev(addr []byte, prev []byte) error
- func (a *AggregatorV3) AddCodePrev(addr []byte, prev []byte) error
- func (a *AggregatorV3) AddLogAddr(addr []byte) error
- func (a *AggregatorV3) AddLogTopic(topic []byte) error
- func (a *AggregatorV3) AddStoragePrev(addr []byte, loc []byte, prev []byte) error
- func (a *AggregatorV3) AddTraceFrom(addr []byte) error
- func (a *AggregatorV3) AddTraceTo(addr []byte) error
- func (a *AggregatorV3) BackgroundProgress() string
- func (a *AggregatorV3) BatchHistoryWriteEnd()
- func (a *AggregatorV3) BatchHistoryWriteStart() *AggregatorV3
- func (a *AggregatorV3) BuildFiles(toTxNum uint64) (err error)
- func (a *AggregatorV3) BuildFilesInBackground(txNum uint64)
- func (a *AggregatorV3) BuildMissedIndices(ctx context.Context, workers int) error
- func (a *AggregatorV3) BuildOptionalMissedIndices(ctx context.Context, workers int) error
- func (a *AggregatorV3) BuildOptionalMissedIndicesInBackground(ctx context.Context, workers int)
- func (a *AggregatorV3) CanPrune(tx kv.Tx) bool
- func (a *AggregatorV3) CanPruneFrom(tx kv.Tx) uint64
- func (a *AggregatorV3) Close()
- func (a *AggregatorV3) Code() *History
- func (a *AggregatorV3) DisableReadAhead()
- func (a *AggregatorV3) DiscardHistory() *AggregatorV3
- func (a *AggregatorV3) EnableMadvNormal() *AggregatorV3
- func (a *AggregatorV3) EnableMadvWillNeed() *AggregatorV3
- func (a *AggregatorV3) EnableReadAhead() *AggregatorV3
- func (a *AggregatorV3) EndTxNumFrozenAndIndexed() uint64
- func (a *AggregatorV3) EndTxNumMinimax() uint64
- func (a *AggregatorV3) Files() (res []string)
- func (a *AggregatorV3) FinishWrites()
- func (a *AggregatorV3) Flush(ctx context.Context, tx kv.RwTx) error
- func (a *AggregatorV3) HasBackgroundFilesBuild() bool
- func (a *AggregatorV3) KeepInDB(v uint64)
- func (a *AggregatorV3) LogStats(tx kv.Tx, tx2block func(endTxNumMinimax uint64) uint64)
- func (a *AggregatorV3) MakeContext() *AggregatorV3Context
- func (a *AggregatorV3) MakeSteps() ([]*AggregatorStep, error)
- func (a *AggregatorV3) MergeLoop(ctx context.Context, workers int) error
- func (a *AggregatorV3) NeedSaveFilesListInDB() bool
- func (a *AggregatorV3) OnFreeze(f OnFreezeFunc)
- func (a *AggregatorV3) OpenFolder() error
- func (a *AggregatorV3) OpenList(fNames []string) error
- func (a *AggregatorV3) Prune(ctx context.Context, limit uint64) error
- func (a *AggregatorV3) PruneWithTiemout(ctx context.Context, timeout time.Duration) error
- func (a *AggregatorV3) SetLogPrefix(v string)
- func (a *AggregatorV3) SetTx(tx kv.RwTx)
- func (a *AggregatorV3) SetTxNum(txNum uint64)
- func (a *AggregatorV3) SetWorkers(i int)
- func (a *AggregatorV3) StartUnbufferedWrites() *AggregatorV3
- func (a *AggregatorV3) StartWrites() *AggregatorV3
- func (a *AggregatorV3) Stats() FilesStats22
- func (a *AggregatorV3) Storage() *History
- func (a *AggregatorV3) Unwind(ctx context.Context, txUnwindTo uint64, stateLoad etl.LoadFunc) error
- func (a *AggregatorV3) Warmup(ctx context.Context, txFrom, limit uint64) error
- type AggregatorV3Context
- func (ac *AggregatorV3Context) AccountHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV
- func (ac *AggregatorV3Context) AccountHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)
- func (ac *AggregatorV3Context) AccountHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) Close()
- func (ac *AggregatorV3Context) CodeHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV
- func (ac *AggregatorV3Context) CodeHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)
- func (ac *AggregatorV3Context) CodeHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) LogAddrRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) LogTopicRange(topic []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) ReadAccountCodeNoState(addr []byte, txNum uint64) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountCodeNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountCodeSizeNoState(addr []byte, txNum uint64) (int, bool, error)
- func (ac *AggregatorV3Context) ReadAccountCodeSizeNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) (int, bool, error)
- func (ac *AggregatorV3Context) ReadAccountDataNoState(addr []byte, txNum uint64) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountDataNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountStorageNoState(addr []byte, loc []byte, txNum uint64) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountStorageNoStateWithRecent(addr []byte, loc []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)
- func (ac *AggregatorV3Context) ReadAccountStorageNoStateWithRecent2(key []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)
- func (ac *AggregatorV3Context) StorageHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV
- func (ac *AggregatorV3Context) StorageHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)
- func (ac *AggregatorV3Context) StorageHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) TraceFromRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- func (ac *AggregatorV3Context) TraceToRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
- type BackgroundResult
- type BtIndex
- func CreateBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error)
- func CreateBtreeIndexWithDecompressor(indexPath string, M uint64, decompressor *compress.Decompressor, ...) (*BtIndex, error)
- func OpenBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error)
- func OpenBtreeIndexWithDecompressor(indexPath string, M uint64, kv *compress.Decompressor) (*BtIndex, error)
- func (b *BtIndex) Close() error
- func (b *BtIndex) Empty() bool
- func (b *BtIndex) FileName() string
- func (b *BtIndex) FilePath() string
- func (b *BtIndex) KeyCount() uint64
- func (b *BtIndex) Lookup(key []byte) uint64
- func (b *BtIndex) ModTime() time.Time
- func (b *BtIndex) OrdinalLookup(i uint64) *Cursor
- func (b *BtIndex) Seek(x []byte) (*Cursor, error)
- func (b *BtIndex) Size() int64
- type BtIndexReader
- type BtIndexWriter
- type BtIndexWriterArgs
- type Collation
- type CommitmentItem
- type CommitmentMode
- type Cursor
- type CursorHeap
- type CursorItem
- type CursorType
- type Domain
- func (d *Domain) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet) (err error)
- func (d *Domain) Close()
- func (d *Domain) Delete(key1, key2 []byte) error
- func (d *Domain) FinishWrites()
- func (d *Domain) GetAndResetStats() DomainStats
- func (d *Domain) MakeContext() *DomainContext
- func (d *Domain) OpenFolder() error
- func (d *Domain) OpenList(fNames []string) error
- func (d *Domain) Put(key1, key2, val []byte) error
- func (d *Domain) StartWrites()
- type DomainCommitted
- func (d *DomainCommitted) ComputeCommitment(trace bool) (rootHash []byte, branchNodeUpdates map[string]commitment.BranchData, err error)
- func (d *DomainCommitted) SeekCommitment(aggStep, sinceTx uint64) (blockNum, txNum uint64, err error)
- func (d *DomainCommitted) SetCommitmentMode(m CommitmentMode)
- func (d *DomainCommitted) TouchPlainKey(key, val []byte, fn func(c *CommitmentItem, val []byte))
- func (d *DomainCommitted) TouchPlainKeyAccount(c *CommitmentItem, val []byte)
- func (d *DomainCommitted) TouchPlainKeyCode(c *CommitmentItem, val []byte)
- func (d *DomainCommitted) TouchPlainKeyStorage(c *CommitmentItem, val []byte)
- func (d *DomainCommitted) TouchedKeyList() ([][]byte, [][]byte, []commitment.Update)
- type DomainContext
- type DomainRanges
- type DomainStats
- type FilesStats
- type FilesStats22
- type FrozenInvertedIdxIter
- type History
- func (h *History) AddPrevValue(key1, key2, original []byte) (err error)
- func (h *History) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet)
- func (h *History) BuildOptionalMissedIndices(ctx context.Context) (err error)
- func (h *History) CleanupDir()
- func (h *History) Close()
- func (h *History) DisableReadAhead()
- func (h *History) DiscardHistory()
- func (h *History) EnableMadvNormalReadAhead() *History
- func (h *History) EnableMadvWillNeed() *History
- func (h *History) EnableReadAhead() *History
- func (h *History) Files() (res []string)
- func (h *History) FinishWrites()
- func (h *History) MakeContext() *HistoryContext
- func (h *History) MakeSteps(toTxNum uint64) []*HistoryStep
- func (h *History) OpenFolder() error
- func (h *History) OpenList(fNames []string) error
- func (h *History) Rotate() historyFlusher
- func (h *History) StartWrites()
- type HistoryChangesIterDB
- type HistoryChangesIterDBDup
- type HistoryChangesIterF
- type HistoryCollation
- type HistoryContext
- func (hc *HistoryContext) Close()
- func (hc *HistoryContext) GetNoState(key []byte, txNum uint64) ([]byte, bool, error)
- func (hc *HistoryContext) GetNoStateWithRecent(key []byte, txNum uint64, roTx kv.Tx) ([]byte, bool, error)
- func (hc *HistoryContext) HistoryRange(fromTxNum, toTxNum int, asc order.By, limit int, roTx kv.Tx) (iter.KV, error)
- func (hc *HistoryContext) IdxRange(key []byte, startTxNum, endTxNum int, asc order.By, limit int, roTx kv.Tx) (iter.U64, error)
- func (hc *HistoryContext) WalkAsOf(startTxNum uint64, from, to []byte, roTx kv.Tx, limit int) iter.KV
- type HistoryFiles
- type HistoryIteratorInc
- type HistoryRanges
- type HistoryStep
- type InvertedFiles
- type InvertedIndex
- func (ii *InvertedIndex) Add(key []byte) error
- func (ii *InvertedIndex) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet)
- func (ii *InvertedIndex) CleanupDir()
- func (ii *InvertedIndex) Close()
- func (ii *InvertedIndex) DisableReadAhead()
- func (ii *InvertedIndex) DiscardHistory(tmpdir string)
- func (ii *InvertedIndex) EnableMadvNormalReadAhead() *InvertedIndex
- func (ii *InvertedIndex) EnableMadvWillNeed() *InvertedIndex
- func (ii *InvertedIndex) EnableReadAhead() *InvertedIndex
- func (ii *InvertedIndex) Files() (res []string)
- func (ii *InvertedIndex) FinishWrites()
- func (ii *InvertedIndex) MakeContext() *InvertedIndexContext
- func (ii *InvertedIndex) OpenFolder() error
- func (ii *InvertedIndex) OpenList(fNames []string) error
- func (ii *InvertedIndex) Rotate() *invertedIndexWAL
- func (ii *InvertedIndex) SetTx(tx kv.RwTx)
- func (ii *InvertedIndex) SetTxNum(txNum uint64)
- func (ii *InvertedIndex) StartWrites()
- type InvertedIndexContext
- type InvertedIterator1
- type LocalityIndex
- func (li *LocalityIndex) BuildMissedIndices(ctx context.Context, ii *InvertedIndex) error
- func (li *LocalityIndex) CleanupDir()
- func (li *LocalityIndex) Close()
- func (li *LocalityIndex) Files() (res []string)
- func (li *LocalityIndex) MakeContext() *ctxLocalityIdx
- func (li *LocalityIndex) NewIdxReader() *recsplit.IndexReader
- func (li *LocalityIndex) OpenList(fNames []string) error
- type LocalityIndexFiles
- type LocalityIterator
- type MergedFiles
- type MergedFilesV3
- type OnFreezeFunc
- type RCollation
- type RMergedFiles
- type RRanges
- type RSelectedStaticFiles
- type RStaticFiles
- type Ranges
- type RangesV3
- type ReadIndices
- func (ri *ReadIndices) Close()
- func (ri *ReadIndices) FinishTx() error
- func (ri *ReadIndices) ReadAccountCode(addr []byte) error
- func (ri *ReadIndices) ReadAccountCodeSize(addr []byte) error
- func (ri *ReadIndices) ReadAccountData(addr []byte) error
- func (ri *ReadIndices) ReadAccountStorage(addr []byte, loc []byte) error
- func (ri *ReadIndices) SetTx(tx kv.RwTx)
- func (ri *ReadIndices) SetTxNum(txNum uint64)
- type RecentInvertedIdxIter
- type ReconHeap
- type ReconHeapOlderFirst
- type ReconItem
- type ScanIteratorInc
- type SelectedStaticFiles
- type SelectedStaticFilesV3
- type StateAsOfIterDB
- type StateAsOfIterDbDup
- type StateAsOfIterF
- type StaticFiles
- type ValueMerger
Constants ¶
const BtreeLogPrefix = "btree"
const LocalityIndexUint64Limit = 64 //bitmap spend 1 bit per file, stored as uint64
const StepsInBiggestFile = 32
StepsInBiggestFile - files of this size are completely frozen/immutable. files of smaller size are also immutable, but can be removed after merge to bigger files.
Variables ¶
var COMPARE_INDEXES = false // if true, will compare values from Btree and INvertedIndex
var DefaultBtreeM = uint64(2048)
var WALCollectorRAM = 2 * (etl.BufferOptimalSize / 8)
3 history + 4 indices = 10 etl collectors, 10*256Mb/8 = 512mb - for all indices buffers
Functions ¶
func BuildBtreeIndex ¶
Opens .kv at dataPath and generates index over it to file 'indexPath'
func BuildBtreeIndexWithDecompressor ¶
func BuildBtreeIndexWithDecompressor(indexPath string, kv *compress.Decompressor, p *background.Progress) error
func DecodeAccountBytes ¶
Types ¶
type AggV3Collation ¶
type AggV3Collation struct {
// contains filtered or unexported fields
}
func (AggV3Collation) Close ¶
func (c AggV3Collation) Close()
type AggV3StaticFiles ¶
type AggV3StaticFiles struct {
// contains filtered or unexported fields
}
func (AggV3StaticFiles) Close ¶
func (sf AggV3StaticFiles) Close()
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
func NewAggregator ¶
func NewAggregator(dir, tmpdir string, aggregationStep uint64, commitmentMode CommitmentMode, commitTrieVariant commitment.TrieVariant) (*Aggregator, error)
func (*Aggregator) AddLogAddr ¶
func (a *Aggregator) AddLogAddr(addr []byte) error
func (*Aggregator) AddLogTopic ¶
func (a *Aggregator) AddLogTopic(topic []byte) error
func (*Aggregator) AddTraceFrom ¶
func (a *Aggregator) AddTraceFrom(addr []byte) error
func (*Aggregator) AddTraceTo ¶
func (a *Aggregator) AddTraceTo(addr []byte) error
func (*Aggregator) AggregatedRoots ¶
func (a *Aggregator) AggregatedRoots() chan [length.Hash]byte
Provides channel which receives commitment hash each time aggregation is occured
func (*Aggregator) Close ¶
func (a *Aggregator) Close()
func (*Aggregator) ComputeCommitment ¶
func (a *Aggregator) ComputeCommitment(saveStateAfter, trace bool) (rootHash []byte, err error)
ComputeCommitment evaluates commitment for processed state. If `saveStateAfter`=true, then trie state will be saved to DB after commitment evaluation.
func (*Aggregator) DeleteAccount ¶
func (a *Aggregator) DeleteAccount(addr []byte) error
func (*Aggregator) DomainEndTxNumMinimax ¶
func (a *Aggregator) DomainEndTxNumMinimax() uint64
func (*Aggregator) EndTxNumMinimax ¶
func (a *Aggregator) EndTxNumMinimax() uint64
func (*Aggregator) FinishTx ¶
func (a *Aggregator) FinishTx() (err error)
func (*Aggregator) FinishWrites ¶
func (a *Aggregator) FinishWrites()
func (*Aggregator) Flush ¶
func (a *Aggregator) Flush(ctx context.Context) error
Flush - must be called before Collate, if you did some writes
func (*Aggregator) GetAndResetStats ¶
func (a *Aggregator) GetAndResetStats() DomainStats
func (*Aggregator) MakeContext ¶
func (a *Aggregator) MakeContext() *AggregatorContext
func (*Aggregator) ReadyToFinishTx ¶
func (a *Aggregator) ReadyToFinishTx() bool
func (*Aggregator) ReopenFolder ¶
func (a *Aggregator) ReopenFolder() (err error)
func (*Aggregator) ReopenList ¶
func (a *Aggregator) ReopenList(fNames []string) error
func (*Aggregator) SeekCommitment ¶
func (a *Aggregator) SeekCommitment() (blockNum, txNum uint64, err error)
func (*Aggregator) SetBlockNum ¶
func (a *Aggregator) SetBlockNum(blockNum uint64)
func (*Aggregator) SetCommitmentMode ¶
func (a *Aggregator) SetCommitmentMode(mode CommitmentMode)
func (*Aggregator) SetDB ¶
func (a *Aggregator) SetDB(db kv.RwDB)
func (*Aggregator) SetTx ¶
func (a *Aggregator) SetTx(tx kv.RwTx)
func (*Aggregator) SetTxNum ¶
func (a *Aggregator) SetTxNum(txNum uint64)
func (*Aggregator) SetWorkers ¶
func (a *Aggregator) SetWorkers(i int)
func (*Aggregator) StartWrites ¶
func (a *Aggregator) StartWrites() *Aggregator
StartWrites - pattern: `defer agg.StartWrites().FinishWrites()`
func (*Aggregator) Stats ¶
func (a *Aggregator) Stats() FilesStats
func (*Aggregator) UpdateAccountCode ¶
func (a *Aggregator) UpdateAccountCode(addr []byte, code []byte) error
func (*Aggregator) UpdateAccountData ¶
func (a *Aggregator) UpdateAccountData(addr []byte, account []byte) error
func (*Aggregator) UpdateCommitmentData ¶
func (a *Aggregator) UpdateCommitmentData(prefix []byte, code []byte) error
func (*Aggregator) WriteAccountStorage ¶
func (a *Aggregator) WriteAccountStorage(addr, loc []byte, value []byte) error
type AggregatorContext ¶
type AggregatorContext struct {
// contains filtered or unexported fields
}
func (*AggregatorContext) Close ¶
func (ac *AggregatorContext) Close()
func (*AggregatorContext) LogAddrIterator ¶
func (*AggregatorContext) LogTopicIterator ¶
func (*AggregatorContext) ReadAccountCode ¶
func (*AggregatorContext) ReadAccountCodeBeforeTxNum ¶
func (*AggregatorContext) ReadAccountCodeSize ¶
func (*AggregatorContext) ReadAccountCodeSizeBeforeTxNum ¶
func (*AggregatorContext) ReadAccountData ¶
func (*AggregatorContext) ReadAccountDataBeforeTxNum ¶
func (*AggregatorContext) ReadAccountStorage ¶
func (*AggregatorContext) ReadAccountStorageBeforeTxNum ¶
func (*AggregatorContext) ReadCommitment ¶
func (*AggregatorContext) ReadCommitmentBeforeTxNum ¶
func (*AggregatorContext) TraceFromIterator ¶
func (*AggregatorContext) TraceToIterator ¶
type AggregatorStep ¶
type AggregatorStep struct {
// contains filtered or unexported fields
}
AggregatorStep is used for incremental reconstitution, it allows accessing history in isolated way for each step
func (*AggregatorStep) Clone ¶
func (as *AggregatorStep) Clone() *AggregatorStep
func (*AggregatorStep) IterateAccountsHistory ¶
func (as *AggregatorStep) IterateAccountsHistory(txNum uint64) *HistoryIteratorInc
func (*AggregatorStep) IterateAccountsTxs ¶
func (as *AggregatorStep) IterateAccountsTxs() *ScanIteratorInc
func (*AggregatorStep) IterateCodeHistory ¶
func (as *AggregatorStep) IterateCodeHistory(txNum uint64) *HistoryIteratorInc
func (*AggregatorStep) IterateCodeTxs ¶
func (as *AggregatorStep) IterateCodeTxs() *ScanIteratorInc
func (*AggregatorStep) IterateStorageHistory ¶
func (as *AggregatorStep) IterateStorageHistory(txNum uint64) *HistoryIteratorInc
func (*AggregatorStep) IterateStorageTxs ¶
func (as *AggregatorStep) IterateStorageTxs() *ScanIteratorInc
func (*AggregatorStep) MaxTxNumAccounts ¶
func (as *AggregatorStep) MaxTxNumAccounts(addr []byte) (bool, uint64)
func (*AggregatorStep) MaxTxNumCode ¶
func (as *AggregatorStep) MaxTxNumCode(addr []byte) (bool, uint64)
func (*AggregatorStep) MaxTxNumStorage ¶
func (as *AggregatorStep) MaxTxNumStorage(addr []byte, loc []byte) (bool, uint64)
func (*AggregatorStep) ReadAccountCodeNoState ¶
func (*AggregatorStep) ReadAccountCodeSizeNoState ¶
func (*AggregatorStep) ReadAccountDataNoState ¶
func (*AggregatorStep) ReadAccountStorageNoState ¶
func (*AggregatorStep) TxNumRange ¶
func (as *AggregatorStep) TxNumRange() (uint64, uint64)
type AggregatorV3 ¶
type AggregatorV3 struct {
// contains filtered or unexported fields
}
func NewAggregatorV3 ¶
func (*AggregatorV3) Accounts ¶
func (a *AggregatorV3) Accounts() *History
func (*AggregatorV3) AddAccountPrev ¶
func (a *AggregatorV3) AddAccountPrev(addr []byte, prev []byte) error
func (*AggregatorV3) AddCodePrev ¶
func (a *AggregatorV3) AddCodePrev(addr []byte, prev []byte) error
AddCodePrev - addr+inc => code
func (*AggregatorV3) AddLogAddr ¶
func (a *AggregatorV3) AddLogAddr(addr []byte) error
func (*AggregatorV3) AddLogTopic ¶
func (a *AggregatorV3) AddLogTopic(topic []byte) error
func (*AggregatorV3) AddStoragePrev ¶
func (a *AggregatorV3) AddStoragePrev(addr []byte, loc []byte, prev []byte) error
func (*AggregatorV3) AddTraceFrom ¶
func (a *AggregatorV3) AddTraceFrom(addr []byte) error
func (*AggregatorV3) AddTraceTo ¶
func (a *AggregatorV3) AddTraceTo(addr []byte) error
func (*AggregatorV3) BackgroundProgress ¶
func (a *AggregatorV3) BackgroundProgress() string
func (*AggregatorV3) BatchHistoryWriteEnd ¶
func (a *AggregatorV3) BatchHistoryWriteEnd()
func (*AggregatorV3) BatchHistoryWriteStart ¶
func (a *AggregatorV3) BatchHistoryWriteStart() *AggregatorV3
func (*AggregatorV3) BuildFiles ¶
func (a *AggregatorV3) BuildFiles(toTxNum uint64) (err error)
func (*AggregatorV3) BuildFilesInBackground ¶
func (a *AggregatorV3) BuildFilesInBackground(txNum uint64)
func (*AggregatorV3) BuildMissedIndices ¶
func (a *AggregatorV3) BuildMissedIndices(ctx context.Context, workers int) error
func (*AggregatorV3) BuildOptionalMissedIndices ¶
func (a *AggregatorV3) BuildOptionalMissedIndices(ctx context.Context, workers int) error
func (*AggregatorV3) BuildOptionalMissedIndicesInBackground ¶
func (a *AggregatorV3) BuildOptionalMissedIndicesInBackground(ctx context.Context, workers int)
func (*AggregatorV3) CanPruneFrom ¶
func (a *AggregatorV3) CanPruneFrom(tx kv.Tx) uint64
func (*AggregatorV3) Close ¶
func (a *AggregatorV3) Close()
func (*AggregatorV3) Code ¶
func (a *AggregatorV3) Code() *History
func (*AggregatorV3) DisableReadAhead ¶
func (a *AggregatorV3) DisableReadAhead()
DisableReadAhead - usage: `defer d.EnableReadAhead().DisableReadAhead()`. Please don't use this funcs without `defer` to avoid leak.
func (*AggregatorV3) DiscardHistory ¶
func (a *AggregatorV3) DiscardHistory() *AggregatorV3
StartWrites - pattern: `defer agg.StartWrites().FinishWrites()`
func (*AggregatorV3) EnableMadvNormal ¶
func (a *AggregatorV3) EnableMadvNormal() *AggregatorV3
func (*AggregatorV3) EnableMadvWillNeed ¶
func (a *AggregatorV3) EnableMadvWillNeed() *AggregatorV3
func (*AggregatorV3) EnableReadAhead ¶
func (a *AggregatorV3) EnableReadAhead() *AggregatorV3
func (*AggregatorV3) EndTxNumFrozenAndIndexed ¶
func (a *AggregatorV3) EndTxNumFrozenAndIndexed() uint64
func (*AggregatorV3) EndTxNumMinimax ¶
func (a *AggregatorV3) EndTxNumMinimax() uint64
func (*AggregatorV3) Files ¶
func (a *AggregatorV3) Files() (res []string)
func (*AggregatorV3) FinishWrites ¶
func (a *AggregatorV3) FinishWrites()
func (*AggregatorV3) HasBackgroundFilesBuild ¶
func (a *AggregatorV3) HasBackgroundFilesBuild() bool
func (*AggregatorV3) KeepInDB ¶
func (a *AggregatorV3) KeepInDB(v uint64)
KeepInDB - usually equal to one a.aggregationStep, but when we exec blocks from snapshots we can set it to 0, because no re-org on this blocks are possible
func (*AggregatorV3) LogStats ¶
func (a *AggregatorV3) LogStats(tx kv.Tx, tx2block func(endTxNumMinimax uint64) uint64)
func (*AggregatorV3) MakeContext ¶
func (a *AggregatorV3) MakeContext() *AggregatorV3Context
func (*AggregatorV3) MakeSteps ¶
func (a *AggregatorV3) MakeSteps() ([]*AggregatorStep, error)
func (*AggregatorV3) MergeLoop ¶
func (a *AggregatorV3) MergeLoop(ctx context.Context, workers int) error
func (*AggregatorV3) NeedSaveFilesListInDB ¶
func (a *AggregatorV3) NeedSaveFilesListInDB() bool
func (*AggregatorV3) OnFreeze ¶
func (a *AggregatorV3) OnFreeze(f OnFreezeFunc)
func (*AggregatorV3) OpenFolder ¶
func (a *AggregatorV3) OpenFolder() error
func (*AggregatorV3) OpenList ¶
func (a *AggregatorV3) OpenList(fNames []string) error
func (*AggregatorV3) PruneWithTiemout ¶
func (*AggregatorV3) SetLogPrefix ¶
func (a *AggregatorV3) SetLogPrefix(v string)
func (*AggregatorV3) SetTx ¶
func (a *AggregatorV3) SetTx(tx kv.RwTx)
func (*AggregatorV3) SetTxNum ¶
func (a *AggregatorV3) SetTxNum(txNum uint64)
func (*AggregatorV3) SetWorkers ¶
func (a *AggregatorV3) SetWorkers(i int)
func (*AggregatorV3) StartUnbufferedWrites ¶
func (a *AggregatorV3) StartUnbufferedWrites() *AggregatorV3
func (*AggregatorV3) StartWrites ¶
func (a *AggregatorV3) StartWrites() *AggregatorV3
StartWrites - pattern: `defer agg.StartWrites().FinishWrites()`
func (*AggregatorV3) Stats ¶
func (a *AggregatorV3) Stats() FilesStats22
func (*AggregatorV3) Storage ¶
func (a *AggregatorV3) Storage() *History
type AggregatorV3Context ¶
type AggregatorV3Context struct {
// contains filtered or unexported fields
}
func (*AggregatorV3Context) AccountHistoricalStateRange ¶
func (*AggregatorV3Context) AccountHistoryRange ¶
func (*AggregatorV3Context) AccountHistoyIdxRange ¶
func (*AggregatorV3Context) Close ¶
func (ac *AggregatorV3Context) Close()
func (*AggregatorV3Context) CodeHistoricalStateRange ¶
func (*AggregatorV3Context) CodeHistoryRange ¶
func (*AggregatorV3Context) CodeHistoyIdxRange ¶
func (*AggregatorV3Context) LogAddrRange ¶
func (ac *AggregatorV3Context) LogAddrRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)
-- range
func (*AggregatorV3Context) LogTopicRange ¶
func (*AggregatorV3Context) ReadAccountCodeNoState ¶
func (*AggregatorV3Context) ReadAccountCodeNoStateWithRecent ¶
func (*AggregatorV3Context) ReadAccountCodeSizeNoState ¶
func (*AggregatorV3Context) ReadAccountCodeSizeNoStateWithRecent ¶
func (*AggregatorV3Context) ReadAccountDataNoState ¶
func (*AggregatorV3Context) ReadAccountDataNoStateWithRecent ¶
func (*AggregatorV3Context) ReadAccountStorageNoState ¶
func (*AggregatorV3Context) ReadAccountStorageNoStateWithRecent ¶
func (*AggregatorV3Context) ReadAccountStorageNoStateWithRecent2 ¶
func (*AggregatorV3Context) StorageHistoricalStateRange ¶
func (*AggregatorV3Context) StorageHistoryRange ¶
func (*AggregatorV3Context) StorageHistoyIdxRange ¶
func (*AggregatorV3Context) TraceFromRange ¶
type BackgroundResult ¶
type BackgroundResult struct {
// contains filtered or unexported fields
}
BackgroundResult - used only indicate that some work is done no much reason to pass exact results by this object, just get latest state when need
func (*BackgroundResult) GetAndReset ¶
func (br *BackgroundResult) GetAndReset() (bool, error)
func (*BackgroundResult) Has ¶
func (br *BackgroundResult) Has() bool
func (*BackgroundResult) Set ¶
func (br *BackgroundResult) Set(err error)
type BtIndex ¶
type BtIndex struct {
// contains filtered or unexported fields
}
func CreateBtreeIndex ¶
func CreateBtreeIndexWithDecompressor ¶
func CreateBtreeIndexWithDecompressor(indexPath string, M uint64, decompressor *compress.Decompressor, p *background.Progress) (*BtIndex, error)
func (*BtIndex) OrdinalLookup ¶
type BtIndexReader ¶
type BtIndexReader struct {
// contains filtered or unexported fields
}
deprecated
func NewBtIndexReader ¶
func NewBtIndexReader(index *BtIndex) *BtIndexReader
func (*BtIndexReader) Empty ¶
func (r *BtIndexReader) Empty() bool
func (*BtIndexReader) Lookup ¶
func (r *BtIndexReader) Lookup(key []byte) uint64
Lookup wraps index Lookup
func (*BtIndexReader) Lookup2 ¶
func (r *BtIndexReader) Lookup2(key1, key2 []byte) uint64
type BtIndexWriter ¶
type BtIndexWriter struct {
// contains filtered or unexported fields
}
func NewBtIndexWriter ¶
func NewBtIndexWriter(args BtIndexWriterArgs) (*BtIndexWriter, error)
NewBtIndexWriter creates a new BtIndexWriter instance with given number of keys Typical bucket size is 100 - 2048, larger bucket sizes result in smaller representations of hash functions, at a cost of slower access salt parameters is used to randomise the hash function construction, to ensure that different Erigon instances (nodes) are likely to use different hash function, to collision attacks are unlikely to slow down any meaningful number of nodes at the same time
func (*BtIndexWriter) Build ¶
func (btw *BtIndexWriter) Build() error
Build has to be called after all the keys have been added, and it initiates the process of building the perfect hash function and writing index into a file
func (*BtIndexWriter) Close ¶
func (btw *BtIndexWriter) Close()
type BtIndexWriterArgs ¶
type Collation ¶
type Collation struct {
// contains filtered or unexported fields
}
Collation is the set of compressors created after aggregation
type CommitmentItem ¶
type CommitmentItem struct {
// contains filtered or unexported fields
}
type CommitmentMode ¶
type CommitmentMode uint
Defines how to evaluate commitments
const ( CommitmentModeDisabled CommitmentMode = 0 CommitmentModeDirect CommitmentMode = 1 CommitmentModeUpdate CommitmentMode = 2 )
func ParseCommitmentMode ¶
func ParseCommitmentMode(s string) CommitmentMode
func (CommitmentMode) String ¶
func (m CommitmentMode) String() string
type CursorHeap ¶
type CursorHeap []*CursorItem
func (CursorHeap) Len ¶
func (ch CursorHeap) Len() int
func (CursorHeap) Less ¶
func (ch CursorHeap) Less(i, j int) bool
func (*CursorHeap) Pop ¶
func (ch *CursorHeap) Pop() interface{}
func (*CursorHeap) Push ¶
func (ch *CursorHeap) Push(x interface{})
func (*CursorHeap) Swap ¶
func (ch *CursorHeap) Swap(i, j int)
type CursorItem ¶
type CursorItem struct {
// contains filtered or unexported fields
}
CursorItem is the item in the priority queue used to do merge interation over storage of a given account
type Domain ¶
type Domain struct { *History // contains filtered or unexported fields }
Domain is a part of the state (examples are Accounts, Storage, Code) Domain should not have any go routines or locks
func (*Domain) BuildMissedIndices ¶
func (d *Domain) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet) (err error)
BuildMissedIndices - produce .efi/.vi/.kvi from .ef/.v/.kv
func (*Domain) FinishWrites ¶
func (d *Domain) FinishWrites()
func (*Domain) GetAndResetStats ¶
func (d *Domain) GetAndResetStats() DomainStats
func (*Domain) MakeContext ¶
func (d *Domain) MakeContext() *DomainContext
func (*Domain) OpenFolder ¶
func (*Domain) OpenList ¶
OpenList - main method to open list of files. It's ok if some files was open earlier. If some file already open: noop. If some file already open but not in provided list: close and remove from `files` field.
func (*Domain) StartWrites ¶
func (d *Domain) StartWrites()
type DomainCommitted ¶
type DomainCommitted struct { *Domain // contains filtered or unexported fields }
func NewCommittedDomain ¶
func NewCommittedDomain(d *Domain, mode CommitmentMode, trieVariant commitment.TrieVariant) *DomainCommitted
func (*DomainCommitted) ComputeCommitment ¶
func (d *DomainCommitted) ComputeCommitment(trace bool) (rootHash []byte, branchNodeUpdates map[string]commitment.BranchData, err error)
Evaluates commitment for processed state. Commit=true - store trie state after evaluation
func (*DomainCommitted) SeekCommitment ¶
func (d *DomainCommitted) SeekCommitment(aggStep, sinceTx uint64) (blockNum, txNum uint64, err error)
SeekCommitment searches for last encoded state from DomainCommitted and if state found, sets it up to current domain
func (*DomainCommitted) SetCommitmentMode ¶
func (d *DomainCommitted) SetCommitmentMode(m CommitmentMode)
func (*DomainCommitted) TouchPlainKey ¶
func (d *DomainCommitted) TouchPlainKey(key, val []byte, fn func(c *CommitmentItem, val []byte))
TouchPlainKey marks plainKey as updated and applies different fn for different key types (different behaviour for Code, Account and Storage key modifications).
func (*DomainCommitted) TouchPlainKeyAccount ¶
func (d *DomainCommitted) TouchPlainKeyAccount(c *CommitmentItem, val []byte)
func (*DomainCommitted) TouchPlainKeyCode ¶
func (d *DomainCommitted) TouchPlainKeyCode(c *CommitmentItem, val []byte)
func (*DomainCommitted) TouchPlainKeyStorage ¶
func (d *DomainCommitted) TouchPlainKeyStorage(c *CommitmentItem, val []byte)
func (*DomainCommitted) TouchedKeyList ¶
func (d *DomainCommitted) TouchedKeyList() ([][]byte, [][]byte, []commitment.Update)
Returns list of both plain and hashed keys. If .mode is CommitmentModeUpdate, updates also returned.
type DomainContext ¶
type DomainContext struct {
// contains filtered or unexported fields
}
DomainContext allows accesing the same domain from multiple go-routines
func (*DomainContext) Close ¶
func (dc *DomainContext) Close()
func (*DomainContext) GetBeforeTxNum ¶
GetBeforeTxNum does not always require usage of roTx. If it is possible to determine historical value based only on static files, roTx will not be used.
func (*DomainContext) IteratePrefix ¶
func (dc *DomainContext) IteratePrefix(prefix []byte, it func(k, v []byte)) error
IteratePrefix iterates over key-value pairs of the domain that start with given prefix Such iteration is not intended to be used in public API, therefore it uses read-write transaction inside the domain. Another version of this for public API use needs to be created, that uses roTx instead and supports ending the iterations before it reaches the end.
type DomainRanges ¶
type DomainRanges struct {
// contains filtered or unexported fields
}
func (DomainRanges) String ¶
func (r DomainRanges) String() string
type DomainStats ¶
type DomainStats struct { MergesCount uint64 LastCollationTook time.Duration LastPruneTook time.Duration LastPruneHistTook time.Duration LastFileBuildingTook time.Duration LastCollationSize uint64 LastPruneSize uint64 HistoryQueries *atomic.Uint64 TotalQueries *atomic.Uint64 EfSearchTime time.Duration DataSize uint64 IndexSize uint64 FilesCount uint64 }
func (*DomainStats) Accumulate ¶
func (ds *DomainStats) Accumulate(other DomainStats)
type FilesStats ¶
type FilesStats22 ¶
type FilesStats22 struct { }
type FrozenInvertedIdxIter ¶
type FrozenInvertedIdxIter struct {
// contains filtered or unexported fields
}
FrozenInvertedIdxIter allows iteration over range of tx numbers Iteration is not implmented via callback function, because there is often a requirement for interators to be composable (for example, to implement AND and OR for indices) FrozenInvertedIdxIter must be closed after use to prevent leaking of resources like cursor
func (*FrozenInvertedIdxIter) Close ¶
func (it *FrozenInvertedIdxIter) Close()
func (*FrozenInvertedIdxIter) HasNext ¶
func (it *FrozenInvertedIdxIter) HasNext() bool
func (*FrozenInvertedIdxIter) Next ¶
func (it *FrozenInvertedIdxIter) Next() (uint64, error)
type History ¶
type History struct { *InvertedIndex // contains filtered or unexported fields }
func NewHistory ¶
func (*History) AddPrevValue ¶
func (*History) BuildMissedIndices ¶
func (h *History) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet)
func (*History) BuildOptionalMissedIndices ¶
BuildMissedIndices - produce .efi/.vi/.kvi from .ef/.v/.kv
func (*History) CleanupDir ¶
func (h *History) CleanupDir()
func (*History) DisableReadAhead ¶
func (h *History) DisableReadAhead()
func (*History) DiscardHistory ¶
func (h *History) DiscardHistory()
func (*History) EnableMadvNormalReadAhead ¶
func (*History) EnableMadvWillNeed ¶
func (*History) EnableReadAhead ¶
func (*History) FinishWrites ¶
func (h *History) FinishWrites()
func (*History) MakeContext ¶
func (h *History) MakeContext() *HistoryContext
func (*History) MakeSteps ¶
func (h *History) MakeSteps(toTxNum uint64) []*HistoryStep
MakeSteps [0, toTxNum)
func (*History) OpenFolder ¶
func (*History) OpenList ¶
OpenList - main method to open list of files. It's ok if some files was open earlier. If some file already open: noop. If some file already open but not in provided list: close and remove from `files` field.
func (*History) StartWrites ¶
func (h *History) StartWrites()
type HistoryChangesIterDB ¶
type HistoryChangesIterDB struct {
// contains filtered or unexported fields
}
func (*HistoryChangesIterDB) Close ¶
func (hi *HistoryChangesIterDB) Close()
func (*HistoryChangesIterDB) HasNext ¶
func (hi *HistoryChangesIterDB) HasNext() bool
type HistoryChangesIterDBDup ¶
type HistoryChangesIterDBDup struct {
// contains filtered or unexported fields
}
func (*HistoryChangesIterDBDup) Close ¶
func (hi *HistoryChangesIterDBDup) Close()
func (*HistoryChangesIterDBDup) HasNext ¶
func (hi *HistoryChangesIterDBDup) HasNext() bool
type HistoryChangesIterF ¶
type HistoryChangesIterF struct {
// contains filtered or unexported fields
}
func (*HistoryChangesIterF) Close ¶
func (hi *HistoryChangesIterF) Close()
func (*HistoryChangesIterF) HasNext ¶
func (hi *HistoryChangesIterF) HasNext() bool
type HistoryCollation ¶
type HistoryCollation struct {
// contains filtered or unexported fields
}
func (HistoryCollation) Close ¶
func (c HistoryCollation) Close()
type HistoryContext ¶
type HistoryContext struct {
// contains filtered or unexported fields
}
func (*HistoryContext) Close ¶
func (hc *HistoryContext) Close()
func (*HistoryContext) GetNoState ¶
func (*HistoryContext) GetNoStateWithRecent ¶
func (hc *HistoryContext) GetNoStateWithRecent(key []byte, txNum uint64, roTx kv.Tx) ([]byte, bool, error)
GetNoStateWithRecent searches history for a value of specified key before txNum second return value is true if the value is found in the history (even if it is nil)
func (*HistoryContext) HistoryRange ¶
type HistoryFiles ¶
type HistoryFiles struct {
// contains filtered or unexported fields
}
func (HistoryFiles) Close ¶
func (sf HistoryFiles) Close()
type HistoryIteratorInc ¶
type HistoryIteratorInc struct {
// contains filtered or unexported fields
}
func (*HistoryIteratorInc) HasNext ¶
func (hii *HistoryIteratorInc) HasNext() bool
type HistoryRanges ¶
type HistoryRanges struct {
// contains filtered or unexported fields
}
func (HistoryRanges) String ¶
func (r HistoryRanges) String(aggStep uint64) string
type HistoryStep ¶
type HistoryStep struct {
// contains filtered or unexported fields
}
HistoryStep used for incremental state reconsitution, it isolates only one snapshot interval
func (*HistoryStep) Clone ¶
func (hs *HistoryStep) Clone() *HistoryStep
func (*HistoryStep) GetNoState ¶
type InvertedFiles ¶
type InvertedFiles struct {
// contains filtered or unexported fields
}
func (InvertedFiles) Close ¶
func (sf InvertedFiles) Close()
type InvertedIndex ¶
type InvertedIndex struct {
// contains filtered or unexported fields
}
func NewInvertedIndex ¶
func (*InvertedIndex) Add ¶
func (ii *InvertedIndex) Add(key []byte) error
Add - !NotThreadSafe. Must use WalRLock/BatchHistoryWriteEnd
func (*InvertedIndex) BuildMissedIndices ¶
func (ii *InvertedIndex) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet)
BuildMissedIndices - produce .efi/.vi/.kvi from .ef/.v/.kv
func (*InvertedIndex) CleanupDir ¶
func (ii *InvertedIndex) CleanupDir()
func (*InvertedIndex) Close ¶
func (ii *InvertedIndex) Close()
func (*InvertedIndex) DisableReadAhead ¶
func (ii *InvertedIndex) DisableReadAhead()
func (*InvertedIndex) DiscardHistory ¶
func (ii *InvertedIndex) DiscardHistory(tmpdir string)
func (*InvertedIndex) EnableMadvNormalReadAhead ¶
func (ii *InvertedIndex) EnableMadvNormalReadAhead() *InvertedIndex
func (*InvertedIndex) EnableMadvWillNeed ¶
func (ii *InvertedIndex) EnableMadvWillNeed() *InvertedIndex
func (*InvertedIndex) EnableReadAhead ¶
func (ii *InvertedIndex) EnableReadAhead() *InvertedIndex
func (*InvertedIndex) Files ¶
func (ii *InvertedIndex) Files() (res []string)
func (*InvertedIndex) FinishWrites ¶
func (ii *InvertedIndex) FinishWrites()
func (*InvertedIndex) MakeContext ¶
func (ii *InvertedIndex) MakeContext() *InvertedIndexContext
func (*InvertedIndex) OpenFolder ¶
func (ii *InvertedIndex) OpenFolder() error
func (*InvertedIndex) OpenList ¶
func (ii *InvertedIndex) OpenList(fNames []string) error
func (*InvertedIndex) Rotate ¶
func (ii *InvertedIndex) Rotate() *invertedIndexWAL
func (*InvertedIndex) SetTx ¶
func (ii *InvertedIndex) SetTx(tx kv.RwTx)
func (*InvertedIndex) SetTxNum ¶
func (ii *InvertedIndex) SetTxNum(txNum uint64)
func (*InvertedIndex) StartWrites ¶
func (ii *InvertedIndex) StartWrites()
type InvertedIndexContext ¶
type InvertedIndexContext struct {
// contains filtered or unexported fields
}
func (*InvertedIndexContext) Close ¶
func (ic *InvertedIndexContext) Close()
func (*InvertedIndexContext) IdxRange ¶
func (ic *InvertedIndexContext) IdxRange(key []byte, startTxNum, endTxNum int, asc order.By, limit int, roTx kv.Tx) (iter.U64, error)
IdxRange - return range of txNums for given `key` is to be used in public API, therefore it relies on read-only transaction so that iteration can be done even when the inverted index is being updated. [startTxNum; endNumTx)
func (*InvertedIndexContext) IterateChangedKeys ¶
func (ic *InvertedIndexContext) IterateChangedKeys(startTxNum, endTxNum uint64, roTx kv.Tx) InvertedIterator1
type InvertedIterator1 ¶
type InvertedIterator1 struct {
// contains filtered or unexported fields
}
func (*InvertedIterator1) Close ¶
func (it *InvertedIterator1) Close()
func (*InvertedIterator1) HasNext ¶
func (it *InvertedIterator1) HasNext() bool
func (*InvertedIterator1) Next ¶
func (it *InvertedIterator1) Next(keyBuf []byte) []byte
type LocalityIndex ¶
type LocalityIndex struct {
// contains filtered or unexported fields
}
LocalityIndex - has info in which .ef files exists given key Format: key -> bitmap(step_number_list) step_number_list is list of .ef files where exists given key
func NewLocalityIndex ¶
func NewLocalityIndex( dir, tmpdir string, aggregationStep uint64, filenameBase string, ) (*LocalityIndex, error)
func (*LocalityIndex) BuildMissedIndices ¶
func (li *LocalityIndex) BuildMissedIndices(ctx context.Context, ii *InvertedIndex) error
func (*LocalityIndex) CleanupDir ¶
func (li *LocalityIndex) CleanupDir()
func (*LocalityIndex) Close ¶
func (li *LocalityIndex) Close()
func (*LocalityIndex) Files ¶
func (li *LocalityIndex) Files() (res []string)
func (*LocalityIndex) MakeContext ¶
func (li *LocalityIndex) MakeContext() *ctxLocalityIdx
func (*LocalityIndex) NewIdxReader ¶
func (li *LocalityIndex) NewIdxReader() *recsplit.IndexReader
func (*LocalityIndex) OpenList ¶
func (li *LocalityIndex) OpenList(fNames []string) error
type LocalityIndexFiles ¶
type LocalityIndexFiles struct {
// contains filtered or unexported fields
}
func (LocalityIndexFiles) Close ¶
func (sf LocalityIndexFiles) Close()
type LocalityIterator ¶
type LocalityIterator struct {
// contains filtered or unexported fields
}
func (*LocalityIterator) FilesAmount ¶
func (si *LocalityIterator) FilesAmount() uint64
func (*LocalityIterator) HasNext ¶
func (si *LocalityIterator) HasNext() bool
func (*LocalityIterator) Next ¶
func (si *LocalityIterator) Next() ([]byte, []uint64)
func (*LocalityIterator) Progress ¶
func (si *LocalityIterator) Progress() float64
type MergedFiles ¶
type MergedFiles struct {
// contains filtered or unexported fields
}
func (MergedFiles) Close ¶
func (mf MergedFiles) Close()
type MergedFilesV3 ¶
type MergedFilesV3 struct {
// contains filtered or unexported fields
}
func (MergedFilesV3) Close ¶
func (mf MergedFilesV3) Close()
func (MergedFilesV3) FrozenList ¶
func (mf MergedFilesV3) FrozenList() (frozen []string)
type OnFreezeFunc ¶
type OnFreezeFunc func(frozenFileNames []string)
type RCollation ¶
type RCollation struct {
// contains filtered or unexported fields
}
func (RCollation) Close ¶
func (c RCollation) Close()
type RMergedFiles ¶
type RMergedFiles struct {
// contains filtered or unexported fields
}
func (RMergedFiles) Close ¶
func (mf RMergedFiles) Close()
type RSelectedStaticFiles ¶
type RSelectedStaticFiles struct {
// contains filtered or unexported fields
}
func (RSelectedStaticFiles) Close ¶
func (sf RSelectedStaticFiles) Close()
type RStaticFiles ¶
type RStaticFiles struct {
// contains filtered or unexported fields
}
func (RStaticFiles) Close ¶
func (sf RStaticFiles) Close()
type ReadIndices ¶
type ReadIndices struct {
// contains filtered or unexported fields
}
func NewReadIndices ¶
func NewReadIndices( dir, tmpdir string, aggregationStep uint64, ) (*ReadIndices, error)
func (*ReadIndices) Close ¶
func (ri *ReadIndices) Close()
func (*ReadIndices) FinishTx ¶
func (ri *ReadIndices) FinishTx() error
func (*ReadIndices) ReadAccountCode ¶
func (ri *ReadIndices) ReadAccountCode(addr []byte) error
func (*ReadIndices) ReadAccountCodeSize ¶
func (ri *ReadIndices) ReadAccountCodeSize(addr []byte) error
func (*ReadIndices) ReadAccountData ¶
func (ri *ReadIndices) ReadAccountData(addr []byte) error
func (*ReadIndices) ReadAccountStorage ¶
func (ri *ReadIndices) ReadAccountStorage(addr []byte, loc []byte) error
func (*ReadIndices) SetTx ¶
func (ri *ReadIndices) SetTx(tx kv.RwTx)
func (*ReadIndices) SetTxNum ¶
func (ri *ReadIndices) SetTxNum(txNum uint64)
type RecentInvertedIdxIter ¶
type RecentInvertedIdxIter struct {
// contains filtered or unexported fields
}
RecentInvertedIdxIter allows iteration over range of tx numbers Iteration is not implmented via callback function, because there is often a requirement for interators to be composable (for example, to implement AND and OR for indices)
func (*RecentInvertedIdxIter) Close ¶
func (it *RecentInvertedIdxIter) Close()
func (*RecentInvertedIdxIter) HasNext ¶
func (it *RecentInvertedIdxIter) HasNext() bool
func (*RecentInvertedIdxIter) Next ¶
func (it *RecentInvertedIdxIter) Next() (uint64, error)
type ReconHeap ¶
type ReconHeap []*ReconItem
func (ReconHeap) Less ¶
Less (part of heap.Interface) compares two links. For persisted links, those with the lower block heights get evicted first. This means that more recently persisted links are preferred. For non-persisted links, those with the highest block heights get evicted first. This is to prevent "holes" in the block heights that may cause inability to insert headers in the ascending order of their block heights.
func (*ReconHeap) Pop ¶
func (rh *ReconHeap) Pop() interface{}
Pop (part of heap.Interface) removes the first link from the queue
func (*ReconHeap) Push ¶
func (rh *ReconHeap) Push(x interface{})
Push (part of heap.Interface) places a new link onto the end of queue. Note that idx attribute is set to the correct position of the new link
func (ReconHeap) Swap ¶
Swap (part of heap.Interface) moves two links in the queue into each other's places. Note that each link has idx attribute that is getting adjusted during the swap. The idx attribute allows the removal of links from the middle of the queue (in case if links are getting invalidated due to failed verification of unavailability of parent headers)
type ReconHeapOlderFirst ¶
type ReconHeapOlderFirst struct {
ReconHeap
}
func (ReconHeapOlderFirst) Less ¶
func (rh ReconHeapOlderFirst) Less(i, j int) bool
type ScanIteratorInc ¶
type ScanIteratorInc struct {
// contains filtered or unexported fields
}
func (*ScanIteratorInc) HasNext ¶
func (sii *ScanIteratorInc) HasNext() bool
func (*ScanIteratorInc) Next ¶
func (sii *ScanIteratorInc) Next() (uint64, error)
type SelectedStaticFiles ¶
type SelectedStaticFiles struct {
// contains filtered or unexported fields
}
func (SelectedStaticFiles) Close ¶
func (sf SelectedStaticFiles) Close()
type SelectedStaticFilesV3 ¶
type SelectedStaticFilesV3 struct {
// contains filtered or unexported fields
}
func (SelectedStaticFilesV3) Close ¶
func (sf SelectedStaticFilesV3) Close()
type StateAsOfIterDB ¶
type StateAsOfIterDB struct {
// contains filtered or unexported fields
}
StateAsOfIterDB - returns state range at given time in history
func (*StateAsOfIterDB) Close ¶
func (hi *StateAsOfIterDB) Close()
func (*StateAsOfIterDB) HasNext ¶
func (hi *StateAsOfIterDB) HasNext() bool
type StateAsOfIterDbDup ¶
type StateAsOfIterDbDup struct {
// contains filtered or unexported fields
}
StateAsOfIter - returns state range at given time in history
func (*StateAsOfIterDbDup) Close ¶
func (hi *StateAsOfIterDbDup) Close()
func (*StateAsOfIterDbDup) HasNext ¶
func (hi *StateAsOfIterDbDup) HasNext() bool
type StateAsOfIterF ¶
type StateAsOfIterF struct {
// contains filtered or unexported fields
}
StateAsOfIter - returns state range at given time in history
func (*StateAsOfIterF) Close ¶
func (hi *StateAsOfIterF) Close()
func (*StateAsOfIterF) HasNext ¶
func (hi *StateAsOfIterF) HasNext() bool
type StaticFiles ¶
type StaticFiles struct {
// contains filtered or unexported fields
}
func (StaticFiles) Close ¶
func (sf StaticFiles) Close()