git.delta.rocks / unique-network / refs/commits / 106cacb2e930

difftreelog

Merge pull request #1082 from UniqueNetwork/feature/increase-future-pool

Yaroslav Bolyukin2024-07-10parents: #0ceea0a #7eeb64b.patch.diff
in: master

9 files changed

modified.baedeker/forkless-data.jsonnetdiffbeforeafterboth
--- a/.baedeker/forkless-data.jsonnet
+++ b/.baedeker/forkless-data.jsonnet
@@ -54,6 +54,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob']
 	},
modified.baedeker/node-only.jsonnetdiffbeforeafterboth
--- a/.baedeker/node-only.jsonnet
+++ b/.baedeker/node-only.jsonnet
@@ -30,6 +30,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob']
 	},
modified.baedeker/xcm-opal-async-backing.jsonnetdiffbeforeafterboth
--- a/.baedeker/xcm-opal-async-backing.jsonnet
+++ b/.baedeker/xcm-opal-async-backing.jsonnet
@@ -55,6 +55,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
 	},
modified.baedeker/xcm-opal.jsonnetdiffbeforeafterboth
--- a/.baedeker/xcm-opal.jsonnet
+++ b/.baedeker/xcm-opal.jsonnet
@@ -35,6 +35,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob']
 	},
modified.baedeker/xcm-quartz.jsonnetdiffbeforeafterboth
--- a/.baedeker/xcm-quartz.jsonnet
+++ b/.baedeker/xcm-quartz.jsonnet
@@ -40,6 +40,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob']
 	},
modified.baedeker/xcm-unique.jsonnetdiffbeforeafterboth
--- a/.baedeker/xcm-unique.jsonnet
+++ b/.baedeker/xcm-unique.jsonnet
@@ -41,6 +41,9 @@
 		[name]: {
 			bin: $.bin,
 			wantedKeys: 'para',
+			extraArgs: [
+				'--increase-future-pool',
+			],
 		},
 		for name in ['alice', 'bob']
 	},
modified.github/workflows/node-only-update.ymldiffbeforeafterboth
--- a/.github/workflows/node-only-update.yml
+++ b/.github/workflows/node-only-update.yml
@@ -161,7 +161,8 @@
           inputs: |
             .baedeker/node-only.jsonnet
             snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
-            ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
+            # extra_node_mixin due to mainnet unique node not supporting --increase-future-pool
+            ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []})
 
       - name: Run Parallel tests before Node Parachain upgrade
         working-directory: ${{ matrix.mainnet_branch }}/tests
modifiednode/cli/src/cli.rsdiffbeforeafterboth
before · node/cli/src/cli.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use std::path::PathBuf;1819use clap::Parser;2021use crate::chain_spec;2223/// Sub-commands supported by the collator.24#[derive(Debug, Parser)]25pub enum Subcommand {26	/// Export the genesis state of the parachain.27	ExportGenesisState(cumulus_client_cli::ExportGenesisHeadCommand),2829	/// Export the genesis wasm of the parachain.30	ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),3132	/// Keys manipulation subcommand33	#[clap(subcommand)]34	Key(sc_cli::KeySubcommand),3536	/// Build a chain specification.37	BuildSpec(sc_cli::BuildSpecCmd),3839	/// Validate blocks.40	CheckBlock(sc_cli::CheckBlockCmd),4142	/// Export blocks.43	ExportBlocks(sc_cli::ExportBlocksCmd),4445	/// Export the state of a given block into a chain spec.46	ExportState(sc_cli::ExportStateCmd),4748	/// Import blocks.49	ImportBlocks(sc_cli::ImportBlocksCmd),5051	/// Remove the whole chain.52	PurgeChain(cumulus_client_cli::PurgeChainCmd),5354	/// Revert the chain to a previous state.55	Revert(sc_cli::RevertCmd),5657	/// The custom benchmark subcommmand benchmarking runtime pallets.58	#[clap(subcommand)]59	#[cfg(feature = "runtime-benchmarks")]60	Benchmark(frame_benchmarking_cli::BenchmarkCmd),6162	/// Try runtime63	#[cfg(feature = "try-runtime")]64	TryRuntime(try_runtime_cli::TryRuntimeCmd),6566	/// Try runtime. Note: `try-runtime` feature must be enabled.67	#[cfg(not(feature = "try-runtime"))]68	TryRuntime,69}7071#[derive(Debug, Parser)]72#[clap(args_conflicts_with_subcommands = true, subcommand_negates_reqs = true)]73pub struct Cli {74	#[structopt(subcommand)]75	pub subcommand: Option<Subcommand>,7677	#[structopt(flatten)]78	pub run: cumulus_client_cli::RunCmd,7980	/// When running the node in the `--dev` mode and81	/// there is no transaction in the transaction pool,82	/// an empty block will be sealed automatically83	/// after the `--idle-autoseal-interval` milliseconds.84	///85	/// The default interval is 500 milliseconds.86	#[structopt(default_value = "500", long)]87	pub idle_autoseal_interval: u64,8889	/// Disable auto-sealing blocks on new transactions in the `--dev` mode.90	#[structopt(long)]91	pub disable_autoseal_on_tx: bool,9293	/// Finalization delay (in seconds) of auto-sealed blocks in the `--dev` mode.94	///95	/// Disabled by default.96	#[structopt(long)]97	pub autoseal_finalization_delay: Option<u64>,9899	/// Disable automatic hardware benchmarks.100	///101	/// By default these benchmarks are automatically ran at startup and measure102	/// the CPU speed, the memory bandwidth and the disk speed.103	///104	/// The results are then printed out in the logs, and also sent as part of105	/// telemetry, if telemetry is enabled.106	#[clap(long)]107	pub no_hardware_benchmarks: bool,108109	/// Relaychain arguments110	#[structopt(raw = true)]111	pub relaychain_args: Vec<String>,112}113114impl Cli {115	pub fn node_name() -> String {116		"Unique".into()117	}118}119120#[derive(Debug)]121pub struct RelayChainCli {122	/// The actual relay chain cli object.123	pub base: polkadot_cli::RunCmd,124125	/// Optional chain id that should be passed to the relay chain.126	pub chain_id: Option<String>,127128	/// The base path that should be used by the relay chain.129	pub base_path: PathBuf,130}131132impl RelayChainCli {133	/// Parse the relay chain CLI parameters using the para chain `Configuration`.134	pub fn new<'a>(135		para_config: &sc_service::Configuration,136		relay_chain_args: impl Iterator<Item = &'a String>,137	) -> Self {138		let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);139		let chain_id = extension.map(|e| e.relay_chain.clone());140		let base_path = para_config.base_path.path().join("polkadot");141		Self {142			base_path,143			chain_id,144			base: polkadot_cli::RunCmd::parse_from(relay_chain_args),145		}146	}147}
after · node/cli/src/cli.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use std::path::PathBuf;1819use clap::Parser;2021use crate::chain_spec;2223/// Sub-commands supported by the collator.24#[derive(Debug, Parser)]25pub enum Subcommand {26	/// Export the genesis state of the parachain.27	ExportGenesisState(cumulus_client_cli::ExportGenesisHeadCommand),2829	/// Export the genesis wasm of the parachain.30	ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),3132	/// Keys manipulation subcommand33	#[clap(subcommand)]34	Key(sc_cli::KeySubcommand),3536	/// Build a chain specification.37	BuildSpec(sc_cli::BuildSpecCmd),3839	/// Validate blocks.40	CheckBlock(sc_cli::CheckBlockCmd),4142	/// Export blocks.43	ExportBlocks(sc_cli::ExportBlocksCmd),4445	/// Export the state of a given block into a chain spec.46	ExportState(sc_cli::ExportStateCmd),4748	/// Import blocks.49	ImportBlocks(sc_cli::ImportBlocksCmd),5051	/// Remove the whole chain.52	PurgeChain(cumulus_client_cli::PurgeChainCmd),5354	/// Revert the chain to a previous state.55	Revert(sc_cli::RevertCmd),5657	/// The custom benchmark subcommmand benchmarking runtime pallets.58	#[clap(subcommand)]59	#[cfg(feature = "runtime-benchmarks")]60	Benchmark(frame_benchmarking_cli::BenchmarkCmd),6162	/// Try runtime63	#[cfg(feature = "try-runtime")]64	TryRuntime(try_runtime_cli::TryRuntimeCmd),6566	/// Try runtime. Note: `try-runtime` feature must be enabled.67	#[cfg(not(feature = "try-runtime"))]68	TryRuntime,69}7071#[derive(Debug, Parser)]72#[clap(args_conflicts_with_subcommands = true, subcommand_negates_reqs = true)]73pub struct Cli {74	#[structopt(subcommand)]75	pub subcommand: Option<Subcommand>,7677	#[structopt(flatten)]78	pub run: cumulus_client_cli::RunCmd,7980	/// When running the node in the `--dev` mode and81	/// there is no transaction in the transaction pool,82	/// an empty block will be sealed automatically83	/// after the `--idle-autoseal-interval` milliseconds.84	///85	/// The default interval is 500 milliseconds.86	#[structopt(default_value = "500", long)]87	pub idle_autoseal_interval: u64,8889	/// Disable auto-sealing blocks on new transactions in the `--dev` mode.90	#[structopt(long)]91	pub disable_autoseal_on_tx: bool,9293	/// Finalization delay (in seconds) of auto-sealed blocks in the `--dev` mode.94	///95	/// Disabled by default.96	#[structopt(long)]97	pub autoseal_finalization_delay: Option<u64>,9899	/// Disable automatic hardware benchmarks.100	///101	/// By default these benchmarks are automatically ran at startup and measure102	/// the CPU speed, the memory bandwidth and the disk speed.103	///104	/// The results are then printed out in the logs, and also sent as part of105	/// telemetry, if telemetry is enabled.106	#[clap(long)]107	pub no_hardware_benchmarks: bool,108109	/// Make future pool the same size as the ready pool.110	///111	/// By default, future pool is factor 10 smaler than the ready pool, which causes transactions to be dropped as they112	/// are retracted, without the ability to move them back to the ready pool after revalidation.113	///114	/// This switch makes that transactions still can be dropped, but only when there is more transactions than the pool115	/// size configured with `--pool-limit` (amount of txes), `--pool-kbytes` (size of all txes in kbytes).116	pub increase_future_pool: bool,117118	/// Relaychain arguments119	#[structopt(raw = true)]120	pub relaychain_args: Vec<String>,121}122123impl Cli {124	pub fn node_name() -> String {125		"Unique".into()126	}127}128129#[derive(Debug)]130pub struct RelayChainCli {131	/// The actual relay chain cli object.132	pub base: polkadot_cli::RunCmd,133134	/// Optional chain id that should be passed to the relay chain.135	pub chain_id: Option<String>,136137	/// The base path that should be used by the relay chain.138	pub base_path: PathBuf,139}140141impl RelayChainCli {142	/// Parse the relay chain CLI parameters using the para chain `Configuration`.143	pub fn new<'a>(144		para_config: &sc_service::Configuration,145		relay_chain_args: impl Iterator<Item = &'a String>,146	) -> Self {147		let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);148		let chain_id = extension.map(|e| e.relay_chain.clone());149		let base_path = para_config.base_path.path().join("polkadot");150		Self {151			base_path,152			chain_id,153			base: polkadot_cli::RunCmd::parse_from(relay_chain_args),154		}155	}156}
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -458,7 +458,7 @@
 			let runner = cli.create_runner(&cli.run.normalize())?;
 			let collator_options = cli.run.collator_options();
 
-			runner.run_node_until_exit(|config| async move {
+			runner.run_node_until_exit(|mut config| async move {
 				let hwbench = if !cli.no_hardware_benchmarks {
 					config.database.path().map(|database_path| {
 						let _ = std::fs::create_dir_all(database_path);
@@ -467,6 +467,10 @@
 				} else {
 					None
 				};
+				
+				if cli.increase_future_pool {
+					config.transaction_pool.future = config.transaction_pool.ready.clone();
+				}
 
 				let extensions = chain_spec::Extensions::try_get(&*config.chain_spec);