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

fatxpool: size limits implemented #6262

Merged
merged 14 commits into from
Nov 11, 2024
Merged

Conversation

michalkucharczyk
Copy link
Contributor

@michalkucharczyk michalkucharczyk commented Oct 28, 2024

This PR adds size-limits to the fork-aware transaction pool.

Review Notes

  • Existing TrackedMap is used in internal mempool to track the size of extrinsics:

    /// Map with size tracking.
    ///
    /// Size reported might be slightly off and only approximately true.
    #[derive(Debug)]
    pub struct TrackedMap<K, V> {
    index: Arc<RwLock<HashMap<K, V>>>,
    bytes: AtomicIsize,
    length: AtomicIsize,
    }

  • In this PR, I also removed the logic that kept transactions in the tx_mem_pool if they were immediately dropped by the views. Initially, I implemented this as an improvement: if there was available space in the mempool and all views dropped the transaction upon submission, the transaction would still be retained in the mempool.

    However, upon further consideration, I decided to remove this functionality to reduce unnecessary complexity. Now, when all views drop a transaction during submission, it is automatically rejected, with the submit/submit_and_watch call returning ImmediatelyDropped.

Closes: #5476

@michalkucharczyk michalkucharczyk added R0-silent Changes should not be mentioned in any release notes T0-node This PR/Issue is related to the topic “node”. labels Oct 29, 2024
Copy link
Contributor

@skunert skunert left a comment

Choose a reason for hiding this comment

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

I like the removal of the initial_views, I think the scenario was relatively niche 👍

Co-authored-by: Sebastian Kunert <[email protected]>
@michalkucharczyk michalkucharczyk added this pull request to the merge queue Nov 11, 2024
Merged via the queue into master with commit ace62f1 Nov 11, 2024
195 of 199 checks passed
@michalkucharczyk michalkucharczyk deleted the mku-fatxpool-size-limits branch November 11, 2024 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fatxpool: size limits shall be obeyed
3 participants