Skip to content

Conversation

@MatusKysel
Copy link
Contributor

Summary of Changes

  1. Unified Eviction Logic

    • Merged two separate transaction eviction loops into a single optimized loop.
    • Handles eviction based on:
      • Account inactivity (pool.config.Lifetime).
      • Transaction age (txEvictionAge, default 24 hours, configurable).
  2. Per-Account Nonce-Gap Limit

    • Introduced a limit (txMaxGapLimit = 32) on queued nonce-gap transactions per account.
    • Transactions exceeding this limit are automatically moved to the OverflowPool.
  3. OverflowPool Integration

    • Updated eviction logic to transfer evicted transactions into the OverflowPool rather than discarding them immediately.
    • Enhanced logging to clearly indicate transactions moved to or from the OverflowPool.
  4. Improved Transaction Reintroduction

    • Optimized logic for periodically transferring transactions from the OverflowPool back into the main pool, considering available slot capacity and transaction size.
  5. Metrics and Monitoring Updates

    • Adjusted metrics to accurately track transactions evicted due to lifetime expiration or nonce-gap limits.

Motivation

  • Efficiency: Streamlines transaction eviction and handling.
  • Robustness: Provides better protection against potential DoS scenarios.
  • Transaction Availability: Ensures better retention and reintroduction of transactions, reducing network overhead.
  • Maintainability: Clarifies and simplifies transaction pool logic, enhancing readability and ease of maintenance.

Review Notes

  • Validate combined eviction logic for correctness and concurrency handling.
  • Confirm accuracy and effectiveness of the nonce-gap limiting.
  • Ensure logging and metric changes are consistent and beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants