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: use BlockWithSenders in executors #5771

Merged
merged 7 commits into from
Dec 15, 2023
Merged

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Dec 15, 2023

Removes the optional senders parameter in the executors and requires passing a BlockWithSenders instead. Various utility functions exist on the block types to seal/unseal, provide senders and recover senders from signatures already. Since the senders parameter already required the user to possibly handle recovering themselves, we explicitly require it now, since it makes it easier to figure out how often you recover, which is an expensive operation.

See the refd issue for more info

Closes #5767

@onbjerg onbjerg added the C-debt Refactor of code section that is hard to understand or maintain label Dec 15, 2023
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.

should we remove the additional ;? :)

crates/revm/src/optimism/processor.rs Outdated Show resolved Hide resolved
Comment on lines +85 to +87
pub fn with_recovered_senders(self) -> Option<BlockWithSenders> {
let senders = self.senders()?;
Some(BlockWithSenders { block: self, senders })
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we return an Err(Self) here?

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't use that anywhere so doesn't make sense imo

crates/primitives/src/block.rs Outdated Show resolved Hide resolved
crates/primitives/src/block.rs Outdated Show resolved Hide resolved
bin/reth/src/debug_cmd/in_memory_merkle.rs Outdated Show resolved Hide resolved
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.

lgtm
this forces the caller to do sender recovery and simplifies the functions

@onbjerg onbjerg added this pull request to the merge queue Dec 15, 2023
Merged via the queue into main with commit faa9a22 Dec 15, 2023
27 checks passed
@onbjerg onbjerg deleted the onbjerg/executor-refactor branch December 15, 2023 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Execution trait ergonomics
2 participants