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

[TxPool] Reject future transactions during high memory usage #690

Merged
merged 59 commits into from
Aug 29, 2022

Conversation

dbrajovic
Copy link
Contributor

@dbrajovic dbrajovic commented Aug 18, 2022

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)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

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

Testing

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

Additional comments

Fixes EDGE-732

@codecov
Copy link

codecov bot commented Aug 19, 2022

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%) ⬆️
txpool/account.go 94.94% <0.00%> (+1.68%) ⬆️

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

Copy link
Contributor

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

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

Looks great 💯

Copy link
Contributor

@Aleksao998 Aleksao998 left a comment

Choose a reason for hiding this comment

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

LGTM, tested with SportX script on local everything works

Copy link
Contributor

@Kourin1996 Kourin1996 left a comment

Choose a reason for hiding this comment

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

Just a small comment

txpool/txpool.go Outdated Show resolved Hide resolved
@zivkovicmilos zivkovicmilos added this to the 0.6 Release milestone Aug 24, 2022
Base automatically changed from fix/txpool-high-slots-pruning to develop August 29, 2022 09:31
@dbrajovic dbrajovic merged commit 5d2db1e into develop Aug 29, 2022
@dbrajovic dbrajovic deleted the fix/txpool-reject-mismatch-tx branch August 29, 2022 11:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants