mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
trie: fix rebase
This commit is contained in:
parent
82a6e30a6d
commit
dd764fea87
1 changed files with 23 additions and 1 deletions
|
|
@ -78,6 +78,17 @@ func (t *TransitionTrie) GetStorage(addr common.Address, key []byte) ([]byte, er
|
|||
return t.base.GetStorage(addr, key)
|
||||
}
|
||||
|
||||
// PrefetchStorage attempts to resolve specific storage slots from the database
|
||||
// to accelerate subsequent trie operations.
|
||||
func (t *TransitionTrie) PrefetchStorage(addr common.Address, keys [][]byte) error {
|
||||
for _, key := range keys {
|
||||
if _, err := t.GetStorage(addr, key); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetAccount abstract an account read from the trie.
|
||||
func (t *TransitionTrie) GetAccount(address common.Address) (*types.StateAccount, error) {
|
||||
data, err := t.overlay.GetAccount(address)
|
||||
|
|
@ -94,6 +105,17 @@ func (t *TransitionTrie) GetAccount(address common.Address) (*types.StateAccount
|
|||
return t.base.GetAccount(address)
|
||||
}
|
||||
|
||||
// PrefetchAccount attempts to resolve specific accounts from the database
|
||||
// to accelerate subsequent trie operations.
|
||||
func (t *TransitionTrie) PrefetchAccount(addresses []common.Address) error {
|
||||
for _, addr := range addresses {
|
||||
if _, err := t.GetAccount(addr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateStorage associates key with value in the trie. If value has length zero, any
|
||||
// existing value is deleted from the trie. The value bytes must not be modified
|
||||
// by the caller while they are stored in the trie.
|
||||
|
|
@ -173,7 +195,7 @@ func (t *TransitionTrie) IsVerkle() bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// UpdateStems updates a group of values, given the stem they are using. If
|
||||
// UpdateStem updates a group of values, given the stem they are using. If
|
||||
// a value already exists, it is overwritten.
|
||||
func (t *TransitionTrie) UpdateStem(key []byte, values [][]byte) error {
|
||||
trie := t.overlay
|
||||
|
|
|
|||
Loading…
Reference in a new issue