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
before · .baedeker/xcm-quartz.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 = std.join([], [14			// [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],15			// for [a, b] in [16			// 	['quartz', 'karura'],17			// 	['quartz', 'moonriver'],18			// 	['quartz', 'statemine'],19			// 	['quartz', 'shiden'],20			// ]21		])),22	}},23	nodes: {24		[name]: {25			bin: $.bin,26			wantedKeys: 'relay',27		},28		for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie']29	},30};3132local quartz = {33	name: 'quartz',34	bin: 'bin/unique',35	paraId: 1001,36	spec: {Genesis:{37		modify:: m.genericPara($),38	}},39	nodes: {40		[name]: {41			bin: $.bin,42			wantedKeys: 'para',43		},44		for name in ['alice', 'bob']45	},46};4748local karura = {49	name: 'karura',50	bin: 'bin/acala',51	paraId: 1002,52	spec: {Genesis:{53		chain: 'karura-dev',54		modify:: bdk.mixer([55			m.genericPara($),56			function(prev) prev {id+: '-local'},57		]),58	}},59	nodes: {60		[name]: {61			bin: $.bin,62			wantedKeys: 'para',63		},64		for name in ['alice', 'bob']65	},66};6768local moonriver = {69	name: 'moonriver',70	bin: 'bin/moonbeam',71	signatureSchema: 'Ethereum',72	paraId: 1003,73	spec: {Genesis:{74		chain: 'moonriver-local',75		specFilePrefix: 'moonriver-local-',76		modify:: m.genericPara($),77	}},78	nodes: {79		[name]: {80			bin: $.bin,81			wantedKeys: 'para-nimbus',82		},83		for name in ['alith', 'baltathar']84	},85};8687local statemine = {88	name: 'statemine',89	bin: 'bin/cumulus',90	paraId: 1004,91	spec: {Genesis:{92		chain: 'statemine-local',93		modify:: m.genericPara($),94	}},95	nodes: {96		[name]: {97			bin: $.bin,98			wantedKeys: 'para',99		},100		for name in ['alice', 'bob']101	},102};103104local shiden = {105	name: 'shiden',106	bin: 'bin/astar',107	paraId: 1005,108	spec: {Genesis:{109		chain: 'shiden-dev',110		modify:: m.genericPara($),111	}},112	nodes: {113		[name]: {114			bin: $.bin,115			wantedKeys: 'para',116		},117		for name in ['alice', 'bob']118	},119};120121relay + {122	parachains: {123		[para.name]: para,124		for para in [quartz, karura, moonriver, statemine, shiden]125	},126}
after · .baedeker/xcm-quartz.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 = std.join([], [14			// [[$.parachains[a].paraId, $.parachains[b].paraId, 8, 512], [$.parachains[b].paraId, $.parachains[a].paraId, 8, 512]],15			// for [a, b] in [16			// 	['quartz', 'karura'],17			// 	['quartz', 'moonriver'],18			// 	['quartz', 'statemine'],19			// 	['quartz', 'shiden'],20			// ]21		])),22	}},23	nodes: {24		[name]: {25			bin: $.bin,26			wantedKeys: 'relay',27		},28		for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie']29	},30};3132local quartz = {33	name: 'quartz',34	bin: 'bin/unique',35	paraId: 1001,36	spec: {Genesis:{37		modify:: m.genericPara($),38	}},39	nodes: {40		[name]: {41			bin: $.bin,42			wantedKeys: 'para',43			extraArgs: [44				'--increase-future-pool',45			],46		},47		for name in ['alice', 'bob']48	},49};5051local karura = {52	name: 'karura',53	bin: 'bin/acala',54	paraId: 1002,55	spec: {Genesis:{56		chain: 'karura-dev',57		modify:: bdk.mixer([58			m.genericPara($),59			function(prev) prev {id+: '-local'},60		]),61	}},62	nodes: {63		[name]: {64			bin: $.bin,65			wantedKeys: 'para',66		},67		for name in ['alice', 'bob']68	},69};7071local moonriver = {72	name: 'moonriver',73	bin: 'bin/moonbeam',74	signatureSchema: 'Ethereum',75	paraId: 1003,76	spec: {Genesis:{77		chain: 'moonriver-local',78		specFilePrefix: 'moonriver-local-',79		modify:: m.genericPara($),80	}},81	nodes: {82		[name]: {83			bin: $.bin,84			wantedKeys: 'para-nimbus',85		},86		for name in ['alith', 'baltathar']87	},88};8990local statemine = {91	name: 'statemine',92	bin: 'bin/cumulus',93	paraId: 1004,94	spec: {Genesis:{95		chain: 'statemine-local',96		modify:: m.genericPara($),97	}},98	nodes: {99		[name]: {100			bin: $.bin,101			wantedKeys: 'para',102		},103		for name in ['alice', 'bob']104	},105};106107local shiden = {108	name: 'shiden',109	bin: 'bin/astar',110	paraId: 1005,111	spec: {Genesis:{112		chain: 'shiden-dev',113		modify:: m.genericPara($),114	}},115	nodes: {116		[name]: {117			bin: $.bin,118			wantedKeys: 'para',119		},120		for name in ['alice', 'bob']121	},122};123124relay + {125	parachains: {126		[para.name]: para,127		for para in [quartz, karura, moonriver, statemine, shiden]128	},129}
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);