Update template triggered by workflow_dispatch

This commit is contained in:
Template Bot
2024-05-06 09:31:35 +00:00
parent b218abb9bc
commit c908bb14c7
9 changed files with 1200 additions and 633 deletions
Generated
+1117 -573
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -46,12 +46,13 @@ default_constructed_unit_structs = { level = "allow", priority = 2 } # stylistic
polkavm = "0.9.3" polkavm = "0.9.3"
polkavm-linker = "0.9.2" polkavm-linker = "0.9.2"
polkavm-derive = "0.9.1" 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" } quote = { version = "1.0.33" }
serde = { version = "1.0.197", default-features = false } serde = { version = "1.0.197", default-features = false }
serde-big-array = { version = "0.3.2" } serde-big-array = { version = "0.3.2" }
serde_derive = { version = "1.0.117" } serde_derive = { version = "1.0.117" }
serde_json = { version = "1.0.114", default-features = false } serde_json = { version = "1.0.114", default-features = false }
serde_yaml = { version = "0.9" } serde_yaml = { version = "0.9" }
syn = { version = "2.0.50" } syn = { version = "2.0.53" }
thiserror = { version = "1.0.48" } thiserror = { version = "1.0.48" }
tracing-subscriber = { version = "0.3.18" }
+25 -25
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "minimal-template-node" name = "minimal-template-node"
description = "A miniaml Substrate-based Substrate node, ready for hacking. (polkadot v1.9.0)" description = "A minimal Substrate-based Substrate node, ready for hacking. (polkadot v1.11.0)"
version = "0.1.0" version = "0.1.0"
license = "MIT-0" license = "MIT-0"
authors.workspace = true authors.workspace = true
@@ -17,36 +17,36 @@ workspace = true
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
clap = { version = "4.5.1", features = ["derive"] } clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.21", features = ["thread-pool"] } futures = { version = "0.3.30", features = ["thread-pool"] }
futures-timer = "3.0.1" futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] } jsonrpsee = { version = "0.22", features = ["server"] }
serde_json = { workspace = true, default-features = true } serde_json = { workspace = true, default-features = true }
sc-cli = { version = "0.39.0" } sc-cli = { version = "0.41.0" }
sc-executor = { version = "0.35.0" } sc-executor = { version = "0.37.0" }
sc-network = { version = "0.37.0" } sc-network = { version = "0.39.0" }
sc-service = { version = "0.38.0" } sc-service = { version = "0.40.0" }
sc-telemetry = { version = "17.0.0" } sc-telemetry = { version = "19.0.0" }
sc-transaction-pool = { version = "31.0.0" } sc-transaction-pool = { version = "33.0.0" }
sc-transaction-pool-api = { version = "31.0.0" } sc-transaction-pool-api = { version = "33.0.0" }
sc-consensus = { version = "0.36.0" } sc-consensus = { version = "0.38.0" }
sc-consensus-manual-seal = { version = "0.38.0" } sc-consensus-manual-seal = { version = "0.40.0" }
sc-rpc-api = { version = "0.36.0" } sc-rpc-api = { version = "0.38.0" }
sc-basic-authorship = { version = "0.37.0" } sc-basic-authorship = { version = "0.39.0" }
sc-offchain = { version = "32.0.0" } sc-offchain = { version = "34.0.0" }
sc-client-api = { version = "31.0.0" } sc-client-api = { version = "33.0.0" }
sp-timestamp = { version = "29.0.0" } sp-timestamp = { version = "31.0.0" }
sp-keyring = { version = "34.0.0" } sp-keyring = { version = "36.0.0" }
sp-api = { version = "29.0.0" } sp-api = { version = "31.0.0" }
sp-blockchain = { version = "31.0.0" } sp-blockchain = { version = "33.0.0" }
sp-block-builder = { version = "29.0.0" } sp-block-builder = { version = "31.0.0" }
sp-io = { version = "33.0.0" } sp-io = { version = "35.0.0" }
sp-runtime = { version = "34.0.0" } sp-runtime = { version = "36.0.0" }
substrate-frame-rpc-system = { version = "31.0.0" } substrate-frame-rpc-system = { version = "33.0.0" }
# Once the native runtime is gone, there should be little to no dependency on FRAME here, and # Once the native runtime is gone, there should be little to no dependency on FRAME here, and
# certainly no dependency on the runtime. # certainly no dependency on the runtime.
frame = { version = "0.1.1", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] } frame = { version = "0.2.0", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" } runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" }
[build-dependencies] [build-dependencies]
+9 -1
View File
@@ -119,7 +119,15 @@ pub fn run() -> sc_cli::Result<()> {
None => { None => {
let runner = cli.create_runner(&cli.run)?; let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|config| async move { runner.run_node_until_exit(|config| async move {
service::new_full(config, cli.consensus).map_err(sc_cli::Error::Service) match config.network.network_backend {
sc_network::config::NetworkBackendType::Libp2p =>
service::new_full::<sc_network::NetworkWorker<_, _>>(config, cli.consensus)
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => service::new_full::<
sc_network::Litep2pNetworkBackend,
>(config, cli.consensus)
.map_err(sc_cli::Error::Service),
}
}) })
}, },
} }
+15 -3
View File
@@ -22,6 +22,7 @@ use sc_executor::WasmExecutor;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker}; use sc_telemetry::{Telemetry, TelemetryWorker};
use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc; use std::sync::Arc;
use crate::cli::Consensus; use crate::cli::Consensus;
@@ -104,7 +105,10 @@ pub fn new_partial(config: &Configuration) -> Result<Service, ServiceError> {
} }
/// Builds a new service for a full client. /// Builds a new service for a full client.
pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManager, ServiceError> { pub fn new_full<Network: sc_network::NetworkBackend<Block, <Block as BlockT>::Hash>>(
config: Configuration,
consensus: Consensus,
) -> Result<TaskManager, ServiceError> {
let sc_service::PartialComponents { let sc_service::PartialComponents {
client, client,
backend, backend,
@@ -116,7 +120,14 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
other: mut telemetry, other: mut telemetry,
} = new_partial(&config)?; } = new_partial(&config)?;
let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); let net_config = sc_network::config::FullNetworkConfiguration::<
Block,
<Block as BlockT>::Hash,
Network,
>::new(&config.network);
let metrics = Network::register_notification_metrics(
config.prometheus_config.as_ref().map(|cfg| &cfg.registry),
);
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams { sc_service::build_network(sc_service::BuildNetworkParams {
@@ -129,6 +140,7 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
block_announce_validator_builder: None, block_announce_validator_builder: None,
warp_sync_params: None, warp_sync_params: None,
block_relay: None, block_relay: None,
metrics,
})?; })?;
if config.offchain_worker.enabled { if config.offchain_worker.enabled {
@@ -143,7 +155,7 @@ pub fn new_full(config: Configuration, consensus: Consensus) -> Result<TaskManag
transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool: Some(OffchainTransactionPoolFactory::new(
transaction_pool.clone(), transaction_pool.clone(),
)), )),
network_provider: network.clone(), network_provider: Arc::new(network.clone()),
enable_http_requests: true, enable_http_requests: true,
custom_extensions: |_| vec![], custom_extensions: |_| vec![],
}) })
+3 -3
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "pallet-minimal-template" name = "pallet-minimal-template"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.9.0)" description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.11.0)"
version = "0.1.0" version = "0.1.0"
license = "MIT-0" license = "MIT-0"
authors.workspace = true authors.workspace = true
@@ -19,10 +19,10 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive", "derive",
], default-features = false } ], default-features = false }
scale-info = { version = "2.10.0", default-features = false, features = [ scale-info = { version = "2.11.1", default-features = false, features = [
"derive", "derive",
] } ] }
frame = { version = "0.1.1", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] } frame = { version = "0.2.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
[features] [features]
+12 -10
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "minimal-template-runtime" name = "minimal-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" version = "0.1.0"
license = "MIT-0" license = "MIT-0"
authors.workspace = true authors.workspace = true
@@ -17,23 +17,24 @@ parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false } scale-info = { version = "2.6.0", default-features = false }
# this is a frame-based runtime, thus importing `frame` with runtime feature enabled. # this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
frame = { version = "0.1.1", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] } frame = { version = "0.2.0", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }
# pallets that we want to use # pallets that we want to use
pallet-balances = { version = "31.0.0", default-features = false } pallet-balances = { version = "34.0.0", default-features = false }
pallet-sudo = { version = "31.0.0", default-features = false } pallet-sudo = { version = "33.0.0", default-features = false }
pallet-timestamp = { version = "30.0.0", default-features = false } pallet-timestamp = { version = "32.0.0", default-features = false }
pallet-transaction-payment = { version = "31.0.0", default-features = false } pallet-transaction-payment = { version = "33.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false } pallet-transaction-payment-rpc-runtime-api = { version = "33.0.0", default-features = false }
# genesis builder that allows us to interacto with runtime genesis config # genesis builder that allows us to interact with runtime genesis config
sp-genesis-builder = { version = "0.10.0", default-features = false } sp-genesis-builder = { version = "0.12.0", default-features = false }
sp-runtime = { version = "36.0.0", default-features = false, features = ["serde"] }
# local pallet templates # local pallet templates
pallet-minimal-template = { path = "../pallets/template", default-features = false, version = "0.1.0" } pallet-minimal-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }
[build-dependencies] [build-dependencies]
substrate-wasm-builder = { version = "20.0.0", optional = true } substrate-wasm-builder = { version = "22.0.0", optional = true }
[features] [features]
default = ["std"] default = ["std"]
@@ -52,5 +53,6 @@ std = [
"pallet-minimal-template/std", "pallet-minimal-template/std",
"sp-genesis-builder/std", "sp-genesis-builder/std",
"sp-runtime/std",
"substrate-wasm-builder", "substrate-wasm-builder",
] ]
+1 -5
View File
@@ -18,10 +18,6 @@
fn main() { fn main() {
#[cfg(feature = "std")] #[cfg(feature = "std")]
{ {
substrate_wasm_builder::WasmBuilder::new() substrate_wasm_builder::WasmBuilder::build_using_defaults();
.with_current_project()
.export_heap_base()
.import_memory()
.build();
} }
} }
+15 -11
View File
@@ -23,7 +23,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
use frame::{ use frame::{
deps::frame_support::{ deps::frame_support::{
genesis_builder_helper::{build_config, create_default_config}, genesis_builder_helper::{build_state, get_preset},
weights::{FixedFee, NoFee}, weights::{FixedFee, NoFee},
}, },
prelude::*, prelude::*,
@@ -83,7 +83,7 @@ parameter_types! {
pub const Version: RuntimeVersion = VERSION; pub const Version: RuntimeVersion = VERSION;
} }
#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)] #[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
impl frame_system::Config for Runtime { impl frame_system::Config for Runtime {
type Block = Block; type Block = Block;
type Version = Version; type Version = Version;
@@ -91,20 +91,20 @@ impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<<Runtime as pallet_balances::Config>::Balance>; type AccountData = pallet_balances::AccountData<<Runtime as pallet_balances::Config>::Balance>;
} }
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
impl pallet_balances::Config for Runtime { impl pallet_balances::Config for Runtime {
type AccountStore = System; type AccountStore = System;
} }
#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig as pallet_sudo::DefaultConfig)] #[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig)]
impl pallet_sudo::Config for Runtime {} impl pallet_sudo::Config for Runtime {}
#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig as pallet_timestamp::DefaultConfig)] #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)]
impl pallet_timestamp::Config for Runtime {} impl pallet_timestamp::Config for Runtime {}
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig as pallet_transaction_payment::DefaultConfig)] #[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)]
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>; type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter<Balances, ()>;
type WeightToFee = NoFee<<Self as pallet_balances::Config>::Balance>; type WeightToFee = NoFee<<Self as pallet_balances::Config>::Balance>;
type LengthToFee = FixedFee<1, <Self as pallet_balances::Config>::Balance>; type LengthToFee = FixedFee<1, <Self as pallet_balances::Config>::Balance>;
} }
@@ -221,12 +221,16 @@ impl_runtime_apis! {
} }
impl sp_genesis_builder::GenesisBuilder<Block> for Runtime { impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn create_default_config() -> Vec<u8> { fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
create_default_config::<RuntimeGenesisConfig>() build_state::<RuntimeGenesisConfig>(config)
} }
fn build_config(config: Vec<u8>) -> sp_genesis_builder::Result { fn get_preset(id: &Option<sp_genesis_builder::PresetId>) -> Option<Vec<u8>> {
build_config::<RuntimeGenesisConfig>(config) get_preset::<RuntimeGenesisConfig>(id, |_| None)
}
fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
vec![]
} }
} }
} }