Versions in this module Expand all Collapse all v1 v1.10.3 Dec 16, 2024 v1.10.2 Dec 15, 2024 Changes in this version + var EmptyCodeHash = crypto.Keccak256Hash(nil) + var EmptyRootHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") + var ErrAddressNotPresent = errors.New("address not present in state") + func NewStateSync(root common.Hash, database ethdb.KeyValueReader, ...) *trie.Sync + type Account struct + Balance *big.Int + CodeHash []byte + Nonce uint64 + Root common.Hash + type Code []byte + func (c Code) String() string + type DB struct + AccountCommits time.Duration + AccountDeleted int + AccountHashes time.Duration + AccountReads time.Duration + AccountUpdated int + AccountUpdates time.Duration + SnapshotAccountReads time.Duration + SnapshotCommits time.Duration + SnapshotStorageReads time.Duration + StorageCommits time.Duration + StorageDeleted int + StorageHashes time.Duration + StorageReads time.Duration + StorageUpdated int + StorageUpdates time.Duration + TrieDBCommits time.Duration + func New(root common.Hash, db Database, snaps *snapshot.Tree) (*DB, error) + func (db *DB) AddAddressToAccessList(addr common.Address) + func (db *DB) AddBalance(addr common.Address, amount *big.Int) + func (db *DB) AddLog(log *types2.Log) + func (db *DB) AddPreimage(hash common.Hash, preimage []byte) + func (db *DB) AddRefund(gas uint64) + func (db *DB) AddReward(snapshot *stk.ValidatorWrapper, reward *big.Int, ...) error + func (db *DB) AddSlotToAccessList(addr common.Address, slot common.Hash) + func (db *DB) AddressInAccessList(addr common.Address) bool + func (db *DB) BlockHash() common.Hash + func (db *DB) Commit(deleteEmptyObjects bool) (common.Hash, error) + func (db *DB) Copy() *DB + func (db *DB) CreateAccount(addr common.Address) + func (db *DB) Database() Database + func (db *DB) Empty(addr common.Address) bool + func (db *DB) Error() error + func (db *DB) Exist(addr common.Address) bool + func (db *DB) Finalise(deleteEmptyObjects bool) + func (db *DB) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool) error + func (db *DB) GetBalance(addr common.Address) *big.Int + func (db *DB) GetCode(addr common.Address) []byte + func (db *DB) GetCodeHash(addr common.Address) common.Hash + func (db *DB) GetCodeSize(addr common.Address) int + func (db *DB) GetCommittedState(addr common.Address, hash common.Hash) common.Hash + func (db *DB) GetLogs(hash common.Hash, blockNumber uint64, blockHash common.Hash) []*types2.Log + func (db *DB) GetNonce(addr common.Address) uint64 + func (db *DB) GetOrNewStateObject(addr common.Address) *Object + func (db *DB) GetProof(addr common.Address) ([][]byte, error) + func (db *DB) GetProofByHash(addrHash common.Hash) ([][]byte, error) + func (db *DB) GetRefund() uint64 + func (db *DB) GetState(addr common.Address, hash common.Hash) common.Hash + func (db *DB) GetStorageProof(a common.Address, key common.Hash) ([][]byte, error) + func (db *DB) GetTransientState(addr common.Address, key common.Hash) common.Hash + func (db *DB) GetValidatorFirstElectionEpoch(addr common.Address) *big.Int + func (db *DB) HasSuicided(addr common.Address) bool + func (db *DB) IntermediateRoot(deleteEmptyObjects bool) common.Hash + func (db *DB) IsValidator(addr common.Address) bool + func (db *DB) Logs() []*types2.Log + func (db *DB) Preimages() map[common.Hash][]byte + func (db *DB) Prepare(thash, bhash common.Hash, ti int) + func (db *DB) Reset(root common.Hash) error + func (db *DB) RevertToSnapshot(revid int) + func (db *DB) SetBalance(addr common.Address, amount *big.Int) + func (db *DB) SetCode(addr common.Address, code []byte, isValidatorCode bool) + func (db *DB) SetNonce(addr common.Address, nonce uint64) + func (db *DB) SetState(addr common.Address, key, value common.Hash) + func (db *DB) SetStorage(addr common.Address, storage map[common.Hash]common.Hash) + func (db *DB) SetTransientState(addr common.Address, key, value common.Hash) + func (db *DB) SetTxContext(thash common.Hash, ti int) + func (db *DB) SetTxHashETH(ethTxHash common.Hash) + func (db *DB) SetValidatorFirstElectionEpoch(addr common.Address, epoch *big.Int) + func (db *DB) SetValidatorFlag(addr common.Address) + func (db *DB) SlotInAccessList(addr common.Address, slot common.Hash) (addressPresent bool, slotPresent bool) + func (db *DB) Snapshot() int + func (db *DB) StartPrefetcher(namespace string) + func (db *DB) StopPrefetcher() + func (db *DB) StorageTrie(addr common.Address) (Trie, error) + func (db *DB) SubBalance(addr common.Address, amount *big.Int) + func (db *DB) SubRefund(gas uint64) + func (db *DB) Suicide(addr common.Address) bool + func (db *DB) TxHash() common.Hash + func (db *DB) TxHashETH() common.Hash + func (db *DB) TxIndex() int + func (db *DB) UnsetValidatorFlag(addr common.Address) + func (db *DB) UpdateValidatorWrapper(addr common.Address, val *stk.ValidatorWrapper) error + func (db *DB) UpdateValidatorWrapperWithRevert(addr common.Address, val *stk.ValidatorWrapper) error + func (db *DB) ValidatorWrapper(addr common.Address, sendOriginal bool, copyDelegations bool) (*stk.ValidatorWrapper, error) + func (s *DB) DiffAndCleanCache(shardId uint32, to *DB) (int, error) + func (s *DB) Dump(opts *DumpConfig) []byte + func (s *DB) DumpToCollector(c DumpCollector, conf *DumpConfig) (nextKey []byte) + func (s *DB) IterativeDump(opts *DumpConfig, output *json.Encoder) + func (s *DB) IteratorDump(opts *DumpConfig) IteratorDump + func (s *DB) Prefetch(parallel int) + func (s *DB) RawDump(opts *DumpConfig) Dump + type Database interface + ContractCode func(addrHash, codeHash common.Hash) ([]byte, error) + ContractCodeSize func(addrHash, codeHash common.Hash) (int, error) + CopyTrie func(Trie) Trie + DiskDB func() ethdb.KeyValueStore + OpenStorageTrie func(stateRoot common.Hash, addrHash, root common.Hash) (Trie, error) + OpenTrie func(root common.Hash) (Trie, error) + TrieDB func() *trie.Database + ValidatorCode func(addrHash, codeHash common.Hash) ([]byte, error) + ValidatorCodeSize func(addrHash, codeHash common.Hash) (int, error) + func NewDatabase(db ethdb.Database) Database + func NewDatabaseWithCache(db ethdb.Database, cache int) Database + func NewDatabaseWithConfig(db ethdb.Database, config *trie.Config) Database + func NewDatabaseWithNodeDB(db ethdb.Database, triedb *trie.Database) Database + type Dump struct + Accounts map[common.Address]DumpAccount + Root string + func (d *Dump) OnAccount(addr common.Address, account DumpAccount) + func (d *Dump) OnRoot(root common.Hash) + type DumpAccount struct + Address *common.Address + Balance string + Code hexutil.Bytes + CodeHash hexutil.Bytes + Nonce uint64 + Root hexutil.Bytes + SecureKey hexutil.Bytes + Storage map[common.Hash]string + type DumpCollector interface + OnAccount func(common.Address, DumpAccount) + OnRoot func(common.Hash) + type DumpConfig struct + End []byte + Max uint64 + OnlyWithAddresses bool + SkipCode bool + SkipStorage bool + Start []byte + type IteratorDump struct + Accounts map[common.Address]DumpAccount + Next []byte + Root string + func (d *IteratorDump) OnAccount(addr common.Address, account DumpAccount) + func (d *IteratorDump) OnRoot(root common.Hash) + type ManagedState struct + func ManageState(statedb *DB) *ManagedState + func (ms *ManagedState) GetNonce(addr common.Address) uint64 + func (ms *ManagedState) HasAccount(addr common.Address) bool + func (ms *ManagedState) NewNonce(addr common.Address) uint64 + func (ms *ManagedState) RemoveNonce(addr common.Address, n uint64) + func (ms *ManagedState) SetNonce(addr common.Address, nonce uint64) + func (ms *ManagedState) SetState(statedb *DB) + type NodeIterator struct + Error error + Hash common.Hash + Parent common.Hash + func NewNodeIterator(state *DB) *NodeIterator + func (it *NodeIterator) Next() bool + type Object struct + func (s *Object) AddBalance(amount *big.Int) + func (s *Object) Address() common.Address + func (s *Object) Balance() *big.Int + func (s *Object) Code(db Database) []byte + func (s *Object) CodeHash() []byte + func (s *Object) CodeSize(db Database) int + func (s *Object) EncodeRLP(w io.Writer) error + func (s *Object) GetCommittedState(db Database, key common.Hash) common.Hash + func (s *Object) GetState(db Database, key common.Hash) common.Hash + func (s *Object) IsValidator(db Database) bool + func (s *Object) Nonce() uint64 + func (s *Object) ReturnGas(gas *big.Int) + func (s *Object) SetBalance(amount *big.Int) + func (s *Object) SetCode(codeHash common.Hash, code []byte, isValidatorCode bool) + func (s *Object) SetNonce(nonce uint64) + func (s *Object) SetState(db Database, key, value common.Hash) + func (s *Object) SetStorage(storage map[common.Hash]common.Hash) + func (s *Object) SubBalance(amount *big.Int) + func (s *Object) Value() *big.Int + type Storage map[common.Hash]common.Hash + func (s Storage) Copy() Storage + func (s Storage) String() (str string) + type Trie interface + Commit func(collectLeaf bool) (common.Hash, *trie.NodeSet) + GetKey func([]byte) []byte + Hash func() common.Hash + NodeIterator func(startKey []byte) trie.NodeIterator + Prove func(key []byte, fromLevel uint, proofDb ethdb.KeyValueWriter) error + TryDelete func(key []byte) error + TryDeleteAccount func(address common.Address) error + TryGet func(key []byte) ([]byte, error) + TryGetAccount func(address common.Address) (*types.StateAccount, error) + TryUpdate func(key, value []byte) error + TryUpdateAccount func(address common.Address, account *types.StateAccount) error