-
Notifications
You must be signed in to change notification settings - Fork 139
Add SSZ support to the Proposer API #685
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
Conversation
services/api/service.go
Outdated
err = signedValidatorRegistrations.UnmarshalSSZ(regBytes) | ||
default: | ||
log.Debug("Parsing registrations as JSON") | ||
err = json.Unmarshal(regBytes, signedValidatorRegistrations) |
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.
This request comes in huge bursts (at epoch boundary), and decoding the JSON is a huge bottleneck. That's why we've moved to the fast json decode above, that this PR deleted. We definitely need the previous fast json decoding, otherwise it's a huge bottleneck in production.
ApplicationJSON = "application/json" | ||
ApplicationOctetStream = "application/octet-stream" | ||
|
||
HeaderAccept = "Accept" | ||
HeaderContentType = "Content-Type" | ||
HeaderEthConsensusVersion = "Eth-Consensus-Version" |
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.
best move to constants.go
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.
looks good overall. has it been tested successfully on testnets/devnet tests yet?
It has not been thoroughly tested. |
📝 Summary
This PR adds SSZ support to the Proposer API endpoints, as described here:
✅ I have run these commands
make lint
make test-race
go mod tidy
CONTRIBUTING.md