Skip to content
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

refactor to comply to specs + SSZ enc/dec of spec types #54

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

thedevbirb
Copy link
Contributor

@thedevbirb thedevbirb commented Jun 4, 2024

This PR aligns as much as possible the relay codebase to the Bolt specs and closes #49 and #21 . It consists of three main parts:

  • adapting/renaming types and endpoints, with related refactoring
  • manually implementing SSZ marshalling and unmarshalling for the spec type SignedConstraints and its inner types (with some tests!). This has been necessary in order to produce a compliant (to consensus-specs) signature digest of the type ConstraintsMessage.
  • restore the SSZ encoding for publishing blocks, removed by mistake in the original implementation
    Fortunately, the SSZ work can be re-used in various part of the stack if needed.

NOTE: this PR doesn't introduce Merkle Multiproofs yet. See #55 for more details.

@thedevbirb thedevbirb changed the title chore(relay): refactor to comply to specs + SSZ enc/dec of spec types refactor to comply to specs + SSZ enc/dec of spec types Jun 4, 2024
@thedevbirb thedevbirb marked this pull request as ready for review June 4, 2024 12:06
@thedevbirb thedevbirb added C: mev-boost-relay Component: mev-boost-relay T: feature Type: Feature labels Jun 4, 2024
Copy link
Collaborator

@merklefruit merklefruit left a comment

Choose a reason for hiding this comment

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

LGTM great job on the SSZ madness

Signature phase0.BLSSignature `ssz-size:"96"`
ProposerIndex uint64
const (
MAX_CONSTRAINTS_PER_SLOT = 256
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be documented, maybe on our docs website?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a comment above the constant that says this is not final yet, and a related issue #61.


type SignedConstraints struct {
Message *ConstraintsMessage `json:"message"`
Signature phase0.BLSSignature `ssz-size:"96" json:"signature"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's mark somewhere the fact that we are moving to ECDSA signatures for constraints

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're now using 2 different signature types in the relay and mev-boost right?

mev-boost-relay/services/api/constraints.go Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

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

damn, this is insane, good job

mev-boost-relay/services/api/service.go Show resolved Hide resolved
@thedevbirb thedevbirb merged commit c2f98e4 into feat/bolt-relay-gt Jun 5, 2024
@thedevbirb thedevbirb deleted the feat/relay-to-specs branch June 5, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: mev-boost-relay Component: mev-boost-relay T: feature Type: Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants