diff --git a/runtime/common/src/attestations.rs b/runtime/common/src/attestations.rs index fb2277649e13..58fbc15d3891 100644 --- a/runtime/common/src/attestations.rs +++ b/runtime/common/src/attestations.rs @@ -96,10 +96,12 @@ decl_storage! { trait Store for Module as Attestations { /// A mapping from modular block number (n % AttestationPeriod) /// to session index and the list of candidate hashes. - pub RecentParaBlocks: map T::BlockNumber => Option>; + pub RecentParaBlocks: map hasher(blake2_256) T::BlockNumber => Option>; /// Attestations on a recent parachain block. - pub ParaBlockAttestations: double_map T::BlockNumber, hasher(blake2_128) Hash => Option>; + pub ParaBlockAttestations: + double_map hasher(blake2_256) T::BlockNumber, hasher(blake2_128) Hash + => Option>; // Did we already have more attestations included in this block? DidUpdate: bool; diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index a2bef829fa9d..00607a45283c 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -109,7 +109,7 @@ decl_storage! { trait Store for Module as Claims { Claims get(claims) build(|config: &GenesisConfig| { config.claims.iter().map(|(a, b)| (a.clone(), b.clone())).collect::>() - }): map EthereumAddress => Option>; + }): map hasher(blake2_256) EthereumAddress => Option>; Total get(total) build(|config: &GenesisConfig| { config.claims.iter().fold(Zero::zero(), |acc: BalanceOf, &(_, n)| acc + n) }): BalanceOf; @@ -117,7 +117,9 @@ decl_storage! { /// First balance is the total amount that should be held for vesting. /// Second balance is how much should be unlocked per block. /// The block number is when the vesting should start. - Vesting get(vesting) config(): map EthereumAddress => Option<(BalanceOf, BalanceOf, T::BlockNumber)>; + Vesting get(vesting) config(): + map hasher(blake2_256) EthereumAddress + => Option<(BalanceOf, BalanceOf, T::BlockNumber)>; } add_extra_genesis { config(claims): Vec<(EthereumAddress, BalanceOf)>; diff --git a/runtime/common/src/crowdfund.rs b/runtime/common/src/crowdfund.rs index 8898f45c64a5..06bd70e5cf5c 100644 --- a/runtime/common/src/crowdfund.rs +++ b/runtime/common/src/crowdfund.rs @@ -158,7 +158,8 @@ decl_storage! { trait Store for Module as Crowdfund { /// Info on all of the funds. Funds get(funds): - map FundIndex => Option, T::Hash, T::BlockNumber>>; + map hasher(blake2_256) FundIndex + => Option, T::Hash, T::BlockNumber>>; /// The total number of funds that have so far been allocated. FundCount get(fund_count): FundIndex; diff --git a/runtime/common/src/parachains.rs b/runtime/common/src/parachains.rs index a6b8941548b4..adafc78ec055 100644 --- a/runtime/common/src/parachains.rs +++ b/runtime/common/src/parachains.rs @@ -158,27 +158,28 @@ decl_storage! { /// All authorities' keys at the moment. pub Authorities get(authorities): Vec; /// The parachains registered at present. - pub Code get(parachain_code): map ParaId => Option>; + pub Code get(parachain_code): map hasher(blake2_256) ParaId => Option>; /// The heads of the parachains registered at present. - pub Heads get(parachain_head): map ParaId => Option>; + pub Heads get(parachain_head): map hasher(blake2_256) ParaId => Option>; /// The watermark heights of the parachains registered at present. /// For every parachain, this is the block height from which all messages targeting /// that parachain have been processed. Can be `None` only if the parachain doesn't exist. - pub Watermarks get(watermark): map ParaId => Option; + pub Watermarks get(watermark): map hasher(blake2_256) ParaId => Option; /// Unrouted ingress. Maps (BlockNumber, to_chain) pairs to [(from_chain, egress_root)]. /// /// There may be an entry under (i, p) in this map for every i between the parachain's /// watermark and the current block. - pub UnroutedIngress: map (T::BlockNumber, ParaId) => Option>; + pub UnroutedIngress: + map hasher(blake2_256) (T::BlockNumber, ParaId) => Option>; /// Messages ready to be dispatched onto the relay chain. It is subject to /// `MAX_MESSAGE_COUNT` and `WATERMARK_MESSAGE_SIZE`. - pub RelayDispatchQueue: map ParaId => Vec; + pub RelayDispatchQueue: map hasher(blake2_256) ParaId => Vec; /// Size of the dispatch queues. Separated from actual data in order to avoid costly /// decoding when checking receipt validity. First item in tuple is the count of messages /// second if the total length (in bytes) of the message payloads. - pub RelayDispatchQueueSize: map ParaId => (u32, u32); + pub RelayDispatchQueueSize: map hasher(blake2_256) ParaId => (u32, u32); /// The ordered list of ParaIds that have a `RelayDispatchQueue` entry. NeedsDispatch: Vec; diff --git a/runtime/common/src/registrar.rs b/runtime/common/src/registrar.rs index 288715b93270..7ac5b6c6c920 100644 --- a/runtime/common/src/registrar.rs +++ b/runtime/common/src/registrar.rs @@ -158,16 +158,16 @@ decl_storage! { NextFreeId: ParaId = LOWEST_USER_ID; /// Pending swap operations. - PendingSwap: map ParaId => Option; + PendingSwap: map hasher(blake2_256) ParaId => Option; /// Map of all registered parathreads/chains. - Paras get(paras): map ParaId => Option; + Paras get(paras): map hasher(blake2_256) ParaId => Option; /// The current queue for parathreads that should be retried. RetryQueue get(retry_queue): Vec>; /// Users who have paid a parathread's deposit - Debtors: map ParaId => T::AccountId; + Debtors: map hasher(blake2_256) ParaId => T::AccountId; } add_extra_genesis { config(parachains): Vec<(ParaId, Vec, Vec)>; diff --git a/runtime/common/src/slots.rs b/runtime/common/src/slots.rs index 566162180377..cee6ed28d340 100644 --- a/runtime/common/src/slots.rs +++ b/runtime/common/src/slots.rs @@ -146,7 +146,7 @@ decl_storage! { /// If a parachain doesn't exist *yet* but is scheduled to exist in the future, then it /// will be left-padded with one or more zeroes to denote the fact that nothing is held on /// deposit for the non-existent chain currently, but is held at some point in the future. - pub Deposits get(deposits): map ParaId => Vec>; + pub Deposits get(deposits): map hasher(blake2_256) ParaId => Vec>; /// Information relating to the current auction, if there is one. /// @@ -158,26 +158,28 @@ decl_storage! { /// The winning bids for each of the 10 ranges at each block in the final Ending Period of /// the current auction. The map's key is the 0-based index into the Ending Period. The /// first block of the ending period is 0; the last is `EndingPeriod - 1`. - pub Winning get(winning): map T::BlockNumber => Option>; + pub Winning get(winning): map hasher(blake2_256) T::BlockNumber => Option>; /// Amounts currently reserved in the accounts of the bidders currently winning /// (sub-)ranges. - pub ReservedAmounts get(reserved_amounts): map Bidder => Option>; + pub ReservedAmounts get(reserved_amounts): + map hasher(blake2_256) Bidder => Option>; /// The set of Para IDs that have won and need to be on-boarded at an upcoming lease-period. /// This is cleared out on the first block of the lease period. - pub OnboardQueue get(onboard_queue): map LeasePeriodOf => Vec; + pub OnboardQueue get(onboard_queue): map hasher(blake2_256) LeasePeriodOf => Vec; /// The actual on-boarding information. Only exists when one of the following is true: /// - It is before the lease period that the parachain should be on-boarded. /// - The full on-boarding information has not yet been provided and the parachain is not /// yet due to be off-boarded. - pub Onboarding get(onboarding): map ParaId => + pub Onboarding get(onboarding): + map hasher(blake2_256) ParaId => Option<(LeasePeriodOf, IncomingParachain)>; /// Off-boarding account; currency held on deposit for the parachain gets placed here if the /// parachain gets off-boarded; i.e. its lease period is up and it isn't renewed. - pub Offboarding get(offboarding): map ParaId => T::AccountId; + pub Offboarding get(offboarding): map hasher(blake2_256) ParaId => T::AccountId; } }