Skip to main content
Remove leading 0\n\n in text that adds no value.
Source Link
Jaco
  • 6k
  • 1
  • 9
  • 29

0

I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been able to figure it out yet.

Currently I'm using the trie_db::proof::generate_proof to generate the proof

This is what I've done so far https://github.com/Wizdave97/extrinsic-from-proof/blob/master/src/main.rs

The issue is the second line of this snippet returns an error 'InvalidStateRoot'

let db = sp_trie::storage_proof::StorageProof::new(proof.to_vec()).into_memory_db::<BlakeTwo256>();
let trie = sp_trie::TrieDB::<sp_trie::LayoutV0<BlakeTwo256>>::new(&db, root).unwrap();

0

I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been able to figure it out yet.

Currently I'm using the trie_db::proof::generate_proof to generate the proof

This is what I've done so far https://github.com/Wizdave97/extrinsic-from-proof/blob/master/src/main.rs

The issue is the second line of this snippet returns an error 'InvalidStateRoot'

let db = sp_trie::storage_proof::StorageProof::new(proof.to_vec()).into_memory_db::<BlakeTwo256>();
let trie = sp_trie::TrieDB::<sp_trie::LayoutV0<BlakeTwo256>>::new(&db, root).unwrap();

I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been able to figure it out yet.

Currently I'm using the trie_db::proof::generate_proof to generate the proof

This is what I've done so far https://github.com/Wizdave97/extrinsic-from-proof/blob/master/src/main.rs

The issue is the second line of this snippet returns an error 'InvalidStateRoot'

let db = sp_trie::storage_proof::StorageProof::new(proof.to_vec()).into_memory_db::<BlakeTwo256>();
let trie = sp_trie::TrieDB::<sp_trie::LayoutV0<BlakeTwo256>>::new(&db, root).unwrap();
Source Link

How do I generate an extrinsic proof that encodes the actual extrinsic for which the proof was generated

0

I am trying to generate an extrinsic proof that can in turn be used to generate a partial trie and then extract the actual extrinsic for which the proof was generated from the trie, but I've not been able to figure it out yet.

Currently I'm using the trie_db::proof::generate_proof to generate the proof

This is what I've done so far https://github.com/Wizdave97/extrinsic-from-proof/blob/master/src/main.rs

The issue is the second line of this snippet returns an error 'InvalidStateRoot'

let db = sp_trie::storage_proof::StorageProof::new(proof.to_vec()).into_memory_db::<BlakeTwo256>();
let trie = sp_trie::TrieDB::<sp_trie::LayoutV0<BlakeTwo256>>::new(&db, root).unwrap();