-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Time-based transaction banning #594
Conversation
polkadot/transaction-pool/src/lib.rs
Outdated
|
||
/// Removes timed bans. | ||
pub fn clear_timeouts(&self, now: &Instant) { | ||
let to_remove = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in {}s?
|
||
/// Removes timed bans. | ||
pub fn clear_timeouts(&self, now: &Instant) { | ||
let to_remove = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the {}s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were collecting the keys to remove using only the .read()
lock. I changed the code though to acquire the lock only once.
fn rotator() -> PoolRotator { | ||
PoolRotator { | ||
ban_time: Duration::from_millis(10), | ||
..Default::default() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated and fixed the borked merged (that resulted in duplicated code).
|
||
/// Removes timed bans. | ||
pub fn clear_timeouts(&self, now: &Instant) { | ||
let to_remove = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were collecting the keys to remove using only the .read()
lock. I changed the code though to acquire the lock only once.
* Allow replacing transactions. * Clear old transactions and ban them temporarily. * Move to a separate module and add some tests. * Add bound to banned transactions. * Remove unnecessary block and double PoolRotator.
…and-rlpcodec * master: Contract signatures checking (#478) extrinsic-pool: use retain() (#613) rename Polkadot to Substrate in the license header via following four commands (#614) typo fixes (#608) RPC: Block number to block hash (#584) Minor fixes for nightly 2018-08-18 (#600) Time-based transaction banning (#594) (#602) cargo --force to allow CI to build. (#599) Fix logging (#587) Fix runtime version cache (#586)
* Fix xaccounts test build error * Modified xasset module mock * Update test * xassets module test ok * Update substrate
If the pool occupies the queue for more than 5 minutes: