Skip to content

Swich interpreter stack from H256 to U256 #317

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 6 commits into from
May 23, 2025
Merged

Swich interpreter stack from H256 to U256 #317

merged 6 commits into from
May 23, 2025

Conversation

sorpaas
Copy link
Member

@sorpaas sorpaas commented May 23, 2025

No description provided.

@sorpaas sorpaas merged commit 8b0c945 into master May 23, 2025
3 checks passed
@sorpaas sorpaas requested a review from Copilot May 23, 2025 06:59
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the interpreter stack from using H256 to using U256 and adjusts related conversions and operations throughout the codebase. Key changes include:

  • Replacing H256 with U256 for stack storage and associated push/pop operations, along with updates in opcode gas calculations.
  • Updating various utility functions and macro invocations to handle the new U256-based stack.
  • Refreshing tooling configurations (rust-toolchain and Cargo.toml) to supported versions.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/mock.rs Changed address existence check to use contains_key for clarity.
src/standard/mod.rs Updated imports to include new types (e.g., IntoCallCreateTrap).
src/standard/gasometer/mod.rs Updated U256 conversions for opcode cost evaluations using utility functions.
src/call_stack.rs Modified depth check using is_some_and for clarity.
rust-toolchain.toml Upgraded Rust version to channel 1.87.0.
jsontests/src/in_memory.rs Applied similar changes as tests/mock.rs for account operations.
interpreter/src/utils.rs Added new utility function u256_to_h160 for consistent conversion.
interpreter/src/machine/stack.rs Reworked the stack implementation to use U256 and updated macros accordingly.
interpreter/src/machine/memory.rs Adjusted doc comments reflecting memory resizing behavior.
interpreter/src/eval/system.rs Updated push/pop macros to the new H256 and U256 conversion routines.
interpreter/src/eval/mod.rs Modified evaluation functions to align with the new stack type.
interpreter/src/eval/misc.rs Updated conversion operations in memory and stack management functions.
interpreter/src/eval/macros.rs Revised macros (push_h256, pop_h256, push_u256) for proper value conversion.
interpreter/src/error/trap.rs Adjusted error trap routines to use consistent U256/H256 conversions.
Cargo.toml Updated rust-version to "1.70.0".

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.

1 participant