Skip to content

Add SSZ support to the Proposer API - #685

Merged
metachris merged 11 commits into
mainfrom
ssz
Apr 24, 2025
Merged

Add SSZ support to the Proposer API#685
metachris merged 11 commits into
mainfrom
ssz

Conversation

@jtraglia

Copy link
Copy Markdown
Collaborator

📝 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
  • I have seen and agree to CONTRIBUTING.md

@jtraglia
jtraglia marked this pull request as ready for review February 21, 2025 17:38
Comment thread services/api/service.go Outdated
err = signedValidatorRegistrations.UnmarshalSSZ(regBytes)
default:
log.Debug("Parsing registrations as JSON")
err = json.Unmarshal(regBytes, signedValidatorRegistrations)

Copy link
Copy Markdown
Collaborator

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.

Comment thread services/api/service.go
Comment on lines +57 to +62
ApplicationJSON = "application/json"
ApplicationOctetStream = "application/octet-stream"

HeaderAccept = "Accept"
HeaderContentType = "Content-Type"
HeaderEthConsensusVersion = "Eth-Consensus-Version"

Copy link
Copy Markdown
Collaborator

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

@metachris metachris left a comment

Copy link
Copy Markdown
Collaborator

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?

@jtraglia

Copy link
Copy Markdown
Collaborator Author

It has not been thoroughly tested.

@metachris
metachris merged commit 47cc71d into main Apr 24, 2025
@metachris
metachris deleted the ssz branch April 24, 2025 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants