Skip to content

Add SSZ support to register validator api#110

Merged
ralexstokes merged 4 commits into
ethereum:mainfrom
nflaig:ssz-register-validator
Feb 24, 2025
Merged

Add SSZ support to register validator api#110
ralexstokes merged 4 commits into
ethereum:mainfrom
nflaig:ssz-register-validator

Conversation

@nflaig
Copy link
Copy Markdown
Member

@nflaig nflaig commented Jan 16, 2025

Follow up on #104 to also add SSZ support to registerValidator api, which should help in cases where the validator client runs a lot of keys and reduce amount of failed requests.

Since we can't really know if the server supports sending the validator registration as SSZ encoded payload the client will be responsible to retry the request using JSON which ideally should only be done if the error status code is 415, indicating an unsupported media type, but since right now we don't really know if all servers properly follow the spec, it is recommended to retry all HTTP errors and after the first error, the client should stop sending SSZ encoded validator registrations.

Copy link
Copy Markdown

@tbenr tbenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread apis/builder/validators.yaml Outdated
Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com>
Copy link
Copy Markdown
Member

@jtraglia jtraglia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @nflaig!

Copy link
Copy Markdown
Member

@ralexstokes ralexstokes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ralexstokes ralexstokes merged commit 1569fc4 into ethereum:main Feb 24, 2025
nflaig added a commit to ChainSafe/lodestar that referenced this pull request May 8, 2025
**Motivation**

See ethereum/builder-specs#110

**Description**

Send validator registrations to builder using SSZ

**TODO**
- [x] make sure all mev sidecars support 415 status code to fall back to
JSON or add custom retry mechanism
- [x] ~~forward bytes submitted through
[registerValidator](https://ethereum.github.io/beacon-APIs/#/Validator/registerValidator)
beacon api to skip extra serialization step~~ cannot be done right now
since we are filtering registrations
[here](https://github.com/ChainSafe/lodestar/blob/0463a14aa47171063aa5fb5452db6a91bcd7e59a/packages/beacon-node/src/api/impl/validator/index.ts#L1544)
so forwarding raw SSZ bytes is not an option and extra work is likely
not worth it as serialization is cheap anyways when using SSZ


Closes #7369
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.

4 participants