Skip to content

Conversation

@ANtutov
Copy link
Contributor

@ANtutov ANtutov commented Nov 19, 2025

This change removes an unnecessary clone of the execution requests in EthBuiltPayload::try_into_v4 by switching to Option::take and passing ownership directly into ExecutionPayloadEnvelopeV4. The previous implementation cloned self.requests even though self is immediately consumed by try_into for the inner V3 envelope, leading to avoidable allocations and copies for potentially large alloy_eips::eip7685::Requests. The new approach mirrors try_into_v5 which already moves requests without cloning, keeps the conversion logic centralized by still delegating to try_into_v3 for envelope_inner, and preserves all semantics while improving performance.

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 makes sense

perhaps one more sanity check @Rjected

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Nov 19, 2025
@mattsse mattsse added the C-debt A clean up/refactor of existing code label Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-debt A clean up/refactor of existing code

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants