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

Polkadot v0.9.16 #185

Merged
merged 14 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
2,868 changes: 1,579 additions & 1,289 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ There are several options to launch Pontem local parachain:

Install [polkadot-launch](https://github.com/paritytech/polkadot-launch).

**Note:** you must have polkadot node `v0.9.13` compiled and built placed in `../polkadot/target/release/`.
**Note:** you must have polkadot node `v0.9.16` compiled and built placed in `../polkadot/target/release/`.
To use different localion you can modify `./launch-config.json`.

Create keystore path for Pontem:
Expand Down Expand Up @@ -105,7 +105,7 @@ Build Polkadot:
git clone https://github.com/paritytech/polkadot.git
cd polkadot
git fetch origin
git checkout release-v0.9.13
git checkout release-v0.9.16
cargo build --release
```

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
dockerfile: launch.Dockerfile
args:
PONTEM_VERSION: v0.4.1
POLKADOT_VERSION: v0.9.13
POLKADOT_VERSION: v0.9.16
NODE_VERSION: 16
ports:
- "9944:9944" # Alice relaychain
Expand Down
105 changes: 54 additions & 51 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ path = "src/main.rs"
targets = ['x86_64-unknown-linux-gnu']

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

[dependencies]
Expand All @@ -26,68 +26,72 @@ futures = { version = "0.3.1", features = ["compat"] }
jsonrpc-core = '18.0'
serde_json = '1.0'
structopt = '0.3.8'
codec = { package = 'parity-scale-codec', version = '2.3.0' }
codec = { package = 'parity-scale-codec', version = '2.3.1' }
log = "0.4"
serde = { version = "1.0", features = ["derive"] }

# Substrate dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
frame-benchmarking = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
substrate-prometheus-endpoint = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }

# Substarte Client Dependencies
sc-basic-authorship = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-cli = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
sc-client-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-executor = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-service = { git = "https://github.com/paritytech/substrate.git", branch = 'polkadot-v0.9.13', features = ['wasmtime'] }
sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-network = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sc-basic-authorship = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-cli = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16', features = ['wasmtime'] }
sc-client-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-consensus = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-executor = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16', features = ['wasmtime'] }
sc-finality-grandpa = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-keystore = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-rpc = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-rpc-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-service = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16', features = ['wasmtime'] }
sc-telemetry = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-tracing = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-chain-spec = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-network = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-transaction-pool-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sc-consensus-manual-seal = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }

# Substrate Primitive Dependencies
sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-block-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-timestamp = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-session = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-offchain = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.13" }
sp-api = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-block-builder = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-blockchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-consensus = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-core = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-finality-grandpa = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-inherents = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-runtime = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-transaction-pool = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-timestamp = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-session = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-offchain = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }
sp-keystore = { git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' }

# Nimbus dependencies
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13" }
nimbus-consensus = { git = "https://github.com/pontem-network/nimbus.git", branch = "polkadot-v0.9.13" }
nimbus-primitives = { git = "https://github.com/pontem-network/nimbus", branch = 'polkadot-v0.9.16' }
nimbus-consensus = { git = "https://github.com/pontem-network/nimbus", branch = 'polkadot-v0.9.16' }

# Cumulus dependencies
cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus.git", branch = "polkadot-v0.9.13" }
cumulus-client-consensus-relay-chain = { 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-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-client-cli = { 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-local = { 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' }

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

flume = "0.10.9"

# Local dependencies
pontem-runtime = { path = "../runtime" }
Expand All @@ -105,8 +109,7 @@ constants = { path = "../constants" }
#
# ** Don't enable relay chains you don't need, as this is a **very** heavy build for no reason**
# More info: https://github.com/paritytech/polkadot/pull/3189

polkadot-cli = { git = 'https://github.com/paritytech/polkadot.git', branch = 'release-v0.9.13', features = ["kusama-native"] }
polkadot-cli = { git = 'https://github.com/paritytech/polkadot.git', branch = 'release-v0.9.16', features = ["kusama-native"] }

[dependencies.move-vm]
package = "mvm"
Expand Down
19 changes: 13 additions & 6 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use pontem_runtime::{
GenesisConfig, SudoConfig, SystemConfig, BalancesConfig, WASM_BINARY, ParachainInfoConfig,
VestingConfig, MvmConfig, TransactionPauseConfig, ParachainStakingConfig, InflationInfo,
Range, AuthorFilterConfig, AuthorMappingConfig, TreasuryConfig, TokensConfig,
DemocracyConfig, PolkadotXcmConfig, SchedulerConfig,
DemocracyConfig, PolkadotXcmConfig,
};
use primitives::{currency::CurrencyId, AccountId, Signature, Balance, BlockNumber};
use constants::SS58_PREFIX;
Expand Down Expand Up @@ -152,7 +152,7 @@ fn paused_extrinsics() -> Vec<(Vec<u8>, Vec<u8>)> {
"teleport_assets",
],
),
("ParachainStaking", vec!["join_candidates", "nominate"]),
("ParachainStaking", vec!["join_candidates", "delegate"]),
("Treasury", vec!["propose_spend"]),
("Mvm", vec!["execute", "publish_module", "publish_package"]),
(
Expand Down Expand Up @@ -246,6 +246,8 @@ pub fn development_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
None,
// Fork ID
None,
// Properties
properties(),
// Extensions
Expand Down Expand Up @@ -334,6 +336,8 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some("pontem_testnet"),
// Fork ID
None,
// Properties
properties(),
// Extensions
Expand Down Expand Up @@ -465,6 +469,8 @@ pub fn westend_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some("nox_westend"),
// Fork ID
None,
// Properties
properties(),
// Extensions
Expand Down Expand Up @@ -709,6 +715,8 @@ pub fn nox_config() -> Result<ChainSpec, String> {
None,
// Protocol ID
Some("nox_mainnet"),
// Fork ID
None,
// Properties
properties(),
// Extensions
Expand All @@ -724,7 +732,7 @@ fn genesis(
wasm_binary: &[u8],
root_key: AccountId,
candidates: Vec<(AccountId, NimbusId, Balance)>,
nominations: Vec<(AccountId, AccountId, Balance)>,
delegations: Vec<(AccountId, AccountId, Balance)>,
balances: Vec<(AccountId, Balance)>,
vesting: Vec<(AccountId, BlockNumber, BlockNumber, Balance)>,
paused: Vec<(Vec<u8>, Vec<u8>)>,
Expand Down Expand Up @@ -754,15 +762,15 @@ fn genesis(
parachain_info: ParachainInfoConfig { parachain_id: id },
sudo: SudoConfig {
// Assign network admin rights.
key: root_key,
key: Some(root_key),
},
parachain_staking: ParachainStakingConfig {
candidates: candidates
.iter()
.cloned()
.map(|(account, _, bond)| (account, bond))
.collect(),
nominations,
delegations,
inflation_config: pontem_inflation_config(),
},
author_filter: AuthorFilterConfig {
Expand Down Expand Up @@ -790,7 +798,6 @@ fn genesis(
vesting: VestingConfig { vesting },
treasury: TreasuryConfig {},
democracy: DemocracyConfig::default(),
scheduler: SchedulerConfig {},
}
}

Expand Down
35 changes: 28 additions & 7 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,11 @@ pub fn run() -> sc_cli::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())?)?;
let chain_spec = load_spec(&params.chain.clone().unwrap_or_default())?;

let state_version = Cli::native_runtime_version(&chain_spec).state_version();

let block: Block = generate_genesis_block(&chain_spec, state_version)?;
let raw_header = block.header().encode();
let output_buf = if params.raw {
raw_header
Expand Down Expand Up @@ -264,8 +267,11 @@ pub fn run() -> sc_cli::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 =
Cli::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 task_executor = config.tokio_handle.clone();
Expand Down Expand Up @@ -348,11 +354,26 @@ impl sc_cli::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 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<C: SubstrateCli>(&self) -> Result<()> {
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