state

package
v0.0.0-...-66aa405 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const BtreeLogPrefix = "btree"
View Source
const LocalityIndexUint64Limit = 64 //bitmap spend 1 bit per file, stored as uint64
View Source
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

View Source
var COMPARE_INDEXES = false // if true, will compare values from Btree and INvertedIndex
View Source
var DefaultBtreeM = uint64(2048)
View Source
var WALCollectorRAM = 2 * (etl.BufferOptimalSize / 8)

3 history + 4 indices = 10 etl collectors, 10*256Mb/8 = 512mb - for all indices buffers

Functions

func BuildBtreeIndex

func BuildBtreeIndex(dataPath, indexPath string) error

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

func DecodeAccountBytes(enc []byte) (nonce uint64, balance *uint256.Int, hash []byte)

func EncodeAccountBytes

func EncodeAccountBytes(nonce uint64, balance *uint256.Int, hash []byte, incarnation uint64) []byte

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 (ac *AggregatorContext) LogAddrIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)

func (*AggregatorContext) LogTopicIterator

func (ac *AggregatorContext) LogTopicIterator(topic []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)

func (*AggregatorContext) ReadAccountCode

func (ac *AggregatorContext) ReadAccountCode(addr []byte, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadAccountCodeBeforeTxNum

func (ac *AggregatorContext) ReadAccountCodeBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadAccountCodeSize

func (ac *AggregatorContext) ReadAccountCodeSize(addr []byte, roTx kv.Tx) (int, error)

func (*AggregatorContext) ReadAccountCodeSizeBeforeTxNum

func (ac *AggregatorContext) ReadAccountCodeSizeBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) (int, error)

func (*AggregatorContext) ReadAccountData

func (ac *AggregatorContext) ReadAccountData(addr []byte, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadAccountDataBeforeTxNum

func (ac *AggregatorContext) ReadAccountDataBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadAccountStorage

func (ac *AggregatorContext) ReadAccountStorage(addr []byte, loc []byte, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadAccountStorageBeforeTxNum

func (ac *AggregatorContext) ReadAccountStorageBeforeTxNum(addr []byte, loc []byte, txNum uint64, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadCommitment

func (ac *AggregatorContext) ReadCommitment(addr []byte, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) ReadCommitmentBeforeTxNum

func (ac *AggregatorContext) ReadCommitmentBeforeTxNum(addr []byte, txNum uint64, roTx kv.Tx) ([]byte, error)

func (*AggregatorContext) TraceFromIterator

func (ac *AggregatorContext) TraceFromIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)

func (*AggregatorContext) TraceToIterator

func (ac *AggregatorContext) TraceToIterator(addr []byte, startTxNum, endTxNum int, roTx kv.Tx) (iter.U64, error)

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 (as *AggregatorStep) ReadAccountCodeNoState(addr []byte, txNum uint64) ([]byte, bool, uint64)

func (*AggregatorStep) ReadAccountCodeSizeNoState

func (as *AggregatorStep) ReadAccountCodeSizeNoState(addr []byte, txNum uint64) (int, bool, uint64)

func (*AggregatorStep) ReadAccountDataNoState

func (as *AggregatorStep) ReadAccountDataNoState(addr []byte, txNum uint64) ([]byte, bool, uint64)

func (*AggregatorStep) ReadAccountStorageNoState

func (as *AggregatorStep) ReadAccountStorageNoState(addr []byte, loc []byte, txNum uint64) ([]byte, bool, uint64)

func (*AggregatorStep) TxNumRange

func (as *AggregatorStep) TxNumRange() (uint64, uint64)

type AggregatorV3

type AggregatorV3 struct {
	// contains filtered or unexported fields
}

func NewAggregatorV3

func NewAggregatorV3(ctx context.Context, dir, tmpdir string, aggregationStep uint64, db kv.RoDB) (*AggregatorV3, error)

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) CanPrune

func (a *AggregatorV3) CanPrune(tx kv.Tx) bool

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) Flush

func (a *AggregatorV3) Flush(ctx context.Context, tx kv.RwTx) error

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) Prune

func (a *AggregatorV3) Prune(ctx context.Context, limit uint64) error

func (*AggregatorV3) PruneWithTiemout

func (a *AggregatorV3) PruneWithTiemout(ctx context.Context, timeout time.Duration) error

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

func (*AggregatorV3) Unwind

func (a *AggregatorV3) Unwind(ctx context.Context, txUnwindTo uint64, stateLoad etl.LoadFunc) error

func (*AggregatorV3) Warmup

func (a *AggregatorV3) Warmup(ctx context.Context, txFrom, limit uint64) error

type AggregatorV3Context

type AggregatorV3Context struct {
	// contains filtered or unexported fields
}

func (*AggregatorV3Context) AccountHistoricalStateRange

func (ac *AggregatorV3Context) AccountHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV

func (*AggregatorV3Context) AccountHistoryRange

func (ac *AggregatorV3Context) AccountHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)

func (*AggregatorV3Context) AccountHistoyIdxRange

func (ac *AggregatorV3Context) AccountHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

func (*AggregatorV3Context) Close

func (ac *AggregatorV3Context) Close()

func (*AggregatorV3Context) CodeHistoricalStateRange

func (ac *AggregatorV3Context) CodeHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV

func (*AggregatorV3Context) CodeHistoryRange

func (ac *AggregatorV3Context) CodeHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)

func (*AggregatorV3Context) CodeHistoyIdxRange

func (ac *AggregatorV3Context) CodeHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

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 (ac *AggregatorV3Context) LogTopicRange(topic []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

func (*AggregatorV3Context) ReadAccountCodeNoState

func (ac *AggregatorV3Context) ReadAccountCodeNoState(addr []byte, txNum uint64) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountCodeNoStateWithRecent

func (ac *AggregatorV3Context) ReadAccountCodeNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountCodeSizeNoState

func (ac *AggregatorV3Context) ReadAccountCodeSizeNoState(addr []byte, txNum uint64) (int, bool, error)

func (*AggregatorV3Context) ReadAccountCodeSizeNoStateWithRecent

func (ac *AggregatorV3Context) ReadAccountCodeSizeNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) (int, bool, error)

func (*AggregatorV3Context) ReadAccountDataNoState

func (ac *AggregatorV3Context) ReadAccountDataNoState(addr []byte, txNum uint64) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountDataNoStateWithRecent

func (ac *AggregatorV3Context) ReadAccountDataNoStateWithRecent(addr []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountStorageNoState

func (ac *AggregatorV3Context) ReadAccountStorageNoState(addr []byte, loc []byte, txNum uint64) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountStorageNoStateWithRecent

func (ac *AggregatorV3Context) ReadAccountStorageNoStateWithRecent(addr []byte, loc []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)

func (*AggregatorV3Context) ReadAccountStorageNoStateWithRecent2

func (ac *AggregatorV3Context) ReadAccountStorageNoStateWithRecent2(key []byte, txNum uint64, tx kv.Tx) ([]byte, bool, error)

func (*AggregatorV3Context) StorageHistoricalStateRange

func (ac *AggregatorV3Context) StorageHistoricalStateRange(startTxNum uint64, from, to []byte, limit int, tx kv.Tx) iter.KV

func (*AggregatorV3Context) StorageHistoryRange

func (ac *AggregatorV3Context) StorageHistoryRange(startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.KV, error)

func (*AggregatorV3Context) StorageHistoyIdxRange

func (ac *AggregatorV3Context) StorageHistoyIdxRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

func (*AggregatorV3Context) TraceFromRange

func (ac *AggregatorV3Context) TraceFromRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

func (*AggregatorV3Context) TraceToRange

func (ac *AggregatorV3Context) TraceToRange(addr []byte, startTxNum, endTxNum int, asc order.By, limit int, tx kv.Tx) (iter.U64, error)

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 CreateBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error)

func CreateBtreeIndexWithDecompressor

func CreateBtreeIndexWithDecompressor(indexPath string, M uint64, decompressor *compress.Decompressor, p *background.Progress) (*BtIndex, error)

func OpenBtreeIndex

func OpenBtreeIndex(indexPath, dataPath string, M uint64) (*BtIndex, error)

func OpenBtreeIndexWithDecompressor

func OpenBtreeIndexWithDecompressor(indexPath string, M uint64, kv *compress.Decompressor) (*BtIndex, error)

func (*BtIndex) Close

func (b *BtIndex) Close() error

func (*BtIndex) Empty

func (b *BtIndex) Empty() bool

func (*BtIndex) FileName

func (b *BtIndex) FileName() string

func (*BtIndex) FilePath

func (b *BtIndex) FilePath() string

func (*BtIndex) KeyCount

func (b *BtIndex) KeyCount() uint64

func (*BtIndex) Lookup

func (b *BtIndex) Lookup(key []byte) uint64

deprecated

func (*BtIndex) ModTime

func (b *BtIndex) ModTime() time.Time

func (*BtIndex) OrdinalLookup

func (b *BtIndex) OrdinalLookup(i uint64) *Cursor

func (*BtIndex) Seek

func (b *BtIndex) Seek(x []byte) (*Cursor, error)

func (*BtIndex) Size

func (b *BtIndex) Size() int64

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

func (*BtIndexReader) Seek

func (r *BtIndexReader) Seek(x []byte) (*Cursor, error)

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) AddKey

func (btw *BtIndexWriter) AddKey(key []byte, offset uint64) error

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 BtIndexWriterArgs struct {
	IndexFile   string // File name where the index and the minimal perfect hash function will be written to
	TmpDir      string
	KeyCount    int
	EtlBufLimit datasize.ByteSize
}

type Collation

type Collation struct {
	// contains filtered or unexported fields
}

Collation is the set of compressors created after aggregation

func (Collation) Close

func (c Collation) Close()

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 Cursor

type Cursor struct {
	// contains filtered or unexported fields
}

func (*Cursor) Key

func (c *Cursor) Key() []byte

func (*Cursor) Next

func (c *Cursor) Next() bool

func (*Cursor) Ordinal

func (c *Cursor) Ordinal() uint64

func (*Cursor) Value

func (c *Cursor) Value() []byte

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 CursorType

type CursorType uint8
const (
	FILE_CURSOR CursorType = iota
	DB_CURSOR
)

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 NewDomain

func NewDomain(dir, tmpdir string, aggregationStep uint64,
	filenameBase, keysTable, valsTable, indexKeysTable, historyValsTable, indexTable string,
	compressVals, largeValues bool) (*Domain, error)

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) Close

func (d *Domain) Close()

func (*Domain) Delete

func (d *Domain) Delete(key1, key2 []byte) error

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 (d *Domain) OpenFolder() error

func (*Domain) OpenList

func (d *Domain) OpenList(fNames []string) error

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) Put

func (d *Domain) Put(key1, key2, val []byte) error

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) Get

func (dc *DomainContext) Get(key1, key2 []byte, roTx kv.Tx) ([]byte, error)

func (*DomainContext) GetBeforeTxNum

func (dc *DomainContext) GetBeforeTxNum(key []byte, txNum uint64, roTx kv.Tx) ([]byte, error)

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 FilesStats struct {
	HistoryReads uint64
	TotalReads   uint64
	IdxAccess    time.Duration
	TxCount      uint64
	FilesCount   uint64
	IdxSize      uint64
	DataSize     uint64
}

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 NewHistory(dir, tmpdir string, aggregationStep uint64,
	filenameBase, indexKeysTable, indexTable, historyValsTable string,
	compressVals bool, integrityFileExtensions []string, largeValues bool) (*History, error)

func (*History) AddPrevValue

func (h *History) AddPrevValue(key1, key2, original []byte) (err error)

func (*History) BuildMissedIndices

func (h *History) BuildMissedIndices(ctx context.Context, g *errgroup.Group, ps *background.ProgressSet)

func (*History) BuildOptionalMissedIndices

func (h *History) BuildOptionalMissedIndices(ctx context.Context) (err error)

BuildMissedIndices - produce .efi/.vi/.kvi from .ef/.v/.kv

func (*History) CleanupDir

func (h *History) CleanupDir()

func (*History) Close

func (h *History) Close()

func (*History) DisableReadAhead

func (h *History) DisableReadAhead()

func (*History) DiscardHistory

func (h *History) DiscardHistory()

func (*History) EnableMadvNormalReadAhead

func (h *History) EnableMadvNormalReadAhead() *History

func (*History) EnableMadvWillNeed

func (h *History) EnableMadvWillNeed() *History

func (*History) EnableReadAhead

func (h *History) EnableReadAhead() *History

func (*History) Files

func (h *History) Files() (res []string)

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 (h *History) OpenFolder() error

func (*History) OpenList

func (h *History) OpenList(fNames []string) error

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) Rotate

func (h *History) Rotate() historyFlusher

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

func (*HistoryChangesIterDB) Next

func (hi *HistoryChangesIterDB) Next() ([]byte, []byte, error)

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

func (*HistoryChangesIterDBDup) Next

func (hi *HistoryChangesIterDBDup) Next() ([]byte, []byte, error)

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

func (*HistoryChangesIterF) Next

func (hi *HistoryChangesIterF) Next() ([]byte, []byte, error)

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 (hc *HistoryContext) GetNoState(key []byte, txNum uint64) ([]byte, bool, error)

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

func (hc *HistoryContext) HistoryRange(fromTxNum, toTxNum int, asc order.By, limit int, roTx kv.Tx) (iter.KV, error)

func (*HistoryContext) IdxRange

func (hc *HistoryContext) IdxRange(key []byte, startTxNum, endTxNum int, asc order.By, limit int, roTx kv.Tx) (iter.U64, error)

func (*HistoryContext) WalkAsOf

func (hc *HistoryContext) WalkAsOf(startTxNum uint64, from, to []byte, roTx kv.Tx, limit int) iter.KV

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

func (*HistoryIteratorInc) Next

func (hii *HistoryIteratorInc) Next() ([]byte, []byte, error)

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

func (hs *HistoryStep) GetNoState(key []byte, txNum uint64) ([]byte, bool, uint64)

func (*HistoryStep) MaxTxNum

func (hs *HistoryStep) MaxTxNum(key []byte) (bool, uint64)

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 NewInvertedIndex(
	dir, tmpdir string,
	aggregationStep uint64,
	filenameBase string,
	indexKeysTable string,
	indexTable string,
	withLocalityIndex bool,
	integrityFileExtensions []string,
) (*InvertedIndex, error)

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 RRanges

type RRanges struct {
	// contains filtered or unexported fields
}

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 Ranges

type Ranges struct {
	// contains filtered or unexported fields
}

func (Ranges) String

func (r Ranges) String() string

type RangesV3

type RangesV3 struct {
	// contains filtered or unexported fields
}

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) Len

func (rh ReconHeap) Len() int

func (ReconHeap) Less

func (rh ReconHeap) Less(i, j int) bool

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

func (rh ReconHeap) Swap(i, j int)

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 ReconItem

type ReconItem struct {
	// contains filtered or unexported fields
}

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

func (*StateAsOfIterDB) Next

func (hi *StateAsOfIterDB) Next() ([]byte, []byte, error)

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

func (*StateAsOfIterDbDup) Next

func (hi *StateAsOfIterDbDup) Next() ([]byte, []byte, error)

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

func (*StateAsOfIterF) Next

func (hi *StateAsOfIterF) Next() ([]byte, []byte, error)

type StaticFiles

type StaticFiles struct {
	// contains filtered or unexported fields
}

func (StaticFiles) Close

func (sf StaticFiles) Close()

type ValueMerger

type ValueMerger func(prev, current []byte) (merged []byte, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL