Skip to content
Snippets Groups Projects
Unverified Commit 0956357b authored by girazoki's avatar girazoki Committed by GitHub
Browse files

work with additional key values (#1757)

Add the possibility to inject additional key-values in the
sproof-builder that generates the relay root that gets stored in
parachain-system.

Rationale: pallets that verify additional storage items (not those
verified by parachain-system) from the relay should be able to proof
against the relay root that gets stored in parachain-system. This PR
allows to create provide additional nibles that can later be used for
verifiability in other pallets
parent 0d6dcb3f
No related merge requests found
Pipeline #417021 canceled with stages
in 49 minutes and 23 seconds
......@@ -61,6 +61,8 @@ pub struct MockValidationDataInherentDataProvider<R = ()> {
pub raw_downward_messages: Vec<Vec<u8>>,
// Inbound Horizontal messages sorted by channel
pub raw_horizontal_messages: Vec<(ParaId, Vec<u8>)>,
// Additional key-value pairs that should be injected.
pub additional_key_values: Option<Vec<(Vec<u8>, Vec<u8>)>>,
}
pub trait GenerateRandomness<I> {
......@@ -210,6 +212,10 @@ impl<R: Send + Sync + GenerateRandomness<u64>> InherentDataProvider
sproof_builder.randomness =
self.relay_randomness_config.generate_randomness(self.current_para_block.into());
if let Some(key_values) = &self.additional_key_values {
sproof_builder.additional_key_values = key_values.clone()
}
let (relay_parent_storage_root, proof) = sproof_builder.into_state_root_and_proof();
inherent_data.put_data(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment