forked from 0xPolygon/polygon-edge
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Txpool] Prune inactive account enqueued transactions when promotion …
…outdated (#153) * Upgrade default outdate duration to 1 hour * Refactor txpool associated contantants to one package * Refactor txpool associated constants to one file * Re-enable pruning outdated account transaction feature * Extract account function * More refactor * More efficient codes when prune stale account * More clear test case comments * Add pruneStaleAccounts benchmark * Fix limnt error
- Loading branch information
1 parent
96ffb10
commit 9e509f5
Showing
7 changed files
with
141 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package txpool | ||
|
||
const ( | ||
DefaultPruneTickSeconds = 300 // ticker duration for pruning account future transactions | ||
DefaultPromoteOutdateSeconds = 3600 // not promoted account for a long time would be pruned | ||
// txpool transaction max slots. tx <= 32kB would only take 1 slot. tx > 32kB would take | ||
// ceil(tx.size / 32kB) slots. | ||
DefaultMaxSlots = 4096 | ||
DefaultMaxAccountDemotions = 10 // account demotion counter limit | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters