Skip to content

Commit cfbc685

Browse files
committed
upgrade to substrate stable 2503(wip)
1 parent 4dca14d commit cfbc685

File tree

90 files changed

+2551
-1828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+2551
-1828
lines changed

Cargo.lock

Lines changed: 1537 additions & 1313 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 151 additions & 149 deletions
Large diffs are not rendered by default.

crates/pallet-domains/src/block_tree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
use alloc::vec::Vec;
1616
use frame_support::{PalletError, ensure};
1717
use frame_system::pallet_prelude::BlockNumberFor;
18-
use parity_scale_codec::{Decode, Encode};
18+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
1919
use scale_info::TypeInfo;
2020
use sp_core::Get;
2121
use sp_domains::execution_receipt::execution_receipt_v0::ExecutionReceiptV0;
@@ -27,7 +27,7 @@ use sp_std::cmp::Ordering;
2727
use sp_std::collections::btree_map::BTreeMap;
2828

2929
/// Block tree specific errors
30-
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq)]
30+
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq, DecodeWithMemTracking)]
3131
pub enum Error {
3232
InvalidExtrinsicsRoots,
3333
UnknownParentBlockReceipt,

crates/pallet-domains/src/bundle_storage_fund.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use frame_support::PalletError;
77
use frame_support::traits::Get;
88
use frame_support::traits::fungible::{Inspect, Mutate, MutateHold};
99
use frame_support::traits::tokens::{Fortitude, Precision, Preservation};
10-
use parity_scale_codec::{Decode, Encode};
10+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
1111
use scale_info::TypeInfo;
1212
use sp_domains::OperatorId;
1313
use sp_runtime::Perquintill;
@@ -19,7 +19,7 @@ use subspace_runtime_primitives::StorageFee;
1919
pub const STORAGE_FEE_RESERVE: Perquintill = Perquintill::from_percent(20);
2020

2121
/// Bundle storage fund specific errors
22-
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq)]
22+
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq, DecodeWithMemTracking)]
2323
pub enum Error {
2424
BundleStorageFeePayment,
2525
BalanceUnderflow,

crates/pallet-domains/src/domain_registry.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use frame_support::traits::tokens::{Fortitude, Precision, Preservation};
2020
use frame_support::weights::Weight;
2121
use frame_support::{PalletError, ensure};
2222
use frame_system::pallet_prelude::*;
23-
use parity_scale_codec::{Decode, Encode};
23+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
2424
use scale_info::TypeInfo;
2525
use sp_core::Get;
2626
use sp_domains::{
@@ -34,7 +34,7 @@ use sp_std::collections::btree_map::BTreeMap;
3434
use sp_std::collections::btree_set::BTreeSet;
3535

3636
/// Domain registry specific errors
37-
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq)]
37+
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq, DecodeWithMemTracking)]
3838
pub enum Error {
3939
ExceedMaxDomainBlockWeight,
4040
ExceedMaxDomainBlockSize,
@@ -82,7 +82,7 @@ pub struct DomainConfig<AccountId: Ord, Balance> {
8282
///
8383
/// It is used to derive `DomainConfig`, and if `maybe_bundle_limit` is `None` a default `max_bundle_size/weight`
8484
/// derived from the `bundle_slot_probability` and other system-wide parameters will be used.
85-
#[derive(TypeInfo, Debug, Encode, Decode, Clone, PartialEq, Eq)]
85+
#[derive(TypeInfo, Debug, Encode, Decode, Clone, PartialEq, Eq, DecodeWithMemTracking)]
8686
pub struct DomainConfigParams<AccountId: Ord, Balance> {
8787
pub domain_name: String,
8888
pub runtime_id: RuntimeId,

crates/pallet-domains/src/extensions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use frame_support::ensure;
99
use frame_support::pallet_prelude::{PhantomData, TypeInfo};
1010
use frame_support::weights::Weight;
1111
use frame_system::pallet_prelude::RuntimeCallFor;
12-
use parity_scale_codec::{Decode, Encode};
12+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
1313
use scale_info::prelude::fmt;
1414
use sp_domains_fraud_proof::InvalidTransactionCode;
1515
use sp_domains_fraud_proof::weights::fraud_proof_verification_weights;
@@ -38,7 +38,7 @@ pub trait DomainsCheck {
3838
}
3939

4040
/// Extensions for pallet-domains unsigned extrinsics.
41-
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)]
41+
#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo, DecodeWithMemTracking)]
4242
pub struct DomainsExtension<Runtime>(PhantomData<Runtime>);
4343

4444
impl<Runtime> DomainsExtension<Runtime> {

crates/pallet-domains/src/fuzz/staking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ fn create_genesis_storage(accounts: &[AccountId], mint: u128) -> Storage {
119119
RuntimeGenesisConfig {
120120
balances: BalancesConfig {
121121
balances: accounts.iter().cloned().map(|k| (k, mint)).collect(),
122+
dev_accounts: None,
122123
},
123124
domains: DomainsConfig {
124125
genesis_domains: vec![GenesisDomain {

crates/pallet-domains/src/lib.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use frame_support::weights::Weight;
4848
use frame_system::offchain::SubmitTransaction;
4949
use frame_system::pallet_prelude::*;
5050
pub use pallet::*;
51-
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
51+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
5252
use scale_info::TypeInfo;
5353
use sp_consensus_subspace::WrappedPotOutput;
5454
use sp_consensus_subspace::consensus::is_proof_of_time_valid;
@@ -169,7 +169,17 @@ pub type BlockTreeNodeFor<T> = crate::block_tree::BlockTreeNode<
169169
>;
170170

171171
/// Custom origin for validated unsigned extrinsics.
172-
#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, TypeInfo, MaxEncodedLen)]
172+
#[derive(
173+
PartialEq,
174+
Eq,
175+
Clone,
176+
Encode,
177+
Decode,
178+
RuntimeDebug,
179+
TypeInfo,
180+
MaxEncodedLen,
181+
DecodeWithMemTracking,
182+
)]
173183
pub enum RawOrigin {
174184
ValidatedUnsigned,
175185
}
@@ -887,7 +897,7 @@ mod pallet {
887897
ExecutionVersionMissing,
888898
}
889899

890-
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq)]
900+
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq, DecodeWithMemTracking)]
891901
pub enum FraudProofError {
892902
/// The targeted bad receipt not found which may already pruned by other
893903
/// fraud proof or the fraud proof is submitted to the wrong fork.
@@ -1037,7 +1047,7 @@ mod pallet {
10371047
}
10381048

10391049
/// Reason for slashing an operator
1040-
#[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo)]
1050+
#[derive(Clone, Debug, PartialEq, Encode, Decode, TypeInfo, DecodeWithMemTracking)]
10411051
pub enum SlashedReason<DomainBlock, ReceiptHash> {
10421052
/// Operator produced bad bundle.
10431053
InvalidBundle(DomainBlock),

crates/pallet-domains/src/mock.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use frame_support::{PalletId, derive_impl, parameter_types};
1111
use frame_system::mocking::MockUncheckedExtrinsic;
1212
use frame_system::pallet_prelude::BlockNumberFor;
1313
use pallet_subspace::NormalEraChange;
14+
use parity_scale_codec::DecodeWithMemTracking;
1415
use sp_consensus_slots::Slot;
1516
use sp_core::H256;
1617
use sp_domains::bundle::BundleVersion;
@@ -82,7 +83,18 @@ impl Get<BlockNumber> for ConfirmationDepthK {
8283
}
8384

8485
#[derive(
85-
PartialEq, Eq, Clone, Encode, Decode, TypeInfo, MaxEncodedLen, Ord, PartialOrd, Copy, Debug,
86+
PartialEq,
87+
Eq,
88+
Clone,
89+
Encode,
90+
Decode,
91+
TypeInfo,
92+
MaxEncodedLen,
93+
Ord,
94+
PartialOrd,
95+
Copy,
96+
Debug,
97+
DecodeWithMemTracking,
8698
)]
8799
pub struct HoldIdentifierWrapper(HoldIdentifier);
88100

crates/pallet-domains/src/runtime_registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use domain_runtime_primitives::{AccountId20, MultiAccountId, TryConvertBack};
1515
use frame_support::{PalletError, ensure};
1616
use frame_system::AccountInfo;
1717
use frame_system::pallet_prelude::*;
18-
use parity_scale_codec::{Decode, Encode};
18+
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode};
1919
use scale_info::TypeInfo;
2020
use sp_core::Hasher;
2121
use sp_core::crypto::AccountId32;
@@ -30,7 +30,7 @@ use sp_std::vec;
3030
use sp_version::RuntimeVersion;
3131

3232
/// Runtime specific errors
33-
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq)]
33+
#[derive(TypeInfo, Encode, Decode, PalletError, Debug, PartialEq, DecodeWithMemTracking)]
3434
pub enum Error {
3535
FailedToExtractRuntimeVersion,
3636
InvalidSpecName,

0 commit comments

Comments
 (0)