From 7eeb64bd9e5e9780296b64a94732bff476f2db37 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 10 Jul 2024 11:03:47 +0200 Subject: [PATCH] feat: future pool increase option --- .baedeker/forkless-data.jsonnet | 3 +++ .baedeker/node-only.jsonnet | 3 +++ .baedeker/xcm-opal-async-backing.jsonnet | 3 +++ .baedeker/xcm-opal.jsonnet | 3 +++ .baedeker/xcm-quartz.jsonnet | 3 +++ .baedeker/xcm-unique.jsonnet | 3 +++ .github/workflows/node-only-update.yml | 3 ++- node/cli/src/cli.rs | 9 +++++++++ node/cli/src/command.rs | 6 +++++- 9 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.baedeker/forkless-data.jsonnet b/.baedeker/forkless-data.jsonnet index 288eae9ebc..68059e5c81 100644 --- a/.baedeker/forkless-data.jsonnet +++ b/.baedeker/forkless-data.jsonnet @@ -54,6 +54,9 @@ local unique = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob'] }, diff --git a/.baedeker/node-only.jsonnet b/.baedeker/node-only.jsonnet index 797ce99827..dce3a85cd3 100644 --- a/.baedeker/node-only.jsonnet +++ b/.baedeker/node-only.jsonnet @@ -30,6 +30,9 @@ local unique = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob'] }, diff --git a/.baedeker/xcm-opal-async-backing.jsonnet b/.baedeker/xcm-opal-async-backing.jsonnet index 41748e44e2..3887267a3a 100644 --- a/.baedeker/xcm-opal-async-backing.jsonnet +++ b/.baedeker/xcm-opal-async-backing.jsonnet @@ -55,6 +55,9 @@ local opal = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob', 'charlie', 'dave', 'eve'] }, diff --git a/.baedeker/xcm-opal.jsonnet b/.baedeker/xcm-opal.jsonnet index e70e9c89fa..2d5be2992a 100644 --- a/.baedeker/xcm-opal.jsonnet +++ b/.baedeker/xcm-opal.jsonnet @@ -35,6 +35,9 @@ local opal = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob'] }, diff --git a/.baedeker/xcm-quartz.jsonnet b/.baedeker/xcm-quartz.jsonnet index 68312dc538..173c6c4c31 100644 --- a/.baedeker/xcm-quartz.jsonnet +++ b/.baedeker/xcm-quartz.jsonnet @@ -40,6 +40,9 @@ local quartz = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob'] }, diff --git a/.baedeker/xcm-unique.jsonnet b/.baedeker/xcm-unique.jsonnet index 06d8ec7903..603bbd7724 100644 --- a/.baedeker/xcm-unique.jsonnet +++ b/.baedeker/xcm-unique.jsonnet @@ -41,6 +41,9 @@ local unique = { [name]: { bin: $.bin, wantedKeys: 'para', + extraArgs: [ + '--increase-future-pool', + ], }, for name in ['alice', 'bob'] }, diff --git a/.github/workflows/node-only-update.yml b/.github/workflows/node-only-update.yml index 5de584fdbd..c1df29db8d 100644 --- a/.github/workflows/node-only-update.yml +++ b/.github/workflows/node-only-update.yml @@ -161,7 +161,8 @@ jobs: 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 diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 7a18c8e4e9..9a35e7f58c 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -106,6 +106,15 @@ pub struct Cli { #[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, diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 432fe62d08..674e24b684 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -458,7 +458,7 @@ pub fn run() -> Result<()> { 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 @@ pub fn run() -> Result<()> { } 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);