Fix the undeterministic storage proof recorded for the same execution (#10915)

* Add a test case for the determinism of recorded proof

* Replace HashMap with BTreeMap for the actual proof records

* cargo +nightly fmt --all

* Store the trie nodes in BTreeSet for StorageProof

* Nit

* Revert the BTreeMap changes and sort when converting to storage proof

* Remove PartialEq from StorageProof

* Remove unnecessary change

* Add `compare` method to StorageProof

* FMT

* Dummy change to trigger CI

* Use `BTreeSet` for StorageProof and keep using `Vec` for CompactProof

* Update comment on `iter_nodes`

* Revert `PartialEq` removal
This commit is contained in:
Liu-Cheng Xu
2022-03-05 15:51:19 +08:00
committed by GitHub
parent 545ac4cf50
commit 6f59a8b183
5 changed files with 65 additions and 32 deletions
+1 -1
View File
@@ -26,8 +26,8 @@ use hash_db::Hasher;
use sp_std::vec::Vec;
use trie_root;
#[derive(Default, Clone)]
/// Codec-flavored TrieStream.
#[derive(Default, Clone)]
pub struct TrieStream {
/// Current node buffer.
buffer: Vec<u8>,