Fix encoding of comma character in query parameters#7757
Merged
rolfyone merged 3 commits intoConsensys:masterfrom Nov 29, 2023
Merged
Fix encoding of comma character in query parameters#7757rolfyone merged 3 commits intoConsensys:masterfrom
rolfyone merged 3 commits intoConsensys:masterfrom
Conversation
Contributor
Author
|
This kind of incompatibility will likely disappear with ethereum/beacon-APIs#367 but I think it still deserves to at least be considered to be fixed. |
Contributor
|
Hey thanks for raising this, it makes complete sense. We do have a change coming to the validators endpoint where it becomes a POST, but having said that, we're yet to change to the post, so happy to merge this one :) |
2 tasks
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.
PR Description
The Teku VC encodes the comma
,character in its request to the/validatorsendpoint, resulting in a request like this:GET /eth/v1/beacon/states/head/validators?id=0x978e96b6b6b474f3f91b705a311906b14a5e2893d15e01f5a0ff210393ace5e0abc8488e844dab00f430364ba4c19b1a%2C0x99f013b0314981b0083e494bdd2989304f9fc9dfd2b0c23b40429d817b02acc78f0b4328e45e745a5c6cc48e8f0e9930 HTTP/1.1This is incompatible with Lodestar's BN, which handles it as one long ID containing the
%2Cstring, 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-requiredlabel to this PR if updates are required.Changelog