Migrate to vm v7 and other relevant dependencies #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.nvmrc
to switch to NodeJS v18 LTS (required by the VM package).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 withbytesToHex()
. 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()
.getBytecodeHashHacky()
andgetDeployedBytecodeMdInfo()
are simplified to convertUint8Array
input to string and use single logic branch. This is due toUint8Array
do not have methodreadInt16BE()
, alsolastIndexOf()
is unable to find index of slice.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
exports
section ofpackage.json
](https://github.com/ethereumjs/ethereumjs-monorepo/blob/c47d2c7351f04f35744de0f2082c37d5f2d2afd0/packages/vm/package.json#L25-L29) of CJS and ESM. This makes makests-node
andmocha
to complain and crash.0x
ofhexToBytes()
andbytesToHex()
).Regards.