Avoid duplicate in-flight RPC slot fetches#1070
Closed
rappie wants to merge 2 commits into
Closed
Conversation
4 tasks
Collaborator
|
Honestly, this changeset is large. I asked an AI to make a smaller one, #1072 That 1072 is quite a bit smaller: |
Collaborator
|
So I'm closing this, because it seems too much to me to change. Honestly, likely 1072 needs quite a bit of love, too. I am not saying it's MUCH better, because both will probably need hand-rewriting. But at least the other one is smaller change :) |
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.
Summary
This PR is vibecoded and loosely reviewed manually.
Tested locally:
Result:
~15,000 -> ~1,500)Below the line is AI generated
Description
This PR reduces redundant RPC load when multiple workers request the same storage slot concurrently.
It does this in two steps:
Motivation
During Echidna fork fuzzing, workers can race on the same uncached storage slot. Before this change, each worker could issue its own identical
eth_getStorageAtrequest before the first result populated the cache.On live fuzzing runs this caused avoidable duplicate RPC traffic and could quickly hit provider call limits.
Behavior
If a slot fetch is already in progress, concurrent callers now wait for that same fetch instead of starting another identical RPC request. Once the fetch completes, all waiters receive the same result and the normal cache remains the source of truth for later reads.
The in-flight key includes the resolved block so reads at different fork blocks remain isolated.
Checklist