polygon-edge icon indicating copy to clipboard operation
polygon-edge copied to clipboard

[TxPool] Reject future transactions during high memory usage

Open dbrajovic opened this issue 3 years ago • 1 comments

Description

This PR adds an additional constraint on transaction acquisition during periods of high slots usage.

If a transaction sent to the pool is not expected in terms of nonce (meaning it's a future transactions or spam) then it is rejected.

Changes include

  • [ ] Bugfix (non-breaking change that solves an issue)
  • [ ] Hotfix (change that solves an urgent issue, and requires immediate attention)
  • [x] New feature (non-breaking change that adds functionality)
  • [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • [x] I have assigned this PR to myself
  • [x] I have added at least 1 reviewer
  • [x] I have added the relevant labels
  • [ ] I have updated the official documentation
  • [x] I have added sufficient documentation in code

Testing

  • [x] I have tested this code with the official test suite
  • [ ] I have tested this code manually

Additional comments

Fixes EDGE-732

dbrajovic avatar Aug 18 '22 11:08 dbrajovic

Codecov Report

Merging #690 (6e56e3e) into develop (210de9e) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #690      +/-   ##
===========================================
+ Coverage    48.72%   48.75%   +0.03%     
===========================================
  Files          112      112              
  Lines        15432    15437       +5     
===========================================
+ Hits          7519     7527       +8     
+ Misses        7279     7277       -2     
+ Partials       634      633       -1     
Impacted Files Coverage Δ
txpool/txpool.go 72.68% <100.00%> (+0.28%) :arrow_up:
txpool/account.go 94.94% <0.00%> (+1.68%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Aug 19 '22 08:08 codecov[bot]