EthereumJS VM v5 released | Ethereum Foundation Blog

Published:

While Everyone Be amazed December 1-12 p.m. HoweverBeing very close to the past Eth We The 1.0 version is also very exciting to us. Chain. πŸ˜€

Some Backstory: EthereumJS The Its ecosystem Virtual Machine it consists of a very modular set of libraries (vm, blockchain, merkle-patricia-tree, tx,…), each of which encapsulates its own dedicated set of functionality. While While This is great news for users but not for developers. You Many times, multiple libraries must be updated simultaneously. This can prove to be time-consuming and difficult. . in different repositories. So We We decided to upgrade our setup earlier in the year and merge all VM-related libraries into one. Monorepo. This This repository allows multiple library changes to been targeted by one pull request It To ensure consistency, all library tests are run together. At HoweverMultiple packs can be a great way for you to save money.

Since Our After the switch to monorepo, development activity exploded. πŸ˜‹ We We We discovered so many things we wanted to improve that we couldn’t stop. Especially Since each change often triggered another. “so obvious to do”. 😜

So we develop. And developed. And developed. Basically All year. That’s We We were so busy with other things, that we haven’t been able to communicate much in the last few months.

While late in the process we sometimes wondered if we’d ever put things back together (check out our extensive release notes for an idea of ​​what I mean), today I’m Very Proud to announce: Did. πŸ˜‹ Thanks An Amazing team for their dedication and hard work. πŸŽ‰

This Not Six major releases are included in our core libraries.


In We This post won’t go into the technical details, but it will provide a high-level overview. For For You can find more information in the release notes. We Really try to make it understandable. They Also, a summary of all significant (breaking) changes.

Maybe Just A note: We I have changed to a new naming scheme These Releases will require that you use the most current names to get the latest versions. Previous ethereumjs-vm For Example: Package is now installed in the below:

npm Install @ethereumjs/vm

It’s okay. What It It really is there? Let’s take a quick look.

all forks

EthereumJS Virtual Machine v5 All Now, forks can be supported back to their genesis This Here This is a brief overview of the history Ethereum JavaScript has many exciting possibilities available to JavaScript users. We We You can find more information about it below.

It It is possible to create a virtual machine for one HF.

Import VM Starting At '@ethereumjs/vm';
Import Common Starting at '@ethereumjs/common';

Const Common = New Common({ Chain: 'mainnet', hardfork: 'spuriousDragon' });
Const vm = New VM({ Common });

An Virtual Machine EIP-centric

While Although Although hardforks excel at gathering a set of agreed changes together in one place, it has proven difficult to support future-driven developments if the virtual machine is not finalized for some time. In In such a case, the EIP is replaced. hardfork Sedan Hardfork It is the best example yet.

With The In the new version, the internal functional modularization of VM was reworked. This Now EIPs can be made native citizens in the virtual machine. You You can create a virtual computer by using a number of EIPs.

Import Common Starting at '@ethereumjs/common';
Import VM Starting At '@ethereumjs/vm';

Const Common = New Common({ Chain: 'mainnet', eips: [2537] });
Const vm = New VM({ Common });

To Get started. We Support the following EIPs, which are primarily for Sedan Fork) with virtual machines v5release:


Typescript

In This EthereumWe We can confidently say that our libraries were integrated into the JS release cycle’s modern technology stacks. The Rest is: With We We are closer to our TypeScript transition All TypeScript now supports our core libraries as well as internal dependencies.

Just This Here’s a summary of TypeScript and how it helps make our libraries more secure. TypeScript is a superset JavaScript, which allows developers understand the data types for each variable and object being utilized. In The code. The Variable is what it is called Address A binary string or string Buffer object? While JavaScript doesn’t provide any explicit guidance about this topic, which could increase the chances of developers making mistakes. TypeScript however will inform you.

It AlsoIt’s easier to work on libraries yourself or use them in a project by a third party. Developers Now you have access to hints such like these in the IDE across the entire code base.

Your Only A TypeScript-typed environment for software development can make sure that the future of software engineering is bright. Block Chain The Variable can be a @ethereumjs/blockchain object (wait with your comments), Go Rust developers πŸ˜…) and not just “something”. So Our TypeScript code is readable code.

promises

If If JavaScript may not be your style, so skip this section. But If JavaScript developers are looking for JavaScript, this news will likely be a relief. So We’ll just mention it briefly.

Another Transition complete. All JavaScript now supports library APIs Promises. So No You can get more calls from anywhere in the stack.

The Use The library begins at:

Blockchain.GetBlock(BlockId, Block => {
  console.Log(Block);
});

New Example of API

Const Block = await Blockchain.GetBlock(BlockId);
console.log(Block);

The This A small notch might not seem to be significant at first glance. HoweverThe It is difficult to understand code when it is nested within many of these older-style calls. Just Google “hell callback” This It is what it looks like. πŸ™‚ Promises You Can write much more readable software

Library Refactorings

Sometimes It’s It is difficult to imagine a car that runs without an engine swap. However, it is essential if you want to drive safely for the next 10,000 mile. With Software Refactoring is often very similar. πŸ˜€ With In In this series, we review the core of some our most important libraries as well as our website. BlockOur Texas Partly Ours Block Chain The Library underwent significant rewrite.

These Libraries Should be easier to use and well-equipped to provide a solid foundation upon which to build. Ethereum The JavaScript ecosystem will evolve over many years.

Panorama

We We We hope that you enjoy our latest releases. This The Information provided in this article is only a small glimpse of major changes. You can find more information in the release comments at the end of the post. We We We are eager to hear your feedback about our services Discord Our new server @EFJavaScript Twitter account

For These Releases are a foundation for a future-oriented cycle of development. We Can’t wait for it to happen. With The VM is now available for integration into our newly redesigned environment. EthereumJS Client Project. We Will This client will not join mainnet anytime soon. HoweverWe We can all do our part in increasing customer diversity. The We You will be able as soon as the client is in its early stages to join their development testnets. Yolo v2 (and other) to actively prevent cross-client consensus mistakes. We You You will also be able to participate in future research protocols and assist with their implementation. You’ll Once The first version of our client is now available. You will hear more about it (geared towards full sync). Yolo v2), this will be early next year.

For We We wish you all a happy and peaceful end to the year. This The launch day will last for a whole week. Beaconchain! πŸš€

The EF JavaScript Team

Related articles

Recent articles