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: add PayloadError variants #649

Merged
merged 3 commits into from
May 3, 2024

Conversation

fgimenez
Copy link
Contributor

@fgimenez fgimenez commented Apr 30, 2024

Towards paradigmxyz/reth#7993

Motivation

During the checks for well-formed payload the existence of hardfork-specific fields is missing.

Solution

Adds PayloaError variants to allow signaling failed checks for the existence of hardfork-specific fields.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@mattsse
Copy link
Member

mattsse commented Apr 30, 2024

ptal @Rjected

PreCancunBlockWithExcessBlobGas,
/// cancun fields present in pre-cancun payload.
#[error("cancun fields present in pre-cancun payload")]
PreCancunWithCancunFields,
Copy link
Member

Choose a reason for hiding this comment

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

what fields in here are not captured in the others?

Copy link
Member

Choose a reason for hiding this comment

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

sorry I meant to do that as a comment not a request changes:)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what fields in here are not captured in the others?

yep, ensure_well_formed_payload receives a cancun_fields argument, of type MaybeCancunPayloadFields, which contains a field of type Option<CancunPayloadFields>, CancunPayloadFields includes parent_beacon_block_root and versioned_hashes, see https://github.com/paradigmxyz/reth/blob/04636400dae1bfb19dddbb3dcc848b163be4dfbd/crates/payload/validator/src/lib.rs#L107.

The error here refers to MaybeCancunPayloadFields containing a None in its single field.

@onbjerg onbjerg self-requested a review May 2, 2024 14:13
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

pending @onbjerg

@mattsse mattsse merged commit af788af into alloy-rs:main May 3, 2024
24 checks passed
ben186 pushed a commit to ben186/alloy that referenced this pull request Jul 27, 2024
* feat: add PayloadError variants

* add PostCancunBlockWithoutBlobTransactions

* update error messages
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