feat(p2p): tx validation cache#22998
Closed
fcarreiro wants to merge 1 commit into
Closed
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
edcb0f0 to
8565228
Compare
8565228 to
d253021
Compare
d253021 to
4b5a440
Compare
fcarreiro
commented
May 6, 2026
| ): Promise<TxValidationResult>; | ||
| } | ||
|
|
||
| /** Node in the doubly-linked list used for LRU ordering. Head = least recent, tail = most recent. */ |
Contributor
Author
There was a problem hiding this comment.
I wouldn't mind simplifying and using some kind of FIFO eviction order with just a list, if I can come up with it, instead of a self-made linked list (even if it was done by Claude). For a big enough cache size it should be ok. WDYT?
PhilWindle
reviewed
May 7, 2026
| #log: Logger; | ||
|
|
||
| private readonly values = new Map<string, Promise<TxValidationResult>>(); | ||
| private readonly nodes = new Map<string, LruNode>(); |
Collaborator
There was a problem hiding this comment.
Could we break this out into something re-usable in foundation? We already have an LruSet in foundation/collection.
Contributor
Author
|
Superseded by #23377 . |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TxValidationCachethat holds validation results and acts in an LRU manner for eviction.CachedTxValidatorwhich wraps an inner validator.P2P_TX_VALIDATION_CACHE_SIZEto 0. Just in case, you know, not that I would introduce any bug.Note that proof verification batching is done at the BB level and therefore is orthogonal to this.
Closes https://linear.app/aztec-labs/issue/A-934/dont-repeatedly-verify-retrieved-transactions .