Fix encoding of comma character in query parameters #7757
Merged
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.
PR Description
The Teku VC encodes the comma
,
character in its request to the/validators
endpoint, resulting in a request like this:GET /eth/v1/beacon/states/head/validators?id=0x978e96b6b6b474f3f91b705a311906b14a5e2893d15e01f5a0ff210393ace5e0abc8488e844dab00f430364ba4c19b1a%2C0x99f013b0314981b0083e494bdd2989304f9fc9dfd2b0c23b40429d817b02acc78f0b4328e45e745a5c6cc48e8f0e9930 HTTP/1.1
This is incompatible with Lodestar's BN, which handles it as one long ID containing the
%2C
string, resulting in an empty array of statuses being returned. This in turn results in the Teku VC failing to get the status for its validators (and subsequently not performing validator duties for them):This was discussed in ChainSafe/lodestar#5403 . The conclusion there was the comma character should not be encoded in this case.
The Teku BN API can handle both cases, regardless of whether the comma character is encoded or not, so this change is completely backwards compatible.
Looking forward to hear your thoughts on this.
Fixed Issue(s)
I have not found an issue for this in this repository.
Documentation
doc-change-required
label to this PR if updates are required.Changelog