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

feat(rpc-types-beacon): BuilderBlockValidationRequestV3 #1310

Conversation

ryanschneider
Copy link
Contributor

Motivation

I'd like to add support for flashbots_validateBuilderSubmissionV3 to reth, but we need the BuilderBlockValidationRequestV3 for the rpc request param.

Solution

This adds the aforementioned struct. Note that the new struct does not contain the withdrawls_root field present in V2. I went through the latest flashbots/builder code and this parameter was removed from the V2 requests, and is not present in V3:

https://github.com/flashbots/builder/blob/7577ac81da21e760ec6693637ce2a81fe58ac9f8/eth/block-validation/api.go#L198-L202

Furthermore the ultrasoundmoney implementation doesn't contain it either: https://github.com/ultrasoundmoney/reth-payload-validator/blob/main/src/rpc/types.rs#L12-L20

I did not remove it from the BuilderBlockValidationRequestV2 struct since that's potentially a breaking change, which seemed worth avoiding.

Finally, I'm unsure if I should add a BuilderBlockValidationRequestV4 for Pectra: since request is a SubmitBlockRequest which uses the ExecutionPayload enum the V3 and V4 structs would have the exact same fields. Alternatively, we could add SubmitBlockRequestV3/V4 structs that use the explicit ExecutionPayloadV3/V4 structs instead of the enum, but that would break the pattern established in V2.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

imo this type belongs in rpc-types-mev. @mattsse thoughts about introducing bescon types dependency there?

@mattsse
Copy link
Member

mattsse commented Sep 19, 2024

@ryanschneider we can add a type alias if both are the same

@mattsse
Copy link
Member

mattsse commented Sep 19, 2024

@rkrasiuk we can keep these types here, because these are closer to the builder/relay than the mev_ eth_ endpoints that the -mev currently supports.

we likely should restructure some things here

@mattsse mattsse merged commit 57dd4c5 into alloy-rs:main Sep 19, 2024
26 checks passed
@ryanschneider ryanschneider deleted the rpc-types-beacon-relay-BuilderBlockValidationRequestV3 branch September 19, 2024 15:51
@ryanschneider
Copy link
Contributor Author

@mattsse type alias works, my only concern with the current layout is using the ExecutionPayload enum vs. the versioned structs means the request needs to be validated on the server for correctness vs using the type system to our advantage, but in the grand scheme its a pretty minor nit.

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