-
Notifications
You must be signed in to change notification settings - Fork 271
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
Adding periodical purge of tx pool #673
Comments
Hi @ngmachado , thx for your proposal! so my understanding is but if a tx is send thru an PRC node, |
Rationale
When utilizing the Scroll network for computationally intensive tasks, there's a risk of hitting processor limits within the ZK processors, potentially leading to transactions becoming stagnant or "zombie" in the transaction pool. While the Scroll team is aware of and working on solutions to this issue, proposed solutions may not be immediately implementable. Existing mechanisms, such as substitution based on pending nonces, still require gas consumption and a certain level of user awareness, which may not be ideal for all use cases.
To enhance the system's efficiency and user experience, it would be beneficial to introduce an additional transaction purge system tied to the transaction pool's lifetime. This system would automatically remove "zombie" transactions that exceed a certain age threshold, ensuring a more dynamic and clean transaction pool.
Proposed Implementation
The idea revolves around periodically checking the age of transactions in the pending transaction pool and removing those that exceed a predefined lifetime. The proposed Go code snippet outlines a basic approach to this:
This implementation leverages a timer to periodically trigger checks against the transaction pool.
Each transaction's timestamp (assumed to be exposed via tx.Time()) is compared against the current time to determine if it exceeds the pool's configured lifetime. Transactions meeting this criterion are then removed from the pool.
Related to #498
The text was updated successfully, but these errors were encountered: