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

Commit

Permalink
To polkadot-v0.9.33 and some other changes (#171)
Browse files Browse the repository at this point in the history
* Anchor polkadot-v0.9.33

* Companion for paritytech/cumulus#1685

* Companion for paritytech/cumulus#1585

* Companion for paritytech/cumulus#1745

* Companion for paritytech/cumulus#1759

* Companion for paritytech/cumulus#1782

* Companion for paritytech/cumulus#1793

* Companion for paritytech/cumulus#1808

* Temp use prepare branch of messages-substrate

* Use darwinia fork frontier

* Use correct moonbeam substrate commit

* Correct bp-darwinia-core std

* Use prepare moonbeam v0.9.33

* Update ethereum to 0.14.0

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 democracy

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 scheduler

* Companion for paritytech/substrate#11649, paritytech/polkadot#5729 preimage

* Companion for paritytech/substrate#12109

* Type create origin

* Format

* Fix type CreateOrigin

* Format

* Companion for polkadot-evm/frontier#935

* Fix compile

* Fix service

* Format

* `Frontier` upgrade (#196)

* Delete BaseFee

* Fix todo

* Update prepare branch

* Fix mock

* Add pallet-evm-precompile-dispatch/std

* Format

* Format

* Correct version after merge

* Fix review

* Fix review

* Fix CI test

* Fix compile after merge

Co-authored-by: bear <boundless.forest@outlook.com>
  • Loading branch information
Guantong and boundless-forest authored Jan 16, 2023
1 parent 0c7cfa0 commit a32342f
Show file tree
Hide file tree
Showing 66 changed files with 1,677 additions and 1,995 deletions.
2,178 changes: 1,046 additions & 1,132 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/inflation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dc-types = { path = "../types" }
substrate-fixed = { default-features = false, git = "https://github.com/encointer/substrate-fixed" }

[dev-dependencies]
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }

[features]
default = ["std"]
Expand Down
7 changes: 3 additions & 4 deletions core/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ version = "6.0.0"
dc-types = { path = "../types" }

# moonbeam
account = { default-features = false, git = "https://github.com/darwinia-network/moonbeam", branch = "polkadot-v0.9.30" }
account = { default-features = false, git = "https://github.com/darwinia-network/moonbeam", branch = "polkadot-v0.9.33" }

# substrate
sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }

sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.33" }

[features]
default = ["std"]
Expand Down
136 changes: 70 additions & 66 deletions node/Cargo.toml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions node/src/chain_spec/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ pub fn genesis_config() -> ChainSpec {
)
},
},
base_fee: Default::default(),

// S2S stuff.
bridge_polkadot_grandpa: Default::default(),
Expand Down Expand Up @@ -340,7 +339,6 @@ fn testnet_genesis(
)
},
},
base_fee: Default::default(),

// S2S stuff.
bridge_polkadot_grandpa: Default::default(),
Expand Down
2 changes: 0 additions & 2 deletions node/src/chain_spec/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ pub fn genesis_config() -> ChainSpec {
)
},
},
base_fee: Default::default(),

// S2S stuff.
bridge_kusama_grandpa: Default::default(),
Expand Down Expand Up @@ -340,7 +339,6 @@ fn testnet_genesis(
)
},
},
base_fee: Default::default(),

// S2S stuff.
bridge_kusama_grandpa: Default::default(),
Expand Down
2 changes: 0 additions & 2 deletions node/src/chain_spec/pangolin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ pub fn genesis_config() -> ChainSpec {
)
},
},
base_fee: Default::default(),
}
},
Vec::new(),
Expand Down Expand Up @@ -334,6 +333,5 @@ fn testnet_genesis(
)
},
},
base_fee: Default::default(),
}
}
27 changes: 16 additions & 11 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,29 @@ pub enum Subcommand {

/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
#[cfg(feature = "try-runtime")]
TryRuntime(try_runtime_cli::TryRuntimeCmd),

/// Errors since the binary was not build with `--features try-runtime`.
#[cfg(not(feature = "try-runtime"))]
TryRuntime,
}

#[derive(Debug, clap::Parser)]
#[clap(
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
#[command(flatten)]
pub run: cumulus_client_cli::RunCmd,

/// Disable automatic hardware benchmarks.
Expand All @@ -81,14 +86,14 @@ pub struct Cli {
///
/// The results are then printed out in the logs, and also sent as part of
/// telemetry, if telemetry is enabled.
#[clap(long)]
#[arg(long)]
pub no_hardware_benchmarks: bool,

/// Relay chain arguments
#[clap(raw = true)]
#[arg(raw = true)]
pub relay_chain_args: Vec<String>,

#[clap(flatten)]
#[command(flatten)]
pub eth_args: EthArgs,
}

Expand Down Expand Up @@ -119,19 +124,19 @@ impl RelayChainCli {
#[derive(Debug, clap::Parser)]
pub struct EthArgs {
/// Size in bytes of the LRU cache for block data.
#[clap(long, default_value = "300000000")]
#[arg(long, default_value = "300000000")]
pub eth_log_block_cache: usize,

/// Size of the LRU cache for block data and their transaction statuses.
#[clap(long, default_value = "300000000")]
#[arg(long, default_value = "300000000")]
pub eth_statuses_cache: usize,

/// Maximum number of logs in a query.
#[clap(long, default_value = "10000")]
#[arg(long, default_value = "10000")]
pub max_past_logs: u32,

/// Maximum fee history cache size.
#[clap(long, default_value = "2048")]
#[arg(long, default_value = "2048")]
pub fee_history_limit: u64,
}
impl EthArgs {
Expand Down
52 changes: 28 additions & 24 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use sc_cli::{
};
use sc_service::{
config::{BasePath, PrometheusConfig},
DatabaseSource, PartialComponents, TaskManager,
DatabaseSource, PartialComponents,
};
use sp_core::{crypto::Ss58AddressFormatRegistry, hexdisplay::HexDisplay};
use sp_runtime::traits::{AccountIdConversion, Block as BlockT};
Expand Down Expand Up @@ -496,35 +496,35 @@ pub fn run() -> Result<()> {
_ => Err("Benchmarking sub-command unsupported".into()),
}
},
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
if cfg!(feature = "try-runtime") {
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;

set_default_ss58_version(chain_spec);
// 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))?;
set_default_ss58_version(chain_spec);
// 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))?;

if chain_spec.is_crab() {
runner.async_run(|config| {
Ok((cmd.run::<Block, CrabRuntimeExecutor>(config), task_manager))
})
} else if chain_spec.is_pangolin() {
runner.async_run(|config| {
Ok((cmd.run::<Block, PangolinRuntimeExecutor>(config), task_manager))
})
} else {
runner.async_run(|config| {
Ok((cmd.run::<Block, DarwiniaRuntimeExecutor>(config), task_manager))
})
}
if chain_spec.is_crab() {
runner.async_run(|config| {
Ok((cmd.run::<Block, CrabRuntimeExecutor>(config), task_manager))
})
} else if chain_spec.is_pangolin() {
runner.async_run(|config| {
Ok((cmd.run::<Block, PangolinRuntimeExecutor>(config), task_manager))
})
} else {
Err("Try-runtime must be enabled by `--features try-runtime`.".into())
runner.async_run(|config| {
Ok((cmd.run::<Block, DarwiniaRuntimeExecutor>(config), task_manager))
})
}
},
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
None => {
let runner = cli.create_runner(&cli.run.normalize())?;
let collator_options = cli.run.collator_options();
Expand Down Expand Up @@ -568,6 +568,10 @@ pub fn run() -> Result<()> {
if config.role.is_authority() { "yes" } else { "no" }
);

if collator_options.relay_chain_rpc_url.is_some() && cli.relay_chain_args.len() > 0 {
log::warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

if chain_spec.is_dev() {
return if chain_spec.is_crab() {
service::start_dev_node::<CrabRuntimeApi, CrabRuntimeExecutor>(
Expand Down
Loading

0 comments on commit a32342f

Please sign in to comment.