Documentation ¶
Overview ¶
Package state provides a caching layer atop the Ethereum state trie.
Index ¶
- Constants
- Variables
- func FindByHistory(tx ethdb.Tx, storage bool, key []byte, timestamp uint64) ([]byte, error)
- func GetAsOf(tx ethdb.Tx, storage bool, key []byte, timestamp uint64) ([]byte, error)
- func WalkAsOfAccounts(tx ethdb.Tx, startAddress common.Address, timestamp uint64, ...) error
- func WalkAsOfStorage(tx ethdb.Tx, address common.Address, incarnation uint64, ...) error
- type Buffer
- type CachedReader
- func (cr *CachedReader) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error)
- func (cr *CachedReader) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (int, error)
- func (cr *CachedReader) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (cr *CachedReader) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (cr *CachedReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- type CachedWriter
- func (cw *CachedWriter) CreateContract(address common.Address) error
- func (cw *CachedWriter) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error
- func (cw *CachedWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (cw *CachedWriter) UpdateAccountData(ctx context.Context, address common.Address, ...) error
- func (cw *CachedWriter) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, ...) error
- func (cw *CachedWriter) WriteChangeSets() error
- func (cw *CachedWriter) WriteHistory() error
- type ChangeSetWriter
- func (w *ChangeSetWriter) CreateContract(address common.Address) error
- func (w *ChangeSetWriter) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error
- func (w *ChangeSetWriter) GetAccountChanges() (*changeset.ChangeSet, error)
- func (w *ChangeSetWriter) GetStorageChanges() (*changeset.ChangeSet, error)
- func (w *ChangeSetWriter) PrintChangedAccounts()
- func (w *ChangeSetWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (w *ChangeSetWriter) UpdateAccountData(ctx context.Context, address common.Address, ...) error
- func (w *ChangeSetWriter) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, ...) error
- func (w *ChangeSetWriter) WriteChangeSets() error
- func (w *ChangeSetWriter) WriteHistory() error
- type Code
- type DbStateReader
- func (dbr *DbStateReader) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error)
- func (dbr *DbStateReader) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (codeSize int, err error)
- func (dbr *DbStateReader) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (dbr *DbStateReader) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (dbr *DbStateReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- func (dbr *DbStateReader) SetAccountCache(accountCache *fastcache.Cache)
- func (dbr *DbStateReader) SetCodeCache(codeCache *fastcache.Cache)
- func (dbr *DbStateReader) SetCodeSizeCache(codeSizeCache *fastcache.Cache)
- func (dbr *DbStateReader) SetStorageCache(storageCache *fastcache.Cache)
- type DbStateWriter
- func (dsw *DbStateWriter) ChangeSetWriter() *ChangeSetWriter
- func (dsw *DbStateWriter) CreateContract(address common.Address) error
- func (dsw *DbStateWriter) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error
- func (dsw *DbStateWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (dsw *DbStateWriter) UpdateAccountData(ctx context.Context, address common.Address, ...) error
- func (dsw *DbStateWriter) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, ...) error
- func (dsw *DbStateWriter) WriteChangeSets() error
- func (dsw *DbStateWriter) WriteHistory() error
- type Dump
- type DumpAccount
- type DumpCollector
- type Dumper
- func (d *Dumper) DefaultDump() []byte
- func (d *Dumper) DefaultRawDump() Dump
- func (d *Dumper) Dump(excludeCode, excludeStorage, excludeMissingPreimages bool) []byte
- func (d *Dumper) DumpToCollector(c DumpCollector, excludeCode, excludeStorage, _ bool, ...) (nextKey []byte, err error)
- func (d *Dumper) IterativeDump(excludeCode, excludeStorage, excludeMissingPreimages bool, ...)
- func (d *Dumper) IteratorDump(excludeCode, excludeStorage, excludeMissingPreimages bool, ...) (IteratorDump, error)
- func (d *Dumper) RawDump(excludeCode, excludeStorage, excludeMissingPreimages bool) Dump
- type IntraBlockState
- func (sdb *IntraBlockState) AddAddressToAccessList(addr common.Address)
- func (sdb *IntraBlockState) AddBalance(addr common.Address, amount *uint256.Int)
- func (sdb *IntraBlockState) AddLog(log *types.Log)
- func (sdb *IntraBlockState) AddPreimage(hash common.Hash, preimage []byte)
- func (sdb *IntraBlockState) AddRefund(gas uint64)
- func (sdb *IntraBlockState) AddSlotToAccessList(addr common.Address, slot common.Hash)
- func (sdb *IntraBlockState) AddressInAccessList(addr common.Address) bool
- func (sdb *IntraBlockState) CommitBlock(ctx context.Context, stateWriter StateWriter) error
- func (sdb *IntraBlockState) Copy() *IntraBlockState
- func (sdb *IntraBlockState) CreateAccount(addr common.Address, contractCreation bool)
- func (sdb *IntraBlockState) Empty(addr common.Address) bool
- func (sdb *IntraBlockState) Error() error
- func (sdb *IntraBlockState) Exist(addr common.Address) bool
- func (sdb *IntraBlockState) FinalizeTx(ctx context.Context, stateWriter StateWriter) error
- func (sdb *IntraBlockState) GetBalance(addr common.Address) *uint256.Int
- func (sdb *IntraBlockState) GetCode(addr common.Address) []byte
- func (sdb *IntraBlockState) GetCodeHash(addr common.Address) common.Hash
- func (sdb *IntraBlockState) GetCodeSize(addr common.Address) int
- func (sdb *IntraBlockState) GetCommittedState(addr common.Address, key *common.Hash, value *uint256.Int)
- func (sdb *IntraBlockState) GetIncarnation(addr common.Address) uint64
- func (sdb *IntraBlockState) GetLogs(hash common.Hash) []*types.Log
- func (sdb *IntraBlockState) GetNonce(addr common.Address) uint64
- func (sdb *IntraBlockState) GetOrNewStateObject(addr common.Address) *stateObject
- func (sdb *IntraBlockState) GetProof(a common.Address) ([][]byte, error)
- func (sdb *IntraBlockState) GetRefund() uint64
- func (sdb *IntraBlockState) GetState(addr common.Address, key *common.Hash, value *uint256.Int)
- func (sdb *IntraBlockState) GetStorageProof(a common.Address, key common.Hash) ([][]byte, error)
- func (sdb *IntraBlockState) HasSuicided(addr common.Address) bool
- func (sdb *IntraBlockState) Logs() []*types.Log
- func (sdb *IntraBlockState) Preimages() map[common.Hash][]byte
- func (sdb *IntraBlockState) Prepare(thash, bhash common.Hash, ti int)
- func (sdb *IntraBlockState) PrepareAccessList(sender common.Address, dst *common.Address, precompiles []common.Address, ...)
- func (sdb *IntraBlockState) Reset() error
- func (sdb *IntraBlockState) RevertToSnapshot(revid int)
- func (sdb *IntraBlockState) SetBalance(addr common.Address, amount *uint256.Int)
- func (sdb *IntraBlockState) SetCode(addr common.Address, code []byte)
- func (sdb *IntraBlockState) SetIncarnation(addr common.Address, incarnation uint64)
- func (sdb *IntraBlockState) SetNonce(addr common.Address, nonce uint64)
- func (sdb *IntraBlockState) SetState(addr common.Address, key *common.Hash, value uint256.Int)
- func (sdb *IntraBlockState) SetStorage(addr common.Address, storage Storage)
- func (sdb *IntraBlockState) SetTrace(trace bool)
- func (sdb *IntraBlockState) SetTracer(tracer StateTracer)
- func (sdb *IntraBlockState) SlotInAccessList(addr common.Address, slot common.Hash) (addressPresent bool, slotPresent bool)
- func (sdb *IntraBlockState) Snapshot() int
- func (sdb *IntraBlockState) SubBalance(addr common.Address, amount *uint256.Int)
- func (sdb *IntraBlockState) SubRefund(gas uint64)
- func (sdb *IntraBlockState) Suicide(addr common.Address) bool
- func (sdb *IntraBlockState) TxIndex() int
- type IteratorDump
- type NoopWriter
- func (nw *NoopWriter) CreateContract(address common.Address) error
- func (nw *NoopWriter) DeleteAccount(_ context.Context, address common.Address, original *accounts.Account) error
- func (nw *NoopWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (nw *NoopWriter) UpdateAccountData(_ context.Context, address common.Address, original, account *accounts.Account) error
- func (nw *NoopWriter) WriteAccountStorage(_ context.Context, address common.Address, incarnation uint64, ...) error
- func (nw *NoopWriter) WriteChangeSets() error
- func (nw *NoopWriter) WriteHistory() error
- type PlainDBState
- func (dbs *PlainDBState) CreateContract(address common.Address) error
- func (dbs *PlainDBState) DeleteAccount(_ context.Context, address common.Address, original *accounts.Account) error
- func (dbs *PlainDBState) ForEachStorage(addr common.Address, startLocation common.Hash, ...) error
- func (dbs *PlainDBState) GetBlockNr() uint64
- func (dbs *PlainDBState) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error)
- func (dbs *PlainDBState) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (int, error)
- func (dbs *PlainDBState) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (dbs *PlainDBState) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (dbs *PlainDBState) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- func (dbs *PlainDBState) SetBlockNr(blockNr uint64)
- func (dbs *PlainDBState) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (dbs *PlainDBState) UpdateAccountData(_ context.Context, address common.Address, original, account *accounts.Account) error
- func (dbs *PlainDBState) WriteAccountStorage(_ context.Context, address common.Address, incarnation uint64, ...) error
- type PlainStateReader
- func (r *PlainStateReader) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error)
- func (r *PlainStateReader) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (int, error)
- func (r *PlainStateReader) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (r *PlainStateReader) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (r *PlainStateReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- type PlainStateWriter
- func (w *PlainStateWriter) ChangeSetWriter() *ChangeSetWriter
- func (w *PlainStateWriter) CreateContract(address common.Address) error
- func (w *PlainStateWriter) DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error
- func (w *PlainStateWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (w *PlainStateWriter) UpdateAccountData(ctx context.Context, address common.Address, ...) error
- func (w *PlainStateWriter) WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, ...) error
- func (w *PlainStateWriter) WriteChangeSets() error
- func (w *PlainStateWriter) WriteHistory() error
- type PreimageWriter
- type StateReader
- type StateTracer
- type StateWriter
- type Stateless
- func (s *Stateless) CheckRoot(expected common.Hash) error
- func (s *Stateless) CreateContract(address common.Address) error
- func (s *Stateless) DeleteAccount(_ context.Context, address common.Address, original *accounts.Account) error
- func (s *Stateless) GetTrie() *trie.Trie
- func (s *Stateless) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) (code []byte, err error)
- func (s *Stateless) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (codeSize int, err error)
- func (s *Stateless) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (s *Stateless) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (s *Stateless) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- func (s *Stateless) SetBlockNr(blockNr uint64)
- func (s *Stateless) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (s *Stateless) UpdateAccountData(_ context.Context, address common.Address, original, account *accounts.Account) error
- func (s *Stateless) WriteAccountStorage(_ context.Context, address common.Address, incarnation uint64, ...) error
- type Storage
- type TrieDbState
- func (tds *TrieDbState) CalcTrieRoots(trace bool) (common.Hash, error)
- func (tds *TrieDbState) ComputeTrieRoots() ([]common.Hash, error)
- func (tds *TrieDbState) Copy() *TrieDbState
- func (tds *TrieDbState) Database() ethdb.Database
- func (tds *TrieDbState) DbStateWriter() *DbStateWriter
- func (tds *TrieDbState) EnablePreimages(ep bool)
- func (tds *TrieDbState) EvictTries(print bool)
- func (tds *TrieDbState) ExtractTouches() (accountTouches [][]byte, storageTouches [][]byte)
- func (tds *TrieDbState) ExtractWitness(trace bool, isBinary bool) (*trie.Witness, error)
- func (tds *TrieDbState) ExtractWitnessForPrefix(prefix []byte, trace bool, isBinary bool) (*trie.Witness, error)
- func (tds *TrieDbState) GetAccount(addrHash common.Hash) (*accounts.Account, bool)
- func (tds *TrieDbState) GetBlockNr() uint64
- func (tds *TrieDbState) GetKey(shaKey []byte) []byte
- func (tds *TrieDbState) GetNodeByHash(hash common.Hash) []byte
- func (tds *TrieDbState) GetTrieHash() common.Hash
- func (tds *TrieDbState) LastRoot() common.Hash
- func (tds *TrieDbState) PlainStateWriter() *PlainStateWriter
- func (tds *TrieDbState) PrintTrie(w io.Writer)
- func (tds *TrieDbState) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) (code []byte, err error)
- func (tds *TrieDbState) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (codeSize int, err error)
- func (tds *TrieDbState) ReadAccountData(address common.Address) (*accounts.Account, error)
- func (tds *TrieDbState) ReadAccountIncarnation(address common.Address) (uint64, error)
- func (tds *TrieDbState) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
- func (tds *TrieDbState) ReadCodeByHash(codeHash common.Hash) (code []byte, err error)
- func (tds *TrieDbState) ResolveStateTrie(extractWitnesses bool, trace bool) ([]*trie.Witness, error)
- func (tds *TrieDbState) ResolveStateTrieStateless(database trie.WitnessStorage) error
- func (tds *TrieDbState) SetBlockNr(blockNr uint64)
- func (tds *TrieDbState) SetHistorical(h bool)
- func (tds *TrieDbState) SetNoHistory(nh bool)
- func (tds *TrieDbState) SetResolveReads(rr bool)
- func (tds *TrieDbState) StartNewBuffer()
- func (tds *TrieDbState) Trie() *trie.Trie
- func (tds *TrieDbState) TriePruningDebugDump() string
- func (tds *TrieDbState) TrieStateWriter() *TrieStateWriter
- func (tds *TrieDbState) UnwindTo(blockNr uint64) error
- func (tds *TrieDbState) UpdateStateTrie() ([]common.Hash, error)
- func (tds *TrieDbState) WithNewBuffer() *TrieDbState
- type TrieStateWriter
- func (tsw *TrieStateWriter) CreateContract(address common.Address) error
- func (tsw *TrieStateWriter) DeleteAccount(_ context.Context, address common.Address, original *accounts.Account) error
- func (tsw *TrieStateWriter) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
- func (tsw *TrieStateWriter) UpdateAccountData(_ context.Context, address common.Address, original, account *accounts.Account) error
- func (tsw *TrieStateWriter) WriteAccountStorage(_ context.Context, address common.Address, incarnation uint64, ...) error
- type WriterWithChangeSets
Constants ¶
const ( //FirstContractIncarnation - first incarnation for contract accounts. After 1 it increases by 1. FirstContractIncarnation = 1 //NonContractIncarnation incarnation for non contracts NonContractIncarnation = 0 )
const MaxChangesetsSearch = 256
MaxChangesetsSearch -
Variables ¶
var MaxTrieCacheSize = uint64(1024 * 1024)
MaxTrieCacheSize is the trie cache size limit after which to evict trie nodes from memory.
Functions ¶
func FindByHistory ¶
func WalkAsOfAccounts ¶
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a structure holding updates, deletes, and reads registered within one change period A change period can be transaction within a block, or a block within group of blocks
type CachedReader ¶
type CachedReader struct {
// contains filtered or unexported fields
}
CachedReader is a wrapper for an instance of type StateReader This wrapper only makes calls to the underlying reader if the item is not in the cache
func NewCachedReader ¶
func NewCachedReader(r StateReader, cache *shards.StateCache) *CachedReader
NewCachedReader wraps a given state reader into the cached reader
func (*CachedReader) ReadAccountCode ¶
func (cr *CachedReader) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error)
ReadAccountCode is called when code of an account needs to be fetched from the state Usually, one of (address;incarnation) or codeHash is enough to uniquely identify the code
func (*CachedReader) ReadAccountCodeSize ¶
func (*CachedReader) ReadAccountData ¶
ReadAccountData is called when an account needs to be fetched from the state
func (*CachedReader) ReadAccountIncarnation ¶
func (cr *CachedReader) ReadAccountIncarnation(address common.Address) (uint64, error)
ReadAccountIncarnation is called when incarnation of the account is required (to create and recreate contract)
func (*CachedReader) ReadAccountStorage ¶
func (cr *CachedReader) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
ReadAccountStorage is called when a storage item needs to be fetched from the state
type CachedWriter ¶
type CachedWriter struct {
// contains filtered or unexported fields
}
CachedWriter is a wrapper for an instance of type StateWriter
func NewCachedWriter ¶
func NewCachedWriter(w WriterWithChangeSets, cache *shards.StateCache) *CachedWriter
NewCachedWriter wraps a given state writer into a cached writer
func (*CachedWriter) CreateContract ¶
func (cw *CachedWriter) CreateContract(address common.Address) error
func (*CachedWriter) DeleteAccount ¶
func (*CachedWriter) UpdateAccountCode ¶
func (*CachedWriter) UpdateAccountData ¶
func (*CachedWriter) WriteAccountStorage ¶
func (*CachedWriter) WriteChangeSets ¶
func (cw *CachedWriter) WriteChangeSets() error
func (*CachedWriter) WriteHistory ¶
func (cw *CachedWriter) WriteHistory() error
type ChangeSetWriter ¶
type ChangeSetWriter struct {
// contains filtered or unexported fields
}
ChangeSetWriter is a mock StateWriter that accumulates changes in-memory into ChangeSets.
func NewChangeSetWriter ¶
func NewChangeSetWriter() *ChangeSetWriter
func NewChangeSetWriterPlain ¶
func NewChangeSetWriterPlain(db ethdb.Database, blockNumber uint64) *ChangeSetWriter
func (*ChangeSetWriter) CreateContract ¶
func (w *ChangeSetWriter) CreateContract(address common.Address) error
func (*ChangeSetWriter) DeleteAccount ¶
func (*ChangeSetWriter) GetAccountChanges ¶
func (w *ChangeSetWriter) GetAccountChanges() (*changeset.ChangeSet, error)
func (*ChangeSetWriter) GetStorageChanges ¶
func (w *ChangeSetWriter) GetStorageChanges() (*changeset.ChangeSet, error)
func (*ChangeSetWriter) PrintChangedAccounts ¶
func (w *ChangeSetWriter) PrintChangedAccounts()
func (*ChangeSetWriter) UpdateAccountCode ¶
func (*ChangeSetWriter) UpdateAccountData ¶
func (*ChangeSetWriter) WriteAccountStorage ¶
func (*ChangeSetWriter) WriteChangeSets ¶
func (w *ChangeSetWriter) WriteChangeSets() error
func (*ChangeSetWriter) WriteHistory ¶
func (w *ChangeSetWriter) WriteHistory() error
type DbStateReader ¶
type DbStateReader struct {
// contains filtered or unexported fields
}
Implements StateReader by wrapping database only, without trie
func NewDbStateReader ¶
func NewDbStateReader(db ethdb.Getter) *DbStateReader
func (*DbStateReader) ReadAccountCode ¶
func (*DbStateReader) ReadAccountCodeSize ¶
func (*DbStateReader) ReadAccountData ¶
func (*DbStateReader) ReadAccountIncarnation ¶
func (dbr *DbStateReader) ReadAccountIncarnation(address common.Address) (uint64, error)
func (*DbStateReader) ReadAccountStorage ¶
func (*DbStateReader) SetAccountCache ¶
func (dbr *DbStateReader) SetAccountCache(accountCache *fastcache.Cache)
func (*DbStateReader) SetCodeCache ¶
func (dbr *DbStateReader) SetCodeCache(codeCache *fastcache.Cache)
func (*DbStateReader) SetCodeSizeCache ¶
func (dbr *DbStateReader) SetCodeSizeCache(codeSizeCache *fastcache.Cache)
func (*DbStateReader) SetStorageCache ¶
func (dbr *DbStateReader) SetStorageCache(storageCache *fastcache.Cache)
type DbStateWriter ¶
type DbStateWriter struct {
// contains filtered or unexported fields
}
func NewDbStateWriter ¶
func NewDbStateWriter(db ethdb.Database, blockNr uint64) *DbStateWriter
func (*DbStateWriter) ChangeSetWriter ¶
func (dsw *DbStateWriter) ChangeSetWriter() *ChangeSetWriter
func (*DbStateWriter) CreateContract ¶
func (dsw *DbStateWriter) CreateContract(address common.Address) error
func (*DbStateWriter) DeleteAccount ¶
func (*DbStateWriter) UpdateAccountCode ¶
func (*DbStateWriter) UpdateAccountData ¶
func (*DbStateWriter) WriteAccountStorage ¶
func (*DbStateWriter) WriteChangeSets ¶
func (dsw *DbStateWriter) WriteChangeSets() error
WriteChangeSets causes accumulated change sets to be written into the database (or batch) associated with the `dsw`
func (*DbStateWriter) WriteHistory ¶
func (dsw *DbStateWriter) WriteHistory() error
type Dump ¶
type Dump struct { Root string `json:"root"` Accounts map[common.Address]DumpAccount `json:"accounts"` }
Dump represents the full dump in a collected format, as one large map.
type DumpAccount ¶
type DumpAccount struct { Balance string `json:"balance"` Nonce uint64 `json:"nonce"` Root string `json:"root"` CodeHash string `json:"codeHash"` Code string `json:"code,omitempty"` Storage map[string]string `json:"storage,omitempty"` Address *common.Address `json:"address,omitempty"` // Address only present in iterative (line-by-line) mode SecureKey hexutil.Bytes `json:"key,omitempty"` // If we don't have address, we can output the key }
DumpAccount represents an account in the state.
type DumpCollector ¶
type DumpCollector interface { // OnRoot is called with the state root OnRoot(common.Hash) // OnAccount is called once for each account in the trie OnAccount(common.Address, DumpAccount) }
DumpCollector interface which the state trie calls during iteration
type Dumper ¶
type Dumper struct {
// contains filtered or unexported fields
}
func (*Dumper) DefaultDump ¶
DefaultDump returns a JSON string representing the state with the default params
func (*Dumper) DefaultRawDump ¶
func (*Dumper) Dump ¶
Dump returns a JSON string representing the entire state as a single json-object
func (*Dumper) DumpToCollector ¶
func (*Dumper) IterativeDump ¶
func (d *Dumper) IterativeDump(excludeCode, excludeStorage, excludeMissingPreimages bool, output *json.Encoder)
IterativeDump dumps out accounts as json-objects, delimited by linebreaks on stdout
func (*Dumper) IteratorDump ¶
func (d *Dumper) IteratorDump(excludeCode, excludeStorage, excludeMissingPreimages bool, start common.Address, maxResults int) (IteratorDump, error)
IteratorDump dumps out a batch of accounts starts with the given start key
type IntraBlockState ¶
IntraBlockState is responsible for caching and managing state changes that occur during block's execution.
func (*IntraBlockState) AddAddressToAccessList ¶
func (sdb *IntraBlockState) AddAddressToAccessList(addr common.Address)
AddAddressToAccessList adds the given address to the access list
func (*IntraBlockState) AddBalance ¶
func (sdb *IntraBlockState) AddBalance(addr common.Address, amount *uint256.Int)
AddBalance adds amount to the account associated with addr. DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) AddLog ¶
func (sdb *IntraBlockState) AddLog(log *types.Log)
func (*IntraBlockState) AddPreimage ¶
func (sdb *IntraBlockState) AddPreimage(hash common.Hash, preimage []byte)
AddPreimage records a SHA3 preimage seen by the VM.
func (*IntraBlockState) AddRefund ¶
func (sdb *IntraBlockState) AddRefund(gas uint64)
AddRefund adds gas to the refund counter
func (*IntraBlockState) AddSlotToAccessList ¶
func (sdb *IntraBlockState) AddSlotToAccessList(addr common.Address, slot common.Hash)
AddSlotToAccessList adds the given (address, slot)-tuple to the access list
func (*IntraBlockState) AddressInAccessList ¶
func (sdb *IntraBlockState) AddressInAccessList(addr common.Address) bool
AddressInAccessList returns true if the given address is in the access list.
func (*IntraBlockState) CommitBlock ¶
func (sdb *IntraBlockState) CommitBlock(ctx context.Context, stateWriter StateWriter) error
CommitBlock finalizes the state by removing the self destructed objects and clears the journal as well as the refunds.
func (*IntraBlockState) Copy ¶
func (sdb *IntraBlockState) Copy() *IntraBlockState
Copy creates a deep, independent copy of the state. Snapshots of the copied state cannot be applied to the copy.
func (*IntraBlockState) CreateAccount ¶
func (sdb *IntraBlockState) CreateAccount(addr common.Address, contractCreation bool)
CreateAccount explicitly creates a state object. If a state object with the address already exists the balance is carried over to the new account.
CreateAccount is called during the EVM CREATE operation. The situation might arise that a contract does the following:
- sends funds to sha(account ++ (nonce + 1))
- tx_create(sha(account ++ nonce)) (note that this gets the address of 1)
Carrying over the balance ensures that Ether doesn't disappear.
func (*IntraBlockState) Empty ¶
func (sdb *IntraBlockState) Empty(addr common.Address) bool
Empty returns whether the state object is either non-existent or empty according to the EIP161 specification (balance = nonce = code = 0)
func (*IntraBlockState) Error ¶
func (sdb *IntraBlockState) Error() error
func (*IntraBlockState) Exist ¶
func (sdb *IntraBlockState) Exist(addr common.Address) bool
Exist reports whether the given account address exists in the state. Notably this also returns true for suicided accounts.
func (*IntraBlockState) FinalizeTx ¶
func (sdb *IntraBlockState) FinalizeTx(ctx context.Context, stateWriter StateWriter) error
FinalizeTx should be called after every transaction.
func (*IntraBlockState) GetBalance ¶
func (sdb *IntraBlockState) GetBalance(addr common.Address) *uint256.Int
GetBalance retrieves the balance from the given address or 0 if object not found DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetCode ¶
func (sdb *IntraBlockState) GetCode(addr common.Address) []byte
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetCodeHash ¶
func (sdb *IntraBlockState) GetCodeHash(addr common.Address) common.Hash
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetCodeSize ¶
func (sdb *IntraBlockState) GetCodeSize(addr common.Address) int
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetCommittedState ¶
func (sdb *IntraBlockState) GetCommittedState(addr common.Address, key *common.Hash, value *uint256.Int)
GetCommittedState retrieves a value from the given account's committed storage trie. DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetIncarnation ¶
func (sdb *IntraBlockState) GetIncarnation(addr common.Address) uint64
func (*IntraBlockState) GetLogs ¶
func (sdb *IntraBlockState) GetLogs(hash common.Hash) []*types.Log
func (*IntraBlockState) GetNonce ¶
func (sdb *IntraBlockState) GetNonce(addr common.Address) uint64
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetOrNewStateObject ¶
func (sdb *IntraBlockState) GetOrNewStateObject(addr common.Address) *stateObject
Retrieve a state object or create a new state object if nil.
func (*IntraBlockState) GetProof ¶
func (sdb *IntraBlockState) GetProof(a common.Address) ([][]byte, error)
GetProof returns the Merkle proof for a given account
func (*IntraBlockState) GetRefund ¶
func (sdb *IntraBlockState) GetRefund() uint64
GetRefund returns the current value of the refund counter.
func (*IntraBlockState) GetState ¶
GetState retrieves a value from the given account's storage trie. DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) GetStorageProof ¶
GetStorageProof returns the storage proof for a given key
func (*IntraBlockState) HasSuicided ¶
func (sdb *IntraBlockState) HasSuicided(addr common.Address) bool
func (*IntraBlockState) Logs ¶
func (sdb *IntraBlockState) Logs() []*types.Log
func (*IntraBlockState) Preimages ¶
func (sdb *IntraBlockState) Preimages() map[common.Hash][]byte
Preimages returns a list of SHA3 preimages that have been submitted.
func (*IntraBlockState) Prepare ¶
func (sdb *IntraBlockState) Prepare(thash, bhash common.Hash, ti int)
Prepare sets the current transaction hash and index and block hash which is used when the EVM emits new state logs.
func (*IntraBlockState) PrepareAccessList ¶
func (sdb *IntraBlockState) PrepareAccessList(sender common.Address, dst *common.Address, precompiles []common.Address, list types.AccessList)
PrepareAccessList handles the preparatory steps for executing a state transition with regards to both EIP-2929 and EIP-2930:
- Add sender to access list (2929) - Add destination to access list (2929) - Add precompiles to access list (2929) - Add the contents of the optional tx access list (2930)
This method should only be called if Yolov3/Berlin/2929+2930 is applicable at the current number.
func (*IntraBlockState) Reset ¶
func (sdb *IntraBlockState) Reset() error
Reset clears out all ephemeral state objects from the state db, but keeps the underlying state trie to avoid reloading data for the next operations.
func (*IntraBlockState) RevertToSnapshot ¶
func (sdb *IntraBlockState) RevertToSnapshot(revid int)
RevertToSnapshot reverts all state changes made since the given revision.
func (*IntraBlockState) SetBalance ¶
func (sdb *IntraBlockState) SetBalance(addr common.Address, amount *uint256.Int)
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) SetCode ¶
func (sdb *IntraBlockState) SetCode(addr common.Address, code []byte)
DESCRIBED: docs/programmers_guide/guide.md#code-hash DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) SetIncarnation ¶
func (sdb *IntraBlockState) SetIncarnation(addr common.Address, incarnation uint64)
SetIncarnation sets incarnation for account if account exists
func (*IntraBlockState) SetNonce ¶
func (sdb *IntraBlockState) SetNonce(addr common.Address, nonce uint64)
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) SetState ¶
DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) SetStorage ¶
func (sdb *IntraBlockState) SetStorage(addr common.Address, storage Storage)
SetStorage replaces the entire storage for the specified account with given storage. This function should only be used for debugging.
func (*IntraBlockState) SetTrace ¶
func (sdb *IntraBlockState) SetTrace(trace bool)
func (*IntraBlockState) SetTracer ¶
func (sdb *IntraBlockState) SetTracer(tracer StateTracer)
func (*IntraBlockState) SlotInAccessList ¶
func (sdb *IntraBlockState) SlotInAccessList(addr common.Address, slot common.Hash) (addressPresent bool, slotPresent bool)
SlotInAccessList returns true if the given (address, slot)-tuple is in the access list.
func (*IntraBlockState) Snapshot ¶
func (sdb *IntraBlockState) Snapshot() int
Snapshot returns an identifier for the current revision of the state.
func (*IntraBlockState) SubBalance ¶
func (sdb *IntraBlockState) SubBalance(addr common.Address, amount *uint256.Int)
SubBalance subtracts amount from the account associated with addr. DESCRIBED: docs/programmers_guide/guide.md#address---identifier-of-an-account
func (*IntraBlockState) SubRefund ¶
func (sdb *IntraBlockState) SubRefund(gas uint64)
SubRefund removes gas from the refund counter. This method will panic if the refund counter goes below zero
func (*IntraBlockState) Suicide ¶
func (sdb *IntraBlockState) Suicide(addr common.Address) bool
Suicide marks the given account as suicided. This clears the account balance.
The account's state object is still available until the state is committed, getStateObject will return a non-nil account after Suicide.
func (*IntraBlockState) TxIndex ¶
func (sdb *IntraBlockState) TxIndex() int
TxIndex returns the current transaction index set by Prepare.
type IteratorDump ¶
type IteratorDump struct { Root string `json:"root"` Accounts map[common.Address]DumpAccount `json:"accounts"` Next []byte `json:"next,omitempty"` // nil if no more accounts }
IteratorDump is an implementation for iterating over data.
func (*IteratorDump) OnAccount ¶
func (d *IteratorDump) OnAccount(addr common.Address, account DumpAccount)
OnAccount implements DumpCollector interface
func (*IteratorDump) OnRoot ¶
func (d *IteratorDump) OnRoot(root common.Hash)
OnRoot implements DumpCollector interface
type NoopWriter ¶
type NoopWriter struct { }
func NewNoopWriter ¶
func NewNoopWriter() *NoopWriter
func (*NoopWriter) CreateContract ¶
func (nw *NoopWriter) CreateContract(address common.Address) error
func (*NoopWriter) DeleteAccount ¶
func (*NoopWriter) UpdateAccountCode ¶
func (*NoopWriter) UpdateAccountData ¶
func (*NoopWriter) WriteAccountStorage ¶
func (*NoopWriter) WriteChangeSets ¶
func (nw *NoopWriter) WriteChangeSets() error
func (*NoopWriter) WriteHistory ¶
func (nw *NoopWriter) WriteHistory() error
type PlainDBState ¶
type PlainDBState struct {
// contains filtered or unexported fields
}
Implements StateReader by wrapping database only, without trie
func NewPlainDBState ¶
func NewPlainDBState(db ethdb.Database, blockNr uint64) *PlainDBState
func (*PlainDBState) CreateContract ¶
func (dbs *PlainDBState) CreateContract(address common.Address) error
func (*PlainDBState) DeleteAccount ¶
func (*PlainDBState) ForEachStorage ¶
func (*PlainDBState) GetBlockNr ¶
func (dbs *PlainDBState) GetBlockNr() uint64
func (*PlainDBState) ReadAccountCode ¶
func (*PlainDBState) ReadAccountCodeSize ¶
func (*PlainDBState) ReadAccountData ¶
func (*PlainDBState) ReadAccountIncarnation ¶
func (dbs *PlainDBState) ReadAccountIncarnation(address common.Address) (uint64, error)
func (*PlainDBState) ReadAccountStorage ¶
func (*PlainDBState) SetBlockNr ¶
func (dbs *PlainDBState) SetBlockNr(blockNr uint64)
func (*PlainDBState) UpdateAccountCode ¶
func (*PlainDBState) UpdateAccountData ¶
type PlainStateReader ¶
type PlainStateReader struct {
// contains filtered or unexported fields
}
PlainStateReader reads data from so called "plain state". Data in the plain state is stored using un-hashed account/storage items as opposed to the "normal" state that uses hashes of merkle paths to store items.
func NewPlainStateReader ¶
func NewPlainStateReader(db ethdb.Database) *PlainStateReader
func (*PlainStateReader) ReadAccountCode ¶
func (*PlainStateReader) ReadAccountCodeSize ¶
func (*PlainStateReader) ReadAccountData ¶
func (*PlainStateReader) ReadAccountIncarnation ¶
func (r *PlainStateReader) ReadAccountIncarnation(address common.Address) (uint64, error)
func (*PlainStateReader) ReadAccountStorage ¶
type PlainStateWriter ¶
type PlainStateWriter struct {
// contains filtered or unexported fields
}
func NewPlainStateWriter ¶
func (*PlainStateWriter) ChangeSetWriter ¶
func (w *PlainStateWriter) ChangeSetWriter() *ChangeSetWriter
func (*PlainStateWriter) CreateContract ¶
func (w *PlainStateWriter) CreateContract(address common.Address) error
func (*PlainStateWriter) DeleteAccount ¶
func (*PlainStateWriter) UpdateAccountCode ¶
func (*PlainStateWriter) UpdateAccountData ¶
func (*PlainStateWriter) WriteAccountStorage ¶
func (*PlainStateWriter) WriteChangeSets ¶
func (w *PlainStateWriter) WriteChangeSets() error
func (*PlainStateWriter) WriteHistory ¶
func (w *PlainStateWriter) WriteHistory() error
type PreimageWriter ¶
type PreimageWriter struct {
// contains filtered or unexported fields
}
func (*PreimageWriter) HashAddress ¶
func (*PreimageWriter) SetSavePreimages ¶
func (pw *PreimageWriter) SetSavePreimages(save bool)
type StateReader ¶
type StateReader interface { ReadAccountData(address common.Address) (*accounts.Account, error) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) ([]byte, error) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (int, error) ReadAccountIncarnation(address common.Address) (uint64, error) }
type StateTracer ¶
type StateWriter ¶
type StateWriter interface { UpdateAccountData(ctx context.Context, address common.Address, original, account *accounts.Account) error UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error DeleteAccount(ctx context.Context, address common.Address, original *accounts.Account) error WriteAccountStorage(ctx context.Context, address common.Address, incarnation uint64, key *common.Hash, original, value *uint256.Int) error CreateContract(address common.Address) error }
type Stateless ¶
type Stateless struct {
// contains filtered or unexported fields
}
Stateless is the inter-block cache for stateless client prototype, iteration 2 It creates the initial state trie during the construction, and then updates it during the execution of block(s)
func NewStateless ¶
func NewStateless(stateRoot common.Hash, blockWitness *trie.Witness, blockNr uint64, trace bool, isBinary bool) (*Stateless, error)
NewStateless creates a new instance of Stateless It deserialises the block witness and creates the state trie out of it, checking that the root of the constructed state trie matches the value of `stateRoot` parameter
func (*Stateless) CheckRoot ¶
CheckRoot finalises the execution of a block and computes the resulting state root
func (*Stateless) CreateContract ¶
CreateContract is a part of StateWriter interface This implementation registers given address in the internal map `created`
func (*Stateless) DeleteAccount ¶
func (s *Stateless) DeleteAccount(_ context.Context, address common.Address, original *accounts.Account) error
DeleteAccount is a part of the StateWriter interface This implementation registers the deletion of the account in two internal maps
func (*Stateless) ReadAccountCode ¶
func (s *Stateless) ReadAccountCode(address common.Address, incarnation uint64, codeHash common.Hash) (code []byte, err error)
ReadAccountCode is a part of the StateReader interface
func (*Stateless) ReadAccountCodeSize ¶
func (s *Stateless) ReadAccountCodeSize(address common.Address, incarnation uint64, codeHash common.Hash) (codeSize int, err error)
ReadAccountCodeSize is a part of the StateReader interface This implementation looks the code up in the codeMap, and returns its size It fails if the code is not found in the map
func (*Stateless) ReadAccountData ¶
ReadAccountData is a part of the StateReader interface This implementation attempts to look up account data in the state trie, and fails if it is not found
func (*Stateless) ReadAccountIncarnation ¶
func (*Stateless) ReadAccountStorage ¶
func (s *Stateless) ReadAccountStorage(address common.Address, incarnation uint64, key *common.Hash) ([]byte, error)
ReadAccountStorage is a part of the StateReader interface This implementation attempts to look up the storage in the state trie, and fails if it is not found
func (*Stateless) SetBlockNr ¶
SetBlockNr changes the block number associated with this
func (*Stateless) UpdateAccountCode ¶
func (s *Stateless) UpdateAccountCode(address common.Address, incarnation uint64, codeHash common.Hash, code []byte) error
UpdateAccountCode is a part of the StateWriter interface This implementation adds the code to the codeMap to make it available for further accesses
func (*Stateless) UpdateAccountData ¶
func (s *Stateless) UpdateAccountData(_ context.Context, address common.Address, original, account *accounts.Account) error
UpdateAccountData is a part of the StateWriter interface This implementation registers the account update in the `accountUpdates` map
func (*Stateless) WriteAccountStorage ¶
func (s *Stateless) WriteAccountStorage(_ context.Context, address common.Address, incarnation uint64, key *common.Hash, original, value *uint256.Int) error
WriteAccountStorage is a part of the StateWriter interface This implementation registeres the change of the account's storage in the internal double map `storageUpdates`
type TrieDbState ¶
type TrieDbState struct {
// contains filtered or unexported fields
}
TrieDbState implements StateReader by wrapping a trie and a database, where trie acts as a cache for the database
func NewTrieDbState ¶
func (*TrieDbState) CalcTrieRoots ¶
func (tds *TrieDbState) CalcTrieRoots(trace bool) (common.Hash, error)
CalcTrieRoots calculates trie roots without modifying the state trie
func (*TrieDbState) ComputeTrieRoots ¶
func (tds *TrieDbState) ComputeTrieRoots() ([]common.Hash, error)
ComputeTrieRoots is a combination of `ResolveStateTrie` and `UpdateStateTrie` DESCRIBED: docs/programmers_guide/guide.md#organising-ethereum-state-into-a-merkle-tree
func (*TrieDbState) Copy ¶
func (tds *TrieDbState) Copy() *TrieDbState
func (*TrieDbState) Database ¶
func (tds *TrieDbState) Database() ethdb.Database
func (*TrieDbState) DbStateWriter ¶
func (tds *TrieDbState) DbStateWriter() *DbStateWriter
DbStateWriter creates a writer that is designed to write changes into the database batch
func (*TrieDbState) EnablePreimages ¶
func (tds *TrieDbState) EnablePreimages(ep bool)
func (*TrieDbState) EvictTries ¶
func (tds *TrieDbState) EvictTries(print bool)
func (*TrieDbState) ExtractTouches ¶
func (tds *TrieDbState) ExtractTouches() (accountTouches [][]byte, storageTouches [][]byte)
ExtractTouches returns two lists of keys - for accounts and storage items correspondingly Each list is the collection of keys that have been "touched" (inserted, updated, or simply accessed) since the last invocation of `ExtractTouches`.
func (*TrieDbState) ExtractWitness ¶
ExtractWitness produces block witness for the block just been processed, in a serialised form
func (*TrieDbState) ExtractWitnessForPrefix ¶
func (tds *TrieDbState) ExtractWitnessForPrefix(prefix []byte, trace bool, isBinary bool) (*trie.Witness, error)
ExtractWitness produces block witness for the block just been processed, in a serialised form
func (*TrieDbState) GetAccount ¶
func (*TrieDbState) GetBlockNr ¶
func (tds *TrieDbState) GetBlockNr() uint64
func (*TrieDbState) GetKey ¶
func (tds *TrieDbState) GetKey(shaKey []byte) []byte
func (*TrieDbState) GetNodeByHash ¶
func (tds *TrieDbState) GetNodeByHash(hash common.Hash) []byte
GetNodeByHash gets node's RLP by hash.
func (*TrieDbState) GetTrieHash ¶
func (tds *TrieDbState) GetTrieHash() common.Hash
func (*TrieDbState) LastRoot ¶
func (tds *TrieDbState) LastRoot() common.Hash
func (*TrieDbState) PlainStateWriter ¶
func (tds *TrieDbState) PlainStateWriter() *PlainStateWriter
DbStateWriter creates a writer that is designed to write changes into the database batch
func (*TrieDbState) PrintTrie ¶
func (tds *TrieDbState) PrintTrie(w io.Writer)
func (*TrieDbState) ReadAccountCode ¶
func (*TrieDbState) ReadAccountCodeSize ¶
func (*TrieDbState) ReadAccountData ¶
func (*TrieDbState) ReadAccountIncarnation ¶
func (tds *TrieDbState) ReadAccountIncarnation(address common.Address) (uint64, error)
func (*TrieDbState) ReadAccountStorage ¶
func (*TrieDbState) ReadCodeByHash ¶
func (tds *TrieDbState) ReadCodeByHash(codeHash common.Hash) (code []byte, err error)
func (*TrieDbState) ResolveStateTrie ¶
func (tds *TrieDbState) ResolveStateTrie(extractWitnesses bool, trace bool) ([]*trie.Witness, error)
ResolveStateTrie resolves parts of the state trie that would be necessary for any updates (and reads, if `resolveReads` is set).
func (*TrieDbState) ResolveStateTrieStateless ¶
func (tds *TrieDbState) ResolveStateTrieStateless(database trie.WitnessStorage) error
ResolveStateTrieStateless uses a witness DB to resolve subtries
func (*TrieDbState) SetBlockNr ¶
func (tds *TrieDbState) SetBlockNr(blockNr uint64)
func (*TrieDbState) SetHistorical ¶
func (tds *TrieDbState) SetHistorical(h bool)
func (*TrieDbState) SetNoHistory ¶
func (tds *TrieDbState) SetNoHistory(nh bool)
func (*TrieDbState) SetResolveReads ¶
func (tds *TrieDbState) SetResolveReads(rr bool)
func (*TrieDbState) StartNewBuffer ¶
func (tds *TrieDbState) StartNewBuffer()
func (*TrieDbState) Trie ¶
func (tds *TrieDbState) Trie() *trie.Trie
func (*TrieDbState) TriePruningDebugDump ¶
func (tds *TrieDbState) TriePruningDebugDump() string
func (*TrieDbState) TrieStateWriter ¶
func (tds *TrieDbState) TrieStateWriter() *TrieStateWriter
func (*TrieDbState) UnwindTo ¶
func (tds *TrieDbState) UnwindTo(blockNr uint64) error
func (*TrieDbState) UpdateStateTrie ¶
func (tds *TrieDbState) UpdateStateTrie() ([]common.Hash, error)
UpdateStateTrie assumes that the state trie is already fully resolved, i.e. any operations will find necessary data inside the trie.
func (*TrieDbState) WithNewBuffer ¶
func (tds *TrieDbState) WithNewBuffer() *TrieDbState
type TrieStateWriter ¶
type TrieStateWriter struct {
// contains filtered or unexported fields
}
func (*TrieStateWriter) CreateContract ¶
func (tsw *TrieStateWriter) CreateContract(address common.Address) error
func (*TrieStateWriter) DeleteAccount ¶
func (*TrieStateWriter) UpdateAccountCode ¶
func (*TrieStateWriter) UpdateAccountData ¶
type WriterWithChangeSets ¶
type WriterWithChangeSets interface { StateWriter WriteChangeSets() error WriteHistory() error }