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(l2-withdrawals): Decompose ExecutionPayloadValidator::ensure_well_formed_payload #14566

Merged
merged 5 commits into from
Feb 19, 2025

Conversation

emhane
Copy link
Member

@emhane emhane commented Feb 18, 2025

Pre-req for #14177

Moves the payload field checks into functions, grouped in modules based on hardfork. This provides building blocks for L2s to implement custom payload validation, for example OP would skip the Cancun validations on the transactions field, but would still check if cancun payload fields are present or not present.

@emhane emhane added C-debt A clean up/refactor of existing code A-op-reth Related to Optimism and op-reth labels Feb 18, 2025
@emhane emhane added the A-consensus Related to the consensus engine label Feb 18, 2025
@emhane emhane requested a review from gakonst as a code owner February 19, 2025 06:49
@emhane emhane changed the title feat(l2-withdrawals): Decompose ExecutionPayloadValidator::ensure_well_formed_payload into … feat(l2-withdrawals): Decompose ExecutionPayloadValidator::ensure_well_formed_payload Feb 19, 2025
Copy link
Collaborator

@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.

this is cleaner

is_cancun_active: bool,
) -> Result<(), PayloadError> {
if is_cancun_active {
if !block_body.has_eip4844_transactions() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this check is wrong I believe

Copy link
Member Author

Choose a reason for hiding this comment

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

should the error variant be removed from alloy?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so, i believe this was intended for the sidecar fields which we check seperately

@emhane emhane enabled auto-merge February 19, 2025 09:18
@emhane emhane added this pull request to the merge queue Feb 19, 2025
is_cancun_active: bool,
) -> Result<(), PayloadError> {
if is_cancun_active {
if !block_body.has_eip4844_transactions() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think so, i believe this was intended for the sidecar fields which we check seperately

Merged via the queue into main with commit 849c04c Feb 19, 2025
41 checks passed
@emhane emhane deleted the emhane/payload-validator branch February 19, 2025 09:39
loocapro pushed a commit to loocapro/reth that referenced this pull request Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine A-op-reth Related to Optimism and op-reth C-debt A clean up/refactor of existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants