Skip to content

Commit

Permalink
Runtime 105 (0.10.0) (#358)
Browse files Browse the repository at this point in the history
* change(kreivo-runtime): prepare for next runtime

- remove pallet-sudo
- remove pallet-burner
- add pallet-vesting
- configure pallet-vesting
- bump version

* fix failing check

---------

Co-authored-by: Daniel Olano <[email protected]>
  • Loading branch information
pandres95 and olanod authored Apr 12, 2024
1 parent ba18406 commit 3829c97
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 109 deletions.
27 changes: 3 additions & 24 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ pallet-transaction-payment-rpc-runtime-api = { default-features = false, git = "
pallet-treasury = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
pallet-uniques = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
pallet-utility = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
pallet-vesting = { default-features = false, git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }

# Cumulus client dependencies
cumulus-client-cli = { git = "https://github.com/virto-network/polkadot-sdk", branch = "release-virto-v1.5.0" }
Expand Down
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "virto-node"
version = "0.9.1"
version = "0.10.0"
authors = ['Virto Team <[email protected]>']
license = "GPL-3.0-only"
homepage = 'https://github.com/virto-network/virto-node'
Expand Down
11 changes: 2 additions & 9 deletions runtime/kreivo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kreivo-runtime"
description = "Kreivo Runtime"
version = "0.9.1"
version = "0.10.0"
authors = ['Virto Team <[email protected]>']
license = "GPL-3.0-only"
homepage = 'https://github.com/virto-network/virto-node'
Expand All @@ -22,7 +22,6 @@ scale-info = { workspace = true, features = ["derive"] }
smallvec = { workspace = true }

# Local
pallet-burner = { workspace = true }
pallet-payments = { workspace = true }
pallet-communities = { workspace = true }

Expand Down Expand Up @@ -53,11 +52,11 @@ pallet-ranked-collective = { workspace = true }
pallet-referenda = { workspace = true }
pallet-scheduler = { workspace = true }
pallet-session = { workspace = true }
pallet-sudo = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-treasury = { workspace = true }
pallet-vesting = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
Expand Down Expand Up @@ -129,7 +128,6 @@ std = [
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-burner/std",
"pallet-communities/std",
"pallet-collator-selection/std",
"pallet-message-queue/std",
Expand All @@ -143,7 +141,6 @@ std = [
"pallet-referenda-tracks/std",
"pallet-scheduler/std",
"pallet-session/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
Expand Down Expand Up @@ -193,7 +190,6 @@ runtime-benchmarks = [
"pallet-asset-tx-payment/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-burner/runtime-benchmarks",
"pallet-communities/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
Expand All @@ -206,7 +202,6 @@ runtime-benchmarks = [
"pallet-referenda/runtime-benchmarks",
"pallet-referenda-tracks/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-sudo/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
Expand Down Expand Up @@ -235,7 +230,6 @@ try-runtime = [
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-burner/try-runtime",
"pallet-communities/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-message-queue/try-runtime",
Expand All @@ -249,7 +243,6 @@ try-runtime = [
"pallet-referenda-tracks/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-session/try-runtime",
"pallet-sudo/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
Expand Down
1 change: 0 additions & 1 deletion runtime/kreivo/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ impl Contains<RuntimeCall> for RuntimeBlackListedCalls {
| RuntimeCall::Utility(_)
| RuntimeCall::Assets(_)
| RuntimeCall::Proxy(_)
| RuntimeCall::Burner(_)
)
}
}
Expand Down
46 changes: 21 additions & 25 deletions runtime/kreivo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use frame_support::{
fungibles,
tokens::{PayFromAccount, UnityAssetBalanceConversion},
AsEnsureOriginWithArg, ConstBool, ConstU32, ConstU64, ConstU8, Contains, EitherOf, EitherOfDiverse,
EnsureOriginWithArg, LinearStoragePrice, NeverEnsureOrigin, TransformOrigin,
EnsureOriginWithArg, LinearStoragePrice, NeverEnsureOrigin, TransformOrigin, WithdrawReasons,
},
weights::{constants::RocksDbWeight, ConstantMultiplier, Weight},
BoundedVec, PalletId,
Expand Down Expand Up @@ -141,10 +141,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kreivo-parachain"),
impl_name: create_runtime_str!("kreivo-parachain"),
authoring_version: 1,
spec_version: 104,
spec_version: 105,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
transaction_version: 5,
state_version: 1,
};

Expand Down Expand Up @@ -172,9 +172,9 @@ construct_runtime!(
// Monetary stuff.
Balances: pallet_balances = 10,
TransactionPayment: pallet_transaction_payment = 11,
Burner: pallet_burner = 12,
Assets: pallet_assets::<Instance1> = 13,
AssetTxPayment: pallet_asset_tx_payment::{Pallet, Storage, Event<T>} = 14,
Vesting: pallet_vesting = 15,

// Collator support. The order of these 4 are important and shall not change.
Authorship: pallet_authorship = 20,
Expand All @@ -190,7 +190,6 @@ construct_runtime!(
MessageQueue: pallet_message_queue = 33,

// Utils
Sudo: pallet_sudo = 40,
Multisig: pallet_multisig = 42,
Utility: pallet_utility = 43,
Proxy: pallet_proxy = 44,
Expand Down Expand Up @@ -421,19 +420,6 @@ parameter_types! {
pub const StakingAdminBodyId: BodyId = BodyId::Defense;
}

parameter_types! {
pub const BurnerPalletId: PalletId = PalletId(*b"burner00");
}

impl pallet_burner::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BurnDestination = ();
type BurnOrigin = frame_system::EnsureRoot<Self::AccountId>;
type PalletId = BurnerPalletId;
type WeightInfo = weights::pallet_burner::WeightInfo<Runtime>;
}

/// We allow root and the StakingAdmin to execute privileged collator selection
/// operations.
pub type CollatorSelectionUpdateOrigin =
Expand All @@ -455,12 +441,6 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = ();
}

impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = 2000 * CENTS;
Expand Down Expand Up @@ -693,6 +673,22 @@ impl pallet_asset_tx_payment::Config for Runtime {
>;
}

parameter_types! {
pub const MinVestedTransfer: Balance = 100 * CENTS;
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
}

impl pallet_vesting::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
type WeightInfo = pallet_vesting::weights::SubstrateWeight<Runtime>;
type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons;
const MAX_VESTING_SCHEDULES: u32 = 28;
}

#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
Expand All @@ -702,9 +698,9 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[pallet_burner, Burner]
[pallet_treasury, Treasury]
[pallet_multisig, Multisig]
[pallet_vesting, Vesting]
[pallet_utility, Utility]
[pallet_assets, Assets]
[pallet_proxy, Proxy]
Expand Down
4 changes: 2 additions & 2 deletions runtime/kreivo/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn runtime_sanity_call_does_not_exceed_1kb() {
// TransactionPayment: pallet_transaction_payment = 11
assert_call_size!(pallet_transaction_payment);
// Burner: pallet_burner = 12
assert_call_size!(pallet_burner);
// assert_call_size!(pallet_burner);
// Assets: pallet_assets::<Instance1> = 13
assert_call_size!(pallet_assets, pallet_assets::Instance1);
// AssetTxPayment: pallet_asset_tx_payment::{Pallet, Storage, Event<T>} = 14
Expand All @@ -59,7 +59,7 @@ fn runtime_sanity_call_does_not_exceed_1kb() {
// // AssetRegistry: pallet_asset_registry = 34
// assert_call_size!(pallet_asset_registry);
// Sudo: pallet_sudo = 40
assert_call_size!(pallet_sudo);
// assert_call_size!(pallet_sudo);
// Multisig: pallet_multisig = 42
assert_call_size!(pallet_multisig);
// Utility: pallet_utility = 43
Expand Down
1 change: 0 additions & 1 deletion runtime/kreivo/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
pub mod block_weights;
pub mod extrinsic_weights;
pub mod pallet_assets;
pub mod pallet_burner;
pub mod pallet_communities;
pub mod pallet_payments;
pub mod pallet_proxy;
Expand Down
46 changes: 0 additions & 46 deletions runtime/kreivo/src/weights/pallet_burner.rs

This file was deleted.

0 comments on commit 3829c97

Please sign in to comment.