Documentation ¶
Overview ¶
Package state provides a caching layer atop the Ethereum state trie.
Index ¶
- Variables
- func CheckCodeEmpty(codeHash []byte) bool
- func NewStateSync(root common.Hash, database trie.DatabaseReader) *trie.TrieSync
- func Rank(candidateInfos CandidateInfos) ([]common.Address, []uint64)
- func RankWithLenth(candidateInfos CandidateInfos, lenth int, committeeMinStake uint64) ([]common.Address, []uint64)
- type Account
- type CandidateInfo
- type CandidateInfos
- type Candidates
- type Code
- type Database
- type Dump
- type DumpAccount
- type FilePropertie
- type 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 *StateDB)
- type NodeIterator
- type StateDB
- func (self *StateDB) AddAccountInForbidBackStakeList(address common.Address) bool
- func (self *StateDB) AddAlreadyBackStack(backStack common.AlreadyBackStake) bool
- func (self *StateDB) AddBalance(addr common.Address, amount *big.Int)
- func (self *StateDB) AddCandidate(candidate common.Address) bool
- func (self *StateDB) AddLastRootState(statehash common.Hash, blockNumber uint64) bool
- func (self *StateDB) AddLog(log *types.Log)
- func (self *StateDB) AddPreimage(hash common.Hash, preimage []byte)
- func (self *StateDB) AddPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool
- func (self *StateDB) AddRefund(gas uint64)
- func (self *StateDB) AddTxInOptionTxTable(hash common.Hash, promissoryNotesOptionTx types.PromissoryNotesOptionTx, ...) bool
- func (self *StateDB) BackStake(id common.Address, blockNumber uint64) (bool, uint64)
- func (self *StateDB) BuyPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx
- func (self *StateDB) CarriedOutPromissoryNotes(orderId common.Hash, address common.Address, optionTxMemorySize uint64) types.PromissoryNotesOptionTx
- func (self *StateDB) CheckUnlockSharedKey(address common.Address, shareKeyId string) bool
- func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error)
- func (self *StateDB) Copy() *StateDB
- func (self *StateDB) CreateAccount(addr common.Address)
- func (self *StateDB) Database() Database
- func (self *StateDB) DelAccountInForbidBackStakeList(address common.Address) bool
- func (self *StateDB) DelCandidate(candidate common.Address) bool
- func (self *StateDB) DelMainAccountBinding(mianAccount common.Address) []common.Address
- func (self *StateDB) DelPromissoryNote(address common.Address, promissoryNote types.PromissoryNote) bool
- func (self *StateDB) DelSubAccountBinding(subAccount common.Address) bool
- func (self *StateDB) DelTxInOptionTxTable(hash common.Hash, optionTxMemorySize uint64) bool
- func (self *StateDB) DeleteStake(id common.Address, stake uint64, blockNumber uint64) (bool, uint64)
- func (s *StateDB) DeleteSuicides()
- func (self *StateDB) Dump() []byte
- func (self *StateDB) Empty(addr common.Address) bool
- func (self *StateDB) Error() error
- func (self *StateDB) Exist(addr common.Address) bool
- func (s *StateDB) Finalise(deleteEmptyObjects bool)
- func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common.Hash) bool)
- func (self *StateDB) GetAccountAttributes(addr common.Address) types.GenaroData
- func (self *StateDB) GetAccountData(address common.Address) *Account
- func (self *StateDB) GetAddressByNode(s string) string
- func (self *StateDB) GetAllPromissoryNotesNum(address common.Address) uint64
- func (self *StateDB) GetAlreadyBackStakeList() (bool, common.BackStakeList)
- func (self *StateDB) GetBalance(addr common.Address) *big.Int
- func (self *StateDB) GetBeforPromissoryNotesNum(address common.Address, blockNumber uint64) uint64
- func (self *StateDB) GetBucketApplyPrice() *big.Int
- func (self *StateDB) GetBuckets(addr common.Address) (map[string]interface{}, error)
- func (self *StateDB) GetCandidateInfoWithAllSubAccounts(candidate common.Address) (candidateInfo CandidateInfo)
- func (self *StateDB) GetCandidates() Candidates
- func (self *StateDB) GetCandidatesInfoInRange(blockNumStart uint64, blockNumEnd uint64) []CandidateInfo
- func (self *StateDB) GetCandidatesInfoWithAllSubAccounts() []CandidateInfo
- func (self *StateDB) GetCode(addr common.Address) []byte
- func (self *StateDB) GetCodeHash(addr common.Address) common.Hash
- func (self *StateDB) GetCodeSize(addr common.Address) int
- func (self *StateDB) GetCommitteeRank(blockNumStart uint64, blockNumEnd uint64) ([]common.Address, []uint64)
- func (self *StateDB) GetFileSharePublicKey(addr common.Address) string
- func (self *StateDB) GetForbidBackStakeList() types.ForbidBackStakeList
- func (self *StateDB) GetGenaroCodeHash(addr common.Address) string
- func (self *StateDB) GetGenaroPrice() *types.GenaroPrice
- func (self *StateDB) GetHeft(id common.Address) (uint64, error)
- func (self *StateDB) GetHeftLastDiff(id common.Address, lastBlockNum uint64) uint64
- func (self *StateDB) GetHeftLog(id common.Address) types.NumLogs
- func (self *StateDB) GetHeftRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64
- func (self *StateDB) GetLastSynState() *types.LastSynState
- func (self *StateDB) GetLogs(hash common.Hash) []*types.Log
- func (self *StateDB) GetMainAccount(subAccount common.Address) *common.Address
- func (self *StateDB) GetMainAccountRank() ([]common.Address, []uint64)
- func (self *StateDB) GetMainAccounts() map[common.Address][]common.Address
- func (self *StateDB) GetNameAccount(name string) (addr common.Address, err error)
- func (self *StateDB) GetNonce(addr common.Address) uint64
- func (self *StateDB) GetOneDayGesCost() *big.Int
- func (self *StateDB) GetOneDaySyncLogGsaCost() *big.Int
- func (self *StateDB) GetOptionTxTable(hash common.Hash, optionTxMemorySize uint64) *types.OptionTxTable
- func (self *StateDB) GetOptionTxTableByAddress(address common.Address) *types.OptionTxTable
- func (self *StateDB) GetOrNewStateObject(addr common.Address) *stateObject
- func (self *StateDB) GetPromissoryNotes(address common.Address) types.PromissoryNotes
- func (self *StateDB) GetRefund() uint64
- func (self *StateDB) GetRewardsValues() *types.RewardsValues
- func (self *StateDB) GetSharedFile(address common.Address, shareKeyId string) types.SynchronizeShareKey
- func (self *StateDB) GetStake(id common.Address) (uint64, error)
- func (self *StateDB) GetStakeLog(id common.Address) types.NumLogs
- func (self *StateDB) GetStakePerNodePrice() *big.Int
- func (self *StateDB) GetStakeRangeDiff(id common.Address, blockNumStart uint64, blockNumEnd uint64) uint64
- func (self *StateDB) GetState(a common.Address, b common.Hash) common.Hash
- func (self *StateDB) GetStorageGas(userid common.Address, bucketID [32]byte) (uint64, error)
- func (self *StateDB) GetStorageGasPrice(userid common.Address, bucketID [32]byte) (uint64, error)
- func (self *StateDB) GetStorageGasUsed(userid common.Address, bucketID [32]byte) (uint64, error)
- func (self *StateDB) GetStorageNodes(addr common.Address) []string
- func (self *StateDB) GetStorageSize(userid common.Address, bucketID [32]byte) (uint64, error)
- func (self *StateDB) GetSubAccounts(mianAccount common.Address) []common.Address
- func (self *StateDB) GetSubAccountsCount(mainAccount common.Address) int
- func (self *StateDB) GetTraffic(addr common.Address) uint64
- func (self *StateDB) GetTrafficApplyPrice() *big.Int
- func (self *StateDB) HasName(addr common.Address, name string) bool
- func (self *StateDB) HasSuicided(addr common.Address) bool
- func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash
- func (self *StateDB) IsAccountExistInForbidBackStakeList(address common.Address) bool
- func (self *StateDB) IsAlreadyBackStake(addr common.Address) bool
- func (self *StateDB) IsBindingAccount(account common.Address) bool
- func (self *StateDB) IsBindingMainAccount(account common.Address) bool
- func (self *StateDB) IsBindingSubAccount(account common.Address) bool
- func (self *StateDB) IsCandidateExist(candidate common.Address) bool
- func (self *StateDB) IsContract(addr common.Address) bool
- func (self *StateDB) IsNameAccountExist(name string) (bool, error)
- func (self *StateDB) Logs() []*types.Log
- func (self *StateDB) MarkStateObjectDirty(addr common.Address)
- func (self *StateDB) Preimages() map[common.Hash][]byte
- func (self *StateDB) Prepare(thash, bhash common.Hash, ti int)
- func (self *StateDB) PromissoryNotesWithdrawCash(address common.Address, blockNumber uint64) uint64
- func (self *StateDB) RawDump() Dump
- func (self *StateDB) Reset(root common.Hash) error
- func (self *StateDB) RevertToSnapshot(revid int)
- func (self *StateDB) SetAlreadyBackStakeList(backStacks common.BackStakeList) bool
- func (self *StateDB) SetBalance(addr common.Address, amount *big.Int)
- func (self *StateDB) SetCode(addr common.Address, code []byte)
- func (self *StateDB) SetCodeHash(addr common.Address, codeHash []byte)
- func (self *StateDB) SetGenaroPrice(genaroPrice types.GenaroPrice) bool
- func (self *StateDB) SetLastSynBlock(blockNumber uint64, blockHash common.Hash) bool
- func (self *StateDB) SetNameAccount(name string, addr common.Address) (err error)
- func (self *StateDB) SetNonce(addr common.Address, nonce uint64)
- func (self *StateDB) SetRewardsValues(rewardsValues types.RewardsValues) bool
- func (self *StateDB) SetState(addr common.Address, key common.Hash, value common.Hash)
- func (self *StateDB) SetTxStatusInOptionTxTable(hash common.Hash, status bool, optionTxMemorySize uint64) bool
- func (self *StateDB) Snapshot() int
- func (self *StateDB) SpecialTxTypeMortgageInit(address common.Address, ...) bool
- func (self *StateDB) SpecialTxTypeSyncSidechainStatus(address common.Address, ...) (map[common.Address]*big.Int, bool)
- func (self *StateDB) StorageTrie(a common.Address) Trie
- func (self *StateDB) SubBalance(addr common.Address, amount *big.Int)
- func (self *StateDB) Suicide(addr common.Address) bool
- func (self *StateDB) SyncNode2Address(node2UserAccountIndexAddress common.Address, s string, userAddress string) error
- func (self *StateDB) SyncStakeNode(address common.Address, s string) error
- func (self *StateDB) SynchronizeShareKey(address common.Address, synchronizeShareKey types.SynchronizeShareKey) bool
- func (self *StateDB) TurnBuyPromissoryNotes(orderId common.Hash, optionPrice *hexutil.Big, address common.Address, ...) bool
- func (self *StateDB) TxLogByDataVersionRead(address common.Address, fileID [32]byte, dataVersion string) (map[common.Address]*hexutil.Big, error)
- func (self *StateDB) TxLogBydataVersionUpdate(address common.Address, fileID [32]byte, OfficialAddress common.Address) bool
- func (self *StateDB) UbindNode2Address(address common.Address, nodeId string) error
- func (self *StateDB) UnbindNode(address common.Address, nodeId string) error
- func (self *StateDB) UnlockSharedKey(address common.Address, shareKeyId string) bool
- func (self *StateDB) UpdateAccountBinding(mainAccount common.Address, subAccount common.Address) bool
- func (self *StateDB) UpdateBucket(addr common.Address, bucket types.BucketPropertie) bool
- func (self *StateDB) UpdateBucketApplyPrice(address common.Address, price *hexutil.Big) bool
- func (self *StateDB) UpdateBucketProperties(userid common.Address, bucketid string, size uint64, backup uint64, ...) bool
- func (self *StateDB) UpdateFileSharePublicKey(id common.Address, publicKey string) bool
- func (self *StateDB) UpdateHeft(id common.Address, heft uint64, blockNumber uint64) bool
- func (self *StateDB) UpdateOneDayGesCost(address common.Address, price *hexutil.Big) bool
- func (self *StateDB) UpdateOneDaySyncLogGsaCost(address common.Address, price *hexutil.Big) bool
- func (self *StateDB) UpdateStake(id common.Address, stake uint64, blockNumber uint64) bool
- func (self *StateDB) UpdateStakePerNodePrice(address common.Address, price *hexutil.Big) bool
- func (self *StateDB) UpdateTraffic(id common.Address, traffic uint64) bool
- func (self *StateDB) UpdateTrafficApplyPrice(address common.Address, price *hexutil.Big) bool
- type Storage
- type Trie
Constants ¶
This section is empty.
Variables ¶
var ErrSyncNode = errors.New("no enough stake value to sync node")
var MaxTrieCacheGen = uint16(120)
Trie cache generation limit after which to evic trie nodes from memory.
Functions ¶
func NewStateSync ¶
NewStateSync create a new state trie download scheduler.
func RankWithLenth ¶
Types ¶
type Account ¶
type Account struct { Nonce uint64 Balance *big.Int Root common.Hash // merkle root of the storage trie CodeHash []byte }
Account is the Ethereum consensus representation of accounts. These objects are stored in the main account trie.
type CandidateInfo ¶
type CandidateInfos ¶
type CandidateInfos []CandidateInfo
func (CandidateInfos) Apply ¶
func (c CandidateInfos) Apply()
func (CandidateInfos) Len ¶
func (c CandidateInfos) Len() int
func (CandidateInfos) Less ¶
func (c CandidateInfos) Less(i, j int) bool
func (CandidateInfos) Swap ¶
func (c CandidateInfos) Swap(i, j int)
type Candidates ¶
func (*Candidates) DelCandidate ¶
func (self *Candidates) DelCandidate(addr common.Address)
type Database ¶
type Database interface { // OpenTrie opens the main account trie. OpenTrie(root common.Hash) (Trie, error) // OpenStorageTrie opens the storage trie of an account. OpenStorageTrie(addrHash, root common.Hash) (Trie, error) // CopyTrie returns an independent copy of the given trie. CopyTrie(Trie) Trie // ContractCode retrieves a particular contract's code. ContractCode(addrHash, codeHash common.Hash) ([]byte, error) // ContractCodeSize retrieves a particular contracts code's size. ContractCodeSize(addrHash, codeHash common.Hash) (int, error) // TrieDB retrieves the low level trie database used for data storage. TrieDB() *trie.Database }
Database wraps access to tries and contract code.
func NewDatabase ¶
NewDatabase creates a backing store for state. The returned database is safe for concurrent use and retains cached trie nodes in memory. The pool is an optional intermediate trie-node memory pool between the low level storage layer and the high level trie abstraction.
type Dump ¶
type Dump struct { Root string `json:"root"` Accounts map[string]DumpAccount `json:"accounts"` }
type DumpAccount ¶
type FilePropertie ¶
type ManagedState ¶
type ManagedState struct { *StateDB // contains filtered or unexported fields }
func ManageState ¶
func ManageState(statedb *StateDB) *ManagedState
ManagedState returns a new managed state with the statedb as it's backing layer
func (*ManagedState) GetNonce ¶
func (ms *ManagedState) GetNonce(addr common.Address) uint64
GetNonce returns the canonical nonce for the managed or unmanaged account.
Because GetNonce mutates the DB, we must take a write lock.
func (*ManagedState) HasAccount ¶
func (ms *ManagedState) HasAccount(addr common.Address) bool
HasAccount returns whether the given address is managed or not
func (*ManagedState) NewNonce ¶
func (ms *ManagedState) NewNonce(addr common.Address) uint64
NewNonce returns the new canonical nonce for the managed account
func (*ManagedState) RemoveNonce ¶
func (ms *ManagedState) RemoveNonce(addr common.Address, n uint64)
RemoveNonce removed the nonce from the managed state and all future pending nonces
func (*ManagedState) SetNonce ¶
func (ms *ManagedState) SetNonce(addr common.Address, nonce uint64)
SetNonce sets the new canonical nonce for the managed state
func (*ManagedState) SetState ¶
func (ms *ManagedState) SetState(statedb *StateDB)
SetState sets the backing layer of the managed state
type NodeIterator ¶
type NodeIterator struct { Hash common.Hash // Hash of the current entry being iterated (nil if not standalone) Parent common.Hash // Hash of the first full ancestor node (nil if current is the root) Error error // Failure set in case of an internal error in the iterator // contains filtered or unexported fields }
NodeIterator is an iterator to traverse the entire state trie post-order, including all of the contract code and contract state tries.
func NewNodeIterator ¶
func NewNodeIterator(state *StateDB) *NodeIterator
NewNodeIterator creates an post-order state node iterator.
func (*NodeIterator) Next ¶
func (it *NodeIterator) Next() bool
Next moves the iterator to the next node, returning whether there are any further nodes. In case of an internal error this method returns false and sets the Error field to the encountered failure.
type StateDB ¶
type StateDB struct {
// contains filtered or unexported fields
}
StateDBs within the ethereum protocol are used to store anything within the merkle trie. StateDBs take care of caching and storing nested states. It's the general query interface to retrieve: * Contracts * Accounts
func (*StateDB) AddAccountInForbidBackStakeList ¶
func (*StateDB) AddAlreadyBackStack ¶
func (self *StateDB) AddAlreadyBackStack(backStack common.AlreadyBackStake) bool
func (*StateDB) AddBalance ¶
AddBalance adds amount to the account associated with addr
func (*StateDB) AddLastRootState ¶
func (*StateDB) AddPreimage ¶
AddPreimage records a SHA3 preimage seen by the VM.
func (*StateDB) AddPromissoryNote ¶
func (*StateDB) AddTxInOptionTxTable ¶
func (*StateDB) BuyPromissoryNotes ¶
func (*StateDB) CarriedOutPromissoryNotes ¶
func (*StateDB) CheckUnlockSharedKey ¶
func (*StateDB) Copy ¶
Copy creates a deep, independent copy of the state. Snapshots of the copied state cannot be applied to the copy.
func (*StateDB) CreateAccount ¶
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 (*StateDB) Database ¶
Database retrieves the low level database supporting the lower level trie ops.
func (*StateDB) DelAccountInForbidBackStakeList ¶
func (*StateDB) DelMainAccountBinding ¶
func (*StateDB) DelPromissoryNote ¶
func (*StateDB) DelSubAccountBinding ¶
func (*StateDB) DelTxInOptionTxTable ¶
func (*StateDB) DeleteStake ¶
func (*StateDB) DeleteSuicides ¶
func (s *StateDB) DeleteSuicides()
DeleteSuicides flags the suicided objects for deletion so that it won't be referenced again when called / queried up on.
DeleteSuicides should not be used for consensus related updates under any circumstances.
func (*StateDB) Empty ¶
Empty returns whether the state object is either non-existent or empty according to the EIP161 specification (balance = nonce = code = 0)
func (*StateDB) Exist ¶
Exist reports whether the given account address exists in the state. Notably this also returns true for suicided accounts.
func (*StateDB) Finalise ¶
Finalise finalises the state by removing the self destructed objects and clears the journal as well as the refunds.
func (*StateDB) ForEachStorage ¶
func (*StateDB) GetAccountAttributes ¶
func (self *StateDB) GetAccountAttributes(addr common.Address) types.GenaroData
func (*StateDB) GetAccountData ¶
func (*StateDB) GetAddressByNode ¶
func (*StateDB) GetAllPromissoryNotesNum ¶
func (*StateDB) GetAlreadyBackStakeList ¶
func (self *StateDB) GetAlreadyBackStakeList() (bool, common.BackStakeList)
func (*StateDB) GetBalance ¶
Retrieve the balance from the given address or 0 if object not found
func (*StateDB) GetBeforPromissoryNotesNum ¶
func (*StateDB) GetBucketApplyPrice ¶
func (*StateDB) GetBuckets ¶
func (*StateDB) GetCandidateInfoWithAllSubAccounts ¶
func (self *StateDB) GetCandidateInfoWithAllSubAccounts(candidate common.Address) (candidateInfo CandidateInfo)
func (*StateDB) GetCandidates ¶
func (self *StateDB) GetCandidates() Candidates
func (*StateDB) GetCandidatesInfoInRange ¶
func (self *StateDB) GetCandidatesInfoInRange(blockNumStart uint64, blockNumEnd uint64) []CandidateInfo
func (*StateDB) GetCandidatesInfoWithAllSubAccounts ¶
func (self *StateDB) GetCandidatesInfoWithAllSubAccounts() []CandidateInfo
func (*StateDB) GetCommitteeRank ¶
func (*StateDB) GetFileSharePublicKey ¶
func (*StateDB) GetForbidBackStakeList ¶
func (self *StateDB) GetForbidBackStakeList() types.ForbidBackStakeList
func (*StateDB) GetGenaroCodeHash ¶
only used in genaro
func (*StateDB) GetGenaroPrice ¶
func (self *StateDB) GetGenaroPrice() *types.GenaroPrice
func (*StateDB) GetHeftLastDiff ¶
func (*StateDB) GetHeftRangeDiff ¶
func (*StateDB) GetLastSynState ¶
func (self *StateDB) GetLastSynState() *types.LastSynState
func (*StateDB) GetMainAccount ¶
func (*StateDB) GetMainAccountRank ¶
func (*StateDB) GetMainAccounts ¶
func (*StateDB) GetNameAccount ¶
func (*StateDB) GetOneDayGesCost ¶
func (*StateDB) GetOneDaySyncLogGsaCost ¶
func (*StateDB) GetOptionTxTable ¶
func (*StateDB) GetOptionTxTableByAddress ¶
func (self *StateDB) GetOptionTxTableByAddress(address common.Address) *types.OptionTxTable
func (*StateDB) GetOrNewStateObject ¶
Retrieve a state object or create a new state object if nil
func (*StateDB) GetPromissoryNotes ¶
func (self *StateDB) GetPromissoryNotes(address common.Address) types.PromissoryNotes
func (*StateDB) GetRewardsValues ¶
func (self *StateDB) GetRewardsValues() *types.RewardsValues
func (*StateDB) GetSharedFile ¶
func (*StateDB) GetStakePerNodePrice ¶
func (*StateDB) GetStakeRangeDiff ¶
func (*StateDB) GetStorageGas ¶
func (*StateDB) GetStorageGasPrice ¶
func (*StateDB) GetStorageGasUsed ¶
func (*StateDB) GetStorageNodes ¶
func (*StateDB) GetStorageSize ¶
func (*StateDB) GetSubAccounts ¶
func (*StateDB) GetSubAccountsCount ¶
func (*StateDB) GetTrafficApplyPrice ¶
func (*StateDB) IntermediateRoot ¶
IntermediateRoot computes the current root hash of the state trie. It is called in between transactions to get the root hash that goes into transaction receipts.
func (*StateDB) IsAccountExistInForbidBackStakeList ¶
func (*StateDB) IsAlreadyBackStake ¶
func (*StateDB) IsBindingAccount ¶
func (*StateDB) IsBindingMainAccount ¶
func (*StateDB) IsBindingSubAccount ¶
func (*StateDB) IsCandidateExist ¶
func (*StateDB) IsNameAccountExist ¶
func (*StateDB) MarkStateObjectDirty ¶
MarkStateObjectDirty adds the specified object to the dirty map to avoid costly state object cache iteration to find a handful of modified ones.
func (*StateDB) Prepare ¶
Prepare sets the current transaction hash and index and block hash which is used when the EVM emits new state logs.
func (*StateDB) PromissoryNotesWithdrawCash ¶
func (*StateDB) Reset ¶
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 (*StateDB) RevertToSnapshot ¶
RevertToSnapshot reverts all state changes made since the given revision.
func (*StateDB) SetAlreadyBackStakeList ¶
func (self *StateDB) SetAlreadyBackStakeList(backStacks common.BackStakeList) bool
func (*StateDB) SetCodeHash ¶
only used in genaro genesis init
func (*StateDB) SetGenaroPrice ¶
func (self *StateDB) SetGenaroPrice(genaroPrice types.GenaroPrice) bool
func (*StateDB) SetLastSynBlock ¶
func (*StateDB) SetNameAccount ¶
func (*StateDB) SetRewardsValues ¶
func (self *StateDB) SetRewardsValues(rewardsValues types.RewardsValues) bool
func (*StateDB) SetTxStatusInOptionTxTable ¶
func (*StateDB) SpecialTxTypeMortgageInit ¶
func (*StateDB) SpecialTxTypeSyncSidechainStatus ¶
func (*StateDB) StorageTrie ¶
StorageTrie returns the storage trie of an account. The return value is a copy and is nil for non-existent accounts.
func (*StateDB) SubBalance ¶
SubBalance subtracts amount from the account associated with addr
func (*StateDB) Suicide ¶
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 (*StateDB) SyncNode2Address ¶
func (*StateDB) SyncStakeNode ¶
func (*StateDB) SynchronizeShareKey ¶
func (*StateDB) TurnBuyPromissoryNotes ¶
func (*StateDB) TxLogByDataVersionRead ¶
func (*StateDB) TxLogBydataVersionUpdate ¶
func (*StateDB) UbindNode2Address ¶
func (*StateDB) UnbindNode ¶
func (*StateDB) UnlockSharedKey ¶
func (*StateDB) UpdateAccountBinding ¶
func (*StateDB) UpdateBucket ¶
func (*StateDB) UpdateBucketApplyPrice ¶
func (*StateDB) UpdateBucketProperties ¶
func (*StateDB) UpdateFileSharePublicKey ¶
func (*StateDB) UpdateHeft ¶
func (*StateDB) UpdateOneDayGesCost ¶
func (*StateDB) UpdateOneDaySyncLogGsaCost ¶
func (*StateDB) UpdateStake ¶
func (*StateDB) UpdateStakePerNodePrice ¶
func (*StateDB) UpdateTraffic ¶
type Trie ¶
type Trie interface { TryGet(key []byte) ([]byte, error) TryUpdate(key, value []byte) error TryDelete(key []byte) error Commit(onleaf trie.LeafCallback) (common.Hash, error) Hash() common.Hash NodeIterator(startKey []byte) trie.NodeIterator GetKey([]byte) []byte // TODO(fjl): remove this when SecureTrie is removed Prove(key []byte, fromLevel uint, proofDb ethdb.Putter) error }
Trie is a Ethereum Merkle Trie.