Increase transaction pool default limits (#4792)

* increase limits, improve logging

* format in kB
This commit is contained in:
Nikolay Volf
2020-02-01 00:27:53 -08:00
committed by GitHub
parent adde404e41
commit 63ad759c69
3 changed files with 14 additions and 5 deletions
@@ -251,10 +251,11 @@ impl<Block, B, E, RA, A> ProposerInner<Block, SubstrateClient<B, E, Block, RA>,
let (block, storage_changes, proof) = block_builder.build()?.into_inner();
info!("Prepared block for proposing at {} [hash: {:?}; parent_hash: {}; extrinsics: [{}]]",
info!("Prepared block for proposing at {} [hash: {:?}; parent_hash: {}; extrinsics ({}): [{}]]",
block.header().number(),
<Block as BlockT>::Hash::from(block.header().hash()),
block.header().parent_hash(),
block.extrinsics().len(),
block.extrinsics()
.iter()
.map(|xt| format!("{}", BlakeTwo256::hash_of(xt)))
+2 -2
View File
@@ -300,10 +300,10 @@ pub struct NodeKeyParams {
#[derive(Debug, StructOpt, Clone)]
pub struct TransactionPoolParams {
/// Maximum number of transactions in the transaction pool.
#[structopt(long = "pool-limit", value_name = "COUNT", default_value = "512")]
#[structopt(long = "pool-limit", value_name = "COUNT", default_value = "8192")]
pub pool_limit: usize,
/// Maximum number of kilobytes of all transactions stored in the pool.
#[structopt(long = "pool-kbytes", value_name = "COUNT", default_value = "10240")]
#[structopt(long = "pool-kbytes", value_name = "COUNT", default_value = "20480")]
pub pool_kbytes: usize,
}
@@ -150,9 +150,16 @@ impl<B: ChainApi> ValidatedPool<B> {
let future_limit = &self.options.future;
debug!(target: "txpool", "Pool Status: {:?}", status);
if ready_limit.is_exceeded(status.ready, status.ready_bytes)
|| future_limit.is_exceeded(status.future, status.future_bytes) {
|| future_limit.is_exceeded(status.future, status.future_bytes)
{
debug!(
target: "txpool",
"Enforcing limits ({}/{}kB ready, {}/{}kB future",
ready_limit.count, ready_limit.total_bytes / 1024,
future_limit.count, future_limit.total_bytes / 1024,
);
// clean up the pool
let removed = {
let mut pool = self.pool.write();
@@ -163,6 +170,7 @@ impl<B: ChainApi> ValidatedPool<B> {
removed
};
// run notifications
debug!(target: "txpool", "Enforcing limits: {} dropped", removed.len());
let mut listener = self.listener.write();
for h in &removed {
listener.dropped(h, None);