Documentation ¶
Index ¶
- Constants
- Variables
- func WalkAccountHashesWrites(writes [5]*btree.BTree, ...)
- func WalkStorageHashesWrites(writes [5]*btree.BTree, ...)
- func WalkWrites(writes [5]*btree.BTree, ...) error
- type AccountHashItem
- func (ahi *AccountHashItem) ClearFlags(flags uint16)
- func (ahi *AccountHashItem) CopyValueFrom(item CacheItem)
- func (ahi *AccountHashItem) GetQueuePos() int
- func (ahi *AccountHashItem) GetSequence() int
- func (ahi *AccountHashItem) GetSize() int
- func (ahi *AccountHashItem) HasFlag(flag uint16) bool
- func (ahi *AccountHashItem) HasPrefix(prefix CacheItem) bool
- func (ahi *AccountHashItem) Less(than btree.Item) bool
- func (ahi *AccountHashItem) SetFlags(flags uint16)
- func (ahi *AccountHashItem) SetQueuePos(pos int)
- func (ahi *AccountHashItem) SetSequence(sequence int)
- func (ahi *AccountHashItem) String() string
- type AccountHashWriteItem
- type AccountItem
- func (ai *AccountItem) ClearFlags(flags uint16)
- func (ai *AccountItem) CopyValueFrom(item CacheItem)
- func (ai *AccountItem) GetQueuePos() int
- func (ai *AccountItem) GetSequence() int
- func (ai *AccountItem) GetSize() int
- func (ai *AccountItem) HasFlag(flag uint16) bool
- func (ai *AccountItem) HasPrefix(prefix CacheItem) bool
- func (ai *AccountItem) Less(than btree.Item) bool
- func (ai *AccountItem) SetFlags(flags uint16)
- func (ai *AccountItem) SetQueuePos(pos int)
- func (ai *AccountItem) SetSequence(sequence int)
- func (ai *AccountItem) String() string
- type AccountSeek
- type AccountWriteItem
- type Accumulator
- func (a *Accumulator) ChangeAccount(address libcommon.Address, incarnation uint64, data []byte)
- func (a *Accumulator) ChangeCode(address libcommon.Address, incarnation uint64, code []byte)
- func (a *Accumulator) ChangeStorage(address libcommon.Address, incarnation uint64, location libcommon.Hash, ...)
- func (a *Accumulator) CopyAndReset(target *Accumulator)
- func (a *Accumulator) DeleteAccount(address libcommon.Address)
- func (a *Accumulator) Reset(plainStateID uint64)
- func (a *Accumulator) SendAndReset(ctx context.Context, c StateChangeConsumer, pendingBaseFee uint64, ...)
- func (a *Accumulator) SetStateID(stateID uint64)
- func (a *Accumulator) StartChange(blockHeight uint64, blockHash libcommon.Hash, txs [][]byte, unwind bool)
- type CacheItem
- type CacheWriteItem
- type CodeItem
- func (ci *CodeItem) ClearFlags(flags uint16)
- func (ci *CodeItem) CopyValueFrom(item CacheItem)
- func (ci *CodeItem) GetQueuePos() int
- func (ci *CodeItem) GetSequence() int
- func (ci *CodeItem) GetSize() int
- func (ci *CodeItem) HasFlag(flag uint16) bool
- func (ci *CodeItem) HasPrefix(prefix CacheItem) bool
- func (ci *CodeItem) Less(than btree.Item) bool
- func (ci *CodeItem) SetFlags(flags uint16)
- func (ci *CodeItem) SetQueuePos(pos int)
- func (ci *CodeItem) SetSequence(sequence int)
- func (ci *CodeItem) String() string
- type CodeWriteItem
- type Events
- func (e *Events) AddHeaderSubscription() (chan [][]byte, func())
- func (e *Events) AddLogsSubscription() (chan []*remote.SubscribeLogsReply, func())
- func (e *Events) AddNewSnapshotSubscription() (chan struct{}, func())
- func (e *Events) AddPendingBlockSubscription(s PendingBlockSubscription)
- func (e *Events) AddPendingLogsSubscription(s PendingLogsSubscription)
- func (e *Events) EmptyLogSubsctiption(empty bool)
- func (e *Events) HasLogSubsriptions() bool
- func (e *Events) OnLogs(logs []*remote.SubscribeLogsReply)
- func (e *Events) OnNewHeader(newHeadersRlp [][]byte)
- func (e *Events) OnNewPendingLogs(logs types.Logs)
- func (e *Events) OnNewSnapshot()
- type HeaderSubscription
- type LogsSubscription
- type NewSnapshotSubscription
- type Notifications
- type PendingBlockSubscription
- type PendingLogsSubscription
- type PendingTxsSubscription
- type ReadHeap
- type RpcEventType
- type StateCache
- func (sc *StateCache) AccountHashCount() int
- func (sc *StateCache) AccountHashesSeek(prefix []byte) ([]byte, uint16, uint16, uint16, []libcommon.Hash)
- func (sc *StateCache) AccountTree(prefix []byte, ...) error
- func (sc *StateCache) Clone() *StateCache
- func (sc *StateCache) DebugPrintAccounts() error
- func (sc *StateCache) DeprecatedSetAccountDelete(addrHash libcommon.Hash)
- func (sc *StateCache) DeprecatedSetAccountRead(addrHash libcommon.Hash, account *accounts.Account)
- func (sc *StateCache) DeprecatedSetAccountWrite(addrHash libcommon.Hash, account *accounts.Account)
- func (sc *StateCache) DeprecatedSetStorageDelete(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash)
- func (sc *StateCache) DeprecatedSetStorageRead(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash, ...)
- func (sc *StateCache) DeprecatedSetStorageWrite(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash, v []byte)
- func (sc *StateCache) GetAccount(address []byte) (*accounts.Account, bool)
- func (sc *StateCache) GetAccountByHashedAddress(addrHash libcommon.Hash) (*accounts.Account, bool)
- func (sc *StateCache) GetAccountHash(prefix []byte) ([]byte, uint16, uint16, uint16, []libcommon.Hash, bool)
- func (sc *StateCache) GetCode(address []byte, incarnation uint64) ([]byte, bool)
- func (sc *StateCache) GetDeletedAccount(address []byte) *accounts.Account
- func (sc *StateCache) GetStorage(address []byte, incarnation uint64, location []byte) ([]byte, bool)
- func (sc *StateCache) GetStorageByHashedAddress(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash) ([]byte, bool)
- func (sc *StateCache) GetStorageHash(addrHash libcommon.Hash, incarnation uint64, prefix []byte) ([]byte, uint16, uint16, uint16, []libcommon.Hash, bool)
- func (sc *StateCache) HasAccountHashWithPrefix(addrHashPrefix []byte) bool
- func (sc *StateCache) HasAccountWithInPrefix(addrHashPrefix []byte) bool
- func (sc *StateCache) PrepareWrites() [5]*btree.BTree
- func (sc *StateCache) ReadSize() int
- func (sc *StateCache) SetAccountAbsent(address []byte)
- func (sc *StateCache) SetAccountDelete(address []byte)
- func (sc *StateCache) SetAccountHashDelete(prefix []byte)
- func (sc *StateCache) SetAccountHashWrite(prefix []byte, hasState, hasTree, hasHash uint16, hashes []libcommon.Hash)
- func (sc *StateCache) SetAccountHashesRead(prefix []byte, hasState, hasTree, hasHash uint16, hashes []libcommon.Hash)
- func (sc *StateCache) SetAccountRead(address []byte, account *accounts.Account)
- func (sc *StateCache) SetAccountWrite(address []byte, account *accounts.Account)
- func (sc *StateCache) SetCodeAbsent(address []byte, incarnation uint64)
- func (sc *StateCache) SetCodeDelete(address []byte, incarnation uint64)
- func (sc *StateCache) SetCodeRead(address []byte, incarnation uint64, code []byte)
- func (sc *StateCache) SetCodeWrite(address []byte, incarnation uint64, code []byte)
- func (sc *StateCache) SetStorageAbsent(address []byte, incarnation uint64, location []byte)
- func (sc *StateCache) SetStorageDelete(address []byte, incarnation uint64, location []byte)
- func (sc *StateCache) SetStorageHashDelete(addrHash libcommon.Hash, incarnation uint64, locHashPrefix []byte, ...)
- func (sc *StateCache) SetStorageHashRead(addrHash libcommon.Hash, incarnation uint64, locHashPrefix []byte, ...)
- func (sc *StateCache) SetStorageHashWrite(addrHash libcommon.Hash, incarnation uint64, locHashPrefix []byte, ...)
- func (sc *StateCache) SetStorageRead(address []byte, incarnation uint64, location []byte, value []byte)
- func (sc *StateCache) SetStorageWrite(address []byte, incarnation uint64, location []byte, value []byte)
- func (sc *StateCache) StorageHashesSeek(addrHash libcommon.Hash, incarnation uint64, prefix []byte) ([]byte, uint16, uint16, uint16, []libcommon.Hash)
- func (sc *StateCache) StorageTree(prefix []byte, accHash libcommon.Hash, incarnation uint64, ...) error
- func (sc *StateCache) TotalCount() (res int)
- func (sc *StateCache) TurnWritesToReads(writes [5]*btree.BTree)
- func (sc *StateCache) WalkAccounts(prefix []byte, ...) error
- func (sc *StateCache) WalkStorage(addrHash libcommon.Hash, incarnation uint64, prefix []byte, ...) error
- func (sc *StateCache) WalkStorageHashes(...) error
- func (sc *StateCache) WriteCount() (res int)
- func (sc *StateCache) WriteSize() int
- type StateChangeConsumer
- type StorageHashItem
- func (shi *StorageHashItem) ClearFlags(flags uint16)
- func (shi *StorageHashItem) CopyValueFrom(item CacheItem)
- func (shi *StorageHashItem) GetQueuePos() int
- func (shi *StorageHashItem) GetSequence() int
- func (shi *StorageHashItem) GetSize() int
- func (shi *StorageHashItem) HasFlag(flag uint16) bool
- func (shi *StorageHashItem) HasPrefix(prefix CacheItem) bool
- func (shi *StorageHashItem) Less(than btree.Item) bool
- func (shi *StorageHashItem) SetFlags(flags uint16)
- func (shi *StorageHashItem) SetQueuePos(pos int)
- func (shi *StorageHashItem) SetSequence(sequence int)
- func (shi *StorageHashItem) String() string
- type StorageHashWriteItem
- type StorageItem
- func (si *StorageItem) ClearFlags(flags uint16)
- func (si *StorageItem) CopyValueFrom(item CacheItem)
- func (si *StorageItem) GetQueuePos() int
- func (si *StorageItem) GetSequence() int
- func (si *StorageItem) GetSize() int
- func (si *StorageItem) HasFlag(flag uint16) bool
- func (si *StorageItem) HasPrefix(prefix CacheItem) bool
- func (si *StorageItem) Less(than btree.Item) bool
- func (si *StorageItem) SetFlags(flags uint16)
- func (si *StorageItem) SetQueuePos(pos int)
- func (si *StorageItem) SetSequence(sequence int)
- func (si *StorageItem) String() string
- type StorageSeek
- type StorageWriteItem
- type UnprocessedHeap
Constants ¶
const ( ModifiedFlag uint16 = 1 // Set when the item is different seek what is last committed to the database AbsentFlag uint16 = 2 // Set when the item is absent in the state DeletedFlag uint16 = 4 // Set when the item is marked for deletion, even though it might have the value in it UnprocessedFlag uint16 = 8 // Set when there is a modification in the item that invalidates merkle root calculated previously )
Variables ¶
var ( AccRead = metrics.GetOrCreateCounter(`cache_total{target="acc_read"}`) StRead = metrics.GetOrCreateCounter(`cache_total{target="st_read"}`) WritesRead = metrics.GetOrCreateCounter(`cache_total{target="write"}`) )
Metrics
Functions ¶
func WalkAccountHashesWrites ¶
func WalkStorageHashesWrites ¶
func WalkStorageHashesWrites(writes [5]*btree.BTree, update func(addrHash libcommon.Hash, incarnation uint64, locHashPrefix []byte, hasState, hasTree, hasHash uint16, h []libcommon.Hash), del func(addrHash libcommon.Hash, incarnation uint64, locHashPrefix []byte, hasStat, hasTree, hasHash uint16, h []libcommon.Hash))
func WalkWrites ¶
func WalkWrites( writes [5]*btree.BTree, accountWrite func(address []byte, account *accounts.Account) error, accountDelete func(address []byte, original *accounts.Account) error, storageWrite func(address []byte, incarnation uint64, location []byte, value []byte) error, storageDelete func(address []byte, incarnation uint64, location []byte) error, codeWrite func(address []byte, incarnation uint64, code []byte) error, codeDelete func(address []byte, incarnation uint64) error, ) error
Types ¶
type AccountHashItem ¶
type AccountHashItem struct {
// contains filtered or unexported fields
}
func (*AccountHashItem) ClearFlags ¶
func (ahi *AccountHashItem) ClearFlags(flags uint16)
func (*AccountHashItem) CopyValueFrom ¶
func (ahi *AccountHashItem) CopyValueFrom(item CacheItem)
func (*AccountHashItem) GetQueuePos ¶
func (ahi *AccountHashItem) GetQueuePos() int
func (*AccountHashItem) GetSequence ¶
func (ahi *AccountHashItem) GetSequence() int
func (*AccountHashItem) GetSize ¶
func (ahi *AccountHashItem) GetSize() int
func (*AccountHashItem) HasFlag ¶
func (ahi *AccountHashItem) HasFlag(flag uint16) bool
func (*AccountHashItem) HasPrefix ¶
func (ahi *AccountHashItem) HasPrefix(prefix CacheItem) bool
func (*AccountHashItem) SetFlags ¶
func (ahi *AccountHashItem) SetFlags(flags uint16)
func (*AccountHashItem) SetQueuePos ¶
func (ahi *AccountHashItem) SetQueuePos(pos int)
func (*AccountHashItem) SetSequence ¶
func (ahi *AccountHashItem) SetSequence(sequence int)
func (*AccountHashItem) String ¶
func (ahi *AccountHashItem) String() string
type AccountHashWriteItem ¶
type AccountHashWriteItem struct {
// contains filtered or unexported fields
}
func (*AccountHashWriteItem) GetCacheItem ¶
func (awi *AccountHashWriteItem) GetCacheItem() CacheItem
func (*AccountHashWriteItem) GetSize ¶
func (awi *AccountHashWriteItem) GetSize() int
func (*AccountHashWriteItem) SetCacheItem ¶
func (awi *AccountHashWriteItem) SetCacheItem(item CacheItem)
type AccountItem ¶
type AccountItem struct {
// contains filtered or unexported fields
}
AccountItem is an element in the `readWrites` B-tree representing an Ethereum account. It can mean either value just read seek the database and cache (read), or value that is different seek what the last committed value in the DB is (write). Reads can be removed or evicted seek the B-tree at any time, because this does not hurt the consistency. Writes cannot be removed or evicted one by one, therefore they can either be deleted all together, or committed all together and turned into reads.
func (*AccountItem) ClearFlags ¶
func (ai *AccountItem) ClearFlags(flags uint16)
func (*AccountItem) CopyValueFrom ¶
func (ai *AccountItem) CopyValueFrom(item CacheItem)
func (*AccountItem) GetQueuePos ¶
func (ai *AccountItem) GetQueuePos() int
func (*AccountItem) GetSequence ¶
func (ai *AccountItem) GetSequence() int
func (*AccountItem) GetSize ¶
func (ai *AccountItem) GetSize() int
func (*AccountItem) HasFlag ¶
func (ai *AccountItem) HasFlag(flag uint16) bool
func (*AccountItem) HasPrefix ¶
func (ai *AccountItem) HasPrefix(prefix CacheItem) bool
func (*AccountItem) SetFlags ¶
func (ai *AccountItem) SetFlags(flags uint16)
func (*AccountItem) SetQueuePos ¶
func (ai *AccountItem) SetQueuePos(pos int)
func (*AccountItem) SetSequence ¶
func (ai *AccountItem) SetSequence(sequence int)
func (*AccountItem) String ¶
func (ai *AccountItem) String() string
type AccountSeek ¶
type AccountSeek struct {
// contains filtered or unexported fields
}
AccountSeek allows to traverse sub-tree
type AccountWriteItem ¶
type AccountWriteItem struct {
// contains filtered or unexported fields
}
AccountWriteItem is an item in the `writes` B-tree. As can be seen, it always references a corresponding `AccountItem`. There can be `AccountItem` without corresponding `AccountWriteItem` (in that case `AccountItem` represents a cached read), but there cannot be `AccountWriteItem` without a corresponding `AccountItem`. Such pair represents an account that has been modified in the cache, but the modification has not been committed to the database yet. The correspondence of an `ai AccountItem` and an `awi AccountWriteItem` implies that `keccak(awi.address) == ai.addrHash`.
func (*AccountWriteItem) GetCacheItem ¶
func (awi *AccountWriteItem) GetCacheItem() CacheItem
func (*AccountWriteItem) GetSize ¶
func (awi *AccountWriteItem) GetSize() int
func (*AccountWriteItem) SetCacheItem ¶
func (awi *AccountWriteItem) SetCacheItem(item CacheItem)
type Accumulator ¶
type Accumulator struct {
// contains filtered or unexported fields
}
Accumulator collects state changes in a form that can then be delivered to the RPC daemon
func NewAccumulator ¶
func NewAccumulator() *Accumulator
func (*Accumulator) ChangeAccount ¶
func (a *Accumulator) ChangeAccount(address libcommon.Address, incarnation uint64, data []byte)
ChangeAccount adds modification of account balance or nonce (or both) to the latest change
func (*Accumulator) ChangeCode ¶
func (a *Accumulator) ChangeCode(address libcommon.Address, incarnation uint64, code []byte)
ChangeCode adds code to the latest change
func (*Accumulator) ChangeStorage ¶
func (*Accumulator) CopyAndReset ¶
func (a *Accumulator) CopyAndReset(target *Accumulator)
func (*Accumulator) DeleteAccount ¶
func (a *Accumulator) DeleteAccount(address libcommon.Address)
DeleteAccount marks account as deleted
func (*Accumulator) Reset ¶
func (a *Accumulator) Reset(plainStateID uint64)
func (*Accumulator) SendAndReset ¶
func (a *Accumulator) SendAndReset(ctx context.Context, c StateChangeConsumer, pendingBaseFee uint64, blockGasLimit uint64)
func (*Accumulator) SetStateID ¶
func (a *Accumulator) SetStateID(stateID uint64)
func (*Accumulator) StartChange ¶
func (a *Accumulator) StartChange(blockHeight uint64, blockHash libcommon.Hash, txs [][]byte, unwind bool)
StartChange begins accumulation of changes for a new block
type CacheItem ¶
type CacheItem interface { btree.Item GetSequence() int SetSequence(sequence int) GetSize() int GetQueuePos() int SetQueuePos(pos int) HasFlag(flag uint16) bool // Check if specified flag is set SetFlags(flags uint16) // Set specified flags, but leaves other flags alone ClearFlags(flags uint16) // Clear specified flags, but laves other flags alone CopyValueFrom(item CacheItem) // Copy value (not key) seek given item HasPrefix(prefix CacheItem) bool // Whether this item has specified item as a prefix }
type CacheWriteItem ¶
type CodeItem ¶
type CodeItem struct {
// contains filtered or unexported fields
}
func (*CodeItem) ClearFlags ¶
func (*CodeItem) CopyValueFrom ¶
func (*CodeItem) GetQueuePos ¶
func (*CodeItem) GetSequence ¶
func (*CodeItem) SetQueuePos ¶
func (*CodeItem) SetSequence ¶
type CodeWriteItem ¶
type CodeWriteItem struct {
// contains filtered or unexported fields
}
func (*CodeWriteItem) GetCacheItem ¶
func (cwi *CodeWriteItem) GetCacheItem() CacheItem
func (*CodeWriteItem) GetSize ¶
func (cwi *CodeWriteItem) GetSize() int
func (*CodeWriteItem) SetCacheItem ¶
func (cwi *CodeWriteItem) SetCacheItem(item CacheItem)
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events manages event subscriptions and dissimination. Thread-safe
func (*Events) AddHeaderSubscription ¶
func (*Events) AddLogsSubscription ¶
func (e *Events) AddLogsSubscription() (chan []*remote.SubscribeLogsReply, func())
func (*Events) AddNewSnapshotSubscription ¶
func (e *Events) AddNewSnapshotSubscription() (chan struct{}, func())
func (*Events) AddPendingBlockSubscription ¶
func (e *Events) AddPendingBlockSubscription(s PendingBlockSubscription)
func (*Events) AddPendingLogsSubscription ¶
func (e *Events) AddPendingLogsSubscription(s PendingLogsSubscription)
func (*Events) EmptyLogSubsctiption ¶
func (*Events) HasLogSubsriptions ¶
func (*Events) OnLogs ¶
func (e *Events) OnLogs(logs []*remote.SubscribeLogsReply)
func (*Events) OnNewHeader ¶
func (*Events) OnNewPendingLogs ¶
func (*Events) OnNewSnapshot ¶
func (e *Events) OnNewSnapshot()
type HeaderSubscription ¶
type LogsSubscription ¶
type LogsSubscription func([]*remote.SubscribeLogsReply) error
type NewSnapshotSubscription ¶
type NewSnapshotSubscription func() error
type Notifications ¶
type Notifications struct { Events *Events Accumulator *Accumulator StateChangesConsumer StateChangeConsumer }
type PendingLogsSubscription ¶
type PendingTxsSubscription ¶
type PendingTxsSubscription func([]types.Transaction) error
type RpcEventType ¶
type RpcEventType uint64
type StateCache ¶
type StateCache struct {
// contains filtered or unexported fields
}
StateCache is the structure containing B-trees and priority queues for the state cache
func NewStateCache ¶
func NewStateCache(degree int, limit datasize.ByteSize) *StateCache
NewStateCache create a new state cache based on the B-trees of specific degree. The second and the third parameters are the limit on the number of reads and writes to cache, respectively
func (*StateCache) AccountHashCount ¶
func (sc *StateCache) AccountHashCount() int
func (*StateCache) AccountHashesSeek ¶
func (*StateCache) AccountTree ¶
func (*StateCache) Clone ¶
func (sc *StateCache) Clone() *StateCache
Clone creates a clone cache which can be modified independently, but it shares the parts of the cache that are common
func (*StateCache) DebugPrintAccounts ¶
func (sc *StateCache) DebugPrintAccounts() error
func (*StateCache) DeprecatedSetAccountDelete ¶
func (sc *StateCache) DeprecatedSetAccountDelete(addrHash libcommon.Hash)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) DeprecatedSetAccountRead ¶
func (sc *StateCache) DeprecatedSetAccountRead(addrHash libcommon.Hash, account *accounts.Account)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) DeprecatedSetAccountWrite ¶
func (sc *StateCache) DeprecatedSetAccountWrite(addrHash libcommon.Hash, account *accounts.Account)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) DeprecatedSetStorageDelete ¶
func (sc *StateCache) DeprecatedSetStorageDelete(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) DeprecatedSetStorageRead ¶
func (sc *StateCache) DeprecatedSetStorageRead(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash, val []byte)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) DeprecatedSetStorageWrite ¶
func (sc *StateCache) DeprecatedSetStorageWrite(addrHash libcommon.Hash, incarnation uint64, locHash libcommon.Hash, v []byte)
hack to set hashed addr - we don't have another one in trie stage
func (*StateCache) GetAccount ¶
func (sc *StateCache) GetAccount(address []byte) (*accounts.Account, bool)
GetAccount searches and account with given address, without modifying any structures Second return value is true if such account is found
func (*StateCache) GetAccountByHashedAddress ¶
func (*StateCache) GetAccountHash ¶
func (*StateCache) GetCode ¶
func (sc *StateCache) GetCode(address []byte, incarnation uint64) ([]byte, bool)
GetCode searches contract code with given address, without modifying any structures Second return value is true if such item is found
func (*StateCache) GetDeletedAccount ¶
func (sc *StateCache) GetDeletedAccount(address []byte) *accounts.Account
GetDeletedAccount attempts to retrieve the last version of account before it was deleted
func (*StateCache) GetStorage ¶
func (sc *StateCache) GetStorage(address []byte, incarnation uint64, location []byte) ([]byte, bool)
GetStorage searches storage item with given address, incarnation, and location, without modifying any structures Second return value is true if such item is found
func (*StateCache) GetStorageByHashedAddress ¶
func (*StateCache) GetStorageHash ¶
func (*StateCache) HasAccountHashWithPrefix ¶
func (sc *StateCache) HasAccountHashWithPrefix(addrHashPrefix []byte) bool
func (*StateCache) HasAccountWithInPrefix ¶
func (sc *StateCache) HasAccountWithInPrefix(addrHashPrefix []byte) bool
func (*StateCache) PrepareWrites ¶
func (sc *StateCache) PrepareWrites() [5]*btree.BTree
func (*StateCache) ReadSize ¶
func (sc *StateCache) ReadSize() int
func (*StateCache) SetAccountAbsent ¶
func (sc *StateCache) SetAccountAbsent(address []byte)
SetAccountRead adds given account address to the cache, marking it as a absent
func (*StateCache) SetAccountDelete ¶
func (sc *StateCache) SetAccountDelete(address []byte)
SetAccountDelete is very similar to SetAccountWrite with the difference that there no set value
func (*StateCache) SetAccountHashDelete ¶
func (sc *StateCache) SetAccountHashDelete(prefix []byte)
func (*StateCache) SetAccountHashWrite ¶
func (sc *StateCache) SetAccountHashWrite(prefix []byte, hasState, hasTree, hasHash uint16, hashes []libcommon.Hash)
func (*StateCache) SetAccountHashesRead ¶
func (sc *StateCache) SetAccountHashesRead(prefix []byte, hasState, hasTree, hasHash uint16, hashes []libcommon.Hash)
func (*StateCache) SetAccountRead ¶
func (sc *StateCache) SetAccountRead(address []byte, account *accounts.Account)
SetAccountRead adds given account to the cache, marking it as a read (not written)
func (*StateCache) SetAccountWrite ¶
func (sc *StateCache) SetAccountWrite(address []byte, account *accounts.Account)
SetAccountWrite adds given account to the cache, marking it as written (cannot be evicted)
func (*StateCache) SetCodeAbsent ¶
func (sc *StateCache) SetCodeAbsent(address []byte, incarnation uint64)
func (*StateCache) SetCodeDelete ¶
func (sc *StateCache) SetCodeDelete(address []byte, incarnation uint64)
func (*StateCache) SetCodeRead ¶
func (sc *StateCache) SetCodeRead(address []byte, incarnation uint64, code []byte)
func (*StateCache) SetCodeWrite ¶
func (sc *StateCache) SetCodeWrite(address []byte, incarnation uint64, code []byte)
func (*StateCache) SetStorageAbsent ¶
func (sc *StateCache) SetStorageAbsent(address []byte, incarnation uint64, location []byte)
func (*StateCache) SetStorageDelete ¶
func (sc *StateCache) SetStorageDelete(address []byte, incarnation uint64, location []byte)
func (*StateCache) SetStorageHashDelete ¶
func (*StateCache) SetStorageHashRead ¶
func (*StateCache) SetStorageHashWrite ¶
func (*StateCache) SetStorageRead ¶
func (sc *StateCache) SetStorageRead(address []byte, incarnation uint64, location []byte, value []byte)
func (*StateCache) SetStorageWrite ¶
func (sc *StateCache) SetStorageWrite(address []byte, incarnation uint64, location []byte, value []byte)
func (*StateCache) StorageHashesSeek ¶
func (*StateCache) StorageTree ¶
func (*StateCache) TotalCount ¶
func (sc *StateCache) TotalCount() (res int)
func (*StateCache) TurnWritesToReads ¶
func (sc *StateCache) TurnWritesToReads(writes [5]*btree.BTree)
func (*StateCache) WalkAccounts ¶
func (*StateCache) WalkStorage ¶
func (*StateCache) WalkStorageHashes ¶
func (*StateCache) WriteCount ¶
func (sc *StateCache) WriteCount() (res int)
func (*StateCache) WriteSize ¶
func (sc *StateCache) WriteSize() int
type StateChangeConsumer ¶
type StateChangeConsumer interface {
SendStateChanges(ctx context.Context, sc *remote.StateChangeBatch)
}
type StorageHashItem ¶
type StorageHashItem struct {
// contains filtered or unexported fields
}
func (*StorageHashItem) ClearFlags ¶
func (shi *StorageHashItem) ClearFlags(flags uint16)
func (*StorageHashItem) CopyValueFrom ¶
func (shi *StorageHashItem) CopyValueFrom(item CacheItem)
func (*StorageHashItem) GetQueuePos ¶
func (shi *StorageHashItem) GetQueuePos() int
func (*StorageHashItem) GetSequence ¶
func (shi *StorageHashItem) GetSequence() int
func (*StorageHashItem) GetSize ¶
func (shi *StorageHashItem) GetSize() int
func (*StorageHashItem) HasFlag ¶
func (shi *StorageHashItem) HasFlag(flag uint16) bool
func (*StorageHashItem) HasPrefix ¶
func (shi *StorageHashItem) HasPrefix(prefix CacheItem) bool
func (*StorageHashItem) SetFlags ¶
func (shi *StorageHashItem) SetFlags(flags uint16)
func (*StorageHashItem) SetQueuePos ¶
func (shi *StorageHashItem) SetQueuePos(pos int)
func (*StorageHashItem) SetSequence ¶
func (shi *StorageHashItem) SetSequence(sequence int)
func (*StorageHashItem) String ¶
func (shi *StorageHashItem) String() string
type StorageHashWriteItem ¶
type StorageHashWriteItem struct {
// contains filtered or unexported fields
}
func (*StorageHashWriteItem) GetCacheItem ¶
func (wi *StorageHashWriteItem) GetCacheItem() CacheItem
func (*StorageHashWriteItem) GetSize ¶
func (wi *StorageHashWriteItem) GetSize() int
func (*StorageHashWriteItem) SetCacheItem ¶
func (wi *StorageHashWriteItem) SetCacheItem(item CacheItem)
type StorageItem ¶
type StorageItem struct {
// contains filtered or unexported fields
}
func (*StorageItem) ClearFlags ¶
func (si *StorageItem) ClearFlags(flags uint16)
func (*StorageItem) CopyValueFrom ¶
func (si *StorageItem) CopyValueFrom(item CacheItem)
func (*StorageItem) GetQueuePos ¶
func (si *StorageItem) GetQueuePos() int
func (*StorageItem) GetSequence ¶
func (si *StorageItem) GetSequence() int
func (*StorageItem) GetSize ¶
func (si *StorageItem) GetSize() int
func (*StorageItem) HasFlag ¶
func (si *StorageItem) HasFlag(flag uint16) bool
func (*StorageItem) HasPrefix ¶
func (si *StorageItem) HasPrefix(prefix CacheItem) bool
func (*StorageItem) SetFlags ¶
func (si *StorageItem) SetFlags(flags uint16)
func (*StorageItem) SetQueuePos ¶
func (si *StorageItem) SetQueuePos(pos int)
func (*StorageItem) SetSequence ¶
func (si *StorageItem) SetSequence(sequence int)
func (*StorageItem) String ¶
func (si *StorageItem) String() string
type StorageSeek ¶
type StorageSeek struct {
// contains filtered or unexported fields
}
StorageSeek allows to traverse sub-tree
type StorageWriteItem ¶
type StorageWriteItem struct {
// contains filtered or unexported fields
}
func (*StorageWriteItem) GetCacheItem ¶
func (swi *StorageWriteItem) GetCacheItem() CacheItem
func (*StorageWriteItem) GetSize ¶
func (swi *StorageWriteItem) GetSize() int
func (*StorageWriteItem) SetCacheItem ¶
func (swi *StorageWriteItem) SetCacheItem(item CacheItem)
type UnprocessedHeap ¶
type UnprocessedHeap struct {
// contains filtered or unexported fields
}
UnprocessedHeap is a priority queue of items that were modified after the last recalculation of the merkle tree
func (UnprocessedHeap) Len ¶
func (uh UnprocessedHeap) Len() int
func (UnprocessedHeap) Less ¶
func (uh UnprocessedHeap) Less(i, j int) bool
func (*UnprocessedHeap) Pop ¶
func (uh *UnprocessedHeap) Pop() interface{}
func (*UnprocessedHeap) Push ¶
func (uh *UnprocessedHeap) Push(x interface{})
func (UnprocessedHeap) Swap ¶
func (uh UnprocessedHeap) Swap(i, j int)