-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(BEDS-1052) VDB: validator search by hex graffiti #1229
Conversation
ff20945
to
672d573
Compare
Deploying beaconchain with Cloudflare Pages
|
672d573
to
f698e55
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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}}]}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, clarified and the answer is "yes can do that for now". Can exclude empty graffitis later if we run into issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bummer! Applied, needs explicit handling though since look-arounds aren't a thing in go's regexp
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..). |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
No description provided.