Skip to content

bump(revm: step 2): bump alloy + revm + alloy-evm + other deps to latest #10454

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

Open
wants to merge 61 commits into
base: zerosnacks/revm-bump-2
Choose a base branch
from

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented May 7, 2025

Motivation

Builds on #10183

Bumps

  • alloy-core 1.0
  • revm 23.* (unreleased version, commit: feat: expose Gas::memory field bluealloy/revm#2512)
  • alloy-evm 0.7.2
  • solar 0.13
  • alloy 1.0
  • op-alloy 0.16
  • revm-inspectors 0.22 (alloy 1.0 related)
  • foundry-fork-db 0.14 (alloy 1.0 related)
  • foundry-block-explorers 0.17.0 (alloy 1.0 related)
  • rand 9 + rand_08 + rand_chacha workaround

Unblocks #10411

Solution

Previously used the following patches, no longer necessary:

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines +1160 to +1165
// Prop test uses rand 8 whereas alloy-core has been bumped to rand 9
// self.test_runner().rng()
self.rng.get_or_insert_with(|| match self.config.seed {
Some(seed) => ChaChaRng::from_seed(seed.to_be_bytes::<32>()),
None => ChaChaRng::from_os_rng(),
})
Copy link
Member Author

Choose a reason for hiding this comment

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

Adds a temp rng field to Cheatcodes to generate random values with the given seed

This is a workaround as proptest still uses rand 8.

cc @DaniPopes @mattsse

mattsse pushed a commit to foundry-rs/compilers that referenced this pull request May 7, 2025
mattsse pushed a commit to foundry-rs/block-explorers that referenced this pull request May 7, 2025
@zerosnacks
Copy link
Member

lgtm!

RE: rand 8 / rand 9

it does effect random cheatcodes we added for kontrol, they'll be getting different fuzzed inputs if set to a certain seed, but they're still going to be deterministic

if we highlight this in the changelog this is fine

Comment on lines 1860 to 1862
// while active_journaled_state.journal.len() > target_fork.journaled_state.journal.len() {
// target_fork.journaled_state.journal.push(Default::default());
// }
Copy link
Member

@zerosnacks zerosnacks May 13, 2025

Choose a reason for hiding this comment

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

Note: Revm 21+ flattens the journal field to Vec<JournalEntry from Vec<Vec<JournalEntry>>

Ref: https://github.com/bluealloy/revm/pull/2440/files

I'm trying to understand whether this has side effects for our multiforking

Do you remember the context of this code block @mattsse?

Copy link
Member

Choose a reason for hiding this comment

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

hmm, unsure previously forking messed up internal tracking causing unwrap panics

I think we no longer need this because this now tracks the entire journal and not nested by calls @rakita ?

so we can try removing this @zerosnacks

Copy link
Member

Choose a reason for hiding this comment

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

Optimistically removed here: 5244a40

@grandizzy grandizzy moved this from In Progress to Completed in Foundry May 13, 2025
@zerosnacks zerosnacks moved this from Completed to Ready For Review in Foundry May 13, 2025
@zerosnacks zerosnacks marked this pull request as ready for review May 13, 2025 15:22
@zerosnacks zerosnacks changed the title bump: alloy + revm + alloy-evm bump(revm: 2): bump alloy + revm + alloy-evm to latest May 13, 2025
@zerosnacks zerosnacks changed the title bump(revm: 2): bump alloy + revm + alloy-evm to latest bump(revm: 2): bump alloy + revm + alloy-evm to latest May 13, 2025
@zerosnacks zerosnacks changed the title bump(revm: 2): bump alloy + revm + alloy-evm to latest bump(revm: step 2): bump alloy + revm + alloy-evm to latest May 13, 2025
Comment on lines +381 to +382
revm = { git = "https://github.com/bluealloy/revm.git", rev = "b5808253" }
op-revm = { git = "https://github.com/bluealloy/revm.git", rev = "b5808253" }
Copy link
Member

@zerosnacks zerosnacks May 14, 2025

Choose a reason for hiding this comment

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

This currently pins to bluealloy/revm#2512 that we rely on, not yet included in a 23.* release

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.

cool,
some nits, regarding the journal change, I believe this okay if we remove the mocking which previously was required to prevent panics (due to unwraps in revm since swapping journal violated some invariats)

Comment on lines 1860 to 1862
// while active_journaled_state.journal.len() > target_fork.journaled_state.journal.len() {
// target_fork.journaled_state.journal.push(Default::default());
// }
Copy link
Member

Choose a reason for hiding this comment

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

hmm, unsure previously forking messed up internal tracking causing unwrap panics

I think we no longer need this because this now tracks the entire journal and not nested by calls @rakita ?

so we can try removing this @zerosnacks

@@ -146,7 +146,7 @@ pub fn configure_tx_req_env(

// Type 4, EIP-7702
if let Some(authorization_list) = authorization_list {
env.tx.authorization_list = authorization_list.clone();
env.tx.set_signed_authorization(authorization_list.clone());
Copy link
Member

Choose a reason for hiding this comment

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

do we also need to update the txtype of the tx?

not obvious

Copy link
Member

Choose a reason for hiding this comment

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

It would make sense that it would

Perhaps something along these lines? yash/revm-alloy-bumps...zerosnacks/derive-tx-type-during-tx-configuration

Copy link
Member

Choose a reason for hiding this comment

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

cc @klkvr on the above

@zerosnacks zerosnacks requested a review from mattsse May 15, 2025 09:09
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.

lgtm, left couple of nits / questions

@zerosnacks zerosnacks requested a review from grandizzy May 15, 2025 13:01
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.

lgtm, pending @mattsse comment to be clarified #10454 (comment)

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, pending @klkvr

@zerosnacks zerosnacks changed the title bump(revm: step 2): bump alloy + revm + alloy-evm to latest bump(revm: step 2): bump alloy + revm + alloy-evm + other deps to latest May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependencies Area: dependencies T-chore Type: chore
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

5 participants