Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: TestNet - Substrate 0.9.36 - Preimage pallet #239

Merged
merged 7 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- [C,D] Updated Substrate to polkadot-v0.9.36
- [C] Added pallet-preimage to support democracy functionality.

## [4.8.4]

Expand Down
18 changes: 18 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions runtime/cere/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/su
pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.36" }
pallet-offences = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36", default-features = false, optional = true }
pallet-preimage = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-proxy = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
pallet-recovery = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.36" }
Expand Down Expand Up @@ -143,6 +144,7 @@ std = [
"node-primitives/std",
"pallet-offences/std",
"pallet-proxy/std",
"pallet-preimage/std",
"sp-core/std",
"pallet-randomness-collective-flip/std",
"sp-std/std",
Expand Down Expand Up @@ -212,6 +214,7 @@ runtime-benchmarks = [
"pallet-nomination-pools/runtime-benchmarks",
"pallet-nomination-pools-benchmarking/runtime-benchmarks",
"pallet-offences-benchmarking/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-session-benchmarking/runtime-benchmarks",
Expand Down
30 changes: 22 additions & 8 deletions runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 48501,
spec_version: 48503,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 10,
transaction_version: 11,
state_version: 0,
};

Expand Down Expand Up @@ -337,6 +337,21 @@ impl pallet_proxy::Config for Runtime {
type AnnouncementDepositFactor = AnnouncementDepositFactor;
}

parameter_types! {
pub const PreimageMaxSize: u32 = 4096 * 1024;
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageByteDeposit: Balance = deposit(0, 1);
}

impl pallet_preimage::Config for Runtime {
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit;
}

parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
RuntimeBlockWeights::get().max_block;
Expand All @@ -352,7 +367,7 @@ impl pallet_scheduler::Config for Runtime {
type MaxScheduledPerBlock = ConstU32<512>;
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
type OriginPrivilegeCmp = EqualPrivilegeOnly;
type Preimages = ();
type Preimages = Preimage;
}

parameter_types! {
Expand Down Expand Up @@ -794,7 +809,7 @@ impl pallet_democracy::Config for Runtime {
type MaxVotes = ConstU32<100>;
type WeightInfo = pallet_democracy::weights::SubstrateWeight<Runtime>;
type MaxProposals = MaxProposals;
type Preimages = ();
type Preimages = Preimage;
type MaxDeposits = ConstU32<100>;
type MaxBlacklisted = ConstU32<100>;
}
Expand Down Expand Up @@ -1413,6 +1428,7 @@ construct_runtime!(
Society: pallet_society,
Recovery: pallet_recovery,
Vesting: pallet_vesting,
Preimage: pallet_preimage,
Scheduler: pallet_scheduler,
Proxy: pallet_proxy,
Multisig: pallet_multisig,
Expand Down Expand Up @@ -1480,10 +1496,7 @@ parameter_types! {
pub DummyPalletAccountId: AccountId = DummyPalletId::get().into_account_truncating();
}
/// Runtime migrations
type Migrations = (
pallet_balances::migration::MigrateToTrackInactive<Runtime, DummyPalletAccountId>,
pallet_contracts::Migration<Runtime>,
);
type Migrations = (pallet_preimage::migration::v1::Migration<Runtime>,);

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down Expand Up @@ -1528,6 +1541,7 @@ mod benches {
[pallet_multisig, Multisig]
[pallet_nomination_pools, NominationPoolsBench::<Runtime>]
[pallet_offences, OffencesBench::<Runtime>]
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_scheduler, Scheduler]
[pallet_session, SessionBench::<Runtime>]
Expand Down
Loading