[x] All Buffer types changed to Uint8Array due to upstream changes.
[x] 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.
[x] 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.
[x] Bytes equality is now done with equalsBytes() instead of Buffer.equals().
[x] VM removed EEI from the package. Its functionality is now provided by StateManager. So there are related adjustments to respect this change.
[x] Transaction data is now passed with TypedTransaction type.
[x] 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.
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
Buffer
types changed toUint8Array
due to upstream changes.Buffer.from()
are replaced withtoBytes()
orhexToBytes()
. This is not necessarily correct, due to these functions require0x
prefix at the beginning of the input string.Buffer.toString("hex")
are replaced with customUint8Array
-to-hex conversion functions. This is not necessarily correct, due to these function adds0x
prefix at the beginning of the result string. This may cause issues.equalsBytes()
instead ofBuffer.equals()
.EEI
from the package. Its functionality is now provided byStateManager
. So there are related adjustments to respect this change.Transaction
data is now passed withTypedTransaction
type.Concerns
cjs
/esm
builds, and I wasn't able to configure TS and Jest to work with it properly.0x
prefix of bytes-to-hex conversion).Regards.