git.delta.rocks / unique-network / refs/commits / 7eeb64bd9e5e

difftreelog

feat future pool increase option

Yaroslav Bolyukin2024-07-10parent: #0ceea0a.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
before · .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		},45		for name in ['alice', 'bob']46	},47};4849local acala = {50	name: 'acala',51	bin: 'bin/acala',52	paraId: 1002,53	spec: {Genesis:{54		chain: 'acala-dev',55		modify:: bdk.mixer([56			m.genericPara($),57			function(prev) prev {id+: '-local'},58		]),59	}},60	nodes: {61		[name]: {62			bin: $.bin,63			wantedKeys: 'para',64		},65		for name in ['alice', 'bob']66	},67};6869local moonbeam = {70	name: 'moonbeam',71	bin: 'bin/moonbeam',72	signatureSchema: 'Ethereum',73	paraId: 1003,74	spec: {Genesis:{75		chain: 'moonbeam-local',76		specFilePrefix: 'moonbeam-local-',77		modify:: m.genericPara($),78	}},79	nodes: {80		[name]: {81			bin: $.bin,82			wantedKeys: 'para-nimbus',83		},84		for name in ['alith', 'baltathar']85	},86};8788local statemint = {89	name: 'statemint',90	bin: 'bin/cumulus',91	paraId: 1004,92	spec: {Genesis:{93		chain: 'statemint-local',94		modify:: m.genericPara($),95	}},96	nodes: {97		[name]: {98			bin: $.bin,99			wantedKeys: 'para-ed',100		},101		for name in ['alice', 'bob']102	},103};104105local astar = {106	name: 'astar',107	bin: 'bin/astar',108	paraId: 1005,109	spec: {Genesis:{110		chain: 'astar-dev',111		modify:: m.genericPara($),112	}},113	nodes: {114		[name]: {115			bin: $.bin,116			wantedKeys: 'para',117		},118		for name in ['alice', 'bob']119	},120};121122local polkadex = {123	name: 'polkadex',124	bin: 'bin/polkadex',125	paraId: 1006,126	spec: {Genesis:{127		chain: 'mainnet',128		modify:: m.genericPara($),129	}},130	nodes: {131		[name]: {132			bin: $.bin,133			wantedKeys: 'para',134		},135		for name in ['alice', 'bob']136	},137};138139local hydraDx = {140	name: 'hydraDx',141	bin: 'bin/hydradx',142	paraId: 1007,143	spec: {Genesis:{144		chain: 'local',145		modify:: m.genericPara($),146	}},147	nodes: {148		[name]: {149			bin: $.bin,150			wantedKeys: 'para',151			legacyRpc: true,152		},153		for name in ['alice', 'bob']154	},155};156157158relay + {159	parachains: {160		[para.name]: para,161		for para in [unique, acala, moonbeam, statemint, astar, polkadex, hydraDx]162	},163}
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);