ethereumjs-monorepo

Monorepo for the Ethereum VM TypeScript Implementation

Downloads
28.5M
Stars
2.5K
Committers
217
ethereumjs-monorepo - @ethereumjs/ethash v3.0.3

Published by holgerd77 7 months ago

Maintenance release with downstream dependency updates, see PR #3297

ethereumjs-monorepo - @ethereumjs/block v5.2.0

Published by holgerd77 7 months ago

Full 4844 Browser Readiness

WASM KZG

Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉

Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.

This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).

Note that kzg-wasm needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):

import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const kzg = await loadKZG()

// Instantiate `common`
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg },
})

Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.

Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).

Trie Node.js Import Bug

Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie library with a Node.js web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.

Other Changes

  • Fixed a bug in the Block.fromRPC() and BlockHeader.fromRPC() constructors to not parse the parentBeaconBlockRoot correctly, PR #3283
ethereumjs-monorepo - @ethereumjs/statemanager v2.3.0

Published by holgerd77 7 months ago

Full 4844 Browser Readiness

WASM KZG

Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉

Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.

This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).

Note that kzg-wasm needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):

import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const kzg = await loadKZG()

// Instantiate `common`
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg },
})

Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.

Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).

Trie Node.js Import Bug

Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie library with a Node.js web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.

Other Changes

  • Properly apply statemanager opts in fromProof(), PR #3276
  • New optional getAppliedKey() method for the interface (see interface definition in @ethereumjs/common), PR #3143
  • Fix inconsistency between the normal and the RPC statemanager regarding empty account return values, PR #3323
  • Fix a type error related to the lru-cache dependency, PR #3285
  • Add tests for verkle statemanager, PR #3257
ethereumjs-monorepo - @ethereumjs/verkle v0.0.2

Published by holgerd77 7 months ago

  • Fix a type error related to the lru-cache dependency, PR #3285
  • Downstream dependency updates, see PR #3297
ethereumjs-monorepo - @ethereumjs/wallet v2.0.3

Published by holgerd77 7 months ago

Maintenance release with downstream dependency updates, see PR #3297

ethereumjs-monorepo - @ethereumjs/devp2p v6.1.2

Published by holgerd77 7 months ago

  • Fix a type error related to the lru-cache dependency, PR #3285
  • Downstream dependency updates, see PR #3297
ethereumjs-monorepo - @ethereumjs/tx v5.3.0

Published by holgerd77 7 months ago

Full 4844 Browser Readiness

WASM KZG

Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉

Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.

This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).

Note that kzg-wasm needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):

import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const kzg = await loadKZG()

// Instantiate `common`
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg },
})

Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.

Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).

Trie Node.js Import Bug

Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie library with a Node.js web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.

ethereumjs-monorepo - @ethereumjs/trie v6.2.0

Published by holgerd77 7 months ago

In the hope that you do not have yet integrated: we needed to remove the new more modern async trie iteration with web streams functionality (new createAsyncReadStream() method) introduced with the v6.1.0 release - see PR #3231 for context - since the related Node.js web streams API import caused relatively severe problems for all upstream libraries when being used in the browser.

So functionality has been removed in PR #3280. We hope we find a good way to re-introduce along with the next breaking release round without limiting browser functionality.

Other Changes

  • Add optional partialPath parameter to trie.findPath(), PR #3305
  • Add export for Path interface for better TypeScript integration when using the findPath() method, PR #3292
  • Improved zero-element proof behavior in verifyProof() method, PR #3047
  • Fix a type error related to the lru-cache dependency, PR #3285
ethereumjs-monorepo - @ethereumjs/common v4.3.0

Published by holgerd77 7 months ago

Full 4844 Browser Readiness

WASM KZG

Shortly following the "Dencun Hardfork Support" release round from last month, this is now the first round of releases where the EthereumJS libraries are now fully browser compatible regarding the new 4844 functionality, see PRs #3294 and #3296! 🎉

Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the c-kzg library which we have released under the kzg-wasm name on npm (and you can also use independently for other projects). See the newly created GitHub repository for some library-specific documentation.

This WASM KZG library can now be used for KZG initialization (replacing the old recommended c-kzg initialization), see the respective README section from the tx library for usage instructions (which is also accurate for the other using upstream libraries like block or EVM).

Note that kzg-wasm needs to be added manually to your own dependencies and the KZG initialization code needs to be adopted like the following (which you will likely want to do in most cases, so if you deal with post Dencun EVM bytecode and/or 4844 blob txs in any way):

import { loadKZG } from 'kzg-wasm'
import { Chain, Common, Hardfork } from '@ethereumjs/common'

const kzg = await loadKZG()

// Instantiate `common`
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg },
})

Manual addition is necessary because we did not want to bundle our libraries with WASM code by default, since some projects are then prevented from using our libraries.

Note that passing in the KZG setup file is not necessary anymore, since this is now defaulting to the setup file from the official KZG ceremony (which is now bundled with the KZG library).

Trie Node.js Import Bug

Since this fits well also to be placed here relatively prominently for awareness: we had a relatively nasty bug in the @ethereumjs/trie library with a Node.js web stream import also affecting browser compatibility, see PR #3280. This bug has been fixed along with these releases and this library now references the updated trie library version.

Other Changes

  • TypeScript type fixes leading to build problems with certain tools (Vercel), PR #3306
  • Early support for EIP-2935 - "Save historical block hashes in state" (Verkle related, likely subject to change), PRs #3268 and #3327
ethereumjs-monorepo - @ethereumjs/util v9.0.3

Published by holgerd77 7 months ago

  • Allow optional trustedSetupPath for the initKZG() method, PR #3296
ethereumjs-monorepo - @ethereumjs/client v0.10.0

Published by holgerd77 9 months ago

This client release now comes with official Dencun hardfork support 🎉 and by default uses WASM for crypto primitives for faster block execution times.

Dencun Hardfork Support

This release now officially supports networks running with or switching to the Dencun hardfork ruleset by including the finalized underlying EthereumJS libraries for the various functionality parts (EVM, Block and Tx libraries).

While EIP-4844 - activating shard blob transactions - is for sure the most prominent EIP from this hardfork, enabling better scaling for the Ethereum ecosystem by providing cheaper block space for L2s, there are in total 6 EIPs contained in the Dencun hardfork. The following is an overview of EIPs now supported along a Dencun switch (called Cancun for the execution switch part):

  • EIP-1153: Transient storage opcodes (@ethereumjs/evm)
  • EIP-4788: Beacon block root in the EVM (@ethereumjs/block, @ethereumjs/evm, @ethereumjs/vm)
  • EIP-4844: Shard Blob Transactions (@ethereumjs/tx, @ethereumjs/block, @ethereumjs/evm)
  • EIP-5656: MCOPY - Memory copying instruction (@ethereumjs/evm)
  • EIP-6780: SELFDESTRUCT only in same transaction (@ethereumjs/vm)
  • EIP-7516: BLOBBASEFEE opcode (@ethereumjs/block, @ethereumjs/evm)

Note that while HF timestamp switches for all testnets are included, a mainnet HF timestamp has not yet been set in this release.

WASM Crypto Support

With this release the client uses WASM by default for all crypto related operations like hashing or signature verification, see PR #3192. As a WASM crypto library @polkadot/wasm-crypto is being used and WASM comes into play in the EVM for hashing opcodes and precompiles, block and tx hashing and ECDSA signature verfication down to trie key hashing and all hashing and signature functionality in the devp2p layer.

This makes up for a significantly lighter and sped-up client experience regarding both block execution and sync times.

Note that this functionality can be disabled by using the --useJsCrypto flag.

Stability Fixes

  • Patch fcu skeleton blockfill process to avoid chain reset, PR #3137
  • Fix bug in tx pool during handling NewPooledTransactionHashes message, PR #3156
  • Improved receipt reorg logic, PR #3146
  • Block fetcher stabilizations, PR #3240

Other Changes

  • Fix RPC debug inconsistencies, PR #3125
  • Better typing/refactoring for devp2p ETH method binding, PR #3164
  • Replace superagent with direct RPC calls in RPC tests, PR #3173
  • testdouble to vi refactoring, PR #3182
  • Fetcher Small Bugfixes and Log Improvements, PR #3024
ethereumjs-monorepo - @ethereumjs/evm v2.2.1

Published by holgerd77 9 months ago

  • Hotfix release moving the @ethereumjs/verkle dependency for @ethereumjs/statemanager from a peer dependency to the main dependencis (note that this decision might be temporary)
ethereumjs-monorepo - @ethereumjs/statemanager v2.2.2

Published by holgerd77 9 months ago

  • Hotfix release moving the @ethereumjs/verkle dependency from a peer dependency to the main dependencis (note that this decision might be temporary)
ethereumjs-monorepo - @ethereumjs/vm v7.2.0

Published by holgerd77 9 months ago

Dencun Hardfork Support

While all EIPs contained in the upcoming Dencun hardfork run pretty much stable within the EthereumJS libraries for quite some time, this is the first release round which puts all this in the official space and removes "experimental" labeling preparing for an imminent Dencun launch on the last testnets (Holesky) and mainnet activation! 🎉

Dencun hardfork on the execution side is called Cancun and can be activated within the EthereumJS libraries (default hardfork still Shanghai) with a following common instance:

import * as kzg from 'c-kzg'
import { Common, Chain, Hardfork } from '@ethereumjs/common'
import { initKZG } from '@ethereumjs/util'

initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt')
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg: kzg },
})
console.log(common.customCrypto.kzg) // Should print the initialized KZG interface

Note that the kzg initialization slightly changed from previous experimental releases and a custom KZG instance is now passed to Common by using the customCrypto parameter, see PR #3262.

At the moment using the Node.js bindings for the c-kzg library is the only option to get KZG related functionality to work, note that this solution is not browser compatible. We are currently working on a WASM build of that respective library. Let us know on the urgency of this task! 😆

While EIP-4844 - activating shard blob transactions - is for sure the most prominent EIP from this hardfork, enabling better scaling for the Ethereum ecosystem by providing cheaper block space for L2s, there are in total 6 EIPs contained in the Dencun hardfork. The following is an overview of which EthereumJS libraries mainly implement the various EIPs:

  • EIP-1153: Transient storage opcodes (@ethereumjs/evm)
  • EIP-4788: Beacon block root in the EVM (@ethereumjs/block, @ethereumjs/evm, @ethereumjs/vm)
  • EIP-4844: Shard Blob Transactions (@ethereumjs/tx, @ethereumjs/block, @ethereumjs/evm)
  • EIP-5656: MCOPY - Memory copying instruction (@ethereumjs/evm)
  • EIP-6780: SELFDESTRUCT only in same transaction (@ethereumjs/vm)
  • EIP-7516: BLOBBASEFEE opcode (@ethereumjs/block, @ethereumjs/evm)

WASM Crypto Support

With this release round there is a new way to replace the native JS crypto primitives used within the EthereumJS ecosystem by custom/other implementations in a controlled fashion, see PR #3192.

This can e.g. be used to replace time-consuming primitives like the commonly used keccak256 hash function with a more performant WASM based implementation, see @ethereumjs/common README for some detailed guidance on how to use.

Self-Contained (and Working 🙂) README Examples

All code examples in EthereumJS monorepo library README files are now self-contained and can be executed "out of the box" by simply copying them over and running "as is", see tracking issue #3234 for an overview. Additionally all examples can now be found in the respective library examples folder (in fact the README examples are now auto-embedded from over there). As a nice side effect all examples are now run in CI on new PRs and so do not risk to get outdated or broken over time.

ethereumjs-monorepo - @ethereumjs/evm v2.2.0

Published by holgerd77 9 months ago

Dencun Hardfork Support

While all EIPs contained in the upcoming Dencun hardfork run pretty much stable within the EthereumJS libraries for quite some time, this is the first release round which puts all this in the official space and removes "experimental" labeling preparing for an imminent Dencun launch on the last testnets (Holesky) and mainnet activation! 🎉

Dencun hardfork on the execution side is called Cancun and can be activated within the EthereumJS libraries (default hardfork still Shanghai) with a following common instance:

import * as kzg from 'c-kzg'
import { Common, Chain, Hardfork } from '@ethereumjs/common'
import { initKZG } from '@ethereumjs/util'

initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt')
const common = new Common({
  chain: Chain.Mainnet,
  hardfork: Hardfork.Cancun,
  customCrypto: { kzg: kzg },
})
console.log(common.customCrypto.kzg) // Should print the initialized KZG interface

Note that the kzg initialization slightly changed from previous experimental releases and a custom KZG instance is now passed to Common by using the customCrypto parameter, see PR #3262.

At the moment using the Node.js bindings for the c-kzg library is the only option to get KZG related functionality to work, note that this solution is not browser compatible. We are currently working on a WASM build of that respective library. Let us know on the urgency of this task! 😆

While EIP-4844 - activating shard blob transactions - is for sure the most prominent EIP from this hardfork, enabling better scaling for the Ethereum ecosystem by providing cheaper block space for L2s, there are in total 6 EIPs contained in the Dencun hardfork. The following is an overview of which EthereumJS libraries mainly implement the various EIPs:

  • EIP-1153: Transient storage opcodes (@ethereumjs/evm)
  • EIP-4788: Beacon block root in the EVM (@ethereumjs/block, @ethereumjs/evm, @ethereumjs/vm)
  • EIP-4844: Shard Blob Transactions (@ethereumjs/tx, @ethereumjs/block, @ethereumjs/evm)
  • EIP-5656: MCOPY - Memory copying instruction (@ethereumjs/evm)
  • EIP-6780: SELFDESTRUCT only in same transaction (@ethereumjs/vm)
  • EIP-7516: BLOBBASEFEE opcode (@ethereumjs/block, @ethereumjs/evm)

WASM Crypto Support

With this release round there is a new way to replace the native JS crypto primitives used within the EthereumJS ecosystem by custom/other implementations in a controlled fashion, see PR #3192.

This can e.g. be used to replace time-consuming primitives like the commonly used keccak256 hash function with a more performant WASM based implementation, see @ethereumjs/common README for some detailed guidance on how to use.

Self-Contained (and Working 🙂) README Examples

All code examples in EthereumJS monorepo library README files are now self-contained and can be executed "out of the box" by simply copying them over and running "as is", see tracking issue #3234 for an overview. Additionally all examples can now be found in the respective library examples folder (in fact the README examples are now auto-embedded from over there). As a nice side effect all examples are now run in CI on new PRs and so do not risk to get outdated or broken over time.

Other Changes

  • Fix modexp precompile edge cases (❤️ to @last-las for reporting!), PR #3169
  • Fix bug in custom precompile functionality (❤️ to @roninjin10 for the contribution!), PR #3158
  • Fix Blake2F gas + output calculation on non-zero aligned inputs (❤️ to @kchojn for the contribution!), PR #3201
  • Ensure modexp right-pads input data (❤️ to @last-las for reporting!), PR #3206
  • Fix CALL(CODE) gas (❤️ to @last-las for reporting!), PR #3195
  • Add runCallOpts and runCodeOpts to evm exports, PR #3172
  • Add test for ecrecover precompile, PR #3184
  • Additional tests for the ripemd160 and blake2f precompiles, PR #3189
ethereumjs-monorepo - @ethereumjs/ethash v3.0.2

Published by holgerd77 9 months ago

Maintenance release with dependency updates, see PR #3261

ethereumjs-monorepo - @ethereumjs/block v5.1.1

Published by holgerd77 9 months ago

  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #3271
ethereumjs-monorepo - @ethereumjs/statemanager v2.2.1

Published by holgerd77 9 months ago

  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #3271
ethereumjs-monorepo - @ethereumjs/devp2p v6.1.1

Published by holgerd77 9 months ago

  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #3271
ethereumjs-monorepo - @ethereumjs/tx v5.2.1

Published by holgerd77 9 months ago

  • Hotfix release adding a missing debug dependency to the @ethereumjs/trie package (dependency), PR #3271
Package Rankings
Top 0.67% on Npmjs.org
Top 6.62% on Proxy.golang.org
Top 12.59% on Repo1.maven.org
Badges
Extracted from project README
Code Coverage Discord GitPOAP NPM Package Block Issues Actions Status Code Coverage NPM Package Blockchain Issues Actions Status Code Coverage NPM Package Client Issues Actions Status Code Coverage NPM Package Common Issues Actions Status Code Coverage NPM Package Devp2p Issues Actions Status Code Coverage NPM Package Ethash Issues Actions Status Code Coverage NPM Package EVM Issues Actions Status Code Coverage NPM Package Genesis Issues Actions Status Code Coverage NPM Package rlp Issues Actions Status Code Coverage NPM Package StateManager Issues Actions Status Code Coverage NPM Package MPT Issues Actions Status Code Coverage NPM Package Tx Issues Actions Status Code Coverage NPM Package Util Issues Actions Status Code Coverage NPM Package VM Issues Actions Status Code Coverage NPM Package VM Issues Actions Status Code Coverage NPM Package StateManager Issues Actions Status Code Coverage