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
before · .baedeker/xcm-opal.jsonnet
1local2m = import 'baedeker-library/mixin/spec.libsonnet',3;45function(relay_spec)67local relay = {8	name: 'relay',9	bin: 'bin/polkadot',10	validatorIdAssignment: 'staking',11	spec: {Genesis:{12		chain: relay_spec,13		modify:: m.genericRelay($, hrmp = [14			// [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],15			// [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],16		]),17	}},18	nodes: {19		[name]: {20			bin: $.bin,21			wantedKeys: 'relay',22		},23		for name in ['alice', 'bob', 'charlie', 'dave', 'eve']24	},25};2627local opal = {28	name: 'opal',29	bin: 'bin/unique',30	paraId: 1001,31	spec: {Genesis:{32		modify:: m.genericPara($),33	}},34	nodes: {35		[name]: {36			bin: $.bin,37			wantedKeys: 'para',38		},39		for name in ['alice', 'bob']40	},41};4243local westmint = {44	name: 'westmint',45	bin: 'bin/cumulus',46	paraId: 1002,47	spec: {Genesis:{48		chain: 'westmint-local',49		modify:: m.genericPara($),50	}},51	nodes: {52		[name]: {53			bin: $.bin,54			wantedKeys: 'para',55		},56		for name in ['alice', 'bob']57	},58};5960relay + {61	parachains: {62		[para.name]: para,63		for para in [opal, westmint]64	},65}
after · .baedeker/xcm-opal.jsonnet
1local2m = import 'baedeker-library/mixin/spec.libsonnet',3;45function(relay_spec)67local relay = {8	name: 'relay',9	bin: 'bin/polkadot',10	validatorIdAssignment: 'staking',11	spec: {Genesis:{12		chain: relay_spec,13		modify:: m.genericRelay($, hrmp = [14			// [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],15			// [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],16		]),17	}},18	nodes: {19		[name]: {20			bin: $.bin,21			wantedKeys: 'relay',22		},23		for name in ['alice', 'bob', 'charlie', 'dave', 'eve']24	},25};2627local opal = {28	name: 'opal',29	bin: 'bin/unique',30	paraId: 1001,31	spec: {Genesis:{32		modify:: m.genericPara($),33	}},34	nodes: {35		[name]: {36			bin: $.bin,37			wantedKeys: 'para',38			extraArgs: [39				'--increase-future-pool',40			],41		},42		for name in ['alice', 'bob']43	},44};4546local westmint = {47	name: 'westmint',48	bin: 'bin/cumulus',49	paraId: 1002,50	spec: {Genesis:{51		chain: 'westmint-local',52		modify:: m.genericPara($),53	}},54	nodes: {55		[name]: {56			bin: $.bin,57			wantedKeys: 'para',58		},59		for name in ['alice', 'bob']60	},61};6263relay + {64	parachains: {65		[para.name]: para,66		for para in [opal, westmint]67	},68}
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
--- a/node/cli/src/cli.rs
+++ b/node/cli/src/cli.rs
@@ -106,6 +106,15 @@
 	#[clap(long)]
 	pub no_hardware_benchmarks: bool,
 
+	/// Make future pool the same size as the ready pool.
+	///
+	/// By default, future pool is factor 10 smaler than the ready pool, which causes transactions to be dropped as they
+	/// are retracted, without the ability to move them back to the ready pool after revalidation.
+	///
+	/// This switch makes that transactions still can be dropped, but only when there is more transactions than the pool
+	/// size configured with `--pool-limit` (amount of txes), `--pool-kbytes` (size of all txes in kbytes).
+	pub increase_future_pool: bool,
+
 	/// Relaychain arguments
 	#[structopt(raw = true)]
 	pub relaychain_args: Vec<String>,
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);