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

EvmStack native endian #8037

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft

EvmStack native endian #8037

wants to merge 20 commits into from

Conversation

Scooletz
Copy link
Contributor

@Scooletz Scooletz commented Jan 9, 2025

This PR changes the endianness of the EvmStack to be aligned with the platform it runs on. It means that no endianness conversions should be done when retrieving storing UInt256. The penalty though is related to pushing/poping bytes that now require reversing. According to the profiling this should happen much less frequent than regular operations.

Beside the endiannes, this PR add one method that allows to peek a ref UInt256 to the top of the stack. This allows for any Instruction that has push/pop behavior to get a ref to the last parameter and directly set the value on the stack, without performing calculations for pop and push. Instead it will calculated the offset once for getting the ref and use it for pop.

Changes

  • EvmStack uses now native platform endianess
  • EvmStack allows peeking a ref to the top

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@Scooletz Scooletz force-pushed the evm-stack-native-endian branch 2 times, most recently from 4e48a4c to 4b804ef Compare January 16, 2025 12:16
@Scooletz Scooletz force-pushed the evm-stack-native-endian branch from 4b804ef to 8f8c479 Compare January 16, 2025 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant