-
Notifications
You must be signed in to change notification settings - Fork 673
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Switch TrieUpdate API to use TrieKey trait (#2278)
Introducing `TrieKey` trait to work with keys within `TrieUpdate` instead of using raw `Vec<u8>`. This allows to have additional logic for keys. E.g. if we want to hash AccountID for keys (see #2215) and later return all touched accounts for a block (see #2253) we need a way to map `sha256(account_id)` from a raw key back to the `account_id`. Then `TrieKey` may implement `fn get_account_id_with_hash() -> Option<(AccountId, CryptoHash)>` logic that provides Account ID and hash of this Account ID. With this info we can remember pairs of touched Accounts in memory of `TrieUpdate` and now we can map back hashes here: https://github.com/nearprotocol/nearcore/blob/62f00b211915790d06e822da866fb01ceb6cdc89/core/store/src/trie/mod.rs#L578 Removes iterators from VMLogic (cause they somewhat block changes from this PR). Fixes #2276 ##Test Plan: - unit tests and CI
- Loading branch information
Evgeny Kuzyakov
authored
Mar 24, 2020
1 parent
6a921fb
commit abfb5e9
Showing
12 changed files
with
172 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.