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

feat: upgrade to Polkadot v0.9.16 #319

Merged
merged 30 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dd2b5a6
chore: bump Polkadot dependencies to v0.9.16
wischli Jan 31, 2022
a4df952
refactor: use AllPalletsWithSystem hook
wischli Jan 31, 2022
0da8631
chore: remove crowdloan pallet
wischli Jan 31, 2022
cfe284f
fix: apply no DefaultAccount check
wischli Jan 31, 2022
8870dbf
fix: switch to default MaxEncodedLen
wischli Jan 31, 2022
a9439cb
fix: apply asset quota + runtime state_version
wischli Jan 31, 2022
9606ae6
fix: Preimage registrar and Scheduler integration
wischli Jan 31, 2022
2471ce1
fix: OrderedSet
wischli Jan 31, 2022
42cde95
fix: apply new fork_id to chainspecs
wischli Feb 1, 2022
bae5e94
fix: apply no default account for SudoConfig
wischli Feb 1, 2022
4130db3
fix: apply name changes for GrandPa
wischli Feb 1, 2022
c76d7ca
fix: EnsureOneOf
wischli Feb 1, 2022
23f3139
fix: preimage weights
wischli Feb 1, 2022
0cde817
fix: parachain client
wischli Feb 1, 2022
495efe1
fix: clippy copied weights
wischli Feb 1, 2022
65a5398
fix: bump deps
wischli Feb 1, 2022
844b60b
tests: attempt staking fix
wischli Feb 1, 2022
1c2acfb
bench: attempt to fix default accountid for dids
wischli Feb 1, 2022
625df70
fix: staking unit test pallet order execution
wischli Feb 1, 2022
d2d48f8
fix: did unit benchmarks
wischli Feb 1, 2022
d43f354
fix: fmt
wischli Feb 2, 2022
6363a5c
fix: revert to old hook order execution
wischli Feb 2, 2022
ae7dc04
bench: run manually for preimage + scheduler
wischli Feb 2, 2022
54d73ab
fix: only import TaskManager for try-runtime feature
wischli Feb 2, 2022
37afc2c
fix: use correct scheduler migration + add logs
wischli Feb 2, 2022
b4c43c7
refactor: use explicit para runtime executors
wischli Feb 2, 2022
825a7fb
fix: apply code review by @Diiaablo95
wischli Feb 2, 2022
a5e9d01
chore: apply suggestion from @weichweich review
wischli Feb 3, 2022
54aa279
chore: bump deps
wischli Feb 9, 2022
00d063b
fix: deps
wischli Feb 9, 2022
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
2,412 changes: 1,289 additions & 1,123 deletions Cargo.lock

Large diffs are not rendered by default.

105 changes: 54 additions & 51 deletions nodes/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "kilt-parachain"
path = "src/main.rs"

[build-dependencies]
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
substrate-build-script-utils = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}

[dependencies]

Expand All @@ -34,67 +34,70 @@ structopt = "0.3.25"
trie-root = "0.15.2"

# Substrate dependencies
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-inherents = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.13"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-trie = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-basic-authorship = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-chain-spec = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-client-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-finality-grandpa = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-network = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-service = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-telemetry = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-tracing = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-transaction-pool-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-block-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-blockchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-consensus = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-consensus-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-core = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-inherents = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-io = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-keystore = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-offchain = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-runtime = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.16"}
sp-session = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-timestamp = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-transaction-pool = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-trie = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
substrate-prometheus-endpoint = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}

# RPC related dependencies
frame-rpc-system = {package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
frame-rpc-system = {package = "substrate-frame-rpc-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
jsonrpc-core = "18.0.0"
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sc-rpc-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
pallet-transaction-payment-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-rpc = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sc-rpc-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
sp-api = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}

# Cumulus dependencies
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-collator = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-consensus-relay-chain = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-network = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.13"}
cumulus-client-cli = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-collator = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-consensus-aura = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-consensus-common = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-consensus-relay-chain = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-network = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-client-service = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-primitives-core = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-primitives-parachain-inherent = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-relay-chain-interface = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}
cumulus-relay-chain-local = {git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16"}

# Polkadot dependencies
polkadot-cli = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13"}
polkadot-parachain = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.13"}
polkadot-cli = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16"}
polkadot-parachain = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16"}
polkadot-primitives = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16"}
polkadot-service = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16"}
xcm = {git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16"}

# Benchmarking
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13"}
frame-benchmarking = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}
frame-benchmarking-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16"}

# Runtime tests
node-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true}
try-runtime-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", optional = true}
node-executor = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true}
try-runtime-cli = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", optional = true}

[features]
default = []
Expand Down
4 changes: 3 additions & 1 deletion nodes/parachain/src/chain_spec/peregrine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub fn make_dev_spec() -> Result<ChainSpec, String> {
vec![],
None,
None,
None,
Some(properties),
Extensions {
relay_chain: "rococo_local_testnet".into(),
Expand Down Expand Up @@ -151,6 +152,7 @@ pub fn make_new_spec() -> Result<ChainSpec, String> {
Vec::new(),
None,
None,
None,
Some(properties),
Extensions {
relay_chain: "rococo_local_testnet".into(),
Expand Down Expand Up @@ -200,7 +202,7 @@ fn testnet_genesis(
.chain(botlabs_accounts.iter().cloned().map(|(who, total, _, _)| (who, total)))
.collect(),
},
sudo: SudoConfig { key: root_key },
sudo: SudoConfig { key: Some(root_key) },
parachain_info: ParachainInfoConfig { parachain_id: id },
kilt_launch: KiltLaunchConfig {
vesting: airdrop_accounts
Expand Down
3 changes: 3 additions & 0 deletions nodes/parachain/src/chain_spec/spiritnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub fn get_chain_spec_dev() -> Result<ChainSpec, String> {
vec![],
None,
None,
None,
Some(properties),
Extensions {
relay_chain: "rococo_local_testnet".into(),
Expand Down Expand Up @@ -170,6 +171,7 @@ pub fn get_chain_spec_wilt() -> Result<ChainSpec, String> {
],
Some(TelemetryEndpoints::new(vec![(TELEMETRY_URL.to_string(), 0)]).expect("WILT telemetry url is valid; qed")),
None,
None,
Some(properties),
Extensions {
relay_chain: "westend".into(),
Expand Down Expand Up @@ -225,6 +227,7 @@ pub fn get_chain_spec_rilt() -> Result<ChainSpec, String> {
],
Some(TelemetryEndpoints::new(vec![(TELEMETRY_URL.to_string(), 0)]).expect("RILT telemetry url is valid; qed")),
None,
None,
Some(properties),
Extensions {
relay_chain: "rococo".into(),
Expand Down
50 changes: 33 additions & 17 deletions nodes/parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use log::info;
#[cfg(feature = "try-runtime")]
use node_executor::ExecutorDispatch;
use polkadot_parachain::primitives::AccountIdConversion;
#[cfg(feature = "try-runtime")]
use polkadot_service::TaskManager;
use runtime_common::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result,
Expand Down Expand Up @@ -254,8 +256,9 @@ pub fn run() -> Result<()> {
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

let block: Block =
generate_genesis_block(&load_spec(&params.chain.clone().unwrap_or_default(), &params.runtime)?)?;
let spec = load_spec(&params.chain.clone().unwrap_or_default(), &params.runtime)?;
let state_version = Cli::native_runtime_version(&spec).state_version();
let block: Block = generate_genesis_block(&spec, state_version)?;
let raw_header = block.header().encode();
let output_buf = if params.raw {
raw_header
Expand Down Expand Up @@ -294,15 +297,13 @@ pub fn run() -> Result<()> {
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
// we don't need any of the components of new_partial, just a runtime, or a task
// manager to do `async_run`.
let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager = sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
.map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;

Ok((cmd.run::<Block, ExecutorDispatch>(config), task_manager))
})

// grab the task manager.
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager = TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| format!("Error: {:?}", e))?;

runner.async_run(|config| Ok((cmd.run::<Block, ExecutorDispatch>(config), task_manager)))
}
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
Expand All @@ -327,7 +328,9 @@ pub fn run() -> Result<()> {

let parachain_account = AccountIdConversion::<polkadot_primitives::v0::AccountId>::into_account(&id);

let block: Block = generate_genesis_block(&config.chain_spec).map_err(|e| format!("{:?}", e))?;
let state_version = RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
let block: Block =
generate_genesis_block(&config.chain_spec, state_version).map_err(|e| format!("{:?}", e))?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));

let tokio_handle = config.tokio_handle.clone();
Expand Down Expand Up @@ -420,11 +423,24 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws(default_listen_port)
}

fn prometheus_config(&self, default_listen_port: u16) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port)
}

fn init<C: SubstrateCli>(&self) -> Result<()> {
fn prometheus_config(
&self,
default_listen_port: u16,
chain_spec: &Box<dyn ChainSpec>,
) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port, chain_spec)
}

fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
{
unreachable!("PolkadotCli is never initialized; qed");
}

Expand Down
Loading