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 and other relevant dependencies #26

Closed
wants to merge 2 commits into from
Closed

Conversation

blitz-1306
Copy link
Contributor

@blitz-1306 blitz-1306 commented Aug 28, 2023

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.
  • Add .nvmrc to switch to NodeJS v18 LTS (required by the VM package).
  • All Buffer types changed to Uint8Array due to upstream changes.
    • All entries 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.
    • All entries of Buffer.toString("hex") are replaced with bytesToHex(). 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().
  • Functions getBytecodeHashHacky() and getDeployedBytecodeMdInfo() are simplified to convert Uint8Array input to string and use single logic branch. This is due to Uint8Array do not have method readInt16BE(), also lastIndexOf() is unable to find index of slice.
  • 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

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/cjs/evm' is not defined by "exports" in sol-dbg/node_modules/@ethereumjs/evm/package.json
  • As mentioned above, there are several cases, when code should be debugged (regading 0x of hexToBytes() and bytesToHex()).

Regards.

@blitz-1306
Copy link
Contributor Author

Closing in favor of #33

@blitz-1306 blitz-1306 closed this Jan 24, 2024
@blitz-1306 blitz-1306 deleted the use-vm-v7 branch January 24, 2024 06:36
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