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
after · .baedeker/xcm-unique.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				// ['unique', 'acala'],17				// ['unique', 'moonbeam'],18				// ['unique', 'statemint'],19				// ['unique', 'astar'],20				// ['unique', 'polkadex'],21			// ]22		])),23	}},24	nodes: {25		[name]: {26			bin: $.bin,27			wantedKeys: 'relay',28		},29		for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie', 'gregory', 'holly']30	},31};3233local unique = {34	name: 'unique',35	bin: 'bin/unique',36	paraId: 1001,37	spec: {Genesis:{38		modify:: m.genericPara($),39	}},40	nodes: {41		[name]: {42			bin: $.bin,43			wantedKeys: 'para',44			extraArgs: [45				'--increase-future-pool',46			],47		},48		for name in ['alice', 'bob']49	},50};5152local acala = {53	name: 'acala',54	bin: 'bin/acala',55	paraId: 1002,56	spec: {Genesis:{57		chain: 'acala-dev',58		modify:: bdk.mixer([59			m.genericPara($),60			function(prev) prev {id+: '-local'},61		]),62	}},63	nodes: {64		[name]: {65			bin: $.bin,66			wantedKeys: 'para',67		},68		for name in ['alice', 'bob']69	},70};7172local moonbeam = {73	name: 'moonbeam',74	bin: 'bin/moonbeam',75	signatureSchema: 'Ethereum',76	paraId: 1003,77	spec: {Genesis:{78		chain: 'moonbeam-local',79		specFilePrefix: 'moonbeam-local-',80		modify:: m.genericPara($),81	}},82	nodes: {83		[name]: {84			bin: $.bin,85			wantedKeys: 'para-nimbus',86		},87		for name in ['alith', 'baltathar']88	},89};9091local statemint = {92	name: 'statemint',93	bin: 'bin/cumulus',94	paraId: 1004,95	spec: {Genesis:{96		chain: 'statemint-local',97		modify:: m.genericPara($),98	}},99	nodes: {100		[name]: {101			bin: $.bin,102			wantedKeys: 'para-ed',103		},104		for name in ['alice', 'bob']105	},106};107108local astar = {109	name: 'astar',110	bin: 'bin/astar',111	paraId: 1005,112	spec: {Genesis:{113		chain: 'astar-dev',114		modify:: m.genericPara($),115	}},116	nodes: {117		[name]: {118			bin: $.bin,119			wantedKeys: 'para',120		},121		for name in ['alice', 'bob']122	},123};124125local polkadex = {126	name: 'polkadex',127	bin: 'bin/polkadex',128	paraId: 1006,129	spec: {Genesis:{130		chain: 'mainnet',131		modify:: m.genericPara($),132	}},133	nodes: {134		[name]: {135			bin: $.bin,136			wantedKeys: 'para',137		},138		for name in ['alice', 'bob']139	},140};141142local hydraDx = {143	name: 'hydraDx',144	bin: 'bin/hydradx',145	paraId: 1007,146	spec: {Genesis:{147		chain: 'local',148		modify:: m.genericPara($),149	}},150	nodes: {151		[name]: {152			bin: $.bin,153			wantedKeys: 'para',154			legacyRpc: true,155		},156		for name in ['alice', 'bob']157	},158};159160161relay + {162	parachains: {163		[para.name]: para,164		for para in [unique, acala, moonbeam, statemint, astar, polkadex, hydraDx]165	},166}
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);