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

Migrate to vm v7 #33

Closed
wants to merge 1 commit into from
Closed

Migrate to vm v7 #33

wants to merge 1 commit into from

Conversation

blitz-1306
Copy link
Contributor

@blitz-1306 blitz-1306 commented Jan 24, 2024

Preface

This is a PoC pull request to use https://github.com/ethereumjs/ethereumjs-monorepo/releases/tag/%40ethereumjs%2Fvm%407.0.0 and other relevant dependencies. List of VM changes can be found here.

Changes

  • Update dependencies.
  • All Buffer types changed to Uint8Array due to upstream changes.
    • Most of Buffer.from() are replaced with toBytes() or hexToBytes(). This is not necessarily correct, due to these functions require 0x prefix at the beginning of the input string.
    • Most of Buffer.toString("hex") are replaced with custom Uint8Array-to-hex conversion functions. This is not necessarily correct, due to these function adds 0x prefix at the beginning of the result string. This may cause issues.
    • Bytes equality is now done with equalsBytes() instead of Buffer.equals().
  • VM removed EEI from the package. Its functionality is now provided by StateManager. So there are related adjustments to respect this change.
  • Transaction data is now passed with TypedTransaction type.
  • RLP is now released as a standalone dependency and therefore used in such way.

Concerns

  • Codebase is still not runnable due to VM package moved to cjs / esm builds, and I wasn't able to configure TS and Jest to work with it properly.
    Cannot find module '@ethereumjs/evm/dist/cjs/opcodes' from 'src/debug/sol_debugger.ts'
    
  • As mentioned above, there are several cases, when code should be debugged (regading 0x prefix of bytes-to-hex conversion).
  • Other VM-dependent packages didnt moved to v7 just yet, so maybe we should wait until they finish their migration first.

Regards.

@nandubatchu
Copy link

is this resolved?

@cd1m0
Copy link
Collaborator

cd1m0 commented Oct 24, 2024

Fixed in another PR.

@cd1m0 cd1m0 closed this Oct 24, 2024
@cd1m0 cd1m0 deleted the vm-v7 branch October 24, 2024 05:27
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.

3 participants