-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allocate less memory when validating new mempool transactions #12838
Labels
C-enhancement
New feature or request
M-prevent-stale
Prevents old inactive issues/PRs from being closed due to inactivity
S-needs-triage
This issue needs to be labelled
Comments
hai-rise
added
C-enhancement
New feature or request
S-needs-triage
This issue needs to be labelled
labels
Nov 25, 2024
3 tasks
ty |
This was referenced Dec 2, 2024
This issue is stale because it has been open for 21 days with no activity. |
github-actions
bot
added
the
S-stale
This issue/PR is stale and will close with no further activity
label
Dec 17, 2024
@github-actions Here is an activity, sir. |
mattsse
added
M-prevent-stale
Prevents old inactive issues/PRs from being closed due to inactivity
and removed
S-stale
This issue/PR is stale and will close with no further activity
labels
Dec 17, 2024
This was referenced Dec 25, 2024
marking this as completed, please open new targeted ones with your new findings, ty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-enhancement
New feature or request
M-prevent-stale
Prevents old inactive issues/PRs from being closed due to inactivity
S-needs-triage
This issue needs to be labelled
Describe the feature
Not sure how accurate bytehound is but it reports that validating new mempool transactions allocates (and deallocates) ~100 GB of RAM for ~10M transactions in ~10 minutes (~15k new transactions per second).
This matches
samply
's complaint in #12629 about copying the 32-byte tx-cost being a big overhead in the same code path.This issue traces the whole transaction validation process and removes unneeded allocations. For instance, one of the earliest checks,
ensure_max_init_code_size
, copies the 21-byteTxKind
(kind()
) to check if the new transaction is a Create one.reth/crates/transaction-pool/src/traits.rs
Lines 1067 to 1071 in 02824da
This check alone would allocate 200MB to validate 10M transactions. Intuitively, this should be a single reference byte check of the
&TxKind
enum.More to come 🙏.
Additional context
No response
The text was updated successfully, but these errors were encountered: