mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 18:37:59 +00:00
Use prefixed keys for trie node. (#2130)
* Account for pending insertions when pruning * Prefixed trie storage * Comments * Prefixed trie storage * Fixed tests * Fixed tests * Bumped runtime version * Bumped runtime version again
This commit is contained in:
committed by
Gav Wood
parent
f9d0da0a18
commit
7046e13de2
@@ -508,8 +508,8 @@ impl<B, E, Block, RA> Client<B, E, Block, RA> where
|
||||
}
|
||||
|
||||
impl<'a, Block: BlockT> ChangesTrieStorage<Blake2Hasher> for AccessedRootsRecorder<'a, Block> {
|
||||
fn get(&self, key: &H256) -> Result<Option<DBValue>, String> {
|
||||
self.storage.get(key)
|
||||
fn get(&self, key: &H256, prefix: &[u8]) -> Result<Option<DBValue>, String> {
|
||||
self.storage.get(key, prefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -742,8 +742,8 @@ impl<H: Hasher> state_machine::ChangesTrieRootsStorage<H> for ChangesTrieStorage
|
||||
}
|
||||
|
||||
impl<H: Hasher> state_machine::ChangesTrieStorage<H> for ChangesTrieStorage<H> where H::Out: HeapSizeOf {
|
||||
fn get(&self, key: &H::Out) -> Result<Option<state_machine::DBValue>, String> {
|
||||
self.0.get(key)
|
||||
fn get(&self, key: &H::Out, prefix: &[u8]) -> Result<Option<state_machine::DBValue>, String> {
|
||||
self.0.get(key, prefix)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ impl<E, H, B: BlockT, S: BlockchainStorage<B>, F> LightDataChecker<E, H, B, S, F
|
||||
// we share the storage for multiple checks, do it here
|
||||
let mut cht_root = H::Out::default();
|
||||
cht_root.as_mut().copy_from_slice(local_cht_root.as_ref());
|
||||
if !storage.contains(&cht_root) {
|
||||
if !storage.contains(&cht_root, &[]) {
|
||||
return Err(ClientErrorKind::InvalidCHTProof.into());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user