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

Make CI succeed and add migrations #1329

Merged
Merged
Show file tree
Hide file tree
Changes from 5 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
22 changes: 21 additions & 1 deletion Cargo.lock

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

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", bra
sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-network-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-network-statement = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.1.0" }
Expand Down
9 changes: 5 additions & 4 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ sc-client-db = { workspace = true }
sc-consensus = { workspace = true }
sc-executor = { workspace = true }
sc-keystore = { workspace = true }
sc-network = { workspace = true }
sc-network-statement = { workspace = true }
sc-offchain = { workspace = true }
sc-rpc = { workspace = true }
sc-rpc-api = { workspace = true }
sc-service = { workspace = true }
Expand Down Expand Up @@ -75,8 +78,7 @@ pallet-author-inherent = { workspace = true, features = ["default"], optional =
pallet-parachain-staking = { workspace = true, features = ["default"], optional = true }
parity-scale-codec = { workspace = true, features = ["default"], optional = true }
sc-chain-spec = { workspace = true, optional = true }
sc-network = { workspace = true, optional = true }
sc-network-common = { workspace = true, optional = true }
sc-network-sync = { workspace = true, optional = true }
sc-tracing = { workspace = true, optional = true }
serde = { workspace = true, features = ["default"], optional = true }
session-keys-primitives = { workspace = true, features = ["default"], optional = true }
Expand Down Expand Up @@ -148,8 +150,7 @@ parachain = [
"parity-scale-codec",
"session-keys-primitives",
"sc-chain-spec",
"sc-network",
"sc-network-common",
"sc-network-sync",
"sc-tracing",
"serde",
"sp-keystore",
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_spec/additional_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ pub struct AdditionalChainSpec {
#[cfg(not(feature = "parachain"))]
pub struct AdditionalChainSpec {
pub initial_authorities:
Vec<(sp_consensus_aura::sr25519::AuthorityId, sp_finality_grandpa::AuthorityId)>,
Vec<(sp_consensus_aura::sr25519::AuthorityId, sp_consensus_grandpa::AuthorityId)>,
}
4 changes: 2 additions & 2 deletions node/src/chain_spec/battery_station.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ cfg_if::cfg_if! {
pub(super) const DEFAULT_STAKING_AMOUNT_BATTERY_STATION: u128 = 2_000 * BASE;
const DEFAULT_COLLATOR_BALANCE_BATTERY_STATION: Option<u128> =
DEFAULT_STAKING_AMOUNT_BATTERY_STATION.checked_add(CollatorDeposit::get());
pub type BatteryStationChainSpec = sc_service::GenericChainSpec<battery_station_runtime::GenesisConfig, Extensions>;
pub type BatteryStationChainSpec = sc_service::GenericChainSpec<battery_station_runtime::RuntimeGenesisConfig, Extensions>;
const NUM_SELECTED_CANDIDATES: u32 = 8;
} else {
pub type BatteryStationChainSpec = sc_service::GenericChainSpec<battery_station_runtime::GenesisConfig>;
pub type BatteryStationChainSpec = sc_service::GenericChainSpec<battery_station_runtime::RuntimeGenesisConfig>;
}
}

Expand Down
4 changes: 2 additions & 2 deletions node/src/chain_spec/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ const INITIAL_BALANCE: Balance = Balance::MAX >> 4;
#[cfg(not(feature = "parachain"))]
fn authority_keys_from_seed(
s: &str,
) -> (sp_consensus_aura::sr25519::AuthorityId, sp_finality_grandpa::AuthorityId) {
) -> (sp_consensus_aura::sr25519::AuthorityId, sp_consensus_grandpa::AuthorityId) {
(
get_from_seed::<sp_consensus_aura::sr25519::AuthorityId>(s),
get_from_seed::<sp_finality_grandpa::AuthorityId>(s),
get_from_seed::<sp_consensus_grandpa::AuthorityId>(s),
)
}

Expand Down
15 changes: 10 additions & 5 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ macro_rules! generate_generic_genesis_function {
acs: AdditionalChainSpec,
endowed_accounts: Vec<EndowedAccountWithBalance>,
wasm_binary: &[u8],
) -> $runtime::GenesisConfig {
$runtime::GenesisConfig {
) -> $runtime::RuntimeGenesisConfig {
$runtime::RuntimeGenesisConfig {
// Common genesis
advisory_committee: Default::default(),
advisory_committee_membership: $runtime::AdvisoryCommitteeMembershipConfig {
Expand All @@ -125,6 +125,7 @@ macro_rules! generate_generic_genesis_function {
#[cfg(feature = "parachain")]
author_filter: $runtime::AuthorFilterConfig {
eligible_count: EligibilityValue::new_unchecked(1),
..Default::default()
},
#[cfg(feature = "parachain")]
author_mapping: $runtime::AuthorMappingConfig {
Expand All @@ -147,13 +148,17 @@ macro_rules! generate_generic_genesis_function {
#[cfg(not(feature = "parachain"))]
grandpa: $runtime::GrandpaConfig {
authorities: acs.initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(),
..Default::default()
},
liquidity_mining: $runtime::LiquidityMiningConfig {
initial_balance: LIQUIDITY_MINING,
per_block_distribution: LIQUIDITY_MINING_PTD.mul_ceil(LIQUIDITY_MINING),
},
#[cfg(feature = "parachain")]
parachain_info: $runtime::ParachainInfoConfig { parachain_id: acs.parachain_id },
parachain_info: $runtime::ParachainInfoConfig {
parachain_id: acs.parachain_id,
..Default::default()
},
#[cfg(feature = "parachain")]
parachain_staking: $runtime::ParachainStakingConfig {
blocks_per_round: acs.blocks_per_round,
Expand All @@ -174,7 +179,7 @@ macro_rules! generate_generic_genesis_function {
#[cfg(feature = "parachain")]
// Default should use the pallet configuration
polkadot_xcm: PolkadotXcmConfig::default(),
system: $runtime::SystemConfig { code: wasm_binary.to_vec() },
system: $runtime::SystemConfig { code: wasm_binary.to_vec(), ..Default::default() },
technical_committee: Default::default(),
technical_committee_membership: $runtime::TechnicalCommitteeMembershipConfig {
members: vec![].try_into().unwrap(),
Expand Down Expand Up @@ -230,7 +235,7 @@ pub struct Extensions {
/// The relay chain of the Parachain.
pub relay_chain: String,
/// Known bad block hashes.
pub bad_blocks: sc_client_api::BadBlocks<polkadot_primitives::v2::Block>,
pub bad_blocks: sc_client_api::BadBlocks<polkadot_primitives::Block>,
}

#[cfg(feature = "parachain")]
Expand Down
8 changes: 4 additions & 4 deletions node/src/chain_spec/zeitgeist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ use {
zeitgeist_primitives::constants::ztg::{STAKING_PTD, TOTAL_INITIAL_ZTG},
zeitgeist_runtime::{
CollatorDeposit, DefaultBlocksPerRound, DefaultCollatorCommission,
DefaultParachainBondReservePercent, EligibilityValue, MinCollatorStk, PolkadotXcmConfig,
DefaultParachainBondReservePercent, EligibilityValue, MinCandidateStk, PolkadotXcmConfig,
},
};

cfg_if::cfg_if! {
if #[cfg(feature = "parachain")] {
const DEFAULT_STAKING_AMOUNT_ZEITGEIST: u128 = MinCollatorStk::get();
const DEFAULT_STAKING_AMOUNT_ZEITGEIST: u128 = MinCandidateStk::get();
const DEFAULT_COLLATOR_BALANCE_ZEITGEIST: Option<u128> =
DEFAULT_STAKING_AMOUNT_ZEITGEIST.checked_add(CollatorDeposit::get());
const NUM_SELECTED_CANDIDATES: u32 = 8;
pub type ZeitgeistChainSpec = sc_service::GenericChainSpec<zeitgeist_runtime::GenesisConfig, Extensions>;
pub type ZeitgeistChainSpec = sc_service::GenericChainSpec<zeitgeist_runtime::RuntimeGenesisConfig, Extensions>;
} else {
pub type ZeitgeistChainSpec = sc_service::GenericChainSpec<zeitgeist_runtime::GenesisConfig>;
pub type ZeitgeistChainSpec = sc_service::GenericChainSpec<zeitgeist_runtime::RuntimeGenesisConfig>;
}
}

Expand Down
Loading