Skip to content

chore: clean up unused EOF code #10715

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

Merged
merged 13 commits into from
Jun 19, 2025
Merged

chore: clean up unused EOF code #10715

merged 13 commits into from
Jun 19, 2025

Conversation

zerosnacks
Copy link
Member

@zerosnacks zerosnacks commented Jun 5, 2025

Motivation

Related PRs:

Updates:

Solution

Removes EOF leftovers, simplifies where possible + retaining abstractions that help readability

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@zerosnacks zerosnacks marked this pull request as ready for review June 9, 2025 14:32
@zerosnacks zerosnacks self-assigned this Jun 9, 2025
@zerosnacks zerosnacks moved this to Ready For Review in Foundry Jun 9, 2025
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.

all of this lgtm, but didn't look too closely at the create cheatcode extractions, or if anything changed there at all.

the large diff for this makes this harder to review, from the looks of it we could have kept the functions?

Comment on lines -788 to -794
// common create_end functionality for both legacy and EOF.
fn create_end_common(
&mut self,
ecx: Ecx,
call: Option<&CreateInputs>,
outcome: &mut CreateOutcome,
) {
Copy link
Member

Choose a reason for hiding this comment

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

this is the main change, haven't reviewed this extractions line by line but this looks okay

Copy link
Member Author

@zerosnacks zerosnacks Jun 17, 2025

Choose a reason for hiding this comment

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

The diff appears large but it is basically just a direct inline of create_common / create_end_common as they were previously a shared implementation with EOF's create_* and it would now be an unnecessary abstraction to keep around

Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

I think this looks good and confident all OK but the debugger changes which we don't have tests for (left some comments, happy to work on a basic test suite to perform).
Also, just a note that we're going to have (at least?) one more iteration to cleanup EOF, see bluealloy/revm#2644

@@ -14,32 +11,8 @@ impl OpcodeParam {
/// Returns the list of named parameters for the given opcode, accounts for special opcodes
/// requiring immediate bytes to determine stack items.
#[inline]
pub(crate) fn of(op: u8, immediate: Option<&Bytes>) -> Option<Vec<Self>> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

in is_jump we keep the way we identify using immediate_bytes but here we don't rely on it anymore, wonder if this is right?

Copy link
Member Author

@zerosnacks zerosnacks Jun 18, 2025

Choose a reason for hiding this comment

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

this is correct, I prefer keeping this abstraction as it is more readable than reverting to what was defined previously inline, ref: paradigmxyz/revm-inspectors#301 (record_immediate_bytes). This is an abstraction introduced as part of the EOF PR but not strictly an EOF feature.

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.

lgtm, ideally we should be able to combine this with bump to bluealloy/revm#2644

@zerosnacks
Copy link
Member Author

I'll follow up in the Revm 25+ bump with the final removal of any EOF related fields to be deprecated in the next Revm release

@zerosnacks zerosnacks merged commit 6181d51 into master Jun 19, 2025
22 checks passed
@zerosnacks zerosnacks deleted the zerosnacks/remove-dead-code branch June 19, 2025 07:43
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants