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

Update to SDK 1.14 #381

Merged
merged 30 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6fa5130
Update to 1.14
ggwpez Jul 14, 2024
d99131f
Update Collectives
ggwpez Jul 14, 2024
ec4914b
Disable Encointer runtime
ggwpez Jul 14, 2024
4143885
Update Kusama coretime
ggwpez Jul 14, 2024
1c0af2d
Update Treasury
ggwpez Jul 14, 2024
7fed1b4
Update collectives
ggwpez Jul 14, 2024
0265664
Mock weights
ggwpez Jul 14, 2024
36c9a7f
Kusama coretime revenue integration (#384)
s0me0ne-unkn0wn Jul 17, 2024
6ca6fcb
re-enable & bump encointer to polkadot-v1.14.0 (#385)
clangenb Jul 17, 2024
0be46e0
Clippy
ggwpez Jul 17, 2024
af19be5
Merge remote-tracking branch 'origin/main' into oty-update-1-14
ggwpez Jul 17, 2024
b0b1a81
Update CHANGELOG
ggwpez Jul 17, 2024
4104b17
Clippy
ggwpez Jul 17, 2024
235d14e
Clippy
ggwpez Jul 17, 2024
b2be560
Fixes
ggwpez Jul 17, 2024
30d1345
Fix changelog
ggwpez Jul 17, 2024
e3fca1e
Re-enable `request_revenue_info_at` in CoretimeInterface (#393)
seadanda Jul 18, 2024
9740965
Merge remote-tracking branch 'origin/main' into oty-update-1-14
ggwpez Jul 18, 2024
6b9d388
Update CHANGELOG.md
ggwpez Jul 19, 2024
3dea8bf
Update system-parachains/coretime/coretime-kusama/src/coretime.rs
ggwpez Jul 26, 2024
604381c
Update CHANGELOG.md
ggwpez Jul 26, 2024
9b1529e
Link issue numbers to TODOs
ggwpez Jul 26, 2024
e3b2d53
Merge remote-tracking branch 'origin/main' into oty-update-1-14
ggwpez Jul 26, 2024
cce6316
Post merge fixup
ggwpez Jul 26, 2024
b74a51f
fmt
ggwpez Jul 26, 2024
d84c74a
Try to make XCM runtime API compile
ggwpez Jul 26, 2024
b912cd0
Fix benchmark
ggwpez Jul 26, 2024
6c529ef
Fix benchmarks
ggwpez Jul 26, 2024
04c308b
Merge branch 'main' into oty-update-1-14
fellowship-merge-bot[bot] Jul 29, 2024
ab7f497
Merge remote-tracking branch 'origin/main' into oty-update-1-14
ggwpez Jul 29, 2024
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
3,177 changes: 1,797 additions & 1,380 deletions Cargo.lock

Large diffs are not rendered by default.

286 changes: 143 additions & 143 deletions Cargo.toml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions chain-spec-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ asset-hub-kusama-runtime = { workspace = true }
collectives-polkadot-runtime = { workspace = true }
bridge-hub-polkadot-runtime = { workspace = true }
bridge-hub-kusama-runtime = { workspace = true }
encointer-kusama-runtime = { workspace = true }
#encointer-kusama-runtime = { workspace = true }
glutton-kusama-runtime = { workspace = true }
coretime-kusama-runtime = { workspace = true }
people-kusama-runtime = { workspace = true }
Expand All @@ -51,7 +51,7 @@ runtime-benchmarks = [
"collectives-polkadot-runtime/runtime-benchmarks",
"coretime-kusama-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"encointer-kusama-runtime/runtime-benchmarks",
#"encointer-kusama-runtime/runtime-benchmarks",
"glutton-kusama-runtime/runtime-benchmarks",
"kusama-runtime/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
Expand All @@ -62,5 +62,5 @@ runtime-benchmarks = [
"polkadot-runtime/runtime-benchmarks",
"runtime-parachains/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"encointer-kusama-runtime/runtime-benchmarks"
#"encointer-kusama-runtime/runtime-benchmarks"
]
8 changes: 4 additions & 4 deletions chain-spec-generator/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use crate::{
relay_chain_specs::{KusamaChainSpec, PolkadotChainSpec},
system_parachains_specs::{
AssetHubKusamaChainSpec, AssetHubPolkadotChainSpec, BridgeHubKusamaChainSpec,
BridgeHubPolkadotChainSpec, CollectivesPolkadotChainSpec, EncointerKusamaChainSpec,
GluttonKusamaChainSpec, PeopleKusamaChainSpec, PeoplePolkadotChainSpec,
BridgeHubPolkadotChainSpec, CollectivesPolkadotChainSpec, GluttonKusamaChainSpec,
PeopleKusamaChainSpec, PeoplePolkadotChainSpec,
},
ChainSpec,
};
Expand Down Expand Up @@ -88,8 +88,8 @@ pub fn from_json_file(filepath: &str, supported: String) -> Result<Box<dyn Chain
Ok(Box::new(BridgeHubKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("glutton-kusama") =>
Ok(Box::new(GluttonKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("encointer-kusama") =>
Ok(Box::new(EncointerKusamaChainSpec::from_json_file(path)?)),
//x if x.starts_with("encointer-kusama") =>
// Ok(Box::new(EncointerKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("people-kusama") =>
Ok(Box::new(PeopleKusamaChainSpec::from_json_file(path)?)),
x if x.starts_with("people-polkadot") =>
Expand Down
8 changes: 4 additions & 4 deletions chain-spec-generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ fn main() -> Result<(), String> {
"glutton-kusama-local",
Box::new(system_parachains_specs::glutton_kusama_local_testnet_config) as Box<_>,
),
(
"encointer-kusama-local",
Box::new(system_parachains_specs::encointer_kusama_local_testnet_config) as Box<_>,
),
//(
// "encointer-kusama-local",
// Box::new(system_parachains_specs::encointer_kusama_local_testnet_config) as Box<_>,
//),
(
"coretime-kusama-local",
Box::new(system_parachains_specs::coretime_kusama_local_testnet_config) as Box<_>,
Expand Down
8 changes: 4 additions & 4 deletions chain-spec-generator/src/system_parachains_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub type BridgeHubKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type GluttonKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type EncointerKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;
//pub type EncointerKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

pub type CoretimeKusamaChainSpec = sc_chain_spec::GenericChainSpec<Extensions>;

Expand All @@ -62,7 +62,7 @@ const BRIDGE_HUB_POLKADOT_ED: Balance = bridge_hub_polkadot_runtime::Existential

const BRIDGE_HUB_KUSAMA_ED: Balance = bridge_hub_kusama_runtime::ExistentialDeposit::get();

const ENCOINTER_KUSAMA_ED: Balance = encointer_kusama_runtime::ExistentialDeposit::get();
//const ENCOINTER_KUSAMA_ED: Balance = encointer_kusama_runtime::ExistentialDeposit::get();

const CORETIME_KUSAMA_ED: Balance = coretime_kusama_runtime::ExistentialDeposit::get();

Expand Down Expand Up @@ -560,7 +560,7 @@ pub fn glutton_kusama_local_testnet_config() -> Result<Box<dyn ChainSpec>, Strin
}

// EncointerKusama
fn encointer_kusama_genesis(endowed_accounts: Vec<AccountId>, id: u32) -> serde_json::Value {
/*fn encointer_kusama_genesis(endowed_accounts: Vec<AccountId>, id: u32) -> serde_json::Value {
serde_json::json!({
"balances": asset_hub_kusama_runtime::BalancesConfig {
balances: endowed_accounts
Expand Down Expand Up @@ -624,7 +624,7 @@ pub fn encointer_kusama_local_testnet_config() -> Result<Box<dyn ChainSpec>, Str
.with_properties(properties)
.build(),
))
}
}*/

// CoretimeKusama
fn coretime_kusama_genesis(
Expand Down
12 changes: 12 additions & 0 deletions relay/kusama/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ pub mod system_parachain {

// System parachains from Kusama point of view.
pub type SystemParachains = IsChildSystemParachain<Id>;

/// Coretime constants
// FAIL-CI @donal please check/fix
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
pub mod coretime {
/// Coretime timeslice period in blocks
/// WARNING: This constant is used accross chains, so additional care should be taken
/// when changing it.
#[cfg(feature = "fast-runtime")]
pub const TIMESLICE_PERIOD: u32 = 10;
#[cfg(not(feature = "fast-runtime"))]
pub const TIMESLICE_PERIOD: u32 = 80;
}
}

/// Kusama Treasury pallet instance.
Expand Down
1 change: 1 addition & 0 deletions relay/kusama/src/governance/fellowship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ impl pallet_ranked_collective::Config<FellowshipCollectiveInstance> for Runtime
type MinRankOfClass = sp_runtime::traits::Identity;
type MemberSwappedHandler = ();
type VoteWeight = pallet_ranked_collective::Geometric;
type MaxMemberCount = ();
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkSetup = ();
}
34 changes: 27 additions & 7 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::weights::constants::{WEIGHT_PROOF_SIZE_PER_KB, WEIGHT_REF_TIME_PER_MICROS};
use kusama_runtime_constants::system_parachain::coretime::TIMESLICE_PERIOD;
use pallet_nis::WithMaximumOf;
use polkadot_primitives::{
slashing, AccountId, AccountIndex, ApprovalVotingParams, Balance, BlockNumber, CandidateEvent,
Expand Down Expand Up @@ -92,8 +93,9 @@ use sp_core::{ConstU128, OpaqueMetadata, H256};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{
AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT,
IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify,
AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto,
Extrinsic as ExtrinsicT, IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion,
Verify,
},
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug,
Expand Down Expand Up @@ -740,13 +742,8 @@ parameter_types! {
impl pallet_treasury::Config for Runtime {
type PalletId = TreasuryPalletId;
type Currency = Balances;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type ProposalBondMaximum = ProposalBondMaximum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type BurnDestination = Society;
Expand Down Expand Up @@ -796,6 +793,7 @@ impl pallet_bounties::Config for Runtime {
type DataDepositPerByte = DataDepositPerByte;
type RuntimeEvent = RuntimeEvent;
type MaximumReasonLength = MaximumReasonLength;
type OnSlash = Treasury;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -1284,12 +1282,22 @@ impl parachains_scheduler::Config for Runtime {

parameter_types! {
pub const BrokerId: u32 = system_parachain::BROKER_ID;
pub const BrokerPalletId: PalletId = PalletId(*b"py/broke");
pub MaxXcmTransactWeight: Weight = Weight::from_parts(
250 * WEIGHT_REF_TIME_PER_MICROS,
20 * WEIGHT_PROOF_SIZE_PER_KB
);
}

// FAIL-CI @donal please check/fix
pub struct BrokerPot;
impl Get<InteriorLocation> for BrokerPot {
fn get() -> InteriorLocation {
Junction::AccountId32 { network: None, id: BrokerPalletId::get().into_account_truncating() }
.into()
}
}

impl coretime::Config for Runtime {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeEvent = RuntimeEvent;
Expand All @@ -1298,17 +1306,29 @@ impl coretime::Config for Runtime {
type WeightInfo = weights::runtime_parachains_coretime::WeightInfo<Runtime>;
type SendXcm = crate::xcm_config::XcmRouter;
type MaxXcmTransactWeight = MaxXcmTransactWeight;
// FAIL-CI @donal please check these three:
type BrokerPotLocation = BrokerPot;
type AssetTransactor = crate::xcm_config::LocalAssetTransactor;
type AccountToLocation = xcm_builder::AliasesIntoAccountId32<
xcm_config::ThisNetwork,
<Runtime as frame_system::Config>::AccountId,
>;
}

parameter_types! {
pub const OnDemandTrafficDefaultValue: FixedU128 = FixedU128::from_u32(1);
// FAIL-CI @donal please check/fix
pub const MaxHistoricalRevenue: BlockNumber = 2 * TIMESLICE_PERIOD;
pub const OnDemandPalletId: PalletId = PalletId(*b"py/ondmd");
}

impl parachains_assigner_on_demand::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type TrafficDefaultValue = OnDemandTrafficDefaultValue;
type WeightInfo = weights::runtime_parachains_assigner_on_demand::WeightInfo<Runtime>;
type MaxHistoricalRevenue = MaxHistoricalRevenue;
type PalletId = OnDemandPalletId;
}

impl parachains_assigner_coretime::Config for Runtime {}
Expand Down
45 changes: 0 additions & 45 deletions relay/kusama/src/weights/pallet_treasury.rs

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

10 changes: 10 additions & 0 deletions relay/kusama/src/weights/runtime_parachains_coretime.rs

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

6 changes: 1 addition & 5 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,13 +854,8 @@ parameter_types! {
impl pallet_treasury::Config for Runtime {
type PalletId = TreasuryPalletId;
type Currency = Balances;
type ApproveOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury;
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type ProposalBondMaximum = ProposalBondMaximum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type BurnDestination = ();
Expand Down Expand Up @@ -910,6 +905,7 @@ impl pallet_bounties::Config for Runtime {
type ChildBountyManager = ChildBounties;
type DataDepositPerByte = DataDepositPerByte;
type MaximumReasonLength = MaximumReasonLength;
type OnSlash = Treasury;
type WeightInfo = weights::pallet_bounties::WeightInfo<Runtime>;
}

Expand Down
45 changes: 0 additions & 45 deletions relay/polkadot/src/weights/pallet_treasury.rs

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

Loading
Loading