Do not include :code in the storage proof if not required (#480)

This is basically a hack that prevents the inclusion of `:code` in the
storage proof. A proper fix requires some changes to the trie crate to
not include nodes that aren't read.
This commit is contained in:
Bastian Köcher
2021-06-07 16:17:19 +02:00
committed by GitHub
parent 0a5dbafd53
commit acb2bc4f00
10 changed files with 59 additions and 8 deletions
@@ -605,7 +605,7 @@ construct_runtime!(
{
// System support stuff;
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event<T>},
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
ParachainInfo: parachain_info::{Pallet, Storage, Config},
@@ -665,8 +665,17 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
OnRuntimeUpgrade
>;
pub struct OnRuntimeUpgrade;
impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade {
fn on_runtime_upgrade() -> u64 {
sp_io::storage::set(b":c", &[]);
RocksDbWeight::get().writes(1)
}
}
impl_runtime_apis! {
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
fn slot_duration() -> sp_consensus_aura::SlotDuration {