Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
add parachains pallets to Polkadot runtime (#3815)
Browse files Browse the repository at this point in the history
* add parachains pallets to Polkadot runtime

* some updates

* temp update deposits, fix compile

* lower para byte deposit

* fix genesis

* fmt

* fix spell

* updates to consts

* update benchmark list

* fix merge master

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_crowdloan.rs

* skip large meta

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::crowdloan --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_crowdloan.rs

* cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=runtime_common::paras_registrar --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/runtime_common_paras_registrar.rs

* fmt

* add and update proxies

* add weight info

* weights

* lower minimum contribution to 5 DOT

* only overwrite when default

Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: Parity Bot <[email protected]>
  • Loading branch information
3 people authored Sep 23, 2021
1 parent 80a0bfd commit ece7544
Show file tree
Hide file tree
Showing 13 changed files with 885 additions and 38 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

15 changes: 14 additions & 1 deletion node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ pub fn wococo_config() -> Result<RococoChainSpec, String> {
}

/// The default parachains host configuration.
#[cfg(any(feature = "rococo-native", feature = "kusama-native", feature = "westend-native"))]
#[cfg(any(
feature = "rococo-native",
feature = "kusama-native",
feature = "westend-native",
feature = "polkadot-native"
))]
fn default_parachains_host_configuration(
) -> polkadot_runtime_parachains::configuration::HostConfiguration<
polkadot_primitives::v1::BlockNumber,
Expand Down Expand Up @@ -364,6 +369,10 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
claims: polkadot::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: polkadot::VestingConfig { vesting: vec![] },
treasury: Default::default(),
configuration: polkadot::ConfigurationConfig {
config: default_parachains_host_configuration(),
},
paras: Default::default(),
}
}

Expand Down Expand Up @@ -1310,6 +1319,10 @@ pub fn polkadot_testnet_genesis(
claims: polkadot::ClaimsConfig { claims: vec![], vesting: vec![] },
vesting: polkadot::VestingConfig { vesting: vec![] },
treasury: Default::default(),
configuration: polkadot::ConfigurationConfig {
config: default_parachains_host_configuration(),
},
paras: Default::default(),
}
}

Expand Down
1 change: 1 addition & 0 deletions runtime/common/src/crowdloan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,7 @@ mod benchmarking {
}

// Worst case: Refund removes `RemoveKeysLimit` keys, and is fully refunded.
#[skip_meta]
refund {
let k in 0 .. T::RemoveKeysLimit::get();
let fund_index = create_fund::<T>(1337, 100u32.into());
Expand Down
1 change: 1 addition & 0 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate",
hex-literal = { version = "0.3.3", optional = true }

runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false }
runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false }
primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false }

[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions runtime/polkadot/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub mod time {
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
pub const WEEKS: BlockNumber = DAYS * 7;

// 1 in 4 blocks (on average, not counting collisions) will be primary babe blocks.
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);
Expand Down
Loading

0 comments on commit ece7544

Please sign in to comment.