(BEDS-1052) VDB: validator search by hex graffiti#1229
Merged
remoterami merged 3 commits intostagingfrom Jan 14, 2025
Merged
Conversation
ff20945 to
672d573
Compare
Deploying beaconchain with
|
| Latest commit: |
f698e55
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://476864b7.beaconchain.pages.dev |
| Branch Preview URL: | https://beds-1052-vdb-hex-graffiti.beaconchain.pages.dev |
672d573 to
f698e55
Compare
LuccaBitfly
requested changes
Jan 7, 2025
| reGraffiti = regexp.MustCompile(`^.{2,}$`) // at least 2 characters, so that queries won't time out | ||
| reCursor = regexp.MustCompile(`^[A-Za-z0-9-_]+$`) // has to be base64 | ||
| reGraffiti = regexp.MustCompile(`^.{2,}$`) // at least 2 characters, so that queries won't time out | ||
| reGraffitiHex = regexp.MustCompile(`^(0x)?([0-9a-fA-F]{2}){2,}$`) // at least 2 bytes, so that queries won't time out |
Contributor
There was a problem hiding this comment.
Question: Should this be a valid hex input?
> curl --location 'http://0.0.0.0:8081/api/i/search' \
--header 'Content-Type: application/json' \
--data '{
"input":"0x0000000000000000000000000000000000000000000000000000000000000000",
"networks":["holesky"]
}'
{"data":[{"type":"validators_by_graffiti","chain_id":17000,"value":{"graffiti":"","hex":"0x0000000000000000000000000000000000000000000000000000000000000000","count":72496}}]}
Contributor
Author
There was a problem hiding this comment.
Good question, clarified and the answer is "yes can do that for now". Can exclude empty graffitis later if we run into issues.
Contributor
Contributor
Author
There was a problem hiding this comment.
Bummer! Applied, needs explicit handling though since look-arounds aren't a thing in go's regexp
Contributor
Author
|
I added some validation checks for maximum graffiti size of 32 bytes (which actually is a chain parameter but I doubt anyone would be messing with this..). |
LuccaBitfly
requested changes
Jan 9, 2025
| reGraffiti = regexp.MustCompile(`^.{2,}$`) // at least 2 characters, so that queries won't time out | ||
| reCursor = regexp.MustCompile(`^[A-Za-z0-9-_]+$`) // has to be base64 | ||
| reGraffiti = regexp.MustCompile(`^.{2,}$`) // at least 2 characters, so that queries won't time out | ||
| reGraffitiHex = regexp.MustCompile(`^(0x)?([0-9a-fA-F]{2}){2,}$`) // at least 2 bytes, so that queries won't time out |
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.

No description provided.