Skip to content

Commit

Permalink
[create-pull-request] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
rzadp authored May 2, 2024
1 parent 4ece703 commit fc34ac6
Show file tree
Hide file tree
Showing 11 changed files with 126 additions and 10,339 deletions.
10,223 changes: 0 additions & 10,223 deletions Cargo.lock

This file was deleted.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic
polkavm = "0.9.3"
polkavm-linker = "0.9.2"
polkavm-derive = "0.9.1"
log = { version = "0.4.20", default-features = false }
log = { version = "0.4.21", default-features = false }
quote = { version = "1.0.33" }
serde = { version = "1.0.197", default-features = false }
serde-big-array = { version = "0.3.2" }
serde_derive = { version = "1.0.117" }
serde_json = { version = "1.0.114", default-features = false }
serde_yaml = { version = "0.9" }
syn = { version = "2.0.50" }
syn = { version = "2.0.53" }
thiserror = { version = "1.0.48" }
tracing-subscriber = { version = "0.3.18" }
72 changes: 34 additions & 38 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solochain-template-node"
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.9.0)"
description = "A solochain node template built with Substrate, part of Polkadot Sdk. (polkadot v1.11.0)"
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -18,47 +18,44 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
clap = { version = "4.5.1", features = ["derive"] }
futures = { version = "0.3.21", features = ["thread-pool"] }
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
serde_json = { workspace = true, default-features = true }
jsonrpsee = { version = "0.22", features = ["server"] }
sc-cli = { version = "0.39.0" }
sp-core = { version = "31.0.0" }
sc-executor = { version = "0.35.0" }
sc-network = { version = "0.37.0" }
sc-service = { version = "0.38.0" }
sc-telemetry = { version = "17.0.0" }
sc-transaction-pool = { version = "31.0.0" }
sc-transaction-pool-api = { version = "31.0.0" }
sc-offchain = { version = "32.0.0" }
sc-consensus-aura = { version = "0.37.0" }
sp-consensus-aura = { version = "0.35.0" }
sc-consensus = { version = "0.36.0" }
sc-consensus-grandpa = { version = "0.22.0" }
sp-consensus-grandpa = { version = "16.0.0" }
sc-client-api = { version = "31.0.0" }
sc-rpc-api = { version = "0.36.0" }
sc-basic-authorship = { version = "0.37.0" }
sp-runtime = { version = "34.0.0" }
sp-io = { version = "33.0.0" }
sp-timestamp = { version = "29.0.0" }
sp-inherents = { version = "29.0.0" }
sp-keyring = { version = "34.0.0" }
sp-api = { version = "29.0.0" }
sp-blockchain = { version = "31.0.0" }
sp-block-builder = { version = "29.0.0" }
frame-system = { version = "31.0.0" }
pallet-transaction-payment = { version = "31.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "33.0.0" }
substrate-frame-rpc-system = { version = "31.0.0" }
frame-benchmarking-cli = { version = "35.0.1" }
sc-cli = { version = "0.41.0" }
sp-core = { version = "32.0.0", path = "../../../substrate/primitives/core" }
sc-executor = { version = "0.37.0" }
sc-network = { version = "0.39.0" }
sc-service = { version = "0.40.0" }
sc-telemetry = { version = "19.0.0" }
sc-transaction-pool = { version = "33.0.0" }
sc-transaction-pool-api = { version = "33.0.0" }
sc-offchain = { version = "34.0.0" }
sc-consensus-aura = { version = "0.39.0" }
sp-consensus-aura = { version = "0.37.0" }
sc-consensus = { version = "0.38.0" }
sc-consensus-grandpa = { version = "0.24.0" }
sp-consensus-grandpa = { version = "18.0.0" }
sc-client-api = { version = "33.0.0" }
sc-rpc-api = { version = "0.38.0" }
sc-basic-authorship = { version = "0.39.0" }
sp-runtime = { version = "36.0.0" }
sp-io = { version = "35.0.0" }
sp-timestamp = { version = "31.0.0" }
sp-inherents = { version = "31.0.0" }
sp-keyring = { version = "36.0.0" }
sp-api = { version = "31.0.0" }
sp-blockchain = { version = "33.0.0" }
sp-block-builder = { version = "31.0.0" }
frame-system = { version = "33.0.0" }
pallet-transaction-payment = { version = "33.0.0", default-features = false }
pallet-transaction-payment-rpc = { version = "35.0.0" }
substrate-frame-rpc-system = { version = "33.0.0" }
frame-benchmarking-cli = { version = "37.0.0" }
solochain-template-runtime = { version = "0.1.0", path = "../runtime" }

# CLI-specific dependencies
try-runtime-cli = { version = "0.41.0", optional = true }

[build-dependencies]
substrate-build-script-utils = { version = "11.0.0" }
substrate-build-script-utils = { version = "11.0.0", path = "../../../substrate/utils/build-script-utils" }

[features]
default = []
Expand All @@ -77,5 +74,4 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"solochain-template-runtime/try-runtime",
"sp-runtime/try-runtime",
"try-runtime-cli/try-runtime",
]
5 changes: 0 additions & 5 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ pub enum Subcommand {
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try-runtime has migrated to a standalone CLI
/// (<https://github.com/paritytech/try-runtime-cli>). The subcommand exists as a stub and
/// deprecation notice. It will be removed entirely some time after January 2024.
TryRuntime,

/// Db meta columns information.
ChainInfo(sc_cli::ChainInfoCmd),
}
23 changes: 15 additions & 8 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ pub fn run() -> sc_cli::Result<()> {
)
}

cmd.run::<sp_runtime::traits::HashingFor<Block>, ()>(config)
cmd.run_with_spec::<sp_runtime::traits::HashingFor<Block>, ()>(Some(
config.chain_spec,
))
},
BenchmarkCmd::Block(cmd) => {
let PartialComponents { client, .. } = service::new_partial(&config)?;
Expand Down Expand Up @@ -168,20 +170,25 @@ pub fn run() -> sc_cli::Result<()> {
}
})
},
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::<Block>(&config))
},
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move {
service::new_full(config).map_err(sc_cli::Error::Service)
match config.network.network_backend {
sc_network::config::NetworkBackendType::Libp2p => service::new_full::<
sc_network::NetworkWorker<
solochain_template_runtime::opaque::Block,
<solochain_template_runtime::opaque::Block as sp_runtime::traits::Block>::Hash,
>,
>(config)
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p =>
service::new_full::<sc_network::Litep2pNetworkBackend>(config)
.map_err(sc_cli::Error::Service),
}
})
},
}
Expand Down
25 changes: 20 additions & 5 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
}

/// Builds a new service for a full client.
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
pub fn new_full<
N: sc_network::NetworkBackend<Block, <Block as sp_runtime::traits::Block>::Hash>,
>(
config: Configuration,
) -> Result<TaskManager, ServiceError> {
let sc_service::PartialComponents {
client,
backend,
Expand All @@ -136,14 +140,24 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
other: (block_import, grandpa_link, mut telemetry),
} = new_partial(&config)?;

let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
let mut net_config = sc_network::config::FullNetworkConfiguration::<
Block,
<Block as sp_runtime::traits::Block>::Hash,
N,
>::new(&config.network);
let metrics = N::register_notification_metrics(config.prometheus_registry());

let peer_store_handle = net_config.peer_store_handle();
let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name(
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
&config.chain_spec,
);
let (grandpa_protocol_config, grandpa_notification_service) =
sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone());
sc_consensus_grandpa::grandpa_peers_set_config::<_, N>(
grandpa_protocol_name.clone(),
metrics.clone(),
peer_store_handle,
);
net_config.add_notification_protocol(grandpa_protocol_config);

let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
Expand All @@ -163,6 +177,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
block_announce_validator_builder: None,
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
block_relay: None,
metrics,
})?;

if config.offchain_worker.enabled {
Expand All @@ -177,7 +192,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
transaction_pool: Some(OffchainTransactionPoolFactory::new(
transaction_pool.clone(),
)),
network_provider: network.clone(),
network_provider: Arc::new(network.clone()),
enable_http_requests: true,
custom_extensions: |_| vec![],
})
Expand Down Expand Up @@ -205,7 +220,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
};

let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
network: network.clone(),
network: Arc::new(network.clone()),
client: client.clone(),
keystore: keystore_container.keystore(),
task_manager: &mut task_manager,
Expand Down
16 changes: 8 additions & 8 deletions pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-template"
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.9.0)"
description = "FRAME pallet template for defining custom runtime logic. (polkadot v1.11.0)"
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -19,19 +19,19 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
"derive",
] }
scale-info = { version = "2.10.0", default-features = false, features = [
scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
] }

# frame deps
frame-benchmarking = { version = "31.0.0", default-features = false, optional = true }
frame-support = { version = "31.0.0", default-features = false }
frame-system = { version = "31.0.0", default-features = false }
frame-benchmarking = { version = "33.0.0", default-features = false, optional = true }
frame-support = { version = "33.0.0", default-features = false }
frame-system = { version = "33.0.0", default-features = false }

[dev-dependencies]
sp-core = { version = "31.0.0" }
sp-io = { version = "33.0.0" }
sp-runtime = { version = "34.0.0" }
sp-core = { path = "../../../../substrate/primitives/core" }
sp-io = { version = "35.0.0" }
sp-runtime = { version = "36.0.0" }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ frame_support::construct_runtime!(
}
);

#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type BlockWeights = ();
Expand Down
64 changes: 31 additions & 33 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solochain-template-runtime"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.9.0)"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.11.0)"
version = "0.1.0"
license = "MIT-0"
authors.workspace = true
Expand All @@ -19,54 +19,54 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = [
"derive",
] }
scale-info = { version = "2.10.0", default-features = false, features = [
scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
"serde",
] }

# frame
frame-support = { version = "31.0.0", default-features = false, features = ["experimental"] }
frame-system = { version = "31.0.0", default-features = false }
frame-try-runtime = { version = "0.37.0", default-features = false, optional = true }
frame-executive = { version = "31.0.0", default-features = false }
frame-support = { version = "33.0.0", default-features = false, features = ["experimental"] }
frame-system = { version = "33.0.0", default-features = false }
frame-try-runtime = { version = "0.39.0", default-features = false, optional = true }
frame-executive = { version = "33.0.0", default-features = false }

# frame pallets
pallet-aura = { version = "30.0.0", default-features = false }
pallet-balances = { version = "31.0.0", default-features = false }
pallet-grandpa = { version = "31.0.0", default-features = false }
pallet-sudo = { version = "31.0.0", default-features = false }
pallet-timestamp = { version = "30.0.0", default-features = false }
pallet-transaction-payment = { version = "31.0.0", default-features = false }
pallet-aura = { version = "32.0.0", default-features = false }
pallet-balances = { version = "34.0.0", default-features = false }
pallet-grandpa = { version = "33.0.0", default-features = false }
pallet-sudo = { version = "33.0.0", default-features = false }
pallet-timestamp = { version = "32.0.0", default-features = false }
pallet-transaction-payment = { version = "33.0.0", default-features = false }

# primitives
sp-api = { version = "29.0.0", default-features = false }
sp-block-builder = { version = "29.0.0", default-features = false }
sp-consensus-aura = { version = "0.35.0", default-features = false, features = ["serde"] }
sp-consensus-grandpa = { version = "16.0.0", default-features = false, features = ["serde"] }
sp-core = { version = "31.0.0", default-features = false, features = ["serde"] }
sp-inherents = { version = "29.0.0", default-features = false }
sp-offchain = { version = "29.0.0", default-features = false }
sp-runtime = { version = "34.0.0", default-features = false, features = ["serde"] }
sp-session = { version = "30.0.0", default-features = false }
sp-std = { version = "14.0.0", default-features = false }
sp-storage = { version = "20.0.0", default-features = false }
sp-transaction-pool = { version = "29.0.0", default-features = false }
sp-version = { version = "32.0.0", default-features = false, features = ["serde"] }
sp-genesis-builder = { version = "0.10.0", default-features = false }
sp-api = { version = "31.0.0", default-features = false }
sp-block-builder = { version = "31.0.0", default-features = false }
sp-consensus-aura = { version = "0.37.0", default-features = false, features = ["serde"] }
sp-consensus-grandpa = { version = "18.0.0", default-features = false, features = ["serde"] }
sp-core = { path = "../../../substrate/primitives/core", default-features = false, features = ["serde"], version = "32.0.0" }
sp-inherents = { version = "31.0.0", default-features = false }
sp-offchain = { version = "31.0.0", default-features = false }
sp-runtime = { version = "36.0.0", default-features = false, features = ["serde"] }
sp-session = { version = "32.0.0", default-features = false }
sp-std = { path = "../../../substrate/primitives/std", default-features = false, version = "14.0.0" }
sp-storage = { path = "../../../substrate/primitives/storage", default-features = false, version = "21.0.0" }
sp-transaction-pool = { version = "31.0.0", default-features = false }
sp-version = { version = "34.0.0", default-features = false, features = ["serde"] }
sp-genesis-builder = { version = "0.12.0", default-features = false }

# RPC related
frame-system-rpc-runtime-api = { version = "29.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false }
frame-system-rpc-runtime-api = { version = "31.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "33.0.0", default-features = false }

# Used for runtime benchmarking
frame-benchmarking = { version = "31.0.0", default-features = false, optional = true }
frame-system-benchmarking = { version = "31.0.0", default-features = false, optional = true }
frame-benchmarking = { version = "33.0.0", default-features = false, optional = true }
frame-system-benchmarking = { version = "33.0.0", default-features = false, optional = true }

# The pallet in this template.
pallet-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }

[build-dependencies]
substrate-wasm-builder = { version = "20.0.0", optional = true }
substrate-wasm-builder = { version = "22.0.0", optional = true }

[features]
default = ["std"]
Expand Down Expand Up @@ -137,5 +137,3 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"sp-runtime/try-runtime",
]

experimental = ["pallet-aura/experimental"]
6 changes: 1 addition & 5 deletions runtime/build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
fn main() {
#[cfg(feature = "std")]
{
substrate_wasm_builder::WasmBuilder::new()
.with_current_project()
.export_heap_base()
.import_memory()
.build();
substrate_wasm_builder::WasmBuilder::build_using_defaults();
}
}
Loading

0 comments on commit fc34ac6

Please sign in to comment.