Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increase future pool #1082

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .baedeker/forkless-data.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ local unique = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob']
},
Expand Down
3 changes: 3 additions & 0 deletions .baedeker/node-only.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ local unique = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob']
},
Expand Down
3 changes: 3 additions & 0 deletions .baedeker/xcm-opal-async-backing.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ local opal = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
Expand Down
3 changes: 3 additions & 0 deletions .baedeker/xcm-opal.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ local opal = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob']
},
Expand Down
3 changes: 3 additions & 0 deletions .baedeker/xcm-quartz.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ local quartz = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob']
},
Expand Down
3 changes: 3 additions & 0 deletions .baedeker/xcm-unique.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ local unique = {
[name]: {
bin: $.bin,
wantedKeys: 'para',
extraArgs: [
'--increase-future-pool',
],
},
for name in ['alice', 'bob']
},
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/node-only-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BuddyGlas такой extra_node_mixin нужно прописать всем старым нодам unique у нас в CI


- name: Run Parallel tests before Node Parachain upgrade
working-directory: ${{ matrix.mainnet_branch }}/tests
Expand Down
9 changes: 9 additions & 0 deletions node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
Expand Down
6 changes: 5 additions & 1 deletion node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down
Loading