Repository navigation
Conversation
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.
What does this PR do?
Caps pending results at 20,000 entries per JSON-RPC log or block filter. A filter at exactly the limit remains readable. If an incoming batch would exceed the limit, the filter is invalidated, its backlog is cleared, and subsequent events are ignored for that filter.
Reads through
eth_getFilterChangesoreth_getFilterLogsthen return error-32005, with messagefilter result limit exceeded; filter invalidatedand structured data:{"reason":"FILTER_OVERFLOW","limit":20000}The shared
FilterResultimplementation synchronizes append, drain, expiration, and close operations. Overflow records retain their original expiration deadline and count toward existing filter limits; failed polls cannot renew them. Other filters continue receiving events. Uninstalling a filter or closing the service releases retained results and prevents stale writers from refilling closed filters.Why are these changes required?
Clients that stop polling can accumulate results until filter expiration. Existing filter-count limits and shared log objects do not cap the queue entries retained by each filter. Explicit invalidation makes a result gap visible to clients while limiting each filter's backlog.
This PR has been tested by:
./gradlew checkstyleMain checkstyleTestandgit diff --checkpassed.The full repository test suite and manual node load tests were not run.
Follow up
Validate and tune
FilterResult.MAX_RESULT_SIZEusing resource tests. The limit is currently a constant and bounds entries per filter; aggregate memory still depends on filter counts and retained payload sizes.Extra details
Normal request parameters and successful response formats remain unchanged. Clients receiving
FILTER_OVERFLOWmust recreate the filter and resynchronize from their saved checkpoint. Expired records continue to be removed by the existing event-dispatch cleanup; no additional cleanup scheduler is introduced.