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

chore: swap blockenv values instead of cloning #10

Merged
merged 3 commits into from
Feb 4, 2025

Conversation

Evalir
Copy link
Contributor

@Evalir Evalir commented Feb 3, 2025

Motivation

Closes #9

Solution

swaps the individual blockenv values instead of cloning the entire block env.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@Evalir Evalir requested review from mattsse and klkvr as code owners February 3, 2025 23:21
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,

this should be fine because immutable during execution, right @klkvr

// disable the base fee check for this call by setting the base fee to zero
self.block_mut().basefee = U256::ZERO;
std::mem::swap(&mut self.block_mut().basefee, &mut basefee);
Copy link
Member

Choose a reason for hiding this comment

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

these should be core::mem

Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

thank you! can we do the same for op as well?

@Evalir
Copy link
Contributor Author

Evalir commented Feb 4, 2025

sg @klkvr , done in 1e987b5

@mattsse mattsse merged commit 316250b into alloy-rs:main Feb 4, 2025
27 checks passed
@Evalir Evalir deleted the evalir/remove-blockenv-clone branch February 4, 2025 00:20
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.

[Feature] Remove blockenv clone on system call
3 participants