Skip to content

chore: bump revm 25#100

Merged
klkvr merged 9 commits intomainfrom
matt/bump-revm25
Jun 20, 2025
Merged

chore: bump revm 25#100
klkvr merged 9 commits intomainfrom
matt/bump-revm25

Conversation

@mattsse
Copy link
Member

@mattsse mattsse commented Jun 9, 2025

Summary

Completes the migration to revm v25 as outlined in issue #99.

Original Task

Complete the migration to revm v25 and follow the hints in issue #99:

  • Change ResultAndState<Halt, EvmState> to ResultAndState<ExecutionResult<Halt>, EvmState>
  • For block numbers and timestamps, use saturating_to() when converting from U256 to u64

Changes Applied

Type System Updates

  • ✅ Updated all ResultAndState signatures from ResultAndState<HaltReason, EvmState> to ResultAndState<ExecutionResult<HaltReason>, EvmState> across:
    • Core Evm trait definitions in src/evm.rs
    • Ethereum implementation in src/eth/mod.rs
    • OP implementation in src/lib.rs
    • Either wrapper in src/either.rs
    • All system call implementations (EIP-2935, EIP-4788, EIP-7002, EIP-7251)

U256 to u64 Conversions

  • ✅ Added saturating_to() method calls for all U256 to u64 conversions:
    • block().number.saturating_to() for block number conversions
    • block().timestamp.saturating_to() for timestamp conversions
    • Applied across both alloy-evm and alloy-op-evm crates

EVM Integration Updates

  • ✅ Replaced manual transact() + journaled_state.finalize() pattern with transact_finalize()
  • ✅ Updated Account struct initialization to include required transaction_id: 0 field
  • ✅ Simplified transaction execution logic using revm v25's improved API

Import Updates

  • ✅ Added ExecutionResult and EvmState imports where needed
  • ✅ Removed unused InspectEvm imports
  • ✅ Updated import paths for revm v25 module structure

Test Results

  • ✅ All existing tests pass
  • ✅ Build completes without warnings
  • ✅ Both alloy-evm and alloy-op-evm crates compile successfully

Closes #99

🤖 Generated with Claude Code

zerosnacks added a commit to foundry-rs/foundry that referenced this pull request Jun 10, 2025
mattsse and others added 2 commits June 10, 2025 14:43
## Original Task
Complete the migration to revm v25 and follow the hints in issue #99:
- Change `ResultAndState<Halt, EvmState>` to `ResultAndState<ExecutionResult<Halt>, EvmState>`
- For block numbers and timestamps, use `saturating_to()` when converting from U256 to u64

## Changes Applied

### Type System Updates
- Updated all `ResultAndState` signatures from `ResultAndState<HaltReason, EvmState>`
  to `ResultAndState<ExecutionResult<HaltReason>, EvmState>` across:
  - Core `Evm` trait definitions in `src/evm.rs`
  - Ethereum implementation in `src/eth/mod.rs`
  - OP implementation in `src/lib.rs`
  - Either wrapper in `src/either.rs`
  - All system call implementations (EIP-2935, EIP-4788, EIP-7002, EIP-7251)

### U256 to u64 Conversions
- Added `saturating_to()` method calls for all U256 to u64 conversions:
  - `block().number.saturating_to()` for block number conversions
  - `block().timestamp.saturating_to()` for timestamp conversions
  - Applied across both `alloy-evm` and `alloy-op-evm` crates

### EVM Integration Updates
- Replaced manual `transact()` + `journaled_state.finalize()` pattern with `transact_finalize()`
- Updated Account struct initialization to include required `transaction_id: 0` field
- Simplified transaction execution logic using revm v25's improved API

### Import Updates
- Added `ExecutionResult` and `EvmState` imports where needed
- Removed unused `InspectEvm` imports
- Updated import paths for revm v25 module structure

## Testing
- All existing tests pass
- Build completes without warnings
- Both `alloy-evm` and `alloy-op-evm` crates compile successfully

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mattsse mattsse marked this pull request as ready for review June 19, 2025 16:33
@mattsse mattsse requested a review from klkvr as a code owner June 19, 2025 16:33
@klkvr klkvr merged commit 01298e4 into main Jun 20, 2025
27 checks passed
@klkvr klkvr deleted the matt/bump-revm25 branch June 20, 2025 09:42
Comment on lines +194 to +201
// `map_or` does not work here as we use `r` to extend lifetime of the slice
// and return it.
#[allow(clippy::option_if_let_else)]
if let Some(slice) = context.local().shared_memory_buffer_slice(range.clone()) {
r = slice;
r.as_ref()
} else {
&[]
Copy link
Member

Choose a reason for hiding this comment

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

In Foundry we are getting the following error on the r.as_ref() line in https://github.com/foundry-rs/foundry/tree/zerosnacks/bump-revm-26.0.0:

the trait bound `[u8]: AsRef<[_; 0]>` is not satisfied
the following other types implement trait `AsRef<T>`:
  `[u8]` implements `AsRef<winnow::stream::bstr::BStr>`
  `[u8]` implements `AsRef<winnow::stream::bytes::Bytes>`

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in #114

yash-atreya added a commit to foundry-rs/foundry that referenced this pull request Jul 15, 2025
* bump revm, pending alloy-evm alloy-rs/evm#100, pending foundry-fork-db

* bump alloy-evm, foundry-fork-db

* bump deps

* apply alloy-evm fix

* start porting types

* unpin revm-inspectors

* fix issues

* continue preperation

* .control field was removed

* frame_return_result now needs to happen in bigger run_exec_loop block

* update handler and inspector per latest changes removing previous methods

* add new frame loop

* pass in frame

* fix transact_raw

* continue fixes

* apply will_exit, on continue should skip as it is none, on exit (any ok, revert or error) we exit

* continue clean up, some attention points in regards to InstructionResult::Continue

* continue porting

* continue porting

* temporarily use hardcoded BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE

* remove clamping now that revm supports U256 internally for number and timestamp

* fix clippy

* fix doctest

* bump alloy version

* make assertion on `bytecode`

* revert bytecode(), fix to come in upcoming release

* bump revm 27

* fix debug

* revert Cargo.toml change

* clean up

* fix(`config`): block_timestamp and block_number mismatch in Config and EvmOpts (#10903)

* fix clippy

* fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction

* bump revm: 27.0.2

* apply clippy fixes

* fix fmt

* fix config defaults

* fix config change of block_number, block_timestamp require hex formatting

* fix(`evm`): create2 in InspectorHandler and trace decoder for None status (#10925)

* fix: handler CREATE2 override in InspectorHandler

* fix: account for trace.status: None - this is due to removal of InstructionResult::Continue

* fix(`forge/test`): update test fixture: can_run_test_with_json_output_verbose - as trace.status can be null and trace.success can be false due to removal of InstructionResult::Continue

* fix(`forge/test`): repro 6501 - account for success being false due to status being None

* fix(`evm/inspectors`): prevent panic in should_revert_on_address_opcode (#10940)

* fix(`evm/inspectors`): prevent panic by checking interp.action.is_some - fixes: should_revert_on_address_opcode

* undo step removal

* fix merge conflict

* fix(`evm`): enable tx_chain_id_check (#10943)

* use dynamic blob_base_fee_update_fraction selection based on hardfork set

* bump alloy-chains version w/ foundry-fork-db

* fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)

* fix: fork revert diagnostic

* feat(`cheatcodes`): introduces `ForkRevertDiagnostic`

* patch revm to include fix for `call_end` not being called

* fix: can_run_test_with_json_output_verbose

* Revert "fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)"

This reverts commit b74f48a.

* fix(`cast`): disable balance check for impersonated txs. (#10972)

fix(`cast/test`): disable balance check for impersonated tx

* Revert "fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction"

This reverts commit 6db3d97.

* fix(`evm`): remove Handler impl for `FoundryHandler` (#10975)

* fix(`evm`): Handler impl for FoundryEvm

* cleanup

* fmt

* bump foundry-fork-db 0.16, fix tests

* bump alloy

* unify blob_base_fee_update_fraction in helper, clarify exception

* move helpers to evm-core for blob_base_fee_update_fraction

* Update mod.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* unpatch revm, update to 27.0.3

* fix fmt

* revert to solar 1.4, waiting for upgrade PR

* bump alloy-evm / alloy-op-evm

* forcibly downgrade solar-config, solar-macros due to breaking change in 0.1.5

* feat(`revm bump`): add serialization method that serializes as `u64` if fits or `U256` if not (#11008)

* add serialization method that serializes as u64 if fits or u256 if not

* clean up, no longer a need for 0x1

* toml spec limits number representation to i64

---------

Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Jrigada pushed a commit to matter-labs/foundry-zksync that referenced this pull request Aug 19, 2025
* feat: added get_blob_by_hash (#10987)

* feat: added get_blob_by_hash

* use correct get_full_block_fn

* clippy

* clippy

* refactoring and moving to backend

* refactoring and moving to backend

* vec blobs

* get blob

* clippy

* chore: fix clippy (#11011)

* fix(forge-lint): [unused imports] check doc cmnts (inheritdoc) (#11003)

* chore: update dependencies (#11007)

perform generic deps update to compatible versions

* chore(deps): bump to revm 27.0.3 (#10838)

* bump revm, pending alloy-evm alloy-rs/evm#100, pending foundry-fork-db

* bump alloy-evm, foundry-fork-db

* bump deps

* apply alloy-evm fix

* start porting types

* unpin revm-inspectors

* fix issues

* continue preperation

* .control field was removed

* frame_return_result now needs to happen in bigger run_exec_loop block

* update handler and inspector per latest changes removing previous methods

* add new frame loop

* pass in frame

* fix transact_raw

* continue fixes

* apply will_exit, on continue should skip as it is none, on exit (any ok, revert or error) we exit

* continue clean up, some attention points in regards to InstructionResult::Continue

* continue porting

* continue porting

* temporarily use hardcoded BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE

* remove clamping now that revm supports U256 internally for number and timestamp

* fix clippy

* fix doctest

* bump alloy version

* make assertion on `bytecode`

* revert bytecode(), fix to come in upcoming release

* bump revm 27

* fix debug

* revert Cargo.toml change

* clean up

* fix(`config`): block_timestamp and block_number mismatch in Config and EvmOpts (#10903)

* fix clippy

* fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction

* bump revm: 27.0.2

* apply clippy fixes

* fix fmt

* fix config defaults

* fix config change of block_number, block_timestamp require hex formatting

* fix(`evm`): create2 in InspectorHandler and trace decoder for None status (#10925)

* fix: handler CREATE2 override in InspectorHandler

* fix: account for trace.status: None - this is due to removal of InstructionResult::Continue

* fix(`forge/test`): update test fixture: can_run_test_with_json_output_verbose - as trace.status can be null and trace.success can be false due to removal of InstructionResult::Continue

* fix(`forge/test`): repro 6501 - account for success being false due to status being None

* fix(`evm/inspectors`): prevent panic in should_revert_on_address_opcode (#10940)

* fix(`evm/inspectors`): prevent panic by checking interp.action.is_some - fixes: should_revert_on_address_opcode

* undo step removal

* fix merge conflict

* fix(`evm`): enable tx_chain_id_check (#10943)

* use dynamic blob_base_fee_update_fraction selection based on hardfork set

* bump alloy-chains version w/ foundry-fork-db

* fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)

* fix: fork revert diagnostic

* feat(`cheatcodes`): introduces `ForkRevertDiagnostic`

* patch revm to include fix for `call_end` not being called

* fix: can_run_test_with_json_output_verbose

* Revert "fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)"

This reverts commit b74f48a2bb5027670809292840fe26d800c8e4b5.

* fix(`cast`): disable balance check for impersonated txs. (#10972)

fix(`cast/test`): disable balance check for impersonated tx

* Revert "fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction"

This reverts commit 6db3d9768f277a610b138d633a915a1485500fcc.

* fix(`evm`): remove Handler impl for `FoundryHandler` (#10975)

* fix(`evm`): Handler impl for FoundryEvm

* cleanup

* fmt

* bump foundry-fork-db 0.16, fix tests

* bump alloy

* unify blob_base_fee_update_fraction in helper, clarify exception

* move helpers to evm-core for blob_base_fee_update_fraction

* Update mod.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* unpatch revm, update to 27.0.3

* fix fmt

* revert to solar 1.4, waiting for upgrade PR

* bump alloy-evm / alloy-op-evm

* forcibly downgrade solar-config, solar-macros due to breaking change in 0.1.5

* feat(`revm bump`): add serialization method that serializes as `u64` if fits or `U256` if not (#11008)

* add serialization method that serializes as u64 if fits or u256 if not

* clean up, no longer a need for 0x1

* toml spec limits number representation to i64

---------

Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* chore: bump to 1.3.0 (#11013)

* fix(`cheatcodes`): count `0` swallows non-matching reverts (#10867)

* fix(`cheatcodes`): count `0` swallows non-matching reverts

* rm test testNoRevertSpecificButDiffRevert as this is a breaking change

* rm t

* fmt

* forge fmt

* fix: tests according to breaking changes

* fmt

* fix: test test_assume_no_revert_with_data due to breaking change

* clippy

* nit

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>

* feat: fuzzer metrics (#10988)

* feat: fuzzer metrics

* Display metrics in progess bar or inline (if corpus set)

* Nits

---------

Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>

* fix(invariant): apply targetSelector and excludeSelector for test contract target (#11015)

* fix(invariant): apply targetSelector and excludeSelector for test
contract target

* fix unrelated test_assume_no_revert_with_data failure on win

* nits, record and use test contract selectors

* fix(forge-lint): [unused-imports] manually walk override paths (#11020)

* fix: manually walk overide paths

* chore: rmv modifier visitor

* fix(`cheatcodes`): load pranked caller acc in state (#11023)

* fix(forge-lint): [inline-config] use relative span positions (#11022)

* chore: relax tracer bounds (#11024)

* feat(forge-lint): new `LateLintPass` + support code snippets (#10846)

* chore: remove manual usage of solar SessionGlobals (#10980)

* docs: Fix dead links across the codebase (#11012)

Update CONTRIBUTING.md

* feat(cast): add `--raw` option to block subcommand (#11027)

* feat(cast): add --raw option to block command for RLP-encoded block header

- Introduced a new `raw` argument in the `CastSubcommand::Block` to allow users to retrieve the raw RLP-encoded block header.
- Updated the `block` function to handle the new `raw` parameter and return the appropriate output.
- Added a unit test to verify the functionality of the `--raw` option in the CLI command.

* quick fix doctest

* encoding only header

* fix the unit test using a mainnet endpoint

* chore: return reorged blocks (#11026)

* fix: ensure account is always loaded and marked as touched when pranked (#11025)

* ensure account is always loaded and marked as touched when pranked

* add clarifying comment

* clarifying comment

* feat(forge fmt): Adds tab support as indent char in fmt (#10979)

* feat(fmt): adds tab as style for indents

* docs(fmt): adds configuration doc for style

* fix(fmt): return char type in indent_char()

* fix(fmt): adds correct char for visibility attrs

* test(fmt): adds testdata for tabs

* test(cli): adds fmt style to default config

* test(cli): adds fmt style at the correct location

* chore: configure fmt testdata to use lf as eol

* fix(fmt): handling of CRLF in parsing of disable line as inline config

* test(fmt): remove tab test cases

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>

* fix(cheatcodes): remove redundant computation in validate_private_key… (#10993)

fix(cheatcodes): remove redundant computation in validate_private_key function

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* docs(lintrules): reflect latest impl changes (#11031)

* fix(forge): show git submodule status error (#11033)

* chore: centralize and reduce number of spawned tokio runtimes (#11040)

* chore: don't create a new tokio runtime for MultiFork

* chore: centralize tokio runtime spawning

* chore: keep std thread if no runtime is available

* chore: avoid spawning a runtime for SignaturesIdentifier::save

This was running after the runtime for forge test was destroyed,
so it was creating its own runtime just for this one simple task.

* refactor(cast): simplify Unit parsing in from_fixed_point (#11042)

* chore: migrate from codespell to typos (#11045)

* chore: migrate from codespell to typos for spellchecking

Replaced codespell with typos for better performance and more flexible
configuration. This includes:

- Removed .codespellrc configuration
- Added typos.toml with equivalent exclusions and ignored words
- Updated GitHub Actions workflow to use crate-ci/typos@v1
- Updated Makefile targets from lint-codespell to lint-typos
- Fixed actual typos found: overide→override, diffent→different,
  unintialized→uninitialized, dependendy→dependency, appropiate→appropriate

* chore: improve typos configuration with pattern-based ignores

Added regex patterns to ignore common programming constructs:
- Hex strings of various lengths (8, 40, 64 chars)
- Hex literals starting with 0x
- Ordinal numbers in identifiers (1st, 2nd, 3rd, etc.)

This removes most of the word-level exceptions except 'ba' which is
used as a command alias for 'basefee'.

* chore: exclude test directories from typos checks

Added test directory exclusions to reduce false positives in test code:
- **/tests/** and **/test/** directories
- Files matching **/*_test.* and **/*_tests.*

Also added descriptive comments to all file exclusion entries for clarity.

* chore: add explanatory comments to allowed words

Documented why each word in extend-words is allowed:
- crate: Rust keyword used in dependency resolution
- ser: Common abbreviation for serialization
- ratatui: Terminal UI library name
- Caf: Appears in test data/fixtures
- froms: Used in error messages and API names
- strat: Common abbreviation for strategy
- ba: Command alias for basefee

* feat(cast): add checksum address with chain id (#11043)

* feat(cast): add checksum address with chain id

* docs(cast): add docs for chain id in ToCheckSumAddress

* chore: revert workflows

* chore: remove unused dep

* chore: clippy

* chore: fmt

* chore: nightly fmt

* fix: update custom_echo_precompile to include reverted flag in output

* fix: update deployment costs and sizes in test outputs

* cargo clippy

* fmt

* fix: adjust deployment costs and sizes in test outputs

* fix: remove duplicate balance check disabling in transaction execution

* re add comment

* fix: add validation comments for address extraction in handle_create2_override

* feat: add test for zk initialization with zksync and verify .gitignore entries

* fix: update test case to reflect correct increment test identifier and remove unnecessary assertion

* fix: add Moonsong-Labs to the allow-org GitHub sources in deny.toml

---------

Co-authored-by: Soubhik Singha Mahapatra <160333583+Soubhik-10@users.noreply.github.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: alpharush <0xalpharush@protonmail.com>
Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: fuder.eth <vtljgrinkiv@gmail.com>
Co-authored-by: Mablr <59505383+mablr@users.noreply.github.com>
Co-authored-by: Mathias Scherer <scherer.mat@gmail.com>
Co-authored-by: Alex Pikme <waysanya1@gmail.com>
Co-authored-by: Vladimir Kumalagov <95184524+KumaCrypto@users.noreply.github.com>
Jrigada pushed a commit to matter-labs/foundry-zksync that referenced this pull request Aug 20, 2025
* bump revm, pending alloy-evm alloy-rs/evm#100, pending foundry-fork-db

* bump alloy-evm, foundry-fork-db

* bump deps

* apply alloy-evm fix

* start porting types

* unpin revm-inspectors

* fix issues

* continue preperation

* .control field was removed

* frame_return_result now needs to happen in bigger run_exec_loop block

* update handler and inspector per latest changes removing previous methods

* add new frame loop

* pass in frame

* fix transact_raw

* continue fixes

* apply will_exit, on continue should skip as it is none, on exit (any ok, revert or error) we exit

* continue clean up, some attention points in regards to InstructionResult::Continue

* continue porting

* continue porting

* temporarily use hardcoded BLOB_BASE_FEE_UPDATE_FRACTION_PRAGUE

* remove clamping now that revm supports U256 internally for number and timestamp

* fix clippy

* fix doctest

* bump alloy version

* make assertion on `bytecode`

* revert bytecode(), fix to come in upcoming release

* bump revm 27

* fix debug

* revert Cargo.toml change

* clean up

* fix(`config`): block_timestamp and block_number mismatch in Config and EvmOpts (#10903)

* fix clippy

* fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction

* bump revm: 27.0.2

* apply clippy fixes

* fix fmt

* fix config defaults

* fix config change of block_number, block_timestamp require hex formatting

* fix(`evm`): create2 in InspectorHandler and trace decoder for None status (#10925)

* fix: handler CREATE2 override in InspectorHandler

* fix: account for trace.status: None - this is due to removal of InstructionResult::Continue

* fix(`forge/test`): update test fixture: can_run_test_with_json_output_verbose - as trace.status can be null and trace.success can be false due to removal of InstructionResult::Continue

* fix(`forge/test`): repro 6501 - account for success being false due to status being None

* fix(`evm/inspectors`): prevent panic in should_revert_on_address_opcode (#10940)

* fix(`evm/inspectors`): prevent panic by checking interp.action.is_some - fixes: should_revert_on_address_opcode

* undo step removal

* fix merge conflict

* fix(`evm`): enable tx_chain_id_check (#10943)

* use dynamic blob_base_fee_update_fraction selection based on hardfork set

* bump alloy-chains version w/ foundry-fork-db

* fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)

* fix: fork revert diagnostic

* feat(`cheatcodes`): introduces `ForkRevertDiagnostic`

* patch revm to include fix for `call_end` not being called

* fix: can_run_test_with_json_output_verbose

* Revert "fix: fork errors getting overriden by RevertDiagnostic inspector (#10954)"

This reverts commit b74f48a2bb5027670809292840fe26d800c8e4b5.

* fix(`cast`): disable balance check for impersonated txs. (#10972)

fix(`cast/test`): disable balance check for impersonated tx

* Revert "fix(`anvil/test`): change delegatecall.value in test_call_ots_trace_transaction"

This reverts commit 6db3d9768f277a610b138d633a915a1485500fcc.

* fix(`evm`): remove Handler impl for `FoundryHandler` (#10975)

* fix(`evm`): Handler impl for FoundryEvm

* cleanup

* fmt

* bump foundry-fork-db 0.16, fix tests

* bump alloy

* unify blob_base_fee_update_fraction in helper, clarify exception

* move helpers to evm-core for blob_base_fee_update_fraction

* Update mod.rs

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

* unpatch revm, update to 27.0.3

* fix fmt

* revert to solar 1.4, waiting for upgrade PR

* bump alloy-evm / alloy-op-evm

* forcibly downgrade solar-config, solar-macros due to breaking change in 0.1.5

* feat(`revm bump`): add serialization method that serializes as `u64` if fits or `U256` if not (#11008)

* add serialization method that serializes as u64 if fits or u256 if not

* clean up, no longer a need for 0x1

* toml spec limits number representation to i64

---------

Co-authored-by: Yash Atreya <44857776+yash-atreya@users.noreply.github.com>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Jan 16, 2026
* chore: bump revm 25

* more saturating

* feat: complete revm v25 migration with proper type conversions

## Original Task
Complete the migration to revm v25 and follow the hints in issue #99:
- Change `ResultAndState<Halt, EvmState>` to `ResultAndState<ExecutionResult<Halt>, EvmState>`
- For block numbers and timestamps, use `saturating_to()` when converting from U256 to u64

## Changes Applied

### Type System Updates
- Updated all `ResultAndState` signatures from `ResultAndState<HaltReason, EvmState>`
  to `ResultAndState<ExecutionResult<HaltReason>, EvmState>` across:
  - Core `Evm` trait definitions in `src/evm.rs`
  - Ethereum implementation in `src/eth/mod.rs`
  - OP implementation in `src/lib.rs`
  - Either wrapper in `src/either.rs`
  - All system call implementations (EIP-2935, EIP-4788, EIP-7002, EIP-7251)

### U256 to u64 Conversions
- Added `saturating_to()` method calls for all U256 to u64 conversions:
  - `block().number.saturating_to()` for block number conversions
  - `block().timestamp.saturating_to()` for timestamp conversions
  - Applied across both `alloy-evm` and `alloy-op-evm` crates

### EVM Integration Updates
- Replaced manual `transact()` + `journaled_state.finalize()` pattern with `transact_finalize()`
- Updated Account struct initialization to include required `transaction_id: 0` field
- Simplified transaction execution logic using revm v25's improved API

### Import Updates
- Added `ExecutionResult` and `EvmState` imports where needed
- Removed unused `InspectEvm` imports
- Updated import paths for revm v25 module structure

## Testing
- All existing tests pass
- Build completes without warnings
- Both `alloy-evm` and `alloy-op-evm` crates compile successfully

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* rusfmt

* bump

* bumo

* chore: bump revm 26

* chore: bump revm v26.0.0 (alloy-rs/evm#105)

fix compilation

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
Co-authored-by: rakita <rakita@users.noreply.github.com>
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] bump to new revm version

5 participants