Documentation ¶
Index ¶
- func ReadTrie(root common.Hash, getPreimage func(key common.Hash) []byte) []hexutil.Bytes
- func WriteTrie(values []hexutil.Bytes) (common.Hash, []hexutil.Bytes)
- type DB
- func (p *DB) Ancient(kind string, number uint64) ([]byte, error)
- func (p *DB) AncientDatadir() (string, error)
- func (p *DB) AncientRange(kind string, start, count, maxBytes uint64) ([][]byte, error)
- func (p *DB) AncientSize(kind string) (uint64, error)
- func (p *DB) Ancients() (uint64, error)
- func (p DB) Close() error
- func (p DB) Compact(start []byte, limit []byte) error
- func (p DB) Delete(key []byte) error
- func (p *DB) Get(key []byte) ([]byte, error)
- func (p *DB) Has(key []byte) (bool, error)
- func (p *DB) HasAncient(kind string, number uint64) (bool, error)
- func (p *DB) MigrateTable(s string, f func([]byte) ([]byte, error)) error
- func (p *DB) ModifyAncients(f func(ethdb.AncientWriteOp) error) (int64, error)
- func (p DB) NewBatch() ethdb.Batch
- func (p DB) NewBatchWithSize(size int) ethdb.Batch
- func (p DB) NewIterator(prefix []byte, start []byte) ethdb.Iterator
- func (p DB) NewSnapshot() (ethdb.Snapshot, error)
- func (p *DB) Put(key []byte, value []byte) error
- func (p *DB) ReadAncients(fn func(ethdb.AncientReaderOp) error) (err error)
- func (p DB) Stat(property string) (string, error)
- func (p *DB) Sync() error
- func (p *DB) Tail() (uint64, error)
- func (p *DB) TruncateHead(n uint64) (uint64, error)
- func (p *DB) TruncateTail(n uint64) (uint64, error)
- type Hooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadTrie ¶
ReadTrie takes a Merkle Patricia Trie (MPT) root of a "DerivableList", and a pre-image oracle getter, and traverses the implied MPT to collect all raw leaf nodes in order, which are then returned.
func WriteTrie ¶
WriteTrie takes a list of values, and merkleizes them as a "DerivableList": a Merkle Patricia Trie (MPT) with values keyed by their RLP encoded index. This merkleization matches that of transactions, receipts, and withdrawals lists in the block header (at least up to the Shanghai L1 update). This then returns the MPT root and a list of pre-images of the trie. Note: empty values are illegal, and there may be less pre-images returned than values, if any values are less than 32 bytes and fit into branch-node slots that way.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements the ethdb.Database to back the StateDB of Geth.
func (*DB) AncientDatadir ¶
func (*DB) AncientRange ¶
func (*DB) ModifyAncients ¶
func (*DB) ReadAncients ¶
func (p *DB) ReadAncients(fn func(ethdb.AncientReaderOp) error) (err error)