ethclient/gethclient: add deduplication and max keys limit to GetProof#3067
Merged
alex-10072 merged 1 commit intodevelopfrom May 6, 2025
Merged
ethclient/gethclient: add deduplication and max keys limit to GetProof#3067alex-10072 merged 1 commit intodevelopfrom
alex-10072 merged 1 commit intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the GetProof functionality in gethclient by introducing deduplication of storage keys and enforcing a maximum limit of 512 keys.
- Deduplicates storage keys (ignoring empty strings) before processing.
- Adds a constant to cap the total number of keys and validates requests accordingly.
- Introduces tests to verify both deduplication and key limit enforcement.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ethclient/gethclient/gethclient.go | Added deduplication logic, a maximum keys limit constant, and validation. |
| ethclient/gethclient/gethclient_test.go | Added tests to verify deduplication and max keys limit functionality. |
Comments suppressed due to low confidence (1)
ethclient/gethclient/gethclient.go:104
- [nitpick] Consider unifying the handling of nil and non-nil keys by initializing keys to an empty slice first and then always calling removeDuplicates, which can simplify the control flow.
if keys == nil {
4e03592 to
9194658
Compare
alex-10072
approved these changes
May 5, 2025
zlacfzy
approved these changes
May 6, 2025
This was referenced May 16, 2025
Merged
galaio
pushed a commit
to galaio/bsc
that referenced
this pull request
May 29, 2025
galaio
pushed a commit
to galaio/bsc
that referenced
this pull request
May 29, 2025
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.
ethclient/gethclient: add deduplication and max keys limit to GetProof