Documentation ¶
Index ¶
- Constants
- Variables
- func IsMptKey(key []byte) bool
- func IsPreimageKey(key []byte) bool
- func UnwrapStorageReceipts(receiptsStorage []*types.ReceiptForStorage, n idx.Block, signer types.Signer, ...) (types.Receipts, error)
- type Store
- func (s *Store) ApplyGenesis(g genesis.Genesis) (err error)
- func (s *Store) Cap(max, min int)
- func (s *Store) CheckEvm(forEachState func(func(root common.Hash) (found bool, err error))) error
- func (s *Store) Commit(block iblockproc.BlockState, flush bool) error
- func (s *Store) Flush(block iblockproc.BlockState, getBlock func(n idx.Block) *inter.Block)
- func (s *Store) GenerateEvmSnapshot(root common.Hash, rebuild, async bool) (err error)
- func (s *Store) GetBlockTxs(n idx.Block, block inter.Block, ...) types.Transactions
- func (s *Store) GetCachedEvmBlock(n idx.Block) *evmcore.EvmBlock
- func (s *Store) GetRawReceipts(n idx.Block) ([]*types.ReceiptForStorage, int)
- func (s *Store) GetRawReceiptsRLP(n idx.Block) rlp.RawValue
- func (s *Store) GetReceipts(n idx.Block, signer types.Signer, hash common.Hash, txs types.Transactions) types.Receipts
- func (s *Store) GetTx(txid common.Hash) *types.Transaction
- func (s *Store) GetTxPosition(txid common.Hash) *TxPosition
- func (s *Store) HasStateDB(from hash.Hash) bool
- func (s *Store) ImportEvm(r io.Reader) error
- func (s *Store) IndexLogs(recs ...*types.Log)
- func (s *Store) IsEvmSnapshotPaused() bool
- func (s *Store) PauseEvmSnapshot()
- func (s *Store) RebuildEvmSnapshot(root common.Hash)
- func (s *Store) SetCachedEvmBlock(n idx.Block, b *evmcore.EvmBlock)
- func (s *Store) SetRawReceipts(n idx.Block, receipts []*types.ReceiptForStorage) (size int)
- func (s *Store) SetReceipts(n idx.Block, receipts types.Receipts)
- func (s *Store) SetTx(txid common.Hash, tx *types.Transaction)
- func (s *Store) SetTxPosition(txid common.Hash, position TxPosition)
- func (s *Store) Snapshots() *snapshot.Tree
- func (s *Store) StateDB(from hash.Hash) (*state.StateDB, error)
- type StoreCacheConfig
- type StoreConfig
- type TxPosition
Constants ¶
View Source
const (
TriesInMemory = 32
)
Variables ¶
View Source
var ( // EmptyCode is the known hash of the empty EVM bytecode. EmptyCode = crypto.Keccak256(nil) )
Functions ¶
func IsPreimageKey ¶
func UnwrapStorageReceipts ¶
Types ¶
type Store ¶
type Store struct { EvmDb ethdb.Database EvmState state.Database EvmLogs *topicsdb.Index Snaps *snapshot.Tree logger.Instance // contains filtered or unexported fields }
Store is a node persistent storage working over physical key-value database.
func NewStore ¶
func NewStore(mainDB kvdb.Store, cfg StoreConfig) *Store
NewStore creates store over key-value db.
func (*Store) ApplyGenesis ¶
ApplyGenesis writes initial state.
func (*Store) Commit ¶
func (s *Store) Commit(block iblockproc.BlockState, flush bool) error
Commit changes.
func (*Store) Flush ¶
func (s *Store) Flush(block iblockproc.BlockState, getBlock func(n idx.Block) *inter.Block)
func (*Store) GenerateEvmSnapshot ¶
func (*Store) GetBlockTxs ¶
func (*Store) GetRawReceipts ¶
func (*Store) GetReceipts ¶
func (s *Store) GetReceipts(n idx.Block, signer types.Signer, hash common.Hash, txs types.Transactions) types.Receipts
GetReceipts returns stored transaction receipts.
func (*Store) GetTx ¶
func (s *Store) GetTx(txid common.Hash) *types.Transaction
GetTx returns stored non-event transaction.
func (*Store) GetTxPosition ¶
func (s *Store) GetTxPosition(txid common.Hash) *TxPosition
GetTxPosition returns stored transaction block and position.
func (*Store) HasStateDB ¶
HasStateDB returns if state database exists
func (*Store) IsEvmSnapshotPaused ¶
func (*Store) PauseEvmSnapshot ¶
func (s *Store) PauseEvmSnapshot()
func (*Store) RebuildEvmSnapshot ¶
func (*Store) SetCachedEvmBlock ¶
func (*Store) SetRawReceipts ¶
SetRawReceipts stores raw transaction receipts.
func (*Store) SetReceipts ¶
SetReceipts stores transaction receipts.
func (*Store) SetTx ¶
func (s *Store) SetTx(txid common.Hash, tx *types.Transaction)
SetTx stores non-event transaction.
func (*Store) SetTxPosition ¶
func (s *Store) SetTxPosition(txid common.Hash, position TxPosition)
SetTxPosition stores transaction block and position.
type StoreCacheConfig ¶
type StoreCacheConfig struct { // Cache size for Receipts (size in bytes). ReceiptsSize uint // Cache size for Receipts (number of blocks). ReceiptsBlocks int // Cache size for TxPositions. TxPositions int // Cache size for EVM database. EvmDatabase int // Cache size for EVM snapshot. EvmSnap int // Cache size for EvmBlock (number of blocks). EvmBlocksNum int // Cache size for EvmBlock (size in bytes). EvmBlocksSize uint // Disk journal for saving clean cache entries. TrieCleanJournal string // Whether to disable trie write caching and GC altogether (archive node) TrieDirtyDisabled bool // Memory limit (MB) at which to start flushing dirty trie nodes to disk TrieDirtyLimit uint }
StoreCacheConfig is a config for the db.
type StoreConfig ¶
type StoreConfig struct { Cache StoreCacheConfig // Enables tracking of SHA3 preimages in the VM EnablePreimageRecording bool }
StoreConfig is a config for store db.
func DefaultStoreConfig ¶
func DefaultStoreConfig(scale cachescale.Func) StoreConfig
DefaultStoreConfig for product.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.