Skip to content
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
1,618 changes: 866 additions & 752 deletions Cargo.lock

Large diffs are not rendered by default.

362 changes: 181 additions & 181 deletions Cargo.toml

Large diffs are not rendered by default.

122 changes: 62 additions & 60 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build = 'build.rs'
targets = ['x86_64-unknown-linux-gnu']

[build-dependencies]
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
substrate-build-script-utils = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }

[features]
shot = [ 'shot-runtime' ]
Expand Down Expand Up @@ -51,72 +51,74 @@ pint-rpc = { path = '../rpc' }
pallet-asset-index-rpc = { path = '../pallets/asset-index/rpc' }

# Substrate Dependencies
frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
frame-system-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
frame-support = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
frame-system-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
frame-benchmarking = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
frame-benchmarking-cli = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }

pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
pallet-transaction-payment-rpc = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }

substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = 'polkadot-v0.9.24'}
substrate-frame-rpc-system = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = 'polkadot-v0.9.26'}

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

## Substrate Primitive Dependencies
sp-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-blockchain = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-consensus = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-trie = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-keystore = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-offchain = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-session = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-storage = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.24' }
sp-api = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-block-builder = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-blockchain = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-consensus = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-consensus-aura = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-core = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-trie = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-io = { git = "https://github.com/paritytech/substrate", branch = 'polkadot-v0.9.26' }
sp-inherents = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-keystore = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-offchain = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-runtime = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-session = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-storage = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-timestamp = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
sp-transaction-pool = { git = 'https://github.com/paritytech/substrate', branch = 'polkadot-v0.9.26' }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.26", optional = true }


# Cumulus dependencies
cumulus-client-consensus-aura = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-consensus-common = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-collator = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-cli = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-network = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-service = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-primitives-core = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-client-consensus-relay-chain = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.24' }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.24" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.24" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.24" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.24" }
cumulus-client-consensus-aura = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-consensus-common = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-collator = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-cli = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-network = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-service = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-primitives-core = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-primitives-parachain-inherent = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-client-consensus-relay-chain = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.26' }
cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.26' }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.26' }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.26' }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = 'polkadot-v0.9.26' }
# Polkadot dependencies
polkadot-primitives = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.24'}
polkadot-service = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.24', default-features = false}
polkadot-cli = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.24'}
polkadot-parachain = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.24'}
polkadot-primitives = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.26'}
polkadot-service = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.26', default-features = false}
polkadot-cli = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.26'}
polkadot-parachain = { git = 'https://github.com/paritytech/polkadot', branch = 'release-v0.9.26'}

node-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
node-executor = { git = "https://github.com/paritytech/substrate", branch = 'polkadot-v0.9.26' }
2 changes: 1 addition & 1 deletion node/src/chain_spec/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn pint_testnet_genesis(
},
polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(2) },
oracle_operator_membership: OracleOperatorMembershipConfig {
members: vec![],
members: vec![].try_into().unwrap(),
phantom: Default::default(),
},
}
Expand Down
62 changes: 19 additions & 43 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@ use clap::Parser;
#[derive(Debug, Parser)]
pub enum Subcommand {
/// Export the genesis state of the parachain.
#[clap(name = "export-genesis-state")]
ExportGenesisState(ExportGenesisStateCommand),
ExportGenesisState(cumulus_client_cli::ExportGenesisStateCommand),

/// Export the genesis wasm of the parachain.
#[clap(name = "export-genesis-wasm")]
ExportGenesisWasm(ExportGenesisWasmCommand),
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),

#[clap(subcommand)]
Key(sc_cli::KeySubcommand),

#[cfg(feature = "try-runtime")]
TryRuntime(try_runtime_cli::TryRuntimeCmd),

/// Verify a signature for a message, provided on STDIN, with a given
/// (public or secret) key.
Verify(sc_cli::VerifyCmd),

/// Generate a seed that provides a vanity address.
Vanity(sc_cli::VanityCmd),

/// Sign a message, with a given (secret) key.
Sign(sc_cli::SignCmd),

/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),
Expand Down Expand Up @@ -45,44 +59,6 @@ pub enum Subcommand {
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
}

/// Command for exporting the genesis state of the parachain
#[derive(Debug, Parser)]
pub struct ExportGenesisStateCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
pub output: Option<PathBuf>,

/// Id of the parachain this state is for.
///
/// Default: 100
#[clap(long)]
pub parachain_id: Option<u32>,

/// Write output in binary. Default is to write in hex.
#[clap(long)]
pub raw: bool,

/// The name of the chain for that the genesis state should be exported.
#[clap(long)]
pub chain: Option<String>,
}

/// Command for exporting the genesis wasm file.
#[derive(Debug, Parser)]
pub struct ExportGenesisWasmCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
pub output: Option<PathBuf>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
pub raw: bool,

/// The name of the chain for that the genesis wasm file should be exported.
#[clap(long)]
pub chain: Option<String>,
}

#[derive(Debug, Parser)]
#[clap(
propagate_version = true,
Expand Down Expand Up @@ -129,6 +105,6 @@ impl RelayChainCli {
let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config.base_path.as_ref().map(|x| x.path().join("polkadot"));
Self { base_path, chain_id, base: polkadot_cli::RunCmd::from_iter(relay_chain_args) }
Self { base_path, chain_id, base: polkadot_cli::RunCmd::parse_from(relay_chain_args) }
}
}
79 changes: 21 additions & 58 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@ use crate::{
cli::{Cli, RelayChainCli, Subcommand},
service::{self, IdentifyVariant, new_partial},
};
use codec::Encode;
use cumulus_client_service::genesis::generate_genesis_block;
use cumulus_primitives_core::ParaId;
use log::info;
// use polkadot_parachain::primitives::AccountIdConversion;
use primitives::Block;
use sc_cli::{
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams, NetworkParams, Result,
RuntimeVersion, SharedParams, SubstrateCli,
};
use sc_service::config::{BasePath, PrometheusConfig};
use sp_core::hexdisplay::HexDisplay;
use sp_runtime::traits::Block as BlockT;
use std::{io::Write, net::SocketAddr};
use std::{net::SocketAddr};
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};

fn load_spec(id: &str, para_id: ParaId) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Expand Down Expand Up @@ -168,15 +163,6 @@ fn set_default_ss58_version(spec: &Box<dyn sc_chain_spec::ChainSpec>) {
sp_core::crypto::set_default_ss58_version(ss58_version.into());
}

fn extract_genesis_wasm(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Result<Vec<u8>> {
let mut storage = chain_spec.build_storage()?;

storage
.top
.remove(sp_core::storage::well_known_keys::CODE)
.ok_or_else(|| "Could not find wasm file in genesis state!".into())
}

macro_rules! with_runtime {
($chain_spec:expr, { $( $code:tt )* }) => {
if $chain_spec.is_shot() {
Expand Down Expand Up @@ -255,52 +241,25 @@ pub fn run() -> Result<()> {
let (client, backend, _, task_manager) = service::new_chain_ops(&mut config)?;
Ok((cmd.run(client, backend, None), task_manager))
}),
Some(Subcommand::ExportGenesisState(params)) => {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();
let chain_spec = cli.load_spec(&params.chain.clone().unwrap_or_default())?;
let state_version = Cli::native_runtime_version(&chain_spec).state_version();
let output_buf = with_runtime!(chain_spec, {
{
let block: Block =
generate_genesis_block(&chain_spec, state_version).map_err(|e| format!("{:?}", e))?;
let raw_header = block.header().encode();
if params.raw {
raw_header
} else {
format!("0x{:?}", HexDisplay::from(&block.header().encode())).into_bytes()
}
}
});
if let Some(output) = &params.output {
std::fs::write(output, output_buf)?;
} else {
std::io::stdout().write_all(&output_buf)?;
}
Some(Subcommand::ExportGenesisState(cmd)) => {
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;

Ok(())
with_runtime!(chain_spec, {
return runner.sync_run(|_config| {
let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?;
let state_version = Cli::native_runtime_version(&spec).state_version();
cmd.run::<Block>(&*spec, state_version)
});
})
}

Some(Subcommand::ExportGenesisWasm(params)) => {
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

let raw_wasm_blob = extract_genesis_wasm(&cli.load_spec(&params.chain.clone().unwrap_or_default())?)?;
let output_buf = if params.raw {
raw_wasm_blob
} else {
format!("0x{:?}", HexDisplay::from(&raw_wasm_blob)).into_bytes()
};

if let Some(output) = &params.output {
std::fs::write(output, output_buf)?;
} else {
std::io::stdout().write_all(&output_buf)?;
}

Ok(())
Some(Subcommand::ExportGenesisWasm(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|_config| {
let spec = cli.load_spec(&cmd.shared_params.chain.clone().unwrap_or_default())?;
cmd.run(&*spec)
})
}
Some(Subcommand::Benchmark(cmd)) => {
if cfg!(feature = "runtime-benchmarks") {
Expand Down Expand Up @@ -343,6 +302,10 @@ pub fn run() -> Result<()> {
.into())
}
}
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::Sign(cmd)) => cmd.run(),
Some(Subcommand::Verify(cmd)) => cmd.run(),
Some(Subcommand::Vanity(cmd)) => cmd.run(),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
let chain_spec = &runner.config().chain_spec;
Expand Down
Loading