diff --git a/package-lock.json b/package-lock.json index 4295728eba..fd198e12be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15659,14 +15659,14 @@ }, "packages/block": { "name": "@ethereumjs/block", - "version": "5.1.1", + "version": "5.2.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { @@ -15678,16 +15678,16 @@ }, "packages/blockchain": { "name": "@ethereumjs/blockchain", - "version": "7.1.0", + "version": "7.2.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/ethash": "^3.0.2", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/ethash": "^3.0.3", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", "lru-cache": "10.1.0" @@ -15699,24 +15699,24 @@ }, "packages/client": { "name": "@ethereumjs/client", - "version": "0.10.0", + "version": "0.10.1", "hasInstallScript": true, "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "5.1.1", - "@ethereumjs/blockchain": "7.1.0", - "@ethereumjs/common": "4.2.0", - "@ethereumjs/devp2p": "6.1.1", - "@ethereumjs/ethash": "3.0.2", - "@ethereumjs/evm": "2.2.1", - "@ethereumjs/genesis": "0.2.1", + "@ethereumjs/block": "5.2.0", + "@ethereumjs/blockchain": "7.2.0", + "@ethereumjs/common": "4.3.0", + "@ethereumjs/devp2p": "6.1.2", + "@ethereumjs/ethash": "3.0.3", + "@ethereumjs/evm": "3.0.0", + "@ethereumjs/genesis": "0.2.2", "@ethereumjs/rlp": "5.0.2", - "@ethereumjs/statemanager": "2.2.2", - "@ethereumjs/trie": "6.1.1", - "@ethereumjs/tx": "5.2.1", - "@ethereumjs/util": "9.0.2", - "@ethereumjs/verkle": "^0.0.1", - "@ethereumjs/vm": "7.2.1", + "@ethereumjs/statemanager": "2.3.0", + "@ethereumjs/trie": "6.2.0", + "@ethereumjs/tx": "5.3.0", + "@ethereumjs/util": "9.0.3", + "@ethereumjs/verkle": "^0.0.2", + "@ethereumjs/vm": "8.0.0", "@polkadot/util": "^12.6.2", "@polkadot/wasm-crypto": "^7.3.2", "abstract-level": "^1.0.3", @@ -15897,10 +15897,10 @@ }, "packages/common": { "name": "@ethereumjs/common", - "version": "4.2.0", + "version": "4.3.0", "license": "MIT", "dependencies": { - "@ethereumjs/util": "^9.0.2" + "@ethereumjs/util": "^9.0.3" }, "devDependencies": { "@polkadot/util": "^12.6.2", @@ -15984,12 +15984,12 @@ }, "packages/devp2p": { "name": "@ethereumjs/devp2p", - "version": "6.1.1", + "version": "6.1.2", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@scure/base": "1.1.1", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", @@ -15999,8 +15999,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/tx": "^5.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/tx": "^5.3.0", "@types/debug": "^4.1.9", "@types/k-bucket": "^5.0.0", "chalk": "^4.1.2", @@ -16023,17 +16023,17 @@ }, "packages/ethash": { "name": "@ethereumjs/ethash", - "version": "3.0.2", + "version": "3.0.3", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^5.1.1", + "@ethereumjs/block": "^5.2.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "bigint-crypto-utils": "^3.2.2", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { - "@ethereumjs/common": "^4.2.0" + "@ethereumjs/common": "^4.3.0" }, "engines": { "node": ">=18" @@ -16041,13 +16041,13 @@ }, "packages/evm": { "name": "@ethereumjs/evm", - "version": "2.2.1", + "version": "3.0.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/statemanager": "^2.2.2", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/statemanager": "^2.3.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "@types/debug": "^4.1.9", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", @@ -16073,14 +16073,14 @@ }, "packages/genesis": { "name": "@ethereumjs/genesis", - "version": "0.2.1", + "version": "0.2.2", "license": "MIT", "dependencies": { - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/util": "^9.0.2" + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/util": "^9.0.3" }, "devDependencies": { - "@ethereumjs/trie": "^6.1.1" + "@ethereumjs/trie": "^6.2.0" }, "engines": { "node": ">=18" @@ -16102,33 +16102,33 @@ }, "packages/statemanager": { "name": "@ethereumjs/statemanager", - "version": "2.2.2", + "version": "2.3.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/util": "^9.0.2", - "@ethereumjs/verkle": "^0.0.1", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/util": "^9.0.3", + "@ethereumjs/verkle": "^0.0.2", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", "js-sdsl": "^4.1.4", "lru-cache": "10.1.0" }, "devDependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/genesis": "^0.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/genesis": "^0.2.2", "@types/debug": "^4.1.9", "rustbn-wasm": "^0.4.0" } }, "packages/trie": { "name": "@ethereumjs/trie", - "version": "6.1.1", + "version": "6.2.0", "license": "MPL-2.0", "dependencies": { "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@types/readable-stream": "^2.3.13", "debug": "^4.3.4", "ethereum-cryptography": "^2.1.3", @@ -16136,7 +16136,7 @@ "readable-stream": "^3.6.0" }, "devDependencies": { - "@ethereumjs/genesis": "^0.2.1", + "@ethereumjs/genesis": "^0.2.2", "@types/benchmark": "^1.0.33", "abstract-level": "^1.0.3", "level": "^8.0.0", @@ -16153,12 +16153,12 @@ }, "packages/tx": { "name": "@ethereumjs/tx", - "version": "5.2.1", + "version": "5.3.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { @@ -16174,7 +16174,7 @@ }, "packages/util": { "name": "@ethereumjs/util", - "version": "9.0.2", + "version": "9.0.3", "license": "MPL-2.0", "dependencies": { "@ethereumjs/rlp": "^5.0.2", @@ -16189,12 +16189,12 @@ }, "packages/verkle": { "name": "@ethereumjs/verkle", - "version": "0.0.1", + "version": "0.0.2", "license": "MIT", "dependencies": { - "@ethereumjs/rlp": "5.0.2", - "@ethereumjs/util": "9.0.2", - "lru-cache": "10.1.0", + "@ethereumjs/rlp": "^5.0.2", + "@ethereumjs/util": "^9.0.3", + "lru-cache": "^10.0.0", "rust-verkle-wasm": "^0.0.1" }, "engines": { @@ -16203,18 +16203,18 @@ }, "packages/vm": { "name": "@ethereumjs/vm", - "version": "7.2.1", + "version": "8.0.0", "license": "MPL-2.0", "dependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/blockchain": "^7.1.0", - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/evm": "^2.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/blockchain": "^7.2.0", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/evm": "^3.0.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/statemanager": "^2.2.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/statemanager": "^2.3.0", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3" }, @@ -16237,10 +16237,10 @@ }, "packages/wallet": { "name": "@ethereumjs/wallet", - "version": "2.0.2", + "version": "2.0.3", "license": "MIT", "dependencies": { - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@scure/base": "^1.1.5", "ethereum-cryptography": "^2.1.3", "js-md5": "^0.8.3", diff --git a/package.json b/package.json index d1fde6dcf0..73f6135451 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "scripts": { "checkNpmVersion": "./scripts/check-npm-version.sh", "clean": "./config/cli/clean-root.sh", + "docs:build": "npm run docs:build --workspaces --if-present", "e2e:inject": "node ./scripts/e2e-inject-resolutions.js", "e2e:publish": "./scripts/e2e-publish.sh", "e2e:resolutions": "node ./scripts/e2e-resolutions.js", diff --git a/packages/block/CHANGELOG.md b/packages/block/CHANGELOG.md index 8f75575f90..24392469be 100644 --- a/packages/block/CHANGELOG.md +++ b/packages/block/CHANGELOG.md @@ -6,6 +6,46 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 5.2.0 - 2024-03-05 + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3283) + ## 5.1.1 - 2024-02-08 - Hotfix release adding a missing `debug` dependency to the `@ethereumjs/trie` package (dependency), PR [#3271](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3271) diff --git a/packages/block/README.md b/packages/block/README.md index 561690e6b0..9d05978685 100644 --- a/packages/block/README.md +++ b/packages/block/README.md @@ -168,12 +168,13 @@ To create blocks which include blob transactions you have to active EIP-4844 in import { Common, Chain, Hardfork } from '@ethereumjs/common' import { Block } from '@ethereumjs/block' import { BlobEIP4844Transaction } from '@ethereumjs/tx' -import { Address, initKZG } from '@ethereumjs/util' -import * as kzg from 'c-kzg' +import { Address } from '@ethereumjs/util' +import { loadKZG } from 'kzg-wasm' import { randomBytes } from 'crypto' const main = async () => { - initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt') + const kzg = await loadKZG() + const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, diff --git a/packages/block/docs/README.md b/packages/block/docs/README.md index 91db86da88..f2067e66e4 100644 --- a/packages/block/docs/README.md +++ b/packages/block/docs/README.md @@ -17,6 +17,9 @@ - [JsonBlock](interfaces/JsonBlock.md) - [JsonHeader](interfaces/JsonHeader.md) - [JsonRpcBlock](interfaces/JsonRpcBlock.md) +- [VerkleExecutionWitness](interfaces/VerkleExecutionWitness.md) +- [VerkleProof](interfaces/VerkleProof.md) +- [VerkleStateDiff](interfaces/VerkleStateDiff.md) ### Type Aliases @@ -24,6 +27,7 @@ - [BlockBytes](README.md#blockbytes) - [BlockHeaderBytes](README.md#blockheaderbytes) - [ExecutionPayload](README.md#executionpayload) +- [ExecutionWitnessBytes](README.md#executionwitnessbytes) - [TransactionsBytes](README.md#transactionsbytes) - [UncleHeadersBytes](README.md#uncleheadersbytes) - [WithdrawalV1](README.md#withdrawalv1) @@ -41,17 +45,17 @@ #### Defined in -[types.ts:119](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L119) +[types.ts:174](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L174) ___ ### BlockBytes -Ƭ **BlockBytes**: [[`BlockHeaderBytes`](README.md#blockheaderbytes), [`TransactionsBytes`](README.md#transactionsbytes), [`UncleHeadersBytes`](README.md#uncleheadersbytes)] \| [[`BlockHeaderBytes`](README.md#blockheaderbytes), [`TransactionsBytes`](README.md#transactionsbytes), [`UncleHeadersBytes`](README.md#uncleheadersbytes), [`WithdrawalsBytes`](README.md#withdrawalsbytes)] +Ƭ **BlockBytes**: [[`BlockHeaderBytes`](README.md#blockheaderbytes), [`TransactionsBytes`](README.md#transactionsbytes), [`UncleHeadersBytes`](README.md#uncleheadersbytes)] \| [[`BlockHeaderBytes`](README.md#blockheaderbytes), [`TransactionsBytes`](README.md#transactionsbytes), [`UncleHeadersBytes`](README.md#uncleheadersbytes), [`WithdrawalsBytes`](README.md#withdrawalsbytes)] \| [[`BlockHeaderBytes`](README.md#blockheaderbytes), [`TransactionsBytes`](README.md#transactionsbytes), [`UncleHeadersBytes`](README.md#uncleheadersbytes), [`WithdrawalsBytes`](README.md#withdrawalsbytes), [`ExecutionWitnessBytes`](README.md#executionwitnessbytes)] #### Defined in -[types.ts:115](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L115) +[types.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L159) ___ @@ -59,9 +63,11 @@ ___ Ƭ **BlockHeaderBytes**: `Uint8Array`[] +BlockHeaderBuffer is a Buffer array, except for the Verkle PreState which is an array of prestate arrays. + #### Defined in -[types.ts:118](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L118) +[types.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L173) ___ @@ -78,6 +84,7 @@ ___ | `blockHash` | `PrefixedHexString` | | `blockNumber` | `PrefixedHexString` | | `excessBlobGas?` | `PrefixedHexString` | +| `executionWitness?` | [`VerkleExecutionWitness`](interfaces/VerkleExecutionWitness.md) \| ``null`` | | `extraData` | `PrefixedHexString` | | `feeRecipient` | `PrefixedHexString` | | `gasLimit` | `PrefixedHexString` | @@ -94,7 +101,17 @@ ___ #### Defined in -[types.ts:206](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L206) +[types.ts:263](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L263) + +___ + +### ExecutionWitnessBytes + +Ƭ **ExecutionWitnessBytes**: `Uint8Array` + +#### Defined in + +[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L157) ___ @@ -106,7 +123,7 @@ TransactionsBytes can be an array of serialized txs for Typed Transactions or an #### Defined in -[types.ts:123](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L123) +[types.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L178) ___ @@ -116,7 +133,7 @@ ___ #### Defined in -[types.ts:124](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L124) +[types.ts:179](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L179) ___ @@ -135,7 +152,7 @@ ___ #### Defined in -[types.ts:198](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L198) +[types.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L255) ___ @@ -145,7 +162,7 @@ ___ #### Defined in -[types.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L113) +[types.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L156) ## Functions @@ -168,4 +185,4 @@ The JSON data can be retrieved from a consensus layer (CL) client on this Beacon #### Defined in -[from-beacon-payload.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/from-beacon-payload.ts#L39) +[from-beacon-payload.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/from-beacon-payload.ts#L41) diff --git a/packages/block/docs/classes/Block.md b/packages/block/docs/classes/Block.md index 6a6754cba5..6cab4981ef 100644 --- a/packages/block/docs/classes/Block.md +++ b/packages/block/docs/classes/Block.md @@ -13,9 +13,9 @@ An object that represents the block. ### Properties - [common](Block.md#common) +- [executionWitness](Block.md#executionwitness) - [header](Block.md#header) - [transactions](Block.md#transactions) -- [txTrie](Block.md#txtrie) - [uncleHeaders](Block.md#uncleheaders) - [withdrawals](Block.md#withdrawals) @@ -52,7 +52,7 @@ An object that represents the block. ### constructor -• **new Block**(`header?`, `transactions?`, `uncleHeaders?`, `withdrawals?`, `opts?`) +• **new Block**(`header?`, `transactions?`, `uncleHeaders?`, `withdrawals?`, `opts?`, `executionWitness?`) This constructor takes the values, validates them, assigns them and freezes the object. Use the static factory methods to assist in creating a Block object from varying data types and options. @@ -66,10 +66,11 @@ Use the static factory methods to assist in creating a Block object from varying | `uncleHeaders` | [`BlockHeader`](BlockHeader.md)[] | `[]` | | `withdrawals?` | `Withdrawal`[] | `undefined` | | `opts` | [`BlockOptions`](../interfaces/BlockOptions.md) | `{}` | +| `executionWitness?` | ``null`` \| [`VerkleExecutionWitness`](../interfaces/VerkleExecutionWitness.md) | `undefined` | #### Defined in -[block.ts:361](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L361) +[block.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L405) ## Properties @@ -79,37 +80,41 @@ Use the static factory methods to assist in creating a Block object from varying #### Defined in -[block.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L52) +[block.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L53) ___ -### header +### executionWitness -• `Readonly` **header**: [`BlockHeader`](BlockHeader.md) +• `Optional` `Readonly` **executionWitness**: ``null`` \| [`VerkleExecutionWitness`](../interfaces/VerkleExecutionWitness.md) + +EIP-6800: Verkle Proof Data (experimental) +null implies that the non default executionWitness might exist but not available +and will not lead to execution of the block via vm with verkle stateless manager #### Defined in -[block.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L47) +[block.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L61) ___ -### transactions +### header -• `Readonly` **transactions**: `TypedTransaction`[] = `[]` +• `Readonly` **header**: [`BlockHeader`](BlockHeader.md) #### Defined in -[block.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L48) +[block.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L49) ___ -### txTrie +### transactions -• `Readonly` **txTrie**: `Trie` +• `Readonly` **transactions**: `TypedTransaction`[] = `[]` #### Defined in -[block.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L51) +[block.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L50) ___ @@ -119,7 +124,7 @@ ___ #### Defined in -[block.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L49) +[block.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L51) ___ @@ -129,7 +134,7 @@ ___ #### Defined in -[block.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L50) +[block.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L52) ## Methods @@ -145,7 +150,7 @@ Return a compact error string representation of the object #### Defined in -[block.ts:701](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L701) +[block.ts:806](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L806) ___ @@ -167,23 +172,23 @@ Returns the canonical difficulty for this block. #### Defined in -[block.ts:667](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L667) +[block.ts:772](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L772) ___ ### genTxTrie -▸ **genTxTrie**(): `Promise`<`void`\> +▸ **genTxTrie**(): `Promise`<`Uint8Array`\> Generates transaction trie for validation. #### Returns -`Promise`<`void`\> +`Promise`<`Uint8Array`\> #### Defined in -[block.ts:442](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L442) +[block.ts:520](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L520) ___ @@ -201,7 +206,7 @@ an array of error strings #### Defined in -[block.ts:470](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L470) +[block.ts:547](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L547) ___ @@ -217,7 +222,7 @@ Returns the hash of the block. #### Defined in -[block.ts:421](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L421) +[block.ts:499](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L499) ___ @@ -233,7 +238,7 @@ Determines if this block is the genesis block. #### Defined in -[block.ts:428](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L428) +[block.ts:506](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L506) ___ @@ -241,7 +246,7 @@ ___ ▸ **raw**(): [`BlockBytes`](../README.md#blockbytes) -Returns a Array of the raw Bytes Arays of this block, in order. +Returns a Array of the raw Bytes Arrays of this block, in order. #### Returns @@ -249,7 +254,7 @@ Returns a Array of the raw Bytes Arays of this block, in order. #### Defined in -[block.ts:403](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L403) +[block.ts:477](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L477) ___ @@ -265,7 +270,7 @@ Returns the rlp encoding of the block. #### Defined in -[block.ts:435](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L435) +[block.ts:513](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L513) ___ @@ -281,7 +286,7 @@ Returns the block in JSON format. #### Defined in -[block.ts:684](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L684) +[block.ts:789](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L789) ___ @@ -299,7 +304,7 @@ True if all transactions are valid, false otherwise #### Defined in -[block.ts:520](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L520) +[block.ts:597](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L597) ___ @@ -318,7 +323,7 @@ True if the transaction trie is valid, false otherwise #### Defined in -[block.ts:452](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L452) +[block.ts:529](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L529) ___ @@ -336,7 +341,7 @@ true if the uncle's hash is valid, false otherwise. #### Defined in -[block.ts:616](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L616) +[block.ts:718](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L718) ___ @@ -360,13 +365,13 @@ blob gas per block #### Defined in -[block.ts:568](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L568) +[block.ts:670](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L670) ___ ### validateData -▸ **validateData**(`onlyHeader?`): `Promise`<`void`\> +▸ **validateData**(`onlyHeader?`, `verifyTxs?`): `Promise`<`void`\> Validates the block data, throwing if invalid. This can be checked on the Block itself without needing access to any parent block @@ -380,6 +385,7 @@ It checks: | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `onlyHeader` | `boolean` | `false` | if only passed the header, skip validating txTrie and unclesHash (default: false) | +| `verifyTxs` | `boolean` | `true` | if set to `false`, will not check for transaction validation errors (default: true) | #### Returns @@ -387,7 +393,7 @@ It checks: #### Defined in -[block.ts:535](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L535) +[block.ts:613](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L613) ___ @@ -410,7 +416,7 @@ Throws if invalid #### Defined in -[block.ts:677](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L677) +[block.ts:782](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L782) ___ @@ -432,7 +438,7 @@ Header does not count an uncle twice. #### Defined in -[block.ts:643](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L643) +[block.ts:748](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L748) ___ @@ -450,13 +456,13 @@ true if the withdrawals trie root is valid, false otherwise #### Defined in -[block.ts:626](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L626) +[block.ts:728](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L728) ___ ### fromBeaconPayloadJson -▸ `Static` **fromBeaconPayloadJson**(`payload`, `options?`): `Promise`<[`Block`](Block.md)\> +▸ `Static` **fromBeaconPayloadJson**(`payload`, `opts?`): `Promise`<[`Block`](Block.md)\> Method to retrieve a block from a beacon payload json @@ -465,7 +471,7 @@ Method to retrieve a block from a beacon payload json | Name | Type | Description | | :------ | :------ | :------ | | `payload` | `BeaconPayloadJson` | json of a beacon beacon fetched from beacon apis | -| `options?` | [`BlockOptions`](../interfaces/BlockOptions.md) | - | +| `opts?` | [`BlockOptions`](../interfaces/BlockOptions.md) | [BlockOptions](../interfaces/BlockOptions.md) | #### Returns @@ -475,7 +481,7 @@ the block constructed block #### Defined in -[block.ts:349](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L349) +[block.ts:393](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L393) ___ @@ -498,22 +504,22 @@ Static constructor to create a block from a block data dictionary #### Defined in -[block.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L86) +[block.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L99) ___ ### fromExecutionPayload -▸ `Static` **fromExecutionPayload**(`payload`, `options?`): `Promise`<[`Block`](Block.md)\> +▸ `Static` **fromExecutionPayload**(`payload`, `opts?`): `Promise`<[`Block`](Block.md)\> Method to retrieve a block from an execution payload #### Parameters -| Name | Type | -| :------ | :------ | -| `payload` | [`ExecutionPayload`](../README.md#executionpayload) | -| `options?` | [`BlockOptions`](../interfaces/BlockOptions.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `payload` | [`ExecutionPayload`](../README.md#executionpayload) | - | +| `opts?` | [`BlockOptions`](../interfaces/BlockOptions.md) | [BlockOptions](../interfaces/BlockOptions.md) | #### Returns @@ -523,7 +529,7 @@ the block constructed block #### Defined in -[block.ts:289](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L289) +[block.ts:320](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L320) ___ @@ -549,7 +555,7 @@ the block specified by `blockTag` #### Defined in -[block.ts:229](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L229) +[block.ts:260](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L260) ___ @@ -572,7 +578,7 @@ Static constructor to create a block from a RLP-serialized block #### Defined in -[block.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L135) +[block.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L153) ___ @@ -588,7 +594,7 @@ Creates a new block object from Ethereum JSON RPC. | :------ | :------ | :------ | | `blockData` | [`JsonRpcBlock`](../interfaces/JsonRpcBlock.md) | - | | `uncles?` | `any`[] | Optional list of Ethereum JSON RPC of uncles (eth_getUncleByBlockHashAndIndex) | -| `opts?` | [`BlockOptions`](../interfaces/BlockOptions.md) | - | +| `opts?` | [`BlockOptions`](../interfaces/BlockOptions.md) | An object describing the blockchain | #### Returns @@ -596,7 +602,7 @@ Creates a new block object from Ethereum JSON RPC. #### Defined in -[block.ts:218](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L218) +[block.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L249) ___ @@ -619,7 +625,7 @@ Static constructor to create a block from an array of Bytes values #### Defined in -[block.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L151) +[block.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L169) ___ @@ -642,7 +648,7 @@ Returns the txs trie root for array of TypedTransaction #### Defined in -[block.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L72) +[block.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L85) ___ @@ -665,4 +671,4 @@ Returns the withdrawals trie root for array of Withdrawal. #### Defined in -[block.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L59) +[block.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/block.ts#L72) diff --git a/packages/block/docs/classes/BlockHeader.md b/packages/block/docs/classes/BlockHeader.md index 8702dba176..1fa40afe74 100644 --- a/packages/block/docs/classes/BlockHeader.md +++ b/packages/block/docs/classes/BlockHeader.md @@ -42,6 +42,7 @@ An object that represents the block header. - [calcDataFee](BlockHeader.md#calcdatafee) - [calcNextBaseFee](BlockHeader.md#calcnextbasefee) +- [calcNextBlobGasPrice](BlockHeader.md#calcnextblobgasprice) - [calcNextExcessBlobGas](BlockHeader.md#calcnextexcessblobgas) - [cliqueEpochTransitionSigners](BlockHeader.md#cliqueepochtransitionsigners) - [cliqueExtraSeal](BlockHeader.md#cliqueextraseal) @@ -67,7 +68,7 @@ An object that represents the block header. ### constructor -• **new BlockHeader**(`headerData`, `options?`) +• **new BlockHeader**(`headerData`, `opts?`) This constructor takes the values, validates them, assigns them and freezes the object. @@ -81,11 +82,11 @@ varying data types. For a default empty header, use [fromHeaderData](BlockHeader | Name | Type | | :------ | :------ | | `headerData` | [`HeaderData`](../interfaces/HeaderData.md) | -| `options` | [`BlockOptions`](../interfaces/BlockOptions.md) | +| `opts` | [`BlockOptions`](../interfaces/BlockOptions.md) | #### Defined in -[header.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L147) +[header.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L150) ## Properties @@ -95,7 +96,7 @@ varying data types. For a default empty header, use [fromHeaderData](BlockHeader #### Defined in -[header.ts:60](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L60) +[header.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L61) ___ @@ -105,7 +106,7 @@ ___ #### Defined in -[header.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L62) +[header.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L63) ___ @@ -115,7 +116,7 @@ ___ #### Defined in -[header.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L47) +[header.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L48) ___ @@ -125,7 +126,7 @@ ___ #### Defined in -[header.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L66) +[header.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L67) ___ @@ -135,7 +136,7 @@ ___ #### Defined in -[header.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L52) +[header.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L53) ___ @@ -145,7 +146,7 @@ ___ #### Defined in -[header.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L63) +[header.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L64) ___ @@ -155,7 +156,7 @@ ___ #### Defined in -[header.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L57) +[header.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L58) ___ @@ -165,7 +166,7 @@ ___ #### Defined in -[header.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L54) +[header.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L55) ___ @@ -175,7 +176,7 @@ ___ #### Defined in -[header.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L55) +[header.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L56) ___ @@ -185,7 +186,7 @@ ___ #### Defined in -[header.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L51) +[header.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L52) ___ @@ -195,7 +196,7 @@ ___ #### Defined in -[header.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L58) +[header.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L59) ___ @@ -205,7 +206,7 @@ ___ #### Defined in -[header.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L59) +[header.ts:60](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L60) ___ @@ -215,7 +216,7 @@ ___ #### Defined in -[header.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L53) +[header.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L54) ___ @@ -225,7 +226,7 @@ ___ #### Defined in -[header.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L64) +[header.ts:65](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L65) ___ @@ -235,7 +236,7 @@ ___ #### Defined in -[header.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L45) +[header.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L46) ___ @@ -245,7 +246,7 @@ ___ #### Defined in -[header.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L50) +[header.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L51) ___ @@ -255,7 +256,7 @@ ___ #### Defined in -[header.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L48) +[header.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L49) ___ @@ -265,7 +266,7 @@ ___ #### Defined in -[header.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L56) +[header.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L57) ___ @@ -275,7 +276,7 @@ ___ #### Defined in -[header.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L49) +[header.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L50) ___ @@ -285,7 +286,7 @@ ___ #### Defined in -[header.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L46) +[header.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L47) ___ @@ -295,7 +296,7 @@ ___ #### Defined in -[header.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L61) +[header.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L62) ## Accessors @@ -311,7 +312,7 @@ EIP-4399: After merge to PoS, `mixHash` supplanted as `prevRandao` #### Defined in -[header.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L75) +[header.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L78) ## Methods @@ -335,7 +336,7 @@ the total blob gas fee for numBlobs blobs #### Defined in -[header.ts:598](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L598) +[header.ts:621](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L621) ___ @@ -351,7 +352,25 @@ Calculates the base fee for a potential next block #### Defined in -[header.ts:537](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L537) +[header.ts:552](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L552) + +___ + +### calcNextBlobGasPrice + +▸ **calcNextBlobGasPrice**(): `bigint` + +Calculate the blob gas price of the block built on top of this one + +#### Returns + +`bigint` + +The blob gas price + +#### Defined in + +[header.ts:648](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L648) ___ @@ -367,7 +386,7 @@ Calculates the excess blob gas for next (hopefully) post EIP 4844 block. #### Defined in -[header.ts:609](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L609) +[header.ts:632](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L632) ___ @@ -388,7 +407,7 @@ in conjunction with [cliqueIsEpochTransition](BlockHeader.md#cliqueisepochtransi #### Defined in -[header.ts:830](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L830) +[header.ts:870](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L870) ___ @@ -405,7 +424,7 @@ Returns extra seal data #### Defined in -[header.ts:798](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L798) +[header.ts:837](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L837) ___ @@ -422,7 +441,7 @@ Returns extra vanity data #### Defined in -[header.ts:789](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L789) +[header.ts:828](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L828) ___ @@ -439,7 +458,7 @@ header (only clique PoA, throws otherwise) #### Defined in -[header.ts:777](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L777) +[header.ts:816](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L816) ___ @@ -455,7 +474,7 @@ PoA clique signature hash without the seal. #### Defined in -[header.ts:766](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L766) +[header.ts:805](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L805) ___ @@ -471,7 +490,7 @@ Returns the signer address #### Defined in -[header.ts:867](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L867) +[header.ts:907](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L907) ___ @@ -496,7 +515,7 @@ Verifies the signature of the block (last 65 bytes of extraData field) #### Defined in -[header.ts:855](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L855) +[header.ts:895](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L895) ___ @@ -512,7 +531,7 @@ Return a compact error string representation of the object #### Defined in -[header.ts:950](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L950) +[header.ts:994](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L994) ___ @@ -534,7 +553,7 @@ Returns the canonical difficulty for this block. #### Defined in -[header.ts:695](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L695) +[header.ts:734](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L734) ___ @@ -552,7 +571,7 @@ the price in gwei per unit of blob gas spent #### Defined in -[header.ts:581](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L581) +[header.ts:596](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L596) ___ @@ -568,7 +587,7 @@ Returns the hash of the block header. #### Defined in -[header.ts:664](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L664) +[header.ts:703](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L703) ___ @@ -584,7 +603,7 @@ Checks if the block header is a genesis header. #### Defined in -[header.ts:677](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L677) +[header.ts:716](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L716) ___ @@ -600,7 +619,7 @@ Returns a Uint8Array Array of the raw Bytes in this header, in order. #### Defined in -[header.ts:624](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L624) +[header.ts:655](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L655) ___ @@ -616,7 +635,7 @@ Returns the rlp encoding of the block header. #### Defined in -[header.ts:884](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L884) +[header.ts:924](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L924) ___ @@ -632,7 +651,7 @@ Returns the block header in JSON format. #### Defined in -[header.ts:891](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L891) +[header.ts:931](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L931) ___ @@ -655,7 +674,7 @@ Throws if out of bounds. #### Defined in -[header.ts:499](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L499) +[header.ts:505](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L505) ___ @@ -678,7 +697,7 @@ Static constructor to create a block header from a header data dictionary #### Defined in -[header.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L91) +[header.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L94) ___ @@ -701,7 +720,7 @@ Static constructor to create a block header from a RLP-serialized header #### Defined in -[header.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L101) +[header.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L104) ___ @@ -724,4 +743,4 @@ Static constructor to create a block header from an array of Bytes values #### Defined in -[header.ts:115](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L115) +[header.ts:118](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/header.ts#L118) diff --git a/packages/block/docs/interfaces/BlockData.md b/packages/block/docs/interfaces/BlockData.md index 07ae48e1b3..7ab271c689 100644 --- a/packages/block/docs/interfaces/BlockData.md +++ b/packages/block/docs/interfaces/BlockData.md @@ -8,6 +8,7 @@ A block's data. ### Properties +- [executionWitness](BlockData.md#executionwitness) - [header](BlockData.md#header) - [transactions](BlockData.md#transactions) - [uncleHeaders](BlockData.md#uncleheaders) @@ -15,6 +16,18 @@ A block's data. ## Properties +### executionWitness + +• `Optional` **executionWitness**: ``null`` \| [`VerkleExecutionWitness`](VerkleExecutionWitness.md) + +EIP-6800: Verkle Proof Data (experimental) + +#### Defined in + +[types.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L153) + +___ + ### header • `Optional` **header**: [`HeaderData`](HeaderData.md) @@ -23,7 +36,7 @@ Header data for the block #### Defined in -[types.ts:107](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L107) +[types.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L146) ___ @@ -33,7 +46,7 @@ ___ #### Defined in -[types.ts:108](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L108) +[types.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L147) ___ @@ -43,7 +56,7 @@ ___ #### Defined in -[types.ts:109](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L109) +[types.ts:148](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L148) ___ @@ -53,4 +66,4 @@ ___ #### Defined in -[types.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L110) +[types.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L149) diff --git a/packages/block/docs/interfaces/HeaderData.md b/packages/block/docs/interfaces/HeaderData.md index 2468291a28..70f584aa23 100644 --- a/packages/block/docs/interfaces/HeaderData.md +++ b/packages/block/docs/interfaces/HeaderData.md @@ -37,7 +37,7 @@ A block header's data. #### Defined in -[types.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L93) +[types.ts:132](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L132) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[types.ts:95](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L95) +[types.ts:134](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L134) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[types.ts:80](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L80) +[types.ts:119](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L119) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[types.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L85) +[types.ts:124](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L124) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L96) +[types.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L135) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[types.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L90) +[types.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L129) ___ @@ -97,7 +97,7 @@ ___ #### Defined in -[types.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L87) +[types.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L126) ___ @@ -107,7 +107,7 @@ ___ #### Defined in -[types.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L88) +[types.ts:127](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L127) ___ @@ -117,7 +117,7 @@ ___ #### Defined in -[types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L84) +[types.ts:123](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L123) ___ @@ -127,7 +127,7 @@ ___ #### Defined in -[types.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L91) +[types.ts:130](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L130) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[types.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L92) +[types.ts:131](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L131) ___ @@ -147,7 +147,7 @@ ___ #### Defined in -[types.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L86) +[types.ts:125](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L125) ___ @@ -157,7 +157,7 @@ ___ #### Defined in -[types.ts:97](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L97) +[types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L136) ___ @@ -167,7 +167,7 @@ ___ #### Defined in -[types.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L78) +[types.ts:117](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L117) ___ @@ -177,7 +177,7 @@ ___ #### Defined in -[types.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L83) +[types.ts:122](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L122) ___ @@ -187,7 +187,7 @@ ___ #### Defined in -[types.ts:81](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L81) +[types.ts:120](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L120) ___ @@ -197,7 +197,7 @@ ___ #### Defined in -[types.ts:89](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L89) +[types.ts:128](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L128) ___ @@ -207,7 +207,7 @@ ___ #### Defined in -[types.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L82) +[types.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L121) ___ @@ -217,7 +217,7 @@ ___ #### Defined in -[types.ts:79](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L79) +[types.ts:118](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L118) ___ @@ -227,4 +227,4 @@ ___ #### Defined in -[types.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L94) +[types.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L133) diff --git a/packages/block/docs/interfaces/JsonBlock.md b/packages/block/docs/interfaces/JsonBlock.md index 618991edab..efdd041e9c 100644 --- a/packages/block/docs/interfaces/JsonBlock.md +++ b/packages/block/docs/interfaces/JsonBlock.md @@ -8,6 +8,7 @@ An object with the block's data represented as strings. ### Properties +- [executionWitness](JsonBlock.md#executionwitness) - [header](JsonBlock.md#header) - [transactions](JsonBlock.md#transactions) - [uncleHeaders](JsonBlock.md#uncleheaders) @@ -15,6 +16,16 @@ An object with the block's data represented as strings. ## Properties +### executionWitness + +• `Optional` **executionWitness**: ``null`` \| [`VerkleExecutionWitness`](VerkleExecutionWitness.md) + +#### Defined in + +[types.ts:192](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L192) + +___ + ### header • `Optional` **header**: [`JsonHeader`](JsonHeader.md) @@ -23,7 +34,7 @@ Header data for the block #### Defined in -[types.ts:133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L133) +[types.ts:188](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L188) ___ @@ -33,7 +44,7 @@ ___ #### Defined in -[types.ts:134](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L134) +[types.ts:189](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L189) ___ @@ -43,7 +54,7 @@ ___ #### Defined in -[types.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L135) +[types.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L190) ___ @@ -53,4 +64,4 @@ ___ #### Defined in -[types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L136) +[types.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L191) diff --git a/packages/block/docs/interfaces/JsonHeader.md b/packages/block/docs/interfaces/JsonHeader.md index 1d7a002530..8b402b01ab 100644 --- a/packages/block/docs/interfaces/JsonHeader.md +++ b/packages/block/docs/interfaces/JsonHeader.md @@ -37,7 +37,7 @@ An object with the block header's data represented as strings. #### Defined in -[types.ts:158](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L158) +[types.ts:214](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L214) ___ @@ -47,7 +47,7 @@ ___ #### Defined in -[types.ts:160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L160) +[types.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L216) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[types.ts:145](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L145) +[types.ts:201](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L201) ___ @@ -67,7 +67,7 @@ ___ #### Defined in -[types.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L150) +[types.ts:206](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L206) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[types.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L161) +[types.ts:217](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L217) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[types.ts:155](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L155) +[types.ts:211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L211) ___ @@ -97,7 +97,7 @@ ___ #### Defined in -[types.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L152) +[types.ts:208](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L208) ___ @@ -107,7 +107,7 @@ ___ #### Defined in -[types.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L153) +[types.ts:209](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L209) ___ @@ -117,7 +117,7 @@ ___ #### Defined in -[types.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L149) +[types.ts:205](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L205) ___ @@ -127,7 +127,7 @@ ___ #### Defined in -[types.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L156) +[types.ts:212](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L212) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L157) +[types.ts:213](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L213) ___ @@ -147,7 +147,7 @@ ___ #### Defined in -[types.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L151) +[types.ts:207](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L207) ___ @@ -157,7 +157,7 @@ ___ #### Defined in -[types.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L162) +[types.ts:218](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L218) ___ @@ -167,7 +167,7 @@ ___ #### Defined in -[types.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L143) +[types.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L199) ___ @@ -177,7 +177,7 @@ ___ #### Defined in -[types.ts:148](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L148) +[types.ts:204](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L204) ___ @@ -187,7 +187,7 @@ ___ #### Defined in -[types.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L146) +[types.ts:202](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L202) ___ @@ -197,7 +197,7 @@ ___ #### Defined in -[types.ts:154](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L154) +[types.ts:210](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L210) ___ @@ -207,7 +207,7 @@ ___ #### Defined in -[types.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L147) +[types.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L203) ___ @@ -217,7 +217,7 @@ ___ #### Defined in -[types.ts:144](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L144) +[types.ts:200](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L200) ___ @@ -227,4 +227,4 @@ ___ #### Defined in -[types.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L159) +[types.ts:215](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L215) diff --git a/packages/block/docs/interfaces/JsonRpcBlock.md b/packages/block/docs/interfaces/JsonRpcBlock.md index bfbe6e2f15..a5f9b612f4 100644 --- a/packages/block/docs/interfaces/JsonRpcBlock.md +++ b/packages/block/docs/interfaces/JsonRpcBlock.md @@ -10,6 +10,7 @@ - [blobGasUsed](JsonRpcBlock.md#blobgasused) - [difficulty](JsonRpcBlock.md#difficulty) - [excessBlobGas](JsonRpcBlock.md#excessblobgas) +- [executionWitness](JsonRpcBlock.md#executionwitness) - [extraData](JsonRpcBlock.md#extradata) - [gasLimit](JsonRpcBlock.md#gaslimit) - [gasUsed](JsonRpcBlock.md#gasused) @@ -41,7 +42,7 @@ #### Defined in -[types.ts:189](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L189) +[types.ts:245](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L245) ___ @@ -51,7 +52,7 @@ ___ #### Defined in -[types.ts:192](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L192) +[types.ts:248](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L248) ___ @@ -61,7 +62,7 @@ ___ #### Defined in -[types.ts:180](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L180) +[types.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L236) ___ @@ -71,7 +72,17 @@ ___ #### Defined in -[types.ts:193](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L193) +[types.ts:249](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L249) + +___ + +### executionWitness + +• `Optional` **executionWitness**: ``null`` \| [`VerkleExecutionWitness`](VerkleExecutionWitness.md) + +#### Defined in + +[types.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L251) ___ @@ -81,7 +92,7 @@ ___ #### Defined in -[types.ts:182](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L182) +[types.ts:238](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L238) ___ @@ -91,7 +102,7 @@ ___ #### Defined in -[types.ts:184](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L184) +[types.ts:240](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L240) ___ @@ -101,7 +112,7 @@ ___ #### Defined in -[types.ts:185](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L185) +[types.ts:241](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L241) ___ @@ -111,7 +122,7 @@ ___ #### Defined in -[types.ts:170](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L170) +[types.ts:226](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L226) ___ @@ -121,7 +132,7 @@ ___ #### Defined in -[types.ts:175](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L175) +[types.ts:231](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L231) ___ @@ -131,7 +142,7 @@ ___ #### Defined in -[types.ts:179](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L179) +[types.ts:235](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L235) ___ @@ -141,7 +152,7 @@ ___ #### Defined in -[types.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L172) +[types.ts:228](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L228) ___ @@ -151,7 +162,7 @@ ___ #### Defined in -[types.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L173) +[types.ts:229](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L229) ___ @@ -161,7 +172,7 @@ ___ #### Defined in -[types.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L169) +[types.ts:225](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L225) ___ @@ -171,7 +182,7 @@ ___ #### Defined in -[types.ts:194](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L194) +[types.ts:250](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L250) ___ @@ -181,7 +192,7 @@ ___ #### Defined in -[types.ts:171](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L171) +[types.ts:227](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L227) ___ @@ -191,7 +202,7 @@ ___ #### Defined in -[types.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L178) +[types.ts:234](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L234) ___ @@ -201,7 +212,7 @@ ___ #### Defined in -[types.ts:174](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L174) +[types.ts:230](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L230) ___ @@ -211,7 +222,7 @@ ___ #### Defined in -[types.ts:183](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L183) +[types.ts:239](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L239) ___ @@ -221,7 +232,7 @@ ___ #### Defined in -[types.ts:177](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L177) +[types.ts:233](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L233) ___ @@ -231,7 +242,7 @@ ___ #### Defined in -[types.ts:186](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L186) +[types.ts:242](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L242) ___ @@ -241,7 +252,7 @@ ___ #### Defined in -[types.ts:181](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L181) +[types.ts:237](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L237) ___ @@ -251,7 +262,7 @@ ___ #### Defined in -[types.ts:187](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L187) +[types.ts:243](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L243) ___ @@ -261,7 +272,7 @@ ___ #### Defined in -[types.ts:176](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L176) +[types.ts:232](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L232) ___ @@ -271,7 +282,7 @@ ___ #### Defined in -[types.ts:188](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L188) +[types.ts:244](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L244) ___ @@ -281,7 +292,7 @@ ___ #### Defined in -[types.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L190) +[types.ts:246](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L246) ___ @@ -291,4 +302,4 @@ ___ #### Defined in -[types.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L191) +[types.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L247) diff --git a/packages/block/docs/interfaces/VerkleExecutionWitness.md b/packages/block/docs/interfaces/VerkleExecutionWitness.md new file mode 100644 index 0000000000..00fad0e8ed --- /dev/null +++ b/packages/block/docs/interfaces/VerkleExecutionWitness.md @@ -0,0 +1,40 @@ +[@ethereumjs/block](../README.md) / VerkleExecutionWitness + +# Interface: VerkleExecutionWitness + +Experimental, object format could eventual change. +An object that provides the state and proof necessary for verkle stateless execution + +## Table of contents + +### Properties + +- [stateDiff](VerkleExecutionWitness.md#statediff) +- [verkleProof](VerkleExecutionWitness.md#verkleproof) + +## Properties + +### stateDiff + +• **stateDiff**: [`VerkleStateDiff`](VerkleStateDiff.md)[] + +An array of state diffs. +Each item corresponding to state accesses or state modifications of the block. +In the current design, it also contains the resulting state of the block execution (post-state). + +#### Defined in + +[types.ts:105](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L105) + +___ + +### verkleProof + +• **verkleProof**: [`VerkleProof`](VerkleProof.md) + +The verkle proof for the block. +Proves that the provided stateDiff belongs to the canonical verkle tree. + +#### Defined in + +[types.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L110) diff --git a/packages/block/docs/interfaces/VerkleProof.md b/packages/block/docs/interfaces/VerkleProof.md new file mode 100644 index 0000000000..23d25192fe --- /dev/null +++ b/packages/block/docs/interfaces/VerkleProof.md @@ -0,0 +1,71 @@ +[@ethereumjs/block](../README.md) / VerkleProof + +# Interface: VerkleProof + +## Table of contents + +### Properties + +- [commitmentsByPath](VerkleProof.md#commitmentsbypath) +- [d](VerkleProof.md#d) +- [depthExtensionPresent](VerkleProof.md#depthextensionpresent) +- [ipaProof](VerkleProof.md#ipaproof) +- [otherStems](VerkleProof.md#otherstems) + +## Properties + +### commitmentsByPath + +• **commitmentsByPath**: `string`[] + +#### Defined in + +[types.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L75) + +___ + +### d + +• **d**: `string` + +#### Defined in + +[types.ts:76](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L76) + +___ + +### depthExtensionPresent + +• **depthExtensionPresent**: `string` + +#### Defined in + +[types.ts:77](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L77) + +___ + +### ipaProof + +• **ipaProof**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `cl` | `string`[] | +| `cr` | `string`[] | +| `finalEvaluation` | `string` | + +#### Defined in + +[types.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L78) + +___ + +### otherStems + +• **otherStems**: `string`[] + +#### Defined in + +[types.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L83) diff --git a/packages/block/docs/interfaces/VerkleStateDiff.md b/packages/block/docs/interfaces/VerkleStateDiff.md new file mode 100644 index 0000000000..7ec08c1329 --- /dev/null +++ b/packages/block/docs/interfaces/VerkleStateDiff.md @@ -0,0 +1,30 @@ +[@ethereumjs/block](../README.md) / VerkleStateDiff + +# Interface: VerkleStateDiff + +## Table of contents + +### Properties + +- [stem](VerkleStateDiff.md#stem) +- [suffixDiffs](VerkleStateDiff.md#suffixdiffs) + +## Properties + +### stem + +• **stem**: `string` + +#### Defined in + +[types.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L87) + +___ + +### suffixDiffs + +• **suffixDiffs**: { `currentValue`: ``null`` \| `string` ; `newValue`: ``null`` \| `string` ; `suffix`: `string` \| `number` }[] + +#### Defined in + +[types.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/block/src/types.ts#L88) diff --git a/packages/block/package.json b/packages/block/package.json index 3c42d2bd7d..94861ee51f 100644 --- a/packages/block/package.json +++ b/packages/block/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/block", - "version": "5.1.1", + "version": "5.2.0", "description": "Provides Block serialization and help functions", "keywords": [ "ethereum", @@ -46,11 +46,11 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { diff --git a/packages/blockchain/CHANGELOG.md b/packages/blockchain/CHANGELOG.md index f13897414d..c5c5d84484 100644 --- a/packages/blockchain/CHANGELOG.md +++ b/packages/blockchain/CHANGELOG.md @@ -6,6 +6,47 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 7.2.0 - 2024-03-05 + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3280). This bug has been fixed along with these releases and this library now references the updated trie library version. + +### Other Changes + +- Remove internal `_init()` method along EVM/VM constructor refactoring, PRs [#3304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3304/) and [#3315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3315) +- Fix a type error related to the `lru-cache` dependency, PR [#3285](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3285) + ## 7.1.0 - 2024-02-08 ### Dencun Hardfork Support diff --git a/packages/blockchain/README.md b/packages/blockchain/README.md index d269a0a68e..8fbd1a09d6 100644 --- a/packages/blockchain/README.md +++ b/packages/blockchain/README.md @@ -178,6 +178,8 @@ This library supports the blob transaction type introduced with [EIP-4844](https The blockchain library now allows for blob transactions to be validated and included in a chain where EIP-4844 activated either by hardfork or standalone EIP. +**Note:** Working with blob transactions needs a manual KZG library installation and global initialization, see [KZG Setup](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx/README.md#kzg-setup) for instructions. + ## Browser With the breaking release round in Summer 2023 we have added hybrid ESM/CJS builds for all our libraries (see section below) and have eliminated many of the caveats which had previously prevented a frictionless browser usage. diff --git a/packages/blockchain/docs/classes/Blockchain.md b/packages/blockchain/docs/classes/Blockchain.md index 3b7dc72169..e82b9b7101 100644 --- a/packages/blockchain/docs/classes/Blockchain.md +++ b/packages/blockchain/docs/classes/Blockchain.md @@ -59,7 +59,7 @@ This class stores and interacts with blocks. #### Defined in -[blockchain.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L112) +[blockchain.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L110) ___ @@ -73,7 +73,7 @@ ___ #### Defined in -[blockchain.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L83) +[blockchain.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L82) ___ @@ -83,7 +83,7 @@ ___ #### Defined in -[blockchain.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L84) +[blockchain.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L83) ___ @@ -93,7 +93,7 @@ ___ #### Defined in -[blockchain.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L85) +[blockchain.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L84) ___ @@ -109,7 +109,7 @@ Optional events emitter #### Defined in -[blockchain.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L86) +[blockchain.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L85) ## Accessors @@ -125,7 +125,7 @@ The genesis Block for the blockchain. #### Defined in -[blockchain.ts:1412](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1412) +[blockchain.ts:1404](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1404) ## Methods @@ -147,7 +147,7 @@ The genesis Block for the blockchain. #### Defined in -[blockchain.ts:1349](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1349) +[blockchain.ts:1341](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1341) ___ @@ -169,7 +169,7 @@ Creates a genesis Block for the blockchain with params from Common.genesis #### Defined in -[blockchain.ts:1421](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1421) +[blockchain.ts:1413](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1413) ___ @@ -202,7 +202,7 @@ we can be sure it is correct). #### Defined in -[blockchain.ts:931](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L931) +[blockchain.ts:923](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L923) ___ @@ -229,7 +229,7 @@ block will be the canonical block at that number in the chain #### Defined in -[blockchain.ts:799](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L799) +[blockchain.ts:791](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L791) ___ @@ -255,7 +255,7 @@ Looks up many blocks relative to blockId Note: due to `GetBlockHeaders #### Defined in -[blockchain.ts:848](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L848) +[blockchain.ts:840](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L840) ___ @@ -275,7 +275,7 @@ Returns the latest full block in the canonical chain. #### Defined in -[blockchain.ts:396](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L396) +[blockchain.ts:386](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L386) ___ @@ -291,7 +291,7 @@ Returns the latest header in the canonical chain. #### Defined in -[blockchain.ts:385](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L385) +[blockchain.ts:375](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L375) ___ @@ -313,7 +313,7 @@ Gets a header by number. Header must be in the canonical chain #### Defined in -[blockchain.ts:1390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1390) +[blockchain.ts:1382](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1382) ___ @@ -344,7 +344,7 @@ has not been run. This matches the behavior of [iterator](Blockchain.md#iterator #### Defined in -[blockchain.ts:355](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L355) +[blockchain.ts:345](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L345) ___ @@ -366,7 +366,7 @@ This method differs from `getIteratorHead`. If the head is not found, it returns #### Defined in -[blockchain.ts:366](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L366) +[blockchain.ts:356](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L356) ___ @@ -388,7 +388,7 @@ Gets total difficulty for a header's parent, helpful for determining terminal bl #### Defined in -[blockchain.ts:834](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L834) +[blockchain.ts:826](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L826) ___ @@ -415,7 +415,7 @@ Gets total difficulty for a block specified by hash and number #### Defined in -[blockchain.ts:820](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L820) +[blockchain.ts:812](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L812) ___ @@ -448,7 +448,7 @@ number of blocks actually iterated #### Defined in -[blockchain.ts:1037](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1037) +[blockchain.ts:1029](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1029) ___ @@ -478,7 +478,7 @@ heads/hashes are overwritten. #### Defined in -[blockchain.ts:426](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L426) +[blockchain.ts:416](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L416) ___ @@ -505,7 +505,7 @@ chain is rebuilt and any stale heads/hashes are overwritten. #### Defined in -[blockchain.ts:412](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L412) +[blockchain.ts:402](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L402) ___ @@ -531,7 +531,7 @@ heads/hashes are overwritten. #### Defined in -[blockchain.ts:453](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L453) +[blockchain.ts:443](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L443) ___ @@ -558,7 +558,7 @@ chain is rebuilt and any stale heads/hashes are overwritten. #### Defined in -[blockchain.ts:439](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L439) +[blockchain.ts:429](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L429) ___ @@ -583,7 +583,7 @@ canonicalHead and cleans up canonical references greater than canonicalHead #### Defined in -[blockchain.ts:465](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L465) +[blockchain.ts:455](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L455) ___ @@ -607,7 +607,7 @@ any other error, this function throws. #### Defined in -[blockchain.ts:1404](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1404) +[blockchain.ts:1396](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1396) ___ @@ -631,7 +631,7 @@ Therefore, the array needs to be ordered upon number. #### Defined in -[blockchain.ts:890](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L890) +[blockchain.ts:882](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L882) ___ @@ -659,7 +659,7 @@ When calling the iterator, the iterator will start running the first child block #### Defined in -[blockchain.ts:1120](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1120) +[blockchain.ts:1112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L1112) ___ @@ -687,7 +687,7 @@ the original. #### Defined in -[blockchain.ts:243](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L243) +[blockchain.ts:309](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L309) ___ @@ -710,7 +710,7 @@ whether the block is internally consistent #### Defined in -[blockchain.ts:702](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L702) +[blockchain.ts:694](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L694) ___ @@ -748,7 +748,7 @@ It verifies the current block against the `parentHash`: #### Defined in -[blockchain.ts:635](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L635) +[blockchain.ts:627](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L627) ___ @@ -771,7 +771,7 @@ encouraged method to use when creating a blockchain object. #### Defined in -[blockchain.ts:131](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L131) +[blockchain.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L129) ___ @@ -795,4 +795,4 @@ objects must be readable by Block.fromBlockData #### Defined in -[blockchain.ts:145](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L145) +[blockchain.ts:211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/blockchain/src/blockchain.ts#L211) diff --git a/packages/blockchain/package.json b/packages/blockchain/package.json index d2fbf3d391..a813233fd2 100644 --- a/packages/blockchain/package.json +++ b/packages/blockchain/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/blockchain", - "version": "7.1.0", + "version": "7.2.0", "description": "A module to store and interact with blocks", "keywords": [ "ethereum", @@ -46,13 +46,13 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/ethash": "^3.0.2", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/ethash": "^3.0.3", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", "lru-cache": "10.1.0" diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 6b4d7fc5cb..4af9204427 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.10.1 - 2024-03-05 + +This is mainly a maintenance release coming with a few internal changes and minor bug fixes, single user-focused addition is the support for the `eth_feeHistory` RPC call. + +### Support for eth_feeHistory RPC Method + +Support for the `eth_feeHistory` RPC endpoint has been added in PR [#3295](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3295). The endpoint allows to query the base fee and the priority fee per gas for a requested/supported block range. + +### Internal Changes and Improvements + +- The underlying EthereumJS libraries now use `kzg-wasm` instead of the `c-kzg` Node.js bindings for 4844 functionality, PR [#3294](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) +- Ensure executed block does not get pruned if head=final FCU, PR [#3153](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3153) +- Improved SNAP sync behavior in certain scenarios (SNAP feature still experimental), PR [#3200](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3200) +- Refactor internal Engine API code structure, PR [#3291](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3291) +- Remove `devnet6.txt` trusted setup file and all test usages in downstream libraries, PR [#3288](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3288) +- Snap sync (experimental): use zero-element proof for checking validity of final, empty range result, PR [#3047](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3047) + ## 0.10.0 - 2024-02-08 This client release now comes with official Dencun hardfork support 🎉 and by default uses WASM for crypto primitives for faster block execution times. diff --git a/packages/client/docs/README.md b/packages/client/docs/README.md index 57bc8d8e05..a130c1fdd2 100644 --- a/packages/client/docs/README.md +++ b/packages/client/docs/README.md @@ -16,6 +16,3 @@ ### Interfaces - [ConfigOptions](interfaces/ConfigOptions.md) - -### Usage -- [Run as EL client](usage/RunAsElClient.md) diff --git a/packages/client/docs/classes/Config.md b/packages/client/docs/classes/Config.md index 486df0b92e..c95f5605a7 100644 --- a/packages/client/docs/classes/Config.md +++ b/packages/client/docs/classes/Config.md @@ -10,65 +10,106 @@ ### Properties +- [accountCache](Config.md#accountcache) - [accounts](Config.md#accounts) - [bootnodes](Config.md#bootnodes) - [chainCommon](Config.md#chaincommon) +- [codeCache](Config.md#codecache) - [datadir](Config.md#datadir) - [debugCode](Config.md#debugcode) -- [disableBeaconSync](Config.md#disablebeaconsync) -- [disableSnapSync](Config.md#disablesnapsync) - [discDns](Config.md#discdns) - [discV4](Config.md#discv4) - [dnsAddr](Config.md#dnsaddr) +- [enableSnapSync](Config.md#enablesnapsync) +- [engineNewpayloadMaxExecute](Config.md#enginenewpayloadmaxexecute) +- [engineNewpayloadMaxTxsExecute](Config.md#enginenewpayloadmaxtxsexecute) +- [engineParentLookupMaxDepth](Config.md#engineparentlookupmaxdepth) - [events](Config.md#events) - [execCommon](Config.md#execcommon) +- [execution](Config.md#execution) - [extIP](Config.md#extip) -- [forceSnapSync](Config.md#forcesnapsync) +- [isSingleNode](Config.md#issinglenode) - [key](Config.md#key) - [lastSyncDate](Config.md#lastsyncdate) +- [lastsyncronized](Config.md#lastsyncronized) - [lightserv](Config.md#lightserv) - [logger](Config.md#logger) +- [maxAccountRange](Config.md#maxaccountrange) - [maxFetcherJobs](Config.md#maxfetcherjobs) +- [maxFetcherRequests](Config.md#maxfetcherrequests) +- [maxInvalidBlocksErrorCache](Config.md#maxinvalidblockserrorcache) - [maxPeers](Config.md#maxpeers) - [maxPerRequest](Config.md#maxperrequest) +- [maxRangeBytes](Config.md#maxrangebytes) +- [maxStorageRange](Config.md#maxstoragerange) - [minPeers](Config.md#minpeers) - [mine](Config.md#mine) - [minerCoinbase](Config.md#minercoinbase) - [multiaddrs](Config.md#multiaddrs) +- [numBlocksPerIteration](Config.md#numblocksperiteration) - [port](Config.md#port) +- [prefixStorageTrieKeys](Config.md#prefixstoragetriekeys) +- [pruneEngineCache](Config.md#pruneenginecache) - [safeReorgDistance](Config.md#safereorgdistance) +- [savePreimages](Config.md#savepreimages) - [saveReceipts](Config.md#savereceipts) -- [servers](Config.md#servers) +- [server](Config.md#server) +- [shutdown](Config.md#shutdown) - [skeletonFillCanonicalBackStep](Config.md#skeletonfillcanonicalbackstep) - [skeletonSubchainMergeMinimum](Config.md#skeletonsubchainmergeminimum) +- [snapAvailabilityDepth](Config.md#snapavailabilitydepth) +- [snapTransitionSafeDepth](Config.md#snaptransitionsafedepth) +- [statelessVerkle](Config.md#statelessverkle) +- [storageCache](Config.md#storagecache) - [syncTargetHeight](Config.md#synctargetheight) +- [syncedStateRemovalPeriod](Config.md#syncedstateremovalperiod) - [synchronized](Config.md#synchronized) - [syncmode](Config.md#syncmode) -- [transports](Config.md#transports) +- [trieCache](Config.md#triecache) - [txLookupLimit](Config.md#txlookuplimit) +- [useStringValueTrieDB](Config.md#usestringvaluetriedb) - [vm](Config.md#vm) +- [vmProfilerOpts](Config.md#vmprofileropts) +- [ACCOUNT\_CACHE](Config.md#account_cache) - [CHAIN\_DEFAULT](Config.md#chain_default) +- [CODE\_CACHE](Config.md#code_cache) - [DATADIR\_DEFAULT](Config.md#datadir_default) - [DEBUGCODE\_DEFAULT](Config.md#debugcode_default) - [DNSADDR\_DEFAULT](Config.md#dnsaddr_default) +- [ENGINE\_NEWPAYLOAD\_MAX\_EXECUTE](Config.md#engine_newpayload_max_execute) +- [ENGINE\_NEWPAYLOAD\_MAX\_TXS\_EXECUTE](Config.md#engine_newpayload_max_txs_execute) +- [ENGINE\_PARENTLOOKUP\_MAX\_DEPTH](Config.md#engine_parentlookup_max_depth) +- [EXECUTION](Config.md#execution-1) - [LIGHTSERV\_DEFAULT](Config.md#lightserv_default) - [MAXFETCHERJOBS\_DEFAULT](Config.md#maxfetcherjobs_default) +- [MAXFETCHERREQUESTS\_DEFAULT](Config.md#maxfetcherrequests_default) - [MAXPEERS\_DEFAULT](Config.md#maxpeers_default) - [MAXPERREQUEST\_DEFAULT](Config.md#maxperrequest_default) +- [MAX\_ACCOUNT\_RANGE](Config.md#max_account_range) +- [MAX\_INVALID\_BLOCKS\_ERROR\_CACHE](Config.md#max_invalid_blocks_error_cache) +- [MAX\_RANGE\_BYTES](Config.md#max_range_bytes) +- [MAX\_STORAGE\_RANGE](Config.md#max_storage_range) - [MINPEERS\_DEFAULT](Config.md#minpeers_default) +- [NUM\_BLOCKS\_PER\_ITERATION](Config.md#num_blocks_per_iteration) - [PORT\_DEFAULT](Config.md#port_default) +- [PRUNE\_ENGINE\_CACHE](Config.md#prune_engine_cache) - [SAFE\_REORG\_DISTANCE](Config.md#safe_reorg_distance) - [SKELETON\_FILL\_CANONICAL\_BACKSTEP](Config.md#skeleton_fill_canonical_backstep) - [SKELETON\_SUBCHAIN\_MERGE\_MINIMUM](Config.md#skeleton_subchain_merge_minimum) +- [SNAP\_AVAILABILITY\_DEPTH](Config.md#snap_availability_depth) +- [SNAP\_TRANSITION\_SAFE\_DEPTH](Config.md#snap_transition_safe_depth) +- [STORAGE\_CACHE](Config.md#storage_cache) +- [SYNCED\_STATE\_REMOVAL\_PERIOD](Config.md#synced_state_removal_period) - [SYNCMODE\_DEFAULT](Config.md#syncmode_default) -- [TRANSPORTS\_DEFAULT](Config.md#transports_default) +- [TRIE\_CACHE](Config.md#trie_cache) ### Methods - [getDataDirectory](Config.md#getdatadirectory) - [getDnsDiscovery](Config.md#getdnsdiscovery) - [getNetworkDirectory](Config.md#getnetworkdirectory) -- [getV4Discovery](Config.md#getv4discovery) +- [superMsg](Config.md#supermsg) +- [updateSynchronizedState](Config.md#updatesynchronizedstate) - [getClientKey](Config.md#getclientkey) - [getConfigDB](Config.md#getconfigdb) @@ -86,17 +127,27 @@ #### Defined in -[config.ts:316](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L316) +[config.ts:460](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L460) ## Properties +### accountCache + +• `Readonly` **accountCache**: `number` + +#### Defined in + +[config.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L410) + +___ + ### accounts -• `Readonly` **accounts**: [address: Address, privKey: Buffer][] +• `Readonly` **accounts**: [address: Address, privKey: Uint8Array][] #### Defined in -[config.ts:295](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L295) +[config.ts:419](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L419) ___ @@ -106,7 +157,7 @@ ___ #### Defined in -[config.ts:280](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L280) +[config.ts:396](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L396) ___ @@ -116,7 +167,17 @@ ___ #### Defined in -[config.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L311) +[config.ts:455](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L455) + +___ + +### codeCache + +• `Readonly` **codeCache**: `number` + +#### Defined in + +[config.ts:412](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L412) ___ @@ -126,7 +187,7 @@ ___ #### Defined in -[config.ts:277](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L277) +[config.ts:394](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L394) ___ @@ -136,57 +197,77 @@ ___ #### Defined in -[config.ts:291](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L291) +[config.ts:414](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L414) ___ -### disableBeaconSync +### discDns -• `Readonly` **disableBeaconSync**: `boolean` +• `Readonly` **discDns**: `boolean` #### Defined in -[config.ts:301](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L301) +[config.ts:415](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L415) ___ -### disableSnapSync +### discV4 -• `Readonly` **disableSnapSync**: `boolean` = `false` +• `Readonly` **discV4**: `boolean` #### Defined in -[config.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L304) +[config.ts:416](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L416) ___ -### discDns +### dnsAddr -• `Readonly` **discDns**: `boolean` +• `Readonly` **dnsAddr**: `string` #### Defined in -[config.ts:292](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L292) +[config.ts:407](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L407) ___ -### discV4 +### enableSnapSync -• `Readonly` **discV4**: `boolean` +• `Readonly` **enableSnapSync**: `boolean` #### Defined in -[config.ts:293](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L293) +[config.ts:440](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L440) ___ -### dnsAddr +### engineNewpayloadMaxExecute -• `Readonly` **dnsAddr**: `string` +• `Readonly` **engineNewpayloadMaxExecute**: `number` + +#### Defined in + +[config.ts:433](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L433) + +___ + +### engineNewpayloadMaxTxsExecute + +• `Readonly` **engineNewpayloadMaxTxsExecute**: `number` + +#### Defined in + +[config.ts:434](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L434) + +___ + +### engineParentLookupMaxDepth + +• `Readonly` **engineParentLookupMaxDepth**: `number` #### Defined in -[config.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L290) +[config.ts:432](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L432) ___ @@ -199,7 +280,7 @@ components of the client #### Defined in -[config.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L255) +[config.ts:346](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L346) ___ @@ -209,7 +290,17 @@ ___ #### Defined in -[config.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L312) +[config.ts:456](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L456) + +___ + +### execution + +• `Readonly` **execution**: `boolean` + +#### Defined in + +[config.ts:408](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L408) ___ @@ -219,27 +310,27 @@ ___ #### Defined in -[config.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L282) +[config.ts:398](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L398) ___ -### forceSnapSync +### isSingleNode -• `Readonly` **forceSnapSync**: `boolean` +• `Readonly` **isSingleNode**: `boolean` #### Defined in -[config.ts:302](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L302) +[config.ts:418](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L418) ___ ### key -• `Readonly` **key**: `Buffer` +• `Readonly` **key**: `Uint8Array` #### Defined in -[config.ts:278](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L278) +[config.ts:395](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L395) ___ @@ -247,9 +338,21 @@ ___ • **lastSyncDate**: `number` +lastSyncDate in ms + +#### Defined in + +[config.ts:449](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L449) + +___ + +### lastsyncronized + +• `Optional` **lastsyncronized**: `boolean` + #### Defined in -[config.ts:307](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L307) +[config.ts:447](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L447) ___ @@ -259,7 +362,7 @@ ___ #### Defined in -[config.ts:276](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L276) +[config.ts:393](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L393) ___ @@ -269,7 +372,17 @@ ___ #### Defined in -[config.ts:273](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L273) +[config.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L390) + +___ + +### maxAccountRange + +• `Readonly` **maxAccountRange**: `bigint` + +#### Defined in + +[config.ts:427](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L427) ___ @@ -279,7 +392,27 @@ ___ #### Defined in -[config.ts:287](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L287) +[config.ts:403](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L403) + +___ + +### maxFetcherRequests + +• `Readonly` **maxFetcherRequests**: `number` + +#### Defined in + +[config.ts:404](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L404) + +___ + +### maxInvalidBlocksErrorCache + +• `Readonly` **maxInvalidBlocksErrorCache**: `number` + +#### Defined in + +[config.ts:429](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L429) ___ @@ -289,7 +422,7 @@ ___ #### Defined in -[config.ts:289](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L289) +[config.ts:406](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L406) ___ @@ -299,7 +432,27 @@ ___ #### Defined in -[config.ts:286](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L286) +[config.ts:402](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L402) + +___ + +### maxRangeBytes + +• `Readonly` **maxRangeBytes**: `number` + +#### Defined in + +[config.ts:426](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L426) + +___ + +### maxStorageRange + +• `Readonly` **maxStorageRange**: `bigint` + +#### Defined in + +[config.ts:428](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L428) ___ @@ -309,7 +462,7 @@ ___ #### Defined in -[config.ts:288](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L288) +[config.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L405) ___ @@ -319,7 +472,7 @@ ___ #### Defined in -[config.ts:294](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L294) +[config.ts:417](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L417) ___ @@ -329,7 +482,7 @@ ___ #### Defined in -[config.ts:296](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L296) +[config.ts:420](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L420) ___ @@ -339,7 +492,17 @@ ___ #### Defined in -[config.ts:283](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L283) +[config.ts:399](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L399) + +___ + +### numBlocksPerIteration + +• `Readonly` **numBlocksPerIteration**: `number` + +#### Defined in + +[config.ts:409](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L409) ___ @@ -349,7 +512,27 @@ ___ #### Defined in -[config.ts:281](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L281) +[config.ts:397](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L397) + +___ + +### prefixStorageTrieKeys + +• `Readonly` **prefixStorageTrieKeys**: `boolean` + +#### Defined in + +[config.ts:438](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L438) + +___ + +### pruneEngineCache + +• `Readonly` **pruneEngineCache**: `boolean` + +#### Defined in + +[config.ts:430](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L430) ___ @@ -359,7 +542,17 @@ ___ #### Defined in -[config.ts:298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L298) +[config.ts:423](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L423) + +___ + +### savePreimages + +• `Readonly` **savePreimages**: `boolean` + +#### Defined in + +[config.ts:442](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L442) ___ @@ -369,17 +562,29 @@ ___ #### Defined in -[config.ts:284](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L284) +[config.ts:400](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L400) ___ -### servers +### server -• `Readonly` **servers**: (`Libp2pServer` \| `RlpxServer`)[] = `[]` +• `Readonly` **server**: `undefined` \| `RlpxServer` = `undefined` #### Defined in -[config.ts:314](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L314) +[config.ts:458](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L458) + +___ + +### shutdown + +• **shutdown**: `boolean` = `false` + +Client is in the process of shutting down + +#### Defined in + +[config.ts:453](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L453) ___ @@ -389,7 +594,7 @@ ___ #### Defined in -[config.ts:299](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L299) +[config.ts:424](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L424) ___ @@ -399,7 +604,47 @@ ___ #### Defined in -[config.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L300) +[config.ts:425](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L425) + +___ + +### snapAvailabilityDepth + +• `Readonly` **snapAvailabilityDepth**: `bigint` + +#### Defined in + +[config.ts:435](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L435) + +___ + +### snapTransitionSafeDepth + +• `Readonly` **snapTransitionSafeDepth**: `bigint` + +#### Defined in + +[config.ts:436](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L436) + +___ + +### statelessVerkle + +• `Readonly` **statelessVerkle**: `boolean` + +#### Defined in + +[config.ts:444](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L444) + +___ + +### storageCache + +• `Readonly` **storageCache**: `number` + +#### Defined in + +[config.ts:411](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L411) ___ @@ -411,7 +656,17 @@ Best known block height #### Defined in -[config.ts:309](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L309) +[config.ts:451](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L451) + +___ + +### syncedStateRemovalPeriod + +• `Readonly` **syncedStateRemovalPeriod**: `number` + +#### Defined in + +[config.ts:431](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L431) ___ @@ -421,7 +676,7 @@ ___ #### Defined in -[config.ts:306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L306) +[config.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L446) ___ @@ -431,17 +686,17 @@ ___ #### Defined in -[config.ts:274](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L274) +[config.ts:391](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L391) ___ -### transports +### trieCache -• `Readonly` **transports**: `string`[] +• `Readonly` **trieCache**: `number` #### Defined in -[config.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L279) +[config.ts:413](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L413) ___ @@ -451,7 +706,17 @@ ___ #### Defined in -[config.ts:285](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L285) +[config.ts:401](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L401) + +___ + +### useStringValueTrieDB + +• `Readonly` **useStringValueTrieDB**: `boolean` + +#### Defined in + +[config.ts:441](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L441) ___ @@ -461,7 +726,27 @@ ___ #### Defined in -[config.ts:275](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L275) +[config.ts:392](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L392) + +___ + +### vmProfilerOpts + +• `Optional` `Readonly` **vmProfilerOpts**: `VMProfilerOpts` + +#### Defined in + +[config.ts:421](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L421) + +___ + +### ACCOUNT\_CACHE + +▪ `Static` `Readonly` **ACCOUNT\_CACHE**: ``400000`` + +#### Defined in + +[config.ts:361](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L361) ___ @@ -471,7 +756,17 @@ ___ #### Defined in -[config.ts:257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L257) +[config.ts:348](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L348) + +___ + +### CODE\_CACHE + +▪ `Static` `Readonly` **CODE\_CACHE**: ``200000`` + +#### Defined in + +[config.ts:363](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L363) ___ @@ -481,7 +776,7 @@ ___ #### Defined in -[config.ts:260](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L260) +[config.ts:351](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L351) ___ @@ -491,7 +786,7 @@ ___ #### Defined in -[config.ts:268](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L268) +[config.ts:365](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L365) ___ @@ -501,7 +796,47 @@ ___ #### Defined in -[config.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L267) +[config.ts:358](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L358) + +___ + +### ENGINE\_NEWPAYLOAD\_MAX\_EXECUTE + +▪ `Static` `Readonly` **ENGINE\_NEWPAYLOAD\_MAX\_EXECUTE**: ``2`` + +#### Defined in + +[config.ts:382](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L382) + +___ + +### ENGINE\_NEWPAYLOAD\_MAX\_TXS\_EXECUTE + +▪ `Static` `Readonly` **ENGINE\_NEWPAYLOAD\_MAX\_TXS\_EXECUTE**: ``100`` + +#### Defined in + +[config.ts:384](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L384) + +___ + +### ENGINE\_PARENTLOOKUP\_MAX\_DEPTH + +▪ `Static` `Readonly` **ENGINE\_PARENTLOOKUP\_MAX\_DEPTH**: ``128`` + +#### Defined in + +[config.ts:381](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L381) + +___ + +### EXECUTION + +▪ `Static` `Readonly` **EXECUTION**: ``true`` + +#### Defined in + +[config.ts:359](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L359) ___ @@ -511,7 +846,7 @@ ___ #### Defined in -[config.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L259) +[config.ts:350](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L350) ___ @@ -521,7 +856,17 @@ ___ #### Defined in -[config.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L264) +[config.ts:354](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L354) + +___ + +### MAXFETCHERREQUESTS\_DEFAULT + +▪ `Static` `Readonly` **MAXFETCHERREQUESTS\_DEFAULT**: ``5`` + +#### Defined in + +[config.ts:355](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L355) ___ @@ -531,17 +876,57 @@ ___ #### Defined in -[config.ts:266](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L266) +[config.ts:357](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L357) ___ ### MAXPERREQUEST\_DEFAULT -▪ `Static` `Readonly` **MAXPERREQUEST\_DEFAULT**: ``50`` +▪ `Static` `Readonly` **MAXPERREQUEST\_DEFAULT**: ``100`` + +#### Defined in + +[config.ts:353](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L353) + +___ + +### MAX\_ACCOUNT\_RANGE + +▪ `Static` `Readonly` **MAX\_ACCOUNT\_RANGE**: `bigint` + +#### Defined in + +[config.ts:372](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L372) + +___ + +### MAX\_INVALID\_BLOCKS\_ERROR\_CACHE + +▪ `Static` `Readonly` **MAX\_INVALID\_BLOCKS\_ERROR\_CACHE**: ``128`` + +#### Defined in + +[config.ts:376](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L376) + +___ + +### MAX\_RANGE\_BYTES + +▪ `Static` `Readonly` **MAX\_RANGE\_BYTES**: ``50000`` #### Defined in -[config.ts:263](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L263) +[config.ts:370](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L370) + +___ + +### MAX\_STORAGE\_RANGE + +▪ `Static` `Readonly` **MAX\_STORAGE\_RANGE**: `bigint` + +#### Defined in + +[config.ts:374](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L374) ___ @@ -551,7 +936,17 @@ ___ #### Defined in -[config.ts:265](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L265) +[config.ts:356](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L356) + +___ + +### NUM\_BLOCKS\_PER\_ITERATION + +▪ `Static` `Readonly` **NUM\_BLOCKS\_PER\_ITERATION**: ``100`` + +#### Defined in + +[config.ts:360](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L360) ___ @@ -561,7 +956,17 @@ ___ #### Defined in -[config.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L262) +[config.ts:352](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L352) + +___ + +### PRUNE\_ENGINE\_CACHE + +▪ `Static` `Readonly` **PRUNE\_ENGINE\_CACHE**: ``true`` + +#### Defined in + +[config.ts:377](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L377) ___ @@ -571,7 +976,7 @@ ___ #### Defined in -[config.ts:269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L269) +[config.ts:366](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L366) ___ @@ -581,7 +986,7 @@ ___ #### Defined in -[config.ts:270](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L270) +[config.ts:367](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L367) ___ @@ -591,7 +996,47 @@ ___ #### Defined in -[config.ts:271](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L271) +[config.ts:368](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L368) + +___ + +### SNAP\_AVAILABILITY\_DEPTH + +▪ `Static` `Readonly` **SNAP\_AVAILABILITY\_DEPTH**: `bigint` + +#### Defined in + +[config.ts:385](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L385) + +___ + +### SNAP\_TRANSITION\_SAFE\_DEPTH + +▪ `Static` `Readonly` **SNAP\_TRANSITION\_SAFE\_DEPTH**: `bigint` + +#### Defined in + +[config.ts:388](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L388) + +___ + +### STORAGE\_CACHE + +▪ `Static` `Readonly` **STORAGE\_CACHE**: ``200000`` + +#### Defined in + +[config.ts:362](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L362) + +___ + +### SYNCED\_STATE\_REMOVAL\_PERIOD + +▪ `Static` `Readonly` **SYNCED\_STATE\_REMOVAL\_PERIOD**: ``60000`` + +#### Defined in + +[config.ts:379](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L379) ___ @@ -601,17 +1046,17 @@ ___ #### Defined in -[config.ts:258](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L258) +[config.ts:349](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L349) ___ -### TRANSPORTS\_DEFAULT +### TRIE\_CACHE -▪ `Static` `Readonly` **TRANSPORTS\_DEFAULT**: `string`[] +▪ `Static` `Readonly` **TRIE\_CACHE**: ``200000`` #### Defined in -[config.ts:261](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L261) +[config.ts:364](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L364) ## Methods @@ -633,7 +1078,7 @@ Returns the location for each [DataDirectory](../enums/DataDirectory.md) #### Defined in -[config.ts:398](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L398) +[config.ts:637](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L637) ___ @@ -656,7 +1101,7 @@ is enabled based on chainName. `true` for goerli #### Defined in -[config.ts:444](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L444) +[config.ts:698](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L698) ___ @@ -672,36 +1117,61 @@ Returns the network directory for the chain. #### Defined in -[config.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L390) +[config.ts:629](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L629) ___ -### getV4Discovery +### superMsg -▸ **getV4Discovery**(`option`): `boolean` +▸ **superMsg**(`msgs`, `meta?`): `void` -Returns specified option or the default setting for whether v4 peer discovery -is enabled based on chainName. `true` for `mainnet` +#### Parameters + +| Name | Type | +| :------ | :------ | +| `msgs` | `string` \| `string`[] | +| `meta?` | `any` | + +#### Returns + +`void` + +#### Defined in + +[config.ts:679](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L679) + +___ + +### updateSynchronizedState + +▸ **updateSynchronizedState**(`latest?`, `emitSyncEvent?`): `void` + +Update the synchronized state of the chain + +**`Emits`** + +Event.SYNC_SYNCHRONIZED #### Parameters | Name | Type | | :------ | :------ | -| `option` | `undefined` \| `boolean` | +| `latest?` | ``null`` \| `BlockHeader` | +| `emitSyncEvent?` | `boolean` | #### Returns -`boolean` +`void` #### Defined in -[config.ts:454](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L454) +[config.ts:570](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L570) ___ ### getClientKey -▸ `Static` **getClientKey**(`datadir`, `common`): `Promise`<`undefined` \| `Buffer`\> +▸ `Static` **getClientKey**(`datadir`, `common`): `Promise`<`undefined` \| `Uint8Array`\> Gets the client private key from the config db. @@ -714,17 +1184,17 @@ Gets the client private key from the config db. #### Returns -`Promise`<`undefined` \| `Buffer`\> +`Promise`<`undefined` \| `Uint8Array`\> #### Defined in -[config.ts:422](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L422) +[config.ts:661](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L661) ___ ### getConfigDB -▸ `Static` **getConfigDB**(`networkDir`): `Level`<`string` \| `Buffer`, `Buffer`\> +▸ `Static` **getConfigDB**(`networkDir`): `Level`<`string` \| `Uint8Array`, `Uint8Array`\> Returns the config level db. @@ -736,8 +1206,8 @@ Returns the config level db. #### Returns -`Level`<`string` \| `Buffer`, `Buffer`\> +`Level`<`string` \| `Uint8Array`, `Uint8Array`\> #### Defined in -[config.ts:415](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L415) +[config.ts:654](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L654) diff --git a/packages/client/docs/enums/SyncMode.md b/packages/client/docs/enums/SyncMode.md index 087d93308b..1f9fac307c 100644 --- a/packages/client/docs/enums/SyncMode.md +++ b/packages/client/docs/enums/SyncMode.md @@ -8,6 +8,7 @@ - [Full](SyncMode.md#full) - [Light](SyncMode.md#light) +- [None](SyncMode.md#none) ## Enumeration Members @@ -17,7 +18,7 @@ #### Defined in -[config.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L23) +[config.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L24) ___ @@ -27,4 +28,14 @@ ___ #### Defined in -[config.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L24) +[config.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L25) + +___ + +### None + +• **None** = ``"none"`` + +#### Defined in + +[config.ts:26](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L26) diff --git a/packages/client/docs/interfaces/ConfigOptions.md b/packages/client/docs/interfaces/ConfigOptions.md index 6b7dbd17ab..2c034912a9 100644 --- a/packages/client/docs/interfaces/ConfigOptions.md +++ b/packages/client/docs/interfaces/ConfigOptions.md @@ -6,44 +6,79 @@ ### Properties +- [accountCache](ConfigOptions.md#accountcache) - [accounts](ConfigOptions.md#accounts) - [bootnodes](ConfigOptions.md#bootnodes) +- [codeCache](ConfigOptions.md#codecache) - [common](ConfigOptions.md#common) - [datadir](ConfigOptions.md#datadir) - [debugCode](ConfigOptions.md#debugcode) -- [disableBeaconSync](ConfigOptions.md#disablebeaconsync) - [discDns](ConfigOptions.md#discdns) - [discV4](ConfigOptions.md#discv4) - [dnsAddr](ConfigOptions.md#dnsaddr) - [dnsNetworks](ConfigOptions.md#dnsnetworks) +- [enableSnapSync](ConfigOptions.md#enablesnapsync) +- [engineNewpayloadMaxExecute](ConfigOptions.md#enginenewpayloadmaxexecute) +- [engineNewpayloadMaxTxsExecute](ConfigOptions.md#enginenewpayloadmaxtxsexecute) +- [engineParentLookupMaxDepth](ConfigOptions.md#engineparentlookupmaxdepth) +- [execution](ConfigOptions.md#execution) - [extIP](ConfigOptions.md#extip) -- [forceSnapSync](ConfigOptions.md#forcesnapsync) +- [isSingleNode](ConfigOptions.md#issinglenode) - [key](ConfigOptions.md#key) - [lightserv](ConfigOptions.md#lightserv) - [logger](ConfigOptions.md#logger) +- [maxAccountRange](ConfigOptions.md#maxaccountrange) - [maxFetcherJobs](ConfigOptions.md#maxfetcherjobs) +- [maxFetcherRequests](ConfigOptions.md#maxfetcherrequests) +- [maxInvalidBlocksErrorCache](ConfigOptions.md#maxinvalidblockserrorcache) - [maxPeers](ConfigOptions.md#maxpeers) - [maxPerRequest](ConfigOptions.md#maxperrequest) +- [maxRangeBytes](ConfigOptions.md#maxrangebytes) +- [maxStorageRange](ConfigOptions.md#maxstoragerange) - [minPeers](ConfigOptions.md#minpeers) - [mine](ConfigOptions.md#mine) - [minerCoinbase](ConfigOptions.md#minercoinbase) - [multiaddrs](ConfigOptions.md#multiaddrs) +- [numBlocksPerIteration](ConfigOptions.md#numblocksperiteration) - [port](ConfigOptions.md#port) +- [prefixStorageTrieKeys](ConfigOptions.md#prefixstoragetriekeys) +- [pruneEngineCache](ConfigOptions.md#pruneenginecache) - [safeReorgDistance](ConfigOptions.md#safereorgdistance) +- [savePreimages](ConfigOptions.md#savepreimages) - [saveReceipts](ConfigOptions.md#savereceipts) -- [servers](ConfigOptions.md#servers) +- [server](ConfigOptions.md#server) - [skeletonFillCanonicalBackStep](ConfigOptions.md#skeletonfillcanonicalbackstep) - [skeletonSubchainMergeMinimum](ConfigOptions.md#skeletonsubchainmergeminimum) +- [snapAvailabilityDepth](ConfigOptions.md#snapavailabilitydepth) +- [snapTransitionSafeDepth](ConfigOptions.md#snaptransitionsafedepth) +- [statelessVerkle](ConfigOptions.md#statelessverkle) +- [storageCache](ConfigOptions.md#storagecache) +- [syncedStateRemovalPeriod](ConfigOptions.md#syncedstateremovalperiod) - [syncmode](ConfigOptions.md#syncmode) -- [transports](ConfigOptions.md#transports) +- [trieCache](ConfigOptions.md#triecache) - [txLookupLimit](ConfigOptions.md#txlookuplimit) +- [useStringValueTrieDB](ConfigOptions.md#usestringvaluetriedb) - [vm](ConfigOptions.md#vm) +- [vmProfileBlocks](ConfigOptions.md#vmprofileblocks) +- [vmProfileTxs](ConfigOptions.md#vmprofiletxs) ## Properties +### accountCache + +• `Optional` **accountCache**: `number` + +Size for the account cache (max number of accounts) + +#### Defined in + +[config.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L199) + +___ + ### accounts -• `Optional` **accounts**: [address: Address, privKey: Buffer][] +• `Optional` **accounts**: [address: Address, privKey: Uint8Array][] Unlocked accounts of form [address, privateKey] Currently only the first account is used to seal mined PoA blocks @@ -52,7 +87,7 @@ Default: [] #### Defined in -[config.ts:221](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L221) +[config.ts:269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L269) ___ @@ -65,7 +100,19 @@ Network bootnodes #### Defined in -[config.ts:98](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L98) +[config.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L96) + +___ + +### codeCache + +• `Optional` **codeCache**: `number` + +Size for the code cache (max number of contracts) + +#### Defined in + +[config.ts:209](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L209) ___ @@ -80,7 +127,7 @@ Default: 'mainnet' Common #### Defined in -[config.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L34) +[config.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L36) ___ @@ -92,7 +139,7 @@ Root data directory for the blockchain #### Defined in -[config.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L78) +[config.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L83) ___ @@ -108,22 +155,7 @@ EthereumJS VM on execution errors #### Defined in -[config.ts:192](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L192) - -___ - -### disableBeaconSync - -• `Optional` **disableBeaconSync**: `boolean` - -Whether to disable beacon (optimistic) sync if CL provides -blocks at the head of chain. - -Default: false - -#### Defined in - -[config.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L49) +[config.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L223) ___ @@ -137,7 +169,7 @@ Default: `true` for testnets, false for mainnet #### Defined in -[config.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L199) +[config.ts:230](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L230) ___ @@ -151,7 +183,7 @@ Default: `false` for testnets, true for mainnet #### Defined in -[config.ts:206](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L206) +[config.ts:237](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L237) ___ @@ -165,7 +197,7 @@ Default `8.8.8.8` (Google) #### Defined in -[config.ts:178](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L178) +[config.ts:179](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L179) ___ @@ -177,7 +209,69 @@ EIP-1459 ENR Tree urls to query via DNS for peer discovery #### Defined in -[config.ts:183](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L183) +[config.ts:184](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L184) + +___ + +### enableSnapSync + +• `Optional` **enableSnapSync**: `boolean` + +Whether to enable and run snapSync, currently experimental + +Default: false + +#### Defined in + +[config.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L50) + +___ + +### engineNewpayloadMaxExecute + +• `Optional` **engineNewpayloadMaxExecute**: `number` + +Max blocks including unexecuted parents to be executed in engine's newPayload + +#### Defined in + +[config.ts:313](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L313) + +___ + +### engineNewpayloadMaxTxsExecute + +• `Optional` **engineNewpayloadMaxTxsExecute**: `number` + +Limit max transactions per block to execute in engine's newPayload for responsive engine api + +#### Defined in + +[config.ts:318](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L318) + +___ + +### engineParentLookupMaxDepth + +• `Optional` **engineParentLookupMaxDepth**: `number` + +Max depth for parent lookups in engine's newPayload and forkchoiceUpdated + +#### Defined in + +[config.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L308) + +___ + +### execution + +• `Optional` **execution**: `boolean` + +Start continuous VM execution (pre-Merge setting) + +#### Defined in + +[config.ts:189](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L189) ___ @@ -189,30 +283,27 @@ RLPx external IP #### Defined in -[config.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L110) +[config.ts:108](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L108) ___ -### forceSnapSync +### isSingleNode -• `Optional` **forceSnapSync**: `boolean` +• `Optional` **isSingleNode**: `boolean` -Whether to test and run snapSync. When fully ready, this needs to -be replaced by a more sophisticated condition based on how far back we are -from the head, and how to run it in conjunction with the beacon sync -blocks at the head of chain. +Is a single node and doesn't need peers for synchronization -Default: false +Default: `false` #### Defined in -[config.ts:59](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L59) +[config.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L251) ___ ### key -• `Optional` **key**: `Buffer` +• `Optional` **key**: `Uint8Array` Private key for the client. Use return value of [getClientKey](../classes/Config.md#getclientkey). @@ -220,7 +311,7 @@ If left blank, a random key will be generated and used. #### Defined in -[config.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L85) +[config.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L90) ___ @@ -234,7 +325,7 @@ Default: `false` #### Defined in -[config.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L73) +[config.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L78) ___ @@ -249,7 +340,17 @@ Default: Logger with loglevel 'info' #### Defined in -[config.ts:143](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L143) +[config.ts:139](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L139) + +___ + +### maxAccountRange + +• `Optional` **maxAccountRange**: `bigint` + +#### Defined in + +[config.ts:299](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L299) ___ @@ -263,7 +364,31 @@ Default: `100` #### Defined in -[config.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L157) +[config.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L153) + +___ + +### maxFetcherRequests + +• `Optional` **maxFetcherRequests**: `number` + +Max outgoing multi-peer requests by the fetcher at any given time + +#### Defined in + +[config.ts:158](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L158) + +___ + +### maxInvalidBlocksErrorCache + +• `Optional` **maxInvalidBlocksErrorCache**: `number` + +Cache size of invalid block hashes and their errors + +#### Defined in + +[config.ts:325](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L325) ___ @@ -277,7 +402,7 @@ Default: `25` #### Defined in -[config.ts:171](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L171) +[config.ts:172](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L172) ___ @@ -287,11 +412,31 @@ ___ Max items per block or header request -Default: `50`` +Default: `100` + +#### Defined in + +[config.ts:146](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L146) + +___ + +### maxRangeBytes + +• `Optional` **maxRangeBytes**: `number` + +#### Defined in + +[config.ts:297](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L297) + +___ + +### maxStorageRange + +• `Optional` **maxStorageRange**: `bigint` #### Defined in -[config.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L150) +[config.ts:320](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L320) ___ @@ -305,7 +450,7 @@ Default: `1` #### Defined in -[config.ts:164](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L164) +[config.ts:165](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L165) ___ @@ -319,7 +464,7 @@ Default: `false` #### Defined in -[config.ts:213](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L213) +[config.ts:244](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L244) ___ @@ -332,7 +477,7 @@ If not provided, defaults to the primary account. #### Defined in -[config.ts:227](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L227) +[config.ts:275](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L275) ___ @@ -345,7 +490,19 @@ Network multiaddrs for libp2p #### Defined in -[config.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L116) +[config.ts:114](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L114) + +___ + +### numBlocksPerIteration + +• `Optional` **numBlocksPerIteration**: `number` + +Number of blocks to execute in batch mode and logged to console + +#### Defined in + +[config.ts:194](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L194) ___ @@ -359,7 +516,32 @@ Default: `30303` #### Defined in -[config.ts:105](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L105) +[config.ts:103](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L103) + +___ + +### prefixStorageTrieKeys + +• `Optional` **prefixStorageTrieKeys**: `boolean` + +A temporary option to offer backward compatibility with already-synced databases that are +using non-prefixed keys for storage tries + +Default: true + +#### Defined in + +[config.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L58) + +___ + +### pruneEngineCache + +• `Optional` **pruneEngineCache**: `boolean` + +#### Defined in + +[config.ts:326](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L326) ___ @@ -372,7 +554,19 @@ to try to refetch and refeed the blocks. #### Defined in -[config.ts:233](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L233) +[config.ts:281](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L281) + +___ + +### savePreimages + +• `Optional` **savePreimages**: `boolean` + +Save account keys preimages in the meta db (default: false) + +#### Defined in + +[config.ts:333](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L333) ___ @@ -384,22 +578,20 @@ Save tx receipts and logs in the meta db (default: false) #### Defined in -[config.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L129) +[config.ts:125](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L125) ___ -### servers - -• `Optional` **servers**: (`Libp2pServer` \| `RlpxServer`)[] +### server -Transport servers (RLPx or Libp2p) -Use `transports` option, only used for testing purposes +• `Optional` **server**: `RlpxServer` -Default: servers created from `transports` option +Transport servers (RLPx) +Only used for testing purposes #### Defined in -[config.ts:124](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L124) +[config.ts:120](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L120) ___ @@ -413,7 +605,7 @@ to backstep and fill again using reverse block fetcher. #### Defined in -[config.ts:240](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L240) +[config.ts:288](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L288) ___ @@ -427,7 +619,63 @@ reset #### Defined in -[config.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L247) +[config.ts:295](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L295) + +___ + +### snapAvailabilityDepth + +• `Optional` **snapAvailabilityDepth**: `bigint` + +#### Defined in + +[config.ts:327](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L327) + +___ + +### snapTransitionSafeDepth + +• `Optional` **snapTransitionSafeDepth**: `bigint` + +#### Defined in + +[config.ts:328](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L328) + +___ + +### statelessVerkle + +• `Optional` **statelessVerkle**: `boolean` + +Enables stateless verkle block execution (default: false) + +#### Defined in + +[config.ts:338](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L338) + +___ + +### storageCache + +• `Optional` **storageCache**: `number` + +Size for the storage cache (max number of contracts) + +#### Defined in + +[config.ts:204](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L204) + +___ + +### syncedStateRemovalPeriod + +• `Optional` **syncedStateRemovalPeriod**: `number` + +The time after which synced state is downgraded to unsynced + +#### Defined in + +[config.ts:303](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L303) ___ @@ -435,27 +683,25 @@ ___ • `Optional` **syncmode**: [`SyncMode`](../enums/SyncMode.md) -Synchronization mode ('full' or 'light') +Synchronization mode ('full', 'light', 'none') Default: 'full' #### Defined in -[config.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L41) +[config.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L43) ___ -### transports +### trieCache -• `Optional` **transports**: `string`[] +• `Optional` **trieCache**: `number` -Network transports ('rlpx' and/or 'libp2p') - -Default: `['rlpx', 'libp2p']` +Size for the trie cache (max number of trie nodes) #### Defined in -[config.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L92) +[config.ts:214](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L214) ___ @@ -468,7 +714,20 @@ Number of recent blocks to maintain transactions index for #### Defined in -[config.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L135) +[config.ts:131](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L131) + +___ + +### useStringValueTrieDB + +• `Optional` **useStringValueTrieDB**: `boolean` + +A temporary option to offer backward compatibility with already-synced databases that stores +trie items as `string`, instead of the more performant `Uint8Array` + +#### Defined in + +[config.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L64) ___ @@ -482,4 +741,28 @@ Default: VM instance created by client #### Defined in -[config.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/lib/config.ts#L66) +[config.ts:71](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L71) + +___ + +### vmProfileBlocks + +• `Optional` **vmProfileBlocks**: `boolean` + +Whether to profile VM blocks + +#### Defined in + +[config.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L256) + +___ + +### vmProfileTxs + +• `Optional` **vmProfileTxs**: `boolean` + +Whether to profile VM txs + +#### Defined in + +[config.ts:261](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/client/src/config.ts#L261) diff --git a/packages/client/package.json b/packages/client/package.json index fddb401d8d..567585aab3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/client", - "version": "0.10.0", + "version": "0.10.1", "description": "EthereumJS Execution Layer (EL) Client Implementation", "keywords": [ "ethereum", @@ -56,20 +56,20 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "5.1.1", - "@ethereumjs/blockchain": "7.1.0", - "@ethereumjs/common": "4.2.0", - "@ethereumjs/devp2p": "6.1.1", - "@ethereumjs/ethash": "3.0.2", - "@ethereumjs/evm": "2.2.1", - "@ethereumjs/genesis": "0.2.1", + "@ethereumjs/block": "5.2.0", + "@ethereumjs/blockchain": "7.2.0", + "@ethereumjs/common": "4.3.0", + "@ethereumjs/devp2p": "6.1.2", + "@ethereumjs/ethash": "3.0.3", + "@ethereumjs/evm": "3.0.0", + "@ethereumjs/genesis": "0.2.2", "@ethereumjs/rlp": "5.0.2", - "@ethereumjs/statemanager": "2.2.2", - "@ethereumjs/trie": "6.1.1", - "@ethereumjs/tx": "5.2.1", - "@ethereumjs/util": "9.0.2", - "@ethereumjs/verkle": "^0.0.1", - "@ethereumjs/vm": "7.2.1", + "@ethereumjs/statemanager": "2.3.0", + "@ethereumjs/trie": "6.2.0", + "@ethereumjs/tx": "5.3.0", + "@ethereumjs/util": "9.0.3", + "@ethereumjs/verkle": "^0.0.2", + "@ethereumjs/vm": "8.0.0", "@polkadot/util": "^12.6.2", "@polkadot/wasm-crypto": "^7.3.2", "abstract-level": "^1.0.3", diff --git a/packages/common/CHANGELOG.md b/packages/common/CHANGELOG.md index ee08dbb3df..617fc94dea 100644 --- a/packages/common/CHANGELOG.md +++ b/packages/common/CHANGELOG.md @@ -6,6 +6,47 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 4.3.0 - 2024-03-05 + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/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](https://github.com/ethereumjs/ethereumjs-monorepo/issues/3306) +- Early support for [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - "Save historical block hashes in state" (Verkle related, likely subject to change), PRs [#3268](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3268) and [#3327](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3327) + ## 4.2.0 - 2024-02-08 ### Dencun Hardfork Support diff --git a/packages/common/README.md b/packages/common/README.md index e0df248eed..1124468ef7 100644 --- a/packages/common/README.md +++ b/packages/common/README.md @@ -126,17 +126,20 @@ to initalize (assuming you are using the `c-kzg` package as your KZG cryptograph ```ts // ./examples/initKzg.ts -import * as kzg from 'c-kzg' +import { loadKZG } from 'kzg-wasm' 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 +const main = async () => { + const kzg = await loadKZG() + const common = new Common({ + chain: Chain.Mainnet, + hardfork: Hardfork.Cancun, + customCrypto: { kzg }, + }) + console.log(common.customCrypto.kzg) // Should print the initialized KZG interface +} + +main() ``` ## Browser @@ -406,6 +409,7 @@ The following EIPs are currently supported: - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS precompiles (removed in v4.0.0, see latest v3 release) - [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp gas cost - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Transaction Types +- [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - Save historical block hashes in state (`experimental`) - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - gas cost increases for state access opcodes - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Optional access list tx type - [EIP-3074](https://eips.ethereum.org/EIPS/eip-3074) - AUTH and AUTHCALL opcodes diff --git a/packages/common/docs/README.md b/packages/common/docs/README.md index e6bdfb583e..d9498dea2a 100644 --- a/packages/common/docs/README.md +++ b/packages/common/docs/README.md @@ -47,6 +47,7 @@ - [EIPOrHFConfig](README.md#eiporhfconfig) - [EthashConfig](README.md#ethashconfig) - [HardforkConfig](README.md#hardforkconfig) +- [HardforksDict](README.md#hardforksdict) - [Proof](README.md#proof) - [StorageProof](README.md#storageproof) @@ -150,7 +151,7 @@ ___ #### Defined in -[types.ts:186](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L186) +[types.ts:188](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L188) ___ @@ -173,7 +174,7 @@ ___ #### Defined in -[types.ts:165](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L165) +[types.ts:167](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L167) ___ @@ -193,7 +194,21 @@ ___ #### Defined in -[types.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L191) +[types.ts:193](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L193) + +___ + +### HardforksDict + +Ƭ **HardforksDict**: `Object` + +#### Index signature + +▪ [key: `string`]: [`HardforkConfig`](README.md#hardforkconfig) + +#### Defined in + +[types.ts:199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L199) ___ diff --git a/packages/common/docs/classes/Common.md b/packages/common/docs/classes/Common.md index 1259881e52..6af73488ec 100644 --- a/packages/common/docs/classes/Common.md +++ b/packages/common/docs/classes/Common.md @@ -33,6 +33,7 @@ can be created via the main constructor and the [customChains](../interfaces/Com - [copy](Common.md#copy) - [dnsNetworks](Common.md#dnsnetworks) - [eipBlock](Common.md#eipblock) +- [eipTimestamp](Common.md#eiptimestamp) - [eips](Common.md#eips) - [forkHash](Common.md#forkhash) - [genesis](Common.md#genesis) @@ -77,7 +78,7 @@ can be created via the main constructor and the [customChains](../interfaces/Com #### Defined in -[common.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L236) +[common.ts:237](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L237) ## Properties @@ -131,7 +132,7 @@ True if HF is active on block number #### Defined in -[common.ts:705](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L705) +[common.ts:703](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L703) ___ @@ -149,7 +150,7 @@ Dict with bootstrap nodes #### Defined in -[common.ts:955](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L955) +[common.ts:975](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L975) ___ @@ -167,7 +168,7 @@ chain Id #### Defined in -[common.ts:979](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L979) +[common.ts:999](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L999) ___ @@ -185,7 +186,7 @@ chain name (lower case) #### Defined in -[common.ts:987](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L987) +[common.ts:1007](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1007) ___ @@ -207,7 +208,7 @@ Note: This value can update along a Hardfork. #### Defined in -[common.ts:1036](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1036) +[common.ts:1056](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1056) ___ @@ -233,7 +234,7 @@ Note: This value can update along a Hardfork. #### Defined in -[common.ts:1062](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1062) +[common.ts:1082](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1082) ___ @@ -252,7 +253,7 @@ Note: This value can update along a Hardfork. #### Defined in -[common.ts:1014](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1014) +[common.ts:1034](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1034) ___ @@ -268,7 +269,7 @@ Returns a deep copy of this [Common](Common.md) instance. #### Defined in -[common.ts:1083](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1083) +[common.ts:1103](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1103) ___ @@ -286,7 +287,7 @@ Array of DNS ENR urls #### Defined in -[common.ts:963](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L963) +[common.ts:983](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L983) ___ @@ -310,7 +311,31 @@ Block number or null if unscheduled #### Defined in -[common.ts:768](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L768) +[common.ts:766](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L766) + +___ + +### eipTimestamp + +▸ **eipTimestamp**(`eip`): ``null`` \| `bigint` + +Returns the scheduled timestamp of the EIP (if scheduled and scheduled by timestamp) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `eip` | `number` | EIP number | + +#### Returns + +``null`` \| `bigint` + +Scheduled timestamp. If this EIP is unscheduled, or the EIP is scheduled by block number or ttd, then it returns `null`. + +#### Defined in + +[common.ts:784](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L784) ___ @@ -329,7 +354,7 @@ List of EIPs #### Defined in -[common.ts:1004](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1004) +[common.ts:1024](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1024) ___ @@ -352,7 +377,7 @@ Returns an eth/64 compliant fork hash (EIP-2124) #### Defined in -[common.ts:889](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L889) +[common.ts:905](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L905) ___ @@ -370,7 +395,7 @@ Genesis dictionary #### Defined in -[common.ts:939](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L939) +[common.ts:955](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L955) ___ @@ -399,7 +424,7 @@ The name of the HF #### Defined in -[common.ts:328](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L328) +[common.ts:330](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L330) ___ @@ -423,7 +448,7 @@ True if hardfork set is greater than hardfork provided #### Defined in -[common.ts:736](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L736) +[common.ts:734](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L734) ___ @@ -441,7 +466,7 @@ Hardfork name #### Defined in -[common.ts:971](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L971) +[common.ts:991](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L991) ___ @@ -465,7 +490,7 @@ Block number or null if unscheduled #### Defined in -[common.ts:745](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L745) +[common.ts:743](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L743) ___ @@ -487,7 +512,7 @@ Array with hardfork data (name, block, forkHash) #### Defined in -[common.ts:911](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L911) +[common.ts:927](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L927) ___ @@ -512,7 +537,7 @@ True if HF1 gte HF2 #### Defined in -[common.ts:716](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L716) +[common.ts:714](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L714) ___ @@ -537,7 +562,7 @@ True if HF is active on block number #### Defined in -[common.ts:690](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L690) +[common.ts:688](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L688) ___ @@ -561,7 +586,7 @@ Total difficulty or null if no set #### Defined in -[common.ts:786](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L786) +[common.ts:802](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L802) ___ @@ -581,7 +606,7 @@ ___ #### Defined in -[common.ts:754](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L754) +[common.ts:752](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L752) ___ @@ -599,7 +624,7 @@ Array with arrays of hardforks #### Defined in -[common.ts:947](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L947) +[common.ts:963](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L963) ___ @@ -626,7 +651,7 @@ by the [eips](../interfaces/CommonOpts.md#eips) constructor option #### Defined in -[common.ts:677](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L677) +[common.ts:675](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L675) ___ @@ -644,7 +669,7 @@ network Id #### Defined in -[common.ts:995](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L995) +[common.ts:1015](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1015) ___ @@ -668,7 +693,7 @@ Block timestamp, number or null if not available #### Defined in -[common.ts:800](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L800) +[common.ts:816](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L816) ___ @@ -697,7 +722,7 @@ The value requested or `BigInt(0)` if not found #### Defined in -[common.ts:581](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L581) +[common.ts:579](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L579) ___ @@ -726,7 +751,7 @@ The value requested or `BigInt(0)` if not found #### Defined in -[common.ts:657](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L657) +[common.ts:655](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L655) ___ @@ -752,7 +777,7 @@ The value requested or `undefined` if not found #### Defined in -[common.ts:632](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L632) +[common.ts:630](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L630) ___ @@ -778,7 +803,7 @@ The value requested or `BigInt(0)` if not found #### Defined in -[common.ts:601](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L601) +[common.ts:599](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L599) ___ @@ -802,7 +827,7 @@ The dictionary with parameters set as chain #### Defined in -[common.ts:268](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L268) +[common.ts:270](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L270) ___ @@ -824,7 +849,7 @@ Sets the active EIPs #### Defined in -[common.ts:471](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L471) +[common.ts:469](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L469) ___ @@ -846,7 +871,7 @@ Sets any missing forkHashes on the passed-in [Common](Common.md) instance #### Defined in -[common.ts:923](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L923) +[common.ts:939](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L939) ___ @@ -868,7 +893,7 @@ Sets the hardfork to get params for #### Defined in -[common.ts:299](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L299) +[common.ts:301](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L301) ___ @@ -897,7 +922,7 @@ The name of the HF set #### Defined in -[common.ts:448](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L448) +[common.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L446) ___ @@ -983,7 +1008,7 @@ ___ #### Defined in -[common.ts:1089](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1089) +[common.ts:1109](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L1109) ___ @@ -1007,4 +1032,4 @@ boolean #### Defined in -[common.ts:208](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L208) +[common.ts:209](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/common.ts#L209) diff --git a/packages/common/docs/interfaces/BootstrapNodeConfig.md b/packages/common/docs/interfaces/BootstrapNodeConfig.md index ef04d8708d..e32bc58982 100644 --- a/packages/common/docs/interfaces/BootstrapNodeConfig.md +++ b/packages/common/docs/interfaces/BootstrapNodeConfig.md @@ -22,7 +22,7 @@ #### Defined in -[types.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L64) +[types.ts:65](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L65) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[types.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L67) +[types.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L68) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[types.ts:65](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L65) +[types.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L66) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[types.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L61) +[types.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L62) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[types.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L66) +[types.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L67) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[types.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L63) +[types.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L64) ___ @@ -82,4 +82,4 @@ ___ #### Defined in -[types.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L62) +[types.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L63) diff --git a/packages/common/docs/interfaces/ChainConfig.md b/packages/common/docs/interfaces/ChainConfig.md index 4c368ddbe7..fca3c544c1 100644 --- a/packages/common/docs/interfaces/ChainConfig.md +++ b/packages/common/docs/interfaces/ChainConfig.md @@ -10,6 +10,7 @@ - [chainId](ChainConfig.md#chainid) - [comment](ChainConfig.md#comment) - [consensus](ChainConfig.md#consensus) +- [customHardforks](ChainConfig.md#customhardforks) - [defaultHardfork](ChainConfig.md#defaulthardfork) - [dnsNetworks](ChainConfig.md#dnsnetworks) - [genesis](ChainConfig.md#genesis) @@ -26,7 +27,7 @@ #### Defined in -[types.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L37) +[types.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L38) ___ @@ -56,7 +57,17 @@ ___ #### Defined in -[types.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L39) +[types.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L40) + +___ + +### customHardforks + +• `Optional` **customHardforks**: [`HardforksDict`](../README.md#hardforksdict) + +#### Defined in + +[types.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L37) ___ @@ -76,7 +87,7 @@ ___ #### Defined in -[types.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L38) +[types.ts:39](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L39) ___ diff --git a/packages/common/docs/interfaces/CommonOpts.md b/packages/common/docs/interfaces/CommonOpts.md index 0aae31c4fa..89e88f0732 100644 --- a/packages/common/docs/interfaces/CommonOpts.md +++ b/packages/common/docs/interfaces/CommonOpts.md @@ -32,7 +32,7 @@ passed in via [customChains](CommonOpts.md#customchains). #### Defined in -[types.ts:122](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L122) +[types.ts:124](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L124) ___ @@ -52,7 +52,7 @@ const common = new Common({ chain: 'myCustomChain1', customChains: [ myCustomCha #### Defined in -[types.ts:134](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L134) +[types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L136) ___ @@ -75,7 +75,7 @@ BaseOpts.customCrypto #### Defined in -[types.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L110) +[types.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L112) ___ @@ -92,7 +92,7 @@ BaseOpts.eips #### Defined in -[types.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L99) +[types.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L101) ___ @@ -110,4 +110,4 @@ BaseOpts.hardfork #### Defined in -[types.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L94) +[types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L96) diff --git a/packages/common/docs/interfaces/CustomCommonOpts.md b/packages/common/docs/interfaces/CustomCommonOpts.md index 63989a29cb..9ade971dbf 100644 --- a/packages/common/docs/interfaces/CustomCommonOpts.md +++ b/packages/common/docs/interfaces/CustomCommonOpts.md @@ -30,7 +30,7 @@ a standard chain used to base the custom chain params on. #### Defined in -[types.ts:145](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L145) +[types.ts:147](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L147) ___ @@ -53,7 +53,7 @@ BaseOpts.customCrypto #### Defined in -[types.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L110) +[types.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L112) ___ @@ -70,7 +70,7 @@ BaseOpts.eips #### Defined in -[types.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L99) +[types.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L101) ___ @@ -88,4 +88,4 @@ BaseOpts.hardfork #### Defined in -[types.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L94) +[types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L96) diff --git a/packages/common/docs/interfaces/CustomCrypto.md b/packages/common/docs/interfaces/CustomCrypto.md index 6599862681..e1d5101884 100644 --- a/packages/common/docs/interfaces/CustomCrypto.md +++ b/packages/common/docs/interfaces/CustomCrypto.md @@ -11,6 +11,7 @@ - [ecrecover](CustomCrypto.md#ecrecover) - [ecsign](CustomCrypto.md#ecsign) - [keccak256](CustomCrypto.md#keccak256) +- [kzg](CustomCrypto.md#kzg) - [sha256](CustomCrypto.md#sha256) ## Properties @@ -37,7 +38,7 @@ #### Defined in -[types.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L85) +[types.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L86) ___ @@ -67,7 +68,7 @@ ___ #### Defined in -[types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L84) +[types.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L85) ___ @@ -95,7 +96,7 @@ ___ #### Defined in -[types.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L75) +[types.ts:76](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L76) ___ @@ -121,7 +122,7 @@ ___ #### Defined in -[types.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L83) +[types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L84) ___ @@ -147,7 +148,17 @@ Interface for providing custom cryptographic primitives in place of `ethereum-cr #### Defined in -[types.ts:74](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L74) +[types.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L75) + +___ + +### kzg + +• `Optional` **kzg**: `Kzg` + +#### Defined in + +[types.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L87) ___ @@ -171,4 +182,4 @@ ___ #### Defined in -[types.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L82) +[types.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L83) diff --git a/packages/common/docs/interfaces/EVMStateManagerInterface.md b/packages/common/docs/interfaces/EVMStateManagerInterface.md index 45d4f52172..feaca2daf2 100644 --- a/packages/common/docs/interfaces/EVMStateManagerInterface.md +++ b/packages/common/docs/interfaces/EVMStateManagerInterface.md @@ -24,6 +24,7 @@ - [dumpStorageRange](EVMStateManagerInterface.md#dumpstoragerange) - [generateCanonicalGenesis](EVMStateManagerInterface.md#generatecanonicalgenesis) - [getAccount](EVMStateManagerInterface.md#getaccount) +- [getAppliedKey](EVMStateManagerInterface.md#getappliedkey) - [getContractCode](EVMStateManagerInterface.md#getcontractcode) - [getContractStorage](EVMStateManagerInterface.md#getcontractstorage) - [getProof](EVMStateManagerInterface.md#getproof) @@ -52,7 +53,7 @@ #### Defined in -[interfaces.ts:89](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L89) +[interfaces.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L90) ## Methods @@ -156,7 +157,7 @@ ___ #### Defined in -[interfaces.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L94) +[interfaces.ts:95](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L95) ___ @@ -178,7 +179,7 @@ ___ #### Defined in -[interfaces.ts:95](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L95) +[interfaces.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L96) ___ @@ -198,7 +199,7 @@ ___ #### Defined in -[interfaces.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L96) +[interfaces.ts:97](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L97) ___ @@ -226,6 +227,30 @@ ___ ___ +### getAppliedKey + +▸ `Optional` **getAppliedKey**(`address`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `Uint8Array` | + +#### Returns + +`Uint8Array` + +#### Inherited from + +[StateManagerInterface](StateManagerInterface.md).[getAppliedKey](StateManagerInterface.md#getappliedkey) + +#### Defined in + +[interfaces.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L86) + +___ + ### getContractCode ▸ **getContractCode**(`address`): `Promise`<`Uint8Array`\> @@ -296,7 +321,7 @@ ___ #### Defined in -[interfaces.ts:97](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L97) +[interfaces.ts:98](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L98) ___ @@ -506,4 +531,4 @@ ___ #### Defined in -[interfaces.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L99) +[interfaces.ts:100](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L100) diff --git a/packages/common/docs/interfaces/GenesisBlockConfig.md b/packages/common/docs/interfaces/GenesisBlockConfig.md index 2c5705c7d0..5485ce77fd 100644 --- a/packages/common/docs/interfaces/GenesisBlockConfig.md +++ b/packages/common/docs/interfaces/GenesisBlockConfig.md @@ -22,7 +22,7 @@ #### Defined in -[types.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L48) +[types.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L49) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[types.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L45) +[types.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L46) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[types.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L49) +[types.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L50) ___ @@ -52,7 +52,7 @@ ___ #### Defined in -[types.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L47) +[types.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L48) ___ @@ -62,7 +62,7 @@ ___ #### Defined in -[types.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L44) +[types.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L45) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[types.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L46) +[types.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L47) ___ @@ -82,4 +82,4 @@ ___ #### Defined in -[types.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L43) +[types.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L44) diff --git a/packages/common/docs/interfaces/GethConfigOpts.md b/packages/common/docs/interfaces/GethConfigOpts.md index 0530b851b0..b6752af521 100644 --- a/packages/common/docs/interfaces/GethConfigOpts.md +++ b/packages/common/docs/interfaces/GethConfigOpts.md @@ -27,7 +27,7 @@ #### Defined in -[types.ts:149](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L149) +[types.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L151) ___ @@ -50,7 +50,7 @@ BaseOpts.customCrypto #### Defined in -[types.ts:110](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L110) +[types.ts:112](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L112) ___ @@ -67,7 +67,7 @@ BaseOpts.eips #### Defined in -[types.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L99) +[types.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L101) ___ @@ -77,7 +77,7 @@ ___ #### Defined in -[types.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L150) +[types.ts:152](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L152) ___ @@ -95,7 +95,7 @@ BaseOpts.hardfork #### Defined in -[types.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L94) +[types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L96) ___ @@ -105,4 +105,4 @@ ___ #### Defined in -[types.ts:151](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L151) +[types.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L153) diff --git a/packages/common/docs/interfaces/HardforkByOpts.md b/packages/common/docs/interfaces/HardforkByOpts.md index 3d12d7afbd..bca998a47e 100644 --- a/packages/common/docs/interfaces/HardforkByOpts.md +++ b/packages/common/docs/interfaces/HardforkByOpts.md @@ -18,7 +18,7 @@ #### Defined in -[types.ts:155](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L155) +[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L157) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L157) +[types.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L159) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[types.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L156) +[types.ts:158](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L158) diff --git a/packages/common/docs/interfaces/HardforkTransitionConfig.md b/packages/common/docs/interfaces/HardforkTransitionConfig.md index 283cc98037..59cdcd6eb6 100644 --- a/packages/common/docs/interfaces/HardforkTransitionConfig.md +++ b/packages/common/docs/interfaces/HardforkTransitionConfig.md @@ -20,7 +20,7 @@ #### Defined in -[types.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L54) +[types.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L55) ___ @@ -30,7 +30,7 @@ ___ #### Defined in -[types.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L57) +[types.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L58) ___ @@ -40,7 +40,7 @@ ___ #### Defined in -[types.ts:53](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L53) +[types.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L54) ___ @@ -50,7 +50,7 @@ ___ #### Defined in -[types.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L56) +[types.ts:57](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L57) ___ @@ -60,4 +60,4 @@ ___ #### Defined in -[types.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L55) +[types.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/types.ts#L56) diff --git a/packages/common/docs/interfaces/StateManagerInterface.md b/packages/common/docs/interfaces/StateManagerInterface.md index dbd7240d39..f3b51db3c2 100644 --- a/packages/common/docs/interfaces/StateManagerInterface.md +++ b/packages/common/docs/interfaces/StateManagerInterface.md @@ -17,6 +17,7 @@ - [commit](StateManagerInterface.md#commit) - [deleteAccount](StateManagerInterface.md#deleteaccount) - [getAccount](StateManagerInterface.md#getaccount) +- [getAppliedKey](StateManagerInterface.md#getappliedkey) - [getContractCode](StateManagerInterface.md#getcontractcode) - [getContractStorage](StateManagerInterface.md#getcontractstorage) - [getProof](StateManagerInterface.md#getproof) @@ -120,6 +121,26 @@ ___ ___ +### getAppliedKey + +▸ `Optional` **getAppliedKey**(`address`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `address` | `Uint8Array` | + +#### Returns + +`Uint8Array` + +#### Defined in + +[interfaces.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/common/src/interfaces.ts#L86) + +___ + ### getContractCode ▸ **getContractCode**(`address`): `Promise`<`Uint8Array`\> diff --git a/packages/common/examples/initKzg.ts b/packages/common/examples/initKzg.ts index 436a3c8d9a..4d6ecdcdf7 100644 --- a/packages/common/examples/initKzg.ts +++ b/packages/common/examples/initKzg.ts @@ -6,7 +6,7 @@ const main = async () => { const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, - customCrypto: { kzg: kzg }, + customCrypto: { kzg }, }) console.log(common.customCrypto.kzg) // Should print the initialized KZG interface } diff --git a/packages/common/package.json b/packages/common/package.json index aec9319960..37bdb5d5d7 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/common", - "version": "4.2.0", + "version": "4.3.0", "description": "Resources common to all Ethereum implementations", "keywords": [ "ethereum", @@ -56,7 +56,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/util": "^9.0.2" + "@ethereumjs/util": "^9.0.3" }, "devDependencies": { "@polkadot/util": "^12.6.2", diff --git a/packages/devp2p/CHANGELOG.md b/packages/devp2p/CHANGELOG.md index d061ec2b7e..17ffa2d4e5 100644 --- a/packages/devp2p/CHANGELOG.md +++ b/packages/devp2p/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 6.1.2 - 2024-03-05 + +- Fix a type error related to the `lru-cache` dependency, PR [#3285](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3285) +- Downstream dependency updates, see PR [#3297](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3297) + ## 6.1.1 - 2024-02-08 - Hotfix release adding a missing `debug` dependency to the `@ethereumjs/trie` package (dependency), PR [#3271](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3271) diff --git a/packages/devp2p/examples/peer-communication-les.ts b/packages/devp2p/examples/peer-communication-les.ts index ff4ee1a400..4f4c1bc60b 100644 --- a/packages/devp2p/examples/peer-communication-les.ts +++ b/packages/devp2p/examples/peer-communication-les.ts @@ -87,7 +87,7 @@ rlpx.events.on('peer:added', (peer) => { forkID: [hexToBytes('0x3b8e0691'), intToBytes(1)], }) - les.events.once('status', (status: LES.Status) => { + les.events.once('status', (status: devp2p.LES.Status) => { const msg = [ Uint8Array.from([]), [ @@ -100,7 +100,7 @@ rlpx.events.on('peer:added', (peer) => { les.sendMessage(devp2p.LES.MESSAGE_CODES.GET_BLOCK_HEADERS, msg) }) - les.events.on('message', async (code: LES.MESSAGE_CODES, payload: any) => { + les.events.on('message', async (code: devp2p.LES.MESSAGE_CODES, payload: any) => { switch (code) { case devp2p.LES.MESSAGE_CODES.BLOCK_HEADERS: { if (payload[2].length > 1) { diff --git a/packages/devp2p/package.json b/packages/devp2p/package.json index 5e53650590..ef61ba0a2d 100644 --- a/packages/devp2p/package.json +++ b/packages/devp2p/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/devp2p", - "version": "6.1.1", + "version": "6.1.2", "description": "A JavaScript implementation of ÐΞVp2p", "keywords": [ "ethereum", @@ -57,9 +57,9 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@scure/base": "1.1.1", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", @@ -69,8 +69,8 @@ "snappyjs": "^0.6.1" }, "devDependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/tx": "^5.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/tx": "^5.3.0", "@types/debug": "^4.1.9", "@types/k-bucket": "^5.0.0", "chalk": "^4.1.2", diff --git a/packages/ethash/CHANGELOG.md b/packages/ethash/CHANGELOG.md index bf5cb5afa3..e6e3a6159c 100644 --- a/packages/ethash/CHANGELOG.md +++ b/packages/ethash/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 3.0.3 - 2024-03-05 + +Maintenance release with downstream dependency updates, see PR [#3297](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3297) + ### 3.0.2 - 2024-02-08 Maintenance release with dependency updates, see PR [#3261](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3261) diff --git a/packages/ethash/docs/README.md b/packages/ethash/docs/README.md index 7b580a06d0..cf5dd92c8f 100644 --- a/packages/ethash/docs/README.md +++ b/packages/ethash/docs/README.md @@ -28,4 +28,4 @@ #### Defined in -[index.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L41) +[index.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L42) diff --git a/packages/ethash/docs/classes/Ethash.md b/packages/ethash/docs/classes/Ethash.md index 7a9ffc0e09..d05ef3e257 100644 --- a/packages/ethash/docs/classes/Ethash.md +++ b/packages/ethash/docs/classes/Ethash.md @@ -44,7 +44,7 @@ #### Defined in -[index.ts:168](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L168) +[index.ts:169](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L169) ## Properties @@ -54,7 +54,7 @@ #### Defined in -[index.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L162) +[index.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L163) ___ @@ -64,7 +64,7 @@ ___ #### Defined in -[index.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L161) +[index.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L162) ___ @@ -74,7 +74,7 @@ ___ #### Defined in -[index.ts:165](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L165) +[index.ts:166](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L166) ___ @@ -84,7 +84,7 @@ ___ #### Defined in -[index.ts:160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L160) +[index.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L161) ___ @@ -94,7 +94,7 @@ ___ #### Defined in -[index.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L163) +[index.ts:164](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L164) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[index.ts:164](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L164) +[index.ts:165](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L165) ___ @@ -114,7 +114,7 @@ ___ #### Defined in -[index.ts:166](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L166) +[index.ts:167](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L167) ## Methods @@ -134,7 +134,7 @@ ___ #### Defined in -[index.ts:368](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L368) +[index.ts:369](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L369) ___ @@ -148,7 +148,7 @@ ___ #### Defined in -[index.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L256) +[index.ts:257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L257) ___ @@ -168,7 +168,7 @@ ___ #### Defined in -[index.ts:196](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L196) +[index.ts:197](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L197) ___ @@ -193,7 +193,7 @@ To mine a `BlockHeader` or `Block`, use the one-liner `await ethash.getMiner(blo #### Defined in -[index.ts:364](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L364) +[index.ts:365](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L365) ___ @@ -213,7 +213,7 @@ ___ #### Defined in -[index.ts:271](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L271) +[index.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L272) ___ @@ -235,7 +235,7 @@ Loads the seed and cache given a block number. #### Defined in -[index.ts:278](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L278) +[index.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L279) ___ @@ -256,7 +256,7 @@ ___ #### Defined in -[index.ts:176](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L176) +[index.ts:177](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L177) ___ @@ -283,7 +283,7 @@ ___ #### Defined in -[index.ts:210](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L210) +[index.ts:211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L211) ___ @@ -303,4 +303,4 @@ ___ #### Defined in -[index.ts:378](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L378) +[index.ts:379](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L379) diff --git a/packages/ethash/docs/classes/Miner.md b/packages/ethash/docs/classes/Miner.md index 924d1420a2..c2e436f30f 100644 --- a/packages/ethash/docs/classes/Miner.md +++ b/packages/ethash/docs/classes/Miner.md @@ -35,7 +35,7 @@ Create a Miner object #### Defined in -[index.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L63) +[index.ts:64](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L64) ## Properties @@ -45,7 +45,7 @@ Create a Miner object #### Defined in -[index.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L51) +[index.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L52) ## Methods @@ -69,7 +69,7 @@ Iterate `iterations` times over nonces to find a valid PoW. Caches solution if o #### Defined in -[index.ts:113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L113) +[index.ts:114](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L114) ___ @@ -94,7 +94,7 @@ Iterate `iterations` time over nonces, returns a `BlockHeader` or `Block` if a s #### Defined in -[index.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L90) +[index.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L91) ___ @@ -110,4 +110,4 @@ Stop the miner on the next iteration #### Defined in -[index.ts:80](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L80) +[index.ts:81](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/ethash/src/index.ts#L81) diff --git a/packages/ethash/package.json b/packages/ethash/package.json index 1c1c185350..86c9b10d6e 100644 --- a/packages/ethash/package.json +++ b/packages/ethash/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/ethash", - "version": "3.0.2", + "version": "3.0.3", "description": "An implementation of the Ethash consensus algorithm in JavaScript", "keywords": [ "ethash", @@ -45,14 +45,14 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^5.1.1", + "@ethereumjs/block": "^5.2.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "bigint-crypto-utils": "^3.2.2", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { - "@ethereumjs/common": "^4.2.0" + "@ethereumjs/common": "^4.3.0" }, "engines": { "node": ">=18" diff --git a/packages/evm/CHANGELOG.md b/packages/evm/CHANGELOG.md index d16398969f..d88163ffa6 100644 --- a/packages/evm/CHANGELOG.md +++ b/packages/evm/CHANGELOG.md @@ -6,6 +6,68 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 3.0.0 - 2024-03-05 + +### New EVM.create() Async Static Constructor + +This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatiblity of our libraries. + +The `EVM` direct constructor initialization with `new EVM()` now has been deprecated and replaced by an async static `create()` constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs [#3304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3304/) and [#3315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3315). + +An EVM is now initialized like the following (from our `examples`): + +```ts +import { hexToBytes } from '@ethereumjs/util' +import { EVM } from '@ethereumjs/evm' + +const evm = await EVM.create() +const res = await evm.runCode({ code: hexToBytes('0x6001') }) +``` + +Beyond solving this specific problem this generally allows for a cleaner and async-complete initialization of underlying libraries and is more future proof towards eventual upcoming async initialization additions. + +Note that the direct usage of the main constructor is not possible anymore with these releases and **you need to update your constructor usages**! + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3280). This bug has been fixed along with these releases and this library now references the updated trie library version. + +### Other Changes + +- Support for Preimage generation (verkle-related, experimental), new `startReportingPreimages()` method, PR [#3143](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3143) and [#3298](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3298) +- Early support for [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - "Save historical block hashes in state" (Verkle related, likely subject to change), PRs [#3268](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3268) and [#3327](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3327) +- Export `getOpcodesForHF()` helper method, PR [#3322](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3322) + ## 2.2.1 - 2024-02-08 - 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) diff --git a/packages/evm/README.md b/packages/evm/README.md index fa2c67c8fb..1537ecde9b 100644 --- a/packages/evm/README.md +++ b/packages/evm/README.md @@ -19,7 +19,7 @@ npm install @ethereumjs/evm This package provides the core Ethereum Virtual Machine (EVM) implementation which is capable of executing EVM-compatible bytecode. The package has been extracted from the [@ethereumjs/vm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/vm) package along the VM `v6` release. -**Note:** If you want to work with `EIP-4844` related functionality, you will have additional manual installation steps for the **KZG setup**, see related section below. +**Note:** Starting with the Dencun hardfork `EIP-4844` related functionality will become an integrated part of the EVM functionality with the activation of the point evaluation precompile. It is therefore strongly recommended to _always_ run the EVM with a KZG library installed and initialized, see [KZG Setup](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx/README.md#kzg-setup) for instructions. ## Usage @@ -35,8 +35,8 @@ The following is the simplest example for an EVM instantiation: import { hexToBytes } from '@ethereumjs/util' import { EVM } from '@ethereumjs/evm' -const evm = new EVM() const main = async () => { + const evm = await EVM.create() const res = await evm.runCode({ code: hexToBytes('0x6001') }) // PUSH1 01 -- simple bytecode to push 1 onto the stack console.log(res.executionGasUsed) // 3n } @@ -44,6 +44,8 @@ const main = async () => { main() ``` +Note: with the switch from v2 to v3 the old direct `new EVM()` constructor usage has been deprecated and an `EVM` now has to be instantiated with the async static `EVM.create()` constructor. + ### Blockchain, State and Events If the EVM should run on a certain state an `@ethereumjs/statemanager` is needed. An `@ethereumjs/blockchain` instance can be passed in to provide access to external interface information like a blockhash: @@ -62,7 +64,7 @@ const main = async () => { const stateManager = new DefaultStateManager() const blockchain = await Blockchain.create() - const evm = new EVM({ + const evm = await EVM.create({ common, stateManager, blockchain, @@ -203,9 +205,13 @@ If you want to activate an EIP not currently active on the hardfork your `common import { Chain, Common } from '@ethereumjs/common' import { EVM } from '@ethereumjs/evm' -const common = new Common({ chain: Chain.Mainnet, eips: [3074] }) -const evm = new EVM({ common }) -console.log(`EIP 3074 is active - ${evm.common.isActivatedEIP(3074)}`) +const main = async () => { + const common = new Common({ chain: Chain.Mainnet, eips: [3074] }) + const evm = await EVM.create({ common }) + console.log(`EIP 3074 is active - ${evm.common.isActivatedEIP(3074)}`) +} + +main() ``` Currently supported EIPs: @@ -216,6 +222,7 @@ Currently supported EIPs: - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS precompiles (removed in v4.0.0, see latest v3 release) - [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp gas cost - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) - Transaction Types +- [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - Save historical block hashes in state (`experimental`) - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - gas cost increases for state access opcodes - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Optional access list tx type - [EIP-3074](https://eips.ethereum.org/EIPS/eip-3074) - AUTH and AUTHCALL opcodes diff --git a/packages/evm/docs/README.md b/packages/evm/docs/README.md index 9048fea45b..36a1e1c3d0 100644 --- a/packages/evm/docs/README.md +++ b/packages/evm/docs/README.md @@ -22,6 +22,7 @@ - [ExecResult](interfaces/ExecResult.md) - [InterpreterStep](interfaces/InterpreterStep.md) - [PrecompileInput](interfaces/PrecompileInput.md) +- [bn128](interfaces/bn128.md) ### Type Aliases @@ -45,7 +46,7 @@ Log that the contract emits. #### Defined in -[types.ts:334](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L334) +[types.ts:337](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L337) ## Variables diff --git a/packages/evm/docs/interfaces/EVMInterface.md b/packages/evm/docs/interfaces/EVMInterface.md index c4c6b0cbec..f85fb83911 100644 --- a/packages/evm/docs/interfaces/EVMInterface.md +++ b/packages/evm/docs/interfaces/EVMInterface.md @@ -24,7 +24,7 @@ #### Defined in -[types.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L161) +[types.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L163) ___ @@ -37,6 +37,7 @@ ___ | Name | Type | | :------ | :------ | | `accessList?` | `Map`<`string`, `Set`<`string`\>\> | +| `preimages?` | `Map`<`string`, `Uint8Array`\> | | `addAlwaysWarmAddress` | (`address`: `string`, `addToAccessList?`: `boolean`) => `void` | | `addAlwaysWarmSlot` | (`address`: `string`, `slot`: `string`, `addToAccessList?`: `boolean`) => `void` | | `checkpoint` | () => `Promise`<`void`\> | @@ -47,6 +48,7 @@ ___ | `putAccount` | (`address`: `Address`, `account`: `Account`) => `Promise`<`void`\> | | `revert` | () => `Promise`<`void`\> | | `startReportingAccessList` | () => `void` | +| `startReportingPreimages?` | () => `void` | #### Defined in @@ -60,7 +62,7 @@ ___ #### Defined in -[types.ts:158](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L158) +[types.ts:160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L160) ___ @@ -70,7 +72,7 @@ ___ #### Defined in -[types.ts:157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L157) +[types.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L159) ## Methods @@ -90,7 +92,7 @@ ___ #### Defined in -[types.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L159) +[types.ts:161](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L161) ___ @@ -110,4 +112,4 @@ ___ #### Defined in -[types.ts:160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L160) +[types.ts:162](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L162) diff --git a/packages/evm/docs/interfaces/EVMResult.md b/packages/evm/docs/interfaces/EVMResult.md index a1a05689f8..bd406a4c2e 100644 --- a/packages/evm/docs/interfaces/EVMResult.md +++ b/packages/evm/docs/interfaces/EVMResult.md @@ -21,7 +21,7 @@ Address of created account during transaction, if any #### Defined in -[types.ts:281](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L281) +[types.ts:284](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L284) ___ @@ -33,4 +33,4 @@ Contains the results from running the code, if any, as described in runCode #### Defined in -[types.ts:285](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L285) +[types.ts:288](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L288) diff --git a/packages/evm/docs/interfaces/ExecResult.md b/packages/evm/docs/interfaces/ExecResult.md index 233f0b74f7..b43ad47ade 100644 --- a/packages/evm/docs/interfaces/ExecResult.md +++ b/packages/evm/docs/interfaces/ExecResult.md @@ -29,7 +29,7 @@ Amount of blob gas consumed by the transaction #### Defined in -[types.ts:328](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L328) +[types.ts:331](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L331) ___ @@ -41,7 +41,7 @@ Map of addresses which were created (used in EIP 6780) #### Defined in -[types.ts:320](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L320) +[types.ts:323](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L323) ___ @@ -53,7 +53,7 @@ Description of the exception, if any occurred #### Defined in -[types.ts:296](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L296) +[types.ts:299](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L299) ___ @@ -65,7 +65,7 @@ Amount of gas the code used to run #### Defined in -[types.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L304) +[types.ts:307](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L307) ___ @@ -77,7 +77,7 @@ Amount of gas left #### Defined in -[types.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L300) +[types.ts:303](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L303) ___ @@ -89,7 +89,7 @@ The gas refund counter #### Defined in -[types.ts:324](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L324) +[types.ts:327](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L327) ___ @@ -101,7 +101,7 @@ Array of logs that the contract emitted #### Defined in -[types.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L312) +[types.ts:315](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L315) ___ @@ -113,7 +113,7 @@ Return value from the contract #### Defined in -[types.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L308) +[types.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L311) ___ @@ -123,7 +123,7 @@ ___ #### Defined in -[types.ts:292](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L292) +[types.ts:295](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L295) ___ @@ -135,4 +135,4 @@ A set of accounts to selfdestruct #### Defined in -[types.ts:316](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L316) +[types.ts:319](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L319) diff --git a/packages/evm/docs/interfaces/bn128.md b/packages/evm/docs/interfaces/bn128.md new file mode 100644 index 0000000000..07679efb9c --- /dev/null +++ b/packages/evm/docs/interfaces/bn128.md @@ -0,0 +1,85 @@ +[@ethereumjs/evm](../README.md) / bn128 + +# Interface: bn128 + +The BN128 curve package (`rustbn-wasm`) + +## Table of contents + +### Properties + +- [ec\_add](bn128.md#ec_add) +- [ec\_mul](bn128.md#ec_mul) +- [ec\_pairing](bn128.md#ec_pairing) + +## Properties + +### ec\_add + +• **ec\_add**: (`input_str`: `string`) => `string` + +#### Type declaration + +▸ (`input_str`): `string` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `input_str` | `string` | + +##### Returns + +`string` + +#### Defined in + +[types.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L390) + +___ + +### ec\_mul + +• **ec\_mul**: (`input_hex`: `string`) => `string` + +#### Type declaration + +▸ (`input_hex`): `string` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `input_hex` | `string` | + +##### Returns + +`string` + +#### Defined in + +[types.ts:391](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L391) + +___ + +### ec\_pairing + +• **ec\_pairing**: (`input_str`: `string`) => `string` + +#### Type declaration + +▸ (`input_str`): `string` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `input_str` | `string` | + +##### Returns + +`string` + +#### Defined in + +[types.ts:389](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/evm/src/types.ts#L389) diff --git a/packages/evm/examples/simple.ts b/packages/evm/examples/simple.ts index 59eb453ae1..06bc94176f 100644 --- a/packages/evm/examples/simple.ts +++ b/packages/evm/examples/simple.ts @@ -2,7 +2,7 @@ import { hexToBytes } from '@ethereumjs/util' import { EVM } from '@ethereumjs/evm' const main = async () => { - const evm = await EVM.create({}) + const evm = await EVM.create() const res = await evm.runCode({ code: hexToBytes('0x6001') }) // PUSH1 01 -- simple bytecode to push 1 onto the stack console.log(res.executionGasUsed) // 3n } diff --git a/packages/evm/package.json b/packages/evm/package.json index 0d5f84e5af..9cb85b3af4 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/evm", - "version": "2.2.1", + "version": "3.0.0", "description": "JavaScript Ethereum Virtual Machine (EVM) implementation", "keywords": [ "ethereum", @@ -53,10 +53,10 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/statemanager": "^2.2.2", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/statemanager": "^2.3.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "@types/debug": "^4.1.9", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", diff --git a/packages/evm/src/evm.ts b/packages/evm/src/evm.ts index f07116370e..a74280121f 100644 --- a/packages/evm/src/evm.ts +++ b/packages/evm/src/evm.ts @@ -181,7 +181,7 @@ export class EVM implements EVMInterface { * @param opts The EVM options * @param bn128 Initialized bn128 WASM object for precompile usage (internal) */ - constructor(opts: EVMOpts, bn128: bn128) { + protected constructor(opts: EVMOpts, bn128: bn128) { this.common = opts.common! this.blockchain = opts.blockchain! this.stateManager = opts.stateManager! diff --git a/packages/evm/src/types.ts b/packages/evm/src/types.ts index c032e331fe..12411af599 100644 --- a/packages/evm/src/types.ts +++ b/packages/evm/src/types.ts @@ -183,6 +183,7 @@ export interface EVMOpts { * - [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) - BLS precompiles (removed in v4.0.0, see latest v3 release) * - [EIP-2565](https://eips.ethereum.org/EIPS/eip-2565) - ModExp gas cost * - [EIP-2718](https://eips.ethereum.org/EIPS/eip-2565) - Transaction Types + * - [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - Save historical block hashes in state (`experimental`) * - [EIP-2929](https://eips.ethereum.org/EIPS/eip-2929) - gas cost increases for state access opcodes * - [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) - Optional access list tx type * - [EIP-3074](https://eips.ethereum.org/EIPS/eip-3074) - AUTH and AUTHCALL opcodes diff --git a/packages/evm/test/customOpcodes.spec.ts b/packages/evm/test/customOpcodes.spec.ts index 47fadaf36a..52a5551c4f 100644 --- a/packages/evm/test/customOpcodes.spec.ts +++ b/packages/evm/test/customOpcodes.spec.ts @@ -67,7 +67,7 @@ describe('VM: custom opcodes', () => { }) assert.ok(res.executionGasUsed === gas, 'successfully deleted opcode') - const evmDefault = await EVM.create({}) + const evmDefault = await EVM.create() // PUSH 04 // PUSH 01 diff --git a/packages/evm/test/customPrecompiles.spec.ts b/packages/evm/test/customPrecompiles.spec.ts index 4d92051213..ac1af774b0 100644 --- a/packages/evm/test/customPrecompiles.spec.ts +++ b/packages/evm/test/customPrecompiles.spec.ts @@ -104,7 +104,7 @@ describe('EVM -> custom precompiles', () => { }) it('should not persist changes to precompiles', async () => { - let EVMSha = await EVM.create({}) + let EVMSha = await EVM.create() const shaResult = await EVMSha.runCall({ to: shaAddress, gasLimit: BigInt(30000), @@ -128,7 +128,7 @@ describe('EVM -> custom precompiles', () => { // sanity: check we have overridden assert.deepEqual(result.execResult.returnValue, expectedReturn, 'return value is correct') assert.ok(result.execResult.executionGasUsed === expectedGas, 'gas used is correct') - EVMSha = await EVM.create({}) + EVMSha = await EVM.create() const shaResult2 = await EVMSha.runCall({ to: shaAddress, gasLimit: BigInt(30000), diff --git a/packages/evm/test/runCode.spec.ts b/packages/evm/test/runCode.spec.ts index de0f795fb5..fdc0f2c790 100644 --- a/packages/evm/test/runCode.spec.ts +++ b/packages/evm/test/runCode.spec.ts @@ -21,7 +21,7 @@ const testCases = [ describe('VM.runCode: initial program counter', () => { it('should work', async () => { - const evm = await EVM.create({}) + const evm = await EVM.create() for (const [i, testData] of testCases.entries()) { const runCodeArgs = { @@ -57,7 +57,7 @@ describe('VM.runCode: initial program counter', () => { describe('VM.runCode: interpreter', () => { it('should return a EvmError as an exceptionError on the result', async () => { - const evm = await EVM.create({}) + const evm = await EVM.create() const INVALID_opcode = 'fe' const runCodeArgs = { @@ -76,7 +76,7 @@ describe('VM.runCode: interpreter', () => { }) it('should throw on non-EvmError', async () => { - const evm = await EVM.create({}) + const evm = await EVM.create() // NOTE: due to now throwing on `getContractStorage` if account does not exist // this now means that if `runCode` is called and the address it runs on (default: zero address) // does not exist, then if SSTORE/SLOAD is used, the runCode will immediately fail because StateManager now throws @@ -105,7 +105,7 @@ describe('VM.runCode: interpreter', () => { describe('VM.runCode: RunCodeOptions', () => { it('should throw on negative value args', async () => { - const evm = await EVM.create({}) + const evm = await EVM.create() const runCodeArgs = { value: BigInt(-10), diff --git a/packages/evm/test/stack.spec.ts b/packages/evm/test/stack.spec.ts index 496b6bc413..1d6b79523d 100644 --- a/packages/evm/test/stack.spec.ts +++ b/packages/evm/test/stack.spec.ts @@ -99,7 +99,7 @@ describe('Stack', () => { it('stack items should not change if they are DUPed', async () => { const caller = new Address(hexToBytes('0x00000000000000000000000000000000000000ee')) const addr = new Address(hexToBytes('0x00000000000000000000000000000000000000ff')) - const evm = await EVM.create({}) + const evm = await EVM.create() const account = createAccount(BigInt(0), BigInt(0)) const code = '0x60008080808060013382F15060005260206000F3' const expectedReturnValue = setLengthLeft(bigIntToBytes(BigInt(0)), 32) diff --git a/packages/genesis/CHANGELOG.md b/packages/genesis/CHANGELOG.md index 146135926f..cdd07f8f6f 100644 --- a/packages/genesis/CHANGELOG.md +++ b/packages/genesis/CHANGELOG.md @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -### 0.2.1 - 2024-02-08 +## 0.2.2 - 2024-03-05 + +Maintenance release with downstream dependency updates, see PR [#3297](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3297) + +## 0.2.1 - 2024-02-08 Maintenance release with dependency updates, see PR [#3261](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3261) diff --git a/packages/genesis/docs/README.md b/packages/genesis/docs/README.md new file mode 100644 index 0000000000..87f7d2e133 --- /dev/null +++ b/packages/genesis/docs/README.md @@ -0,0 +1,34 @@ +@ethereumjs/genesis + +# @ethereumjs/genesis + +## Table of contents + +### Functions + +- [getGenesis](README.md#getgenesis) + +## Functions + +### getGenesis + +▸ **getGenesis**(`chainId`): `GenesisState` \| `undefined` + +Utility to get the genesisState of a well known network +@param: chainId of the network + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `chainId` | `number` | + +#### Returns + +`GenesisState` \| `undefined` + +genesisState of the chain + +#### Defined in + +[index.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/genesis/src/index.ts#L15) diff --git a/packages/genesis/package.json b/packages/genesis/package.json index c3ab4113c7..4f20a33224 100644 --- a/packages/genesis/package.json +++ b/packages/genesis/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/genesis", - "version": "0.2.1", + "version": "0.2.2", "description": "A module to provide genesis states of well known networks", "keywords": [ "ethereum", @@ -58,13 +58,13 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/util": "^9.0.2" + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/util": "^9.0.3" }, "engines": { "node": ">=18" }, "devDependencies": { - "@ethereumjs/trie": "^6.1.1" + "@ethereumjs/trie": "^6.2.0" } } diff --git a/packages/statemanager/CHANGELOG.md b/packages/statemanager/CHANGELOG.md index 4ae535dcf7..9d0c5069cc 100644 --- a/packages/statemanager/CHANGELOG.md +++ b/packages/statemanager/CHANGELOG.md @@ -6,6 +6,50 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 2.3.0 - 2024-03-05 + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3276) +- New optional `getAppliedKey()` method for the interface (see interface definition in `@ethereumjs/common`), PR [#3143](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3143) +- Fix inconsistency between the normal and the RPC statemanager regarding empty account return values, PR [#3323](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3323) +- Fix a type error related to the `lru-cache` dependency, PR [#3285](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3285) +- Add tests for verkle statemanager, PR [#3257](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3257) + ## 2.2.2 - 2024-02-08 - Hotfix release moving the `@ethereumjs/verkle` dependency from a peer dependency to the main dependencis (note that this decision might be temporary) diff --git a/packages/statemanager/docs/classes/DefaultStateManager.md b/packages/statemanager/docs/classes/DefaultStateManager.md index 6688570ee7..b83a7834e7 100644 --- a/packages/statemanager/docs/classes/DefaultStateManager.md +++ b/packages/statemanager/docs/classes/DefaultStateManager.md @@ -39,6 +39,7 @@ The default state manager implementation uses a - [flush](DefaultStateManager.md#flush) - [generateCanonicalGenesis](DefaultStateManager.md#generatecanonicalgenesis) - [getAccount](DefaultStateManager.md#getaccount) +- [getAppliedKey](DefaultStateManager.md#getappliedkey) - [getContractCode](DefaultStateManager.md#getcontractcode) - [getContractStorage](DefaultStateManager.md#getcontractstorage) - [getProof](DefaultStateManager.md#getproof) @@ -70,7 +71,7 @@ Instantiate the StateManager interface. #### Defined in -[stateManager.ts:194](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L194) +[stateManager.ts:192](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L192) ## Properties @@ -117,7 +118,7 @@ Add proof(s) into an already existing trie #### Defined in -[stateManager.ts:824](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L824) +[stateManager.ts:819](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L819) ___ @@ -139,7 +140,7 @@ EVMStateManagerInterface.checkpoint #### Defined in -[stateManager.ts:597](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L597) +[stateManager.ts:593](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L593) ___ @@ -155,7 +156,7 @@ Clears all underlying caches #### Defined in -[stateManager.ts:1133](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1133) +[stateManager.ts:1148](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1148) ___ @@ -181,7 +182,7 @@ EVMStateManagerInterface.clearContractStorage #### Defined in -[stateManager.ts:580](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L580) +[stateManager.ts:576](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L576) ___ @@ -202,7 +203,7 @@ EVMStateManagerInterface.commit #### Defined in -[stateManager.ts:609](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L609) +[stateManager.ts:605](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L605) ___ @@ -228,7 +229,7 @@ EVMStateManagerInterface.deleteAccount #### Defined in -[stateManager.ts:337](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L337) +[stateManager.ts:333](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L333) ___ @@ -258,7 +259,7 @@ EVMStateManagerInterface.dumpStorage #### Defined in -[stateManager.ts:963](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L963) +[stateManager.ts:962](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L962) ___ @@ -290,7 +291,7 @@ EVMStateManagerInterface.dumpStorageRange #### Defined in -[stateManager.ts:989](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L989) +[stateManager.ts:995](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L995) ___ @@ -306,7 +307,7 @@ Writes all cache items to the trie #### Defined in -[stateManager.ts:651](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L651) +[stateManager.ts:647](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L647) ___ @@ -333,7 +334,7 @@ EVMStateManagerInterface.generateCanonicalGenesis #### Defined in -[stateManager.ts:1036](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1036) +[stateManager.ts:1051](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1051) ___ @@ -359,7 +360,36 @@ EVMStateManagerInterface.getAccount #### Defined in -[stateManager.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L264) +[stateManager.ts:260](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L260) + +___ + +### getAppliedKey + +▸ **getAppliedKey**(`address`): `Uint8Array` + +Returns the applied key for a given address +Used for saving preimages + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `Uint8Array` | The address to return the applied key | + +#### Returns + +`Uint8Array` + +- The applied key (e.g. hashed address) + +#### Implementation of + +EVMStateManagerInterface.getAppliedKey + +#### Defined in + +[stateManager.ts:1160](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1160) ___ @@ -388,7 +418,7 @@ EVMStateManagerInterface.getContractCode #### Defined in -[stateManager.ts:383](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L383) +[stateManager.ts:379](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L379) ___ @@ -420,7 +450,7 @@ EVMStateManagerInterface.getContractStorage #### Defined in -[stateManager.ts:466](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L466) +[stateManager.ts:462](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L462) ___ @@ -447,7 +477,7 @@ EVMStateManagerInterface.getProof #### Defined in -[stateManager.ts:711](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L711) +[stateManager.ts:707](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L707) ___ @@ -471,7 +501,7 @@ EVMStateManagerInterface.getStateRoot #### Defined in -[stateManager.ts:921](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L921) +[stateManager.ts:920](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L920) ___ @@ -497,7 +527,7 @@ EVMStateManagerInterface.hasStateRoot #### Defined in -[stateManager.ts:1072](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1072) +[stateManager.ts:1087](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1087) ___ @@ -526,7 +556,7 @@ EVMStateManagerInterface.modifyAccountFields #### Defined in -[stateManager.ts:321](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L321) +[stateManager.ts:317](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L317) ___ @@ -553,7 +583,7 @@ EVMStateManagerInterface.putAccount #### Defined in -[stateManager.ts:288](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L288) +[stateManager.ts:284](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L284) ___ @@ -581,7 +611,7 @@ EVMStateManagerInterface.putContractCode #### Defined in -[stateManager.ts:360](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L360) +[stateManager.ts:356](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L356) ___ @@ -610,7 +640,7 @@ EVMStateManagerInterface.putContractStorage #### Defined in -[stateManager.ts:553](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L553) +[stateManager.ts:549](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L549) ___ @@ -631,7 +661,7 @@ EVMStateManagerInterface.revert #### Defined in -[stateManager.ts:631](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L631) +[stateManager.ts:627](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L627) ___ @@ -661,7 +691,7 @@ EVMStateManagerInterface.setStateRoot #### Defined in -[stateManager.ts:933](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L933) +[stateManager.ts:932](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L932) ___ @@ -706,7 +736,7 @@ EVMStateManagerInterface.shallowCopy #### Defined in -[stateManager.ts:1098](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1098) +[stateManager.ts:1113](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L1113) ___ @@ -728,7 +758,7 @@ Verify an EIP-1186 proof. Throws if proof is invalid, otherwise returns true. #### Defined in -[stateManager.ts:847](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L847) +[stateManager.ts:842](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L842) ___ @@ -744,8 +774,8 @@ This generates a (partial) StateManager where one can retrieve all items from th | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | | `proof` | [`Proof`](../README.md#proof) \| [`Proof`](../README.md#proof)[] | `undefined` | Either a proof retrieved from `getProof`, or an array of those proofs | -| `safe` | `boolean` | `false` | Wether or not to verify that the roots of the proof items match the reported roots | -| `opts` | [`DefaultStateManagerOpts`](../interfaces/DefaultStateManagerOpts.md) | `{}` | - | +| `safe` | `boolean` | `false` | Whether or not to verify that the roots of the proof items match the reported roots | +| `opts` | [`DefaultStateManagerOpts`](../interfaces/DefaultStateManagerOpts.md) | `{}` | a dictionary of StateManager opts | #### Returns @@ -755,4 +785,4 @@ A new DefaultStateManager with elements from the given proof included in its bac #### Defined in -[stateManager.ts:765](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L765) +[stateManager.ts:760](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/stateManager.ts#L760) diff --git a/packages/statemanager/docs/classes/RPCBlockChain.md b/packages/statemanager/docs/classes/RPCBlockChain.md index e780218fb8..7d85a86c54 100644 --- a/packages/statemanager/docs/classes/RPCBlockChain.md +++ b/packages/statemanager/docs/classes/RPCBlockChain.md @@ -31,7 +31,7 @@ #### Defined in -[rpcStateManager.ts:435](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L435) +[rpcStateManager.ts:445](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L445) ## Properties @@ -41,7 +41,7 @@ #### Defined in -[rpcStateManager.ts:434](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L434) +[rpcStateManager.ts:444](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L444) ## Methods @@ -61,7 +61,7 @@ #### Defined in -[rpcStateManager.ts:439](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L439) +[rpcStateManager.ts:449](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L449) ___ @@ -75,4 +75,4 @@ ___ #### Defined in -[rpcStateManager.ts:449](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L449) +[rpcStateManager.ts:459](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L459) diff --git a/packages/statemanager/docs/classes/RPCStateManager.md b/packages/statemanager/docs/classes/RPCStateManager.md index 32b837fbc9..4ccdbf9ff2 100644 --- a/packages/statemanager/docs/classes/RPCStateManager.md +++ b/packages/statemanager/docs/classes/RPCStateManager.md @@ -30,6 +30,7 @@ - [flush](RPCStateManager.md#flush) - [generateCanonicalGenesis](RPCStateManager.md#generatecanonicalgenesis) - [getAccount](RPCStateManager.md#getaccount) +- [getAppliedKey](RPCStateManager.md#getappliedkey) - [getContractCode](RPCStateManager.md#getcontractcode) - [getContractStorage](RPCStateManager.md#getcontractstorage) - [getProof](RPCStateManager.md#getproof) @@ -128,7 +129,7 @@ EVMStateManagerInterface.checkpoint #### Defined in -[rpcStateManager.ts:377](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L377) +[rpcStateManager.ts:387](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L387) ___ @@ -194,7 +195,7 @@ EVMStateManagerInterface.commit #### Defined in -[rpcStateManager.ts:388](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L388) +[rpcStateManager.ts:398](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L398) ___ @@ -290,7 +291,7 @@ ___ #### Defined in -[rpcStateManager.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L405) +[rpcStateManager.ts:415](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L415) ___ @@ -314,7 +315,7 @@ EVMStateManagerInterface.generateCanonicalGenesis #### Defined in -[rpcStateManager.ts:428](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L428) +[rpcStateManager.ts:438](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L438) ___ @@ -347,6 +348,35 @@ EVMStateManagerInterface.getAccount ___ +### getAppliedKey + +▸ **getAppliedKey**(`address`): `Uint8Array` + +Returns the applied key for a given address +Used for saving preimages + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `address` | `Uint8Array` | The address to return the applied key | + +#### Returns + +`Uint8Array` + +- The applied key (e.g. hashed address) + +#### Implementation of + +EVMStateManagerInterface.getAppliedKey + +#### Defined in + +[rpcStateManager.ts:376](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L376) + +___ + ### getContractCode ▸ **getContractCode**(`address`): `Promise`<`Uint8Array`\> @@ -455,7 +485,7 @@ EVMStateManagerInterface.getStateRoot #### Defined in -[rpcStateManager.ts:412](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L412) +[rpcStateManager.ts:422](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L422) ___ @@ -477,7 +507,7 @@ EVMStateManagerInterface.hasStateRoot #### Defined in -[rpcStateManager.ts:424](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L424) +[rpcStateManager.ts:434](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L434) ___ @@ -613,7 +643,7 @@ EVMStateManagerInterface.revert #### Defined in -[rpcStateManager.ts:399](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L399) +[rpcStateManager.ts:409](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L409) ___ @@ -664,7 +694,7 @@ EVMStateManagerInterface.setStateRoot #### Defined in -[rpcStateManager.ts:419](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L419) +[rpcStateManager.ts:429](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/rpcStateManager.ts#L429) ___ diff --git a/packages/statemanager/docs/classes/StatelessVerkleStateManager.md b/packages/statemanager/docs/classes/StatelessVerkleStateManager.md index b3a0253c9f..24bb3f863c 100644 --- a/packages/statemanager/docs/classes/StatelessVerkleStateManager.md +++ b/packages/statemanager/docs/classes/StatelessVerkleStateManager.md @@ -43,6 +43,7 @@ to fetch data requested by the the VM. - [flush](StatelessVerkleStateManager.md#flush) - [generateCanonicalGenesis](StatelessVerkleStateManager.md#generatecanonicalgenesis) - [getAccount](StatelessVerkleStateManager.md#getaccount) +- [getAppliedKey](StatelessVerkleStateManager.md#getappliedkey) - [getComputedValue](StatelessVerkleStateManager.md#getcomputedvalue) - [getContractCode](StatelessVerkleStateManager.md#getcontractcode) - [getContractStorage](StatelessVerkleStateManager.md#getcontractstorage) @@ -414,6 +415,30 @@ EVMStateManagerInterface.getAccount ___ +### getAppliedKey + +▸ **getAppliedKey**(`_`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_` | `Uint8Array` | + +#### Returns + +`Uint8Array` + +#### Implementation of + +EVMStateManagerInterface.getAppliedKey + +#### Defined in + +[statelessVerkleStateManager.ts:891](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/statemanager/src/statelessVerkleStateManager.ts#L891) + +___ + ### getComputedValue ▸ **getComputedValue**(`accessedState`): ``null`` \| `string` diff --git a/packages/statemanager/package.json b/packages/statemanager/package.json index 3f473c1994..7d21a37530 100644 --- a/packages/statemanager/package.json +++ b/packages/statemanager/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/statemanager", - "version": "2.2.2", + "version": "2.3.0", "description": "An Ethereum statemanager implementation", "keywords": [ "ethereum", @@ -49,19 +49,19 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/util": "^9.0.2", - "@ethereumjs/verkle": "^0.0.1", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/util": "^9.0.3", + "@ethereumjs/verkle": "^0.0.2", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3", "js-sdsl": "^4.1.4", "lru-cache": "10.1.0" }, "devDependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/genesis": "^0.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/genesis": "^0.2.2", "@types/debug": "^4.1.9", "rustbn-wasm": "^0.4.0" } diff --git a/packages/statemanager/test/statelessVerkleStateManager.spec.ts b/packages/statemanager/test/statelessVerkleStateManager.spec.ts index 65384d8e16..b1a804e7c8 100644 --- a/packages/statemanager/test/statelessVerkleStateManager.spec.ts +++ b/packages/statemanager/test/statelessVerkleStateManager.spec.ts @@ -61,7 +61,7 @@ describe('StatelessVerkleStateManager: Kaustinen Verkle Block', () => { try { await stateManager.getAccount(address) assert.fail('should throw on getting account that is not found in witness') - } catch (e) { + } catch (e: any) { assert.equal( e.message.slice(0, 25), 'Missing execution witness', @@ -116,16 +116,16 @@ describe('StatelessVerkleStateManager: Kaustinen Verkle Block', () => { const account = await stateManager.getAccount(address) assert.equal( - account.balance, - bytesToBigInt(hexToBytes(balanceRaw), true), + account!.balance, + bytesToBigInt(hexToBytes(balanceRaw!), true), 'should have correct balance' ) assert.equal( - account.nonce, - bytesToBigInt(hexToBytes(nonceRaw), true), + account!.nonce, + bytesToBigInt(hexToBytes(nonceRaw!), true), 'should have correct nonce' ) - assert.equal(bytesToHex(account.codeHash), codeHash, 'should have correct codeHash') + assert.equal(bytesToHex(account!.codeHash), codeHash, 'should have correct codeHash') }) it(`copy()`, async () => { @@ -143,12 +143,12 @@ describe('StatelessVerkleStateManager: Kaustinen Verkle Block', () => { const stateManagerCopy = stateManager.shallowCopy() assert.equal( - stateManagerCopy['_accountCacheSettings'].type, + (stateManagerCopy as any)['_accountCacheSettings'].type, CacheType.ORDERED_MAP, 'should switch to ORDERED_MAP account cache on copy()' ) assert.equal( - stateManagerCopy['_storageCacheSettings'].type, + (stateManagerCopy as any)['_storageCacheSettings'].type, CacheType.ORDERED_MAP, 'should switch to ORDERED_MAP storage cache on copy()' ) diff --git a/packages/trie/CHANGELOG.md b/packages/trie/CHANGELOG.md index 1a5f7d48d7..f6d0ea01c0 100644 --- a/packages/trie/CHANGELOG.md +++ b/packages/trie/CHANGELOG.md @@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 6.2.0 - 2024-03-05 + +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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3305) +- Add export for `Path` interface for better TypeScript integration when using the `findPath()` method, PR [#3292](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3292) +- Improved zero-element proof behavior in `verifyProof()` method, PR [#3047](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3047) +- Fix a type error related to the `lru-cache` dependency, PR [#3285](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3285) + ## 6.1.1 - 2024-02-08 - Hotfix release adding a missing `debug` dependency, PR [#3271](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3271) diff --git a/packages/trie/docs/README.md b/packages/trie/docs/README.md index 4df5257d94..82129244dc 100644 --- a/packages/trie/docs/README.md +++ b/packages/trie/docs/README.md @@ -19,6 +19,7 @@ - [CheckpointDBOpts](interfaces/CheckpointDBOpts.md) - [CommonInterface](interfaces/CommonInterface.md) +- [Path](interfaces/Path.md) - [TrieOpts](interfaces/TrieOpts.md) - [TrieShallowCopyOpts](interfaces/TrieShallowCopyOpts.md) @@ -39,7 +40,6 @@ ### Functions -- [asyncTrieReadStream](README.md#asynctriereadstream) - [byteTypeToNibbleType](README.md#bytetypetonibbletype) - [bytesToNibbles](README.md#bytestonibbles) - [compactBytesToNibbles](README.md#compactbytestonibbles) @@ -72,7 +72,7 @@ #### Defined in -[packages/trie/src/types.ts:129](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L129) +[packages/trie/src/types.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L135) ___ @@ -109,7 +109,7 @@ ___ #### Defined in -[packages/trie/src/types.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L23) +[packages/trie/src/types.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L29) ___ @@ -133,7 +133,7 @@ ___ #### Defined in -[packages/trie/src/types.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L30) +[packages/trie/src/types.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L36) ___ @@ -173,7 +173,7 @@ ___ #### Defined in -[packages/trie/src/types.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L99) +[packages/trie/src/types.ts:105](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L105) ## Variables @@ -183,30 +183,10 @@ ___ #### Defined in -[packages/trie/src/types.ts:136](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L136) +[packages/trie/src/types.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L142) ## Functions -### asyncTrieReadStream - -▸ **asyncTrieReadStream**(`trie`): `ReadableStream`<`any`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `trie` | [`Trie`](classes/Trie.md) | - -#### Returns - -`ReadableStream`<`any`\> - -#### Defined in - -[packages/trie/src/util/readStream.ts:69](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/util/readStream.ts#L69) - -___ - ### byteTypeToNibbleType ▸ **byteTypeToNibbleType**(`key`): [`Nibbles`](README.md#nibbles) @@ -558,12 +538,12 @@ NOTE: Currently only supports verification when the length of firstKey and lastK | Name | Type | Description | | :------ | :------ | :------ | -| `rootHash` | `Uint8Array` | root hash. | -| `firstKey` | ``null`` \| [`Nibbles`](README.md#nibbles) | first key. | -| `lastKey` | ``null`` \| [`Nibbles`](README.md#nibbles) | last key. | -| `keys` | [`Nibbles`](README.md#nibbles)[] | key list. | -| `values` | `Uint8Array`[] | value list, one-to-one correspondence with keys. | -| `proof` | ``null`` \| `Uint8Array`[] | proof node list, if proof is null, both `firstKey` and `lastKey` must be null | +| `rootHash` | `Uint8Array` | root hash of state trie this proof is being verified against. | +| `firstKey` | ``null`` \| [`Nibbles`](README.md#nibbles) | first key of range being proven. | +| `lastKey` | ``null`` \| [`Nibbles`](README.md#nibbles) | last key of range being proven. | +| `keys` | [`Nibbles`](README.md#nibbles)[] | key list of leaf data being proven. | +| `values` | `Uint8Array`[] | value list of leaf data being proven, one-to-one correspondence with keys. | +| `proof` | ``null`` \| `Uint8Array`[] | proof node list, if all-elements-proof where no proof is needed, proof should be null, and both `firstKey` and `lastKey` must be null as well | | `useKeyHashingFunction` | [`HashKeysFunction`](README.md#hashkeysfunction) | - | #### Returns @@ -574,4 +554,4 @@ a flag to indicate whether there exists more trie node in the trie #### Defined in -[packages/trie/src/proof/range.ts:408](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/proof/range.ts#L408) +[packages/trie/src/proof/range.ts:411](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/proof/range.ts#L411) diff --git a/packages/trie/docs/classes/Trie.md b/packages/trie/docs/classes/Trie.md index 3e4acf5ac8..f69e040cb5 100644 --- a/packages/trie/docs/classes/Trie.md +++ b/packages/trie/docs/classes/Trie.md @@ -21,7 +21,6 @@ The basic trie interface, use with `import { Trie } from '@ethereumjs/trie'`. - [checkRoot](Trie.md#checkroot) - [checkpoint](Trie.md#checkpoint) - [commit](Trie.md#commit) -- [createAsyncReadStream](Trie.md#createasyncreadstream) - [createProof](Trie.md#createproof) - [createReadStream](Trie.md#createreadstream) - [database](Trie.md#database) @@ -67,7 +66,7 @@ Creates a new trie. #### Defined in -[packages/trie/src/trie.ts:99](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L99) +[packages/trie/src/trie.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L85) ## Properties @@ -79,7 +78,7 @@ The root for an empty trie #### Defined in -[packages/trie/src/trie.ts:80](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L80) +[packages/trie/src/trie.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L66) ___ @@ -103,7 +102,7 @@ ___ #### Defined in -[packages/trie/src/trie.ts:566](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L566) +[packages/trie/src/trie.ts:738](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L738) ## Methods @@ -140,7 +139,7 @@ await trie.batch(ops) #### Defined in -[packages/trie/src/trie.ts:967](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L967) +[packages/trie/src/trie.ts:1139](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1139) ___ @@ -162,7 +161,7 @@ Checks if a given root exists. #### Defined in -[packages/trie/src/trie.ts:305](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L305) +[packages/trie/src/trie.ts:458](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L458) ___ @@ -179,7 +178,7 @@ After this is called, all changes can be reverted until `commit` is called. #### Defined in -[packages/trie/src/trie.ts:1277](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1277) +[packages/trie/src/trie.ts:1306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1306) ___ @@ -200,25 +199,7 @@ If not during a checkpoint phase #### Defined in -[packages/trie/src/trie.ts:1287](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1287) - -___ - -### createAsyncReadStream - -▸ **createAsyncReadStream**(): `ReadableStream`<`any`\> - -Use asynchronous iteration over the chunks in a web stream using the for await...of syntax. - -#### Returns - -`ReadableStream`<`any`\> - -Returns a [web stream](https://nodejs.org/api/webstreams.html#example-readablestream) of the contents of the `trie` - -#### Defined in - -[packages/trie/src/trie.ts:1182](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1182) +[packages/trie/src/trie.ts:1316](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1316) ___ @@ -226,13 +207,15 @@ ___ ▸ **createProof**(`key`): `Promise`<[`Proof`](../README.md#proof)\> -Creates a proof from a trie and key that can be verified using [verifyProof](Trie.md#verifyproof-1). +Creates a proof from a trie and key that can be verified using [verifyProof](Trie.md#verifyproof-1). An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains +the encoded trie nodes from the root node to the leaf node storing state data. The returned proof will be in the format of an array that contains Uint8Arrays of +serialized branch, extension, and/or leaf nodes. #### Parameters -| Name | Type | -| :------ | :------ | -| `key` | `Uint8Array` | +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `Uint8Array` | key to create a proof for | #### Returns @@ -240,7 +223,7 @@ Creates a proof from a trie and key that can be verified using [verifyProof](Tri #### Defined in -[packages/trie/src/trie.ts:1035](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1035) +[packages/trie/src/trie.ts:269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L269) ___ @@ -250,10 +233,6 @@ ___ The `data` event is given an `Object` that has two properties; the `key` and the `value`. Both should be Uint8Arrays. -**`Deprecated`** - -Use `createAsyncReadStream` - #### Returns [`TrieReadStream`](TrieReadStream.md) @@ -262,7 +241,7 @@ Returns a [stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#str #### Defined in -[packages/trie/src/trie.ts:1174](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1174) +[packages/trie/src/trie.ts:1211](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1211) ___ @@ -283,7 +262,7 @@ ___ #### Defined in -[packages/trie/src/trie.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L272) +[packages/trie/src/trie.ts:423](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L423) ___ @@ -309,13 +288,13 @@ A Promise that resolves once value is deleted. #### Defined in -[packages/trie/src/trie.ts:406](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L406) +[packages/trie/src/trie.ts:559](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L559) ___ ### findPath -▸ **findPath**(`key`, `throwIfMissing?`): `Promise`<`Path`\> +▸ **findPath**(`key`, `throwIfMissing?`, `partialPath?`): `Promise`<[`Path`](../interfaces/Path.md)\> Tries to find a path to the node for the given key. It returns a `stack` of nodes to the closest node. @@ -326,14 +305,16 @@ It returns a `stack` of nodes to the closest node. | :------ | :------ | :------ | :------ | | `key` | `Uint8Array` | `undefined` | the search key | | `throwIfMissing` | `boolean` | `false` | if true, throws if any nodes are missing. Used for verifying proofs. (default: false) | +| `partialPath` | `Object` | `undefined` | - | +| `partialPath.stack` | [`TrieNode`](../README.md#trienode)[] | `undefined` | - | #### Returns -`Promise`<`Path`\> +`Promise`<[`Path`](../interfaces/Path.md)\> #### Defined in -[packages/trie/src/trie.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L446) +[packages/trie/src/trie.ts:599](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L599) ___ @@ -349,7 +330,7 @@ Flushes all checkpoints, restoring the initial checkpoint state. #### Defined in -[packages/trie/src/trie.ts:1319](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1319) +[packages/trie/src/trie.ts:1348](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1348) ___ @@ -357,7 +338,9 @@ ___ ▸ **fromProof**(`proof`): `Promise`<`void`\> -Saves the nodes from a proof into the trie. A static version of this function exists with the same name. +Create a trie from a given (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof. An EIP-1186 proof contains the encoded trie nodes from the root +node to the leaf node storing state data. This function does not check if the proof has the same expected root. A static version of this function exists +with the same name. **`Deprecated`** @@ -365,9 +348,9 @@ Use `updateFromProof` #### Parameters -| Name | Type | -| :------ | :------ | -| `proof` | [`Proof`](../README.md#proof) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `proof` | [`Proof`](../README.md#proof) | an EIP-1186 proof to update the trie from | #### Returns @@ -375,7 +358,7 @@ Use `updateFromProof` #### Defined in -[packages/trie/src/trie.ts:986](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L986) +[packages/trie/src/trie.ts:369](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L369) ___ @@ -400,7 +383,7 @@ A Promise that resolves to `Uint8Array` if a value was found or `null` if no val #### Defined in -[packages/trie/src/trie.ts:324](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L324) +[packages/trie/src/trie.ts:477](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L477) ___ @@ -416,7 +399,7 @@ Is the trie during a checkpoint phase? #### Defined in -[packages/trie/src/trie.ts:1269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1269) +[packages/trie/src/trie.ts:1298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1298) ___ @@ -438,7 +421,7 @@ Retrieves a node from db by hash. #### Defined in -[packages/trie/src/trie.ts:615](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L615) +[packages/trie/src/trie.ts:787](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L787) ___ @@ -454,7 +437,7 @@ Persists the root hash in the underlying database #### Defined in -[packages/trie/src/trie.ts:1216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1216) +[packages/trie/src/trie.ts:1245](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1245) ___ @@ -481,7 +464,7 @@ A Promise that resolves once value is stored. #### Defined in -[packages/trie/src/trie.ts:342](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L342) +[packages/trie/src/trie.ts:495](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L495) ___ @@ -499,7 +482,7 @@ parent checkpoint as current. #### Defined in -[packages/trie/src/trie.ts:1303](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1303) +[packages/trie/src/trie.ts:1332](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1332) ___ @@ -521,7 +504,7 @@ Gets and/or Sets the current root of the `trie` #### Defined in -[packages/trie/src/trie.ts:287](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L287) +[packages/trie/src/trie.ts:438](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L438) ___ @@ -545,7 +528,7 @@ Saves a stack of nodes to the database. #### Defined in -[packages/trie/src/trie.ts:881](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L881) +[packages/trie/src/trie.ts:1053](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1053) ___ @@ -576,7 +559,7 @@ explicitly setting `cacheSize` as an option on the method. #### Defined in -[packages/trie/src/trie.ts:1199](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1199) +[packages/trie/src/trie.ts:1228](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1228) ___ @@ -584,13 +567,15 @@ ___ ▸ **updateFromProof**(`proof`, `shouldVerifyRoot?`): `Promise`<`undefined` \| `Uint8Array`\> -Updates a trie from a proof +Updates a trie from a proof by putting all the nodes in the proof into the trie. If a trie is being updated with multiple proofs, {@param shouldVerifyRoot} can +be passed as false in order to not immediately throw on an unexpected root, so that root verification can happen after all proofs and their nodes have been added. +An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains the encoded trie nodes from the root node to the leaf node storing state data. #### Parameters | Name | Type | Default value | Description | | :------ | :------ | :------ | :------ | -| `proof` | [`Proof`](../README.md#proof) | `undefined` | The proof | +| `proof` | [`Proof`](../README.md#proof) | `undefined` | An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof to update the trie from. | | `shouldVerifyRoot` | `boolean` | `false` | If `true`, verifies that the root key of the proof matches the trie root. Throws if this is not the case. | #### Returns @@ -601,7 +586,7 @@ The root of the proof #### Defined in -[packages/trie/src/trie.ts:1005](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1005) +[packages/trie/src/trie.ts:287](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L287) ___ @@ -609,7 +594,8 @@ ___ ▸ **verifyProof**(`rootHash`, `key`, `proof`): `Promise`<``null`` \| `Uint8Array`\> -Verifies a proof. A static version of this function exists with the same name. +Verifies a proof by putting all of its nodes into a trie and attempting to get the proven key. An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof +contains the encoded trie nodes from the root node to the leaf node storing state data. A static version of this function exists with the same name. **`Throws`** @@ -617,11 +603,11 @@ If proof is found to be invalid. #### Parameters -| Name | Type | -| :------ | :------ | -| `rootHash` | `Uint8Array` | -| `key` | `Uint8Array` | -| `proof` | [`Proof`](../README.md#proof) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `rootHash` | `Uint8Array` | Root hash of the trie that this proof was created from and is being verified for | +| `key` | `Uint8Array` | Key that is being verified and that the proof is created for | +| `proof` | [`Proof`](../README.md#proof) | an EIP-1186 proof to verify the key against | #### Returns @@ -631,7 +617,7 @@ The value from the key, or null if valid proof of non-existence. #### Defined in -[packages/trie/src/trie.ts:1053](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1053) +[packages/trie/src/trie.ts:322](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L322) ___ @@ -645,7 +631,7 @@ ___ #### Defined in -[packages/trie/src/trie.ts:1119](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1119) +[packages/trie/src/trie.ts:1157](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1157) ___ @@ -653,26 +639,31 @@ ___ ▸ **verifyRangeProof**(`rootHash`, `firstKey`, `lastKey`, `keys`, `values`, `proof`): `Promise`<`boolean`\> -[verifyRangeProof](../README.md#verifyrangeproof) +A range proof is a proof that includes the encoded trie nodes from the root node to leaf node for one or more branches of a trie, +allowing an entire range of leaf nodes to be validated. This is useful in applications such as snap sync where contiguous ranges +of state trie data is received and validated for constructing world state, locally. Also see [verifyRangeProof](../README.md#verifyrangeproof). A static +version of this function also exists. #### Parameters -| Name | Type | -| :------ | :------ | -| `rootHash` | `Uint8Array` | -| `firstKey` | ``null`` \| `Uint8Array` | -| `lastKey` | ``null`` \| `Uint8Array` | -| `keys` | `Uint8Array`[] | -| `values` | `Uint8Array`[] | -| `proof` | ``null`` \| `Uint8Array`[] | +| Name | Type | Description | +| :------ | :------ | :------ | +| `rootHash` | `Uint8Array` | root hash of state trie this proof is being verified against. | +| `firstKey` | ``null`` \| `Uint8Array` | first key of range being proven. | +| `lastKey` | ``null`` \| `Uint8Array` | last key of range being proven. | +| `keys` | `Uint8Array`[] | key list of leaf data being proven. | +| `values` | `Uint8Array`[] | value list of leaf data being proven, one-to-one correspondence with keys. | +| `proof` | ``null`` \| `Uint8Array`[] | proof node list, if all-elements-proof where no proof is needed, proof should be null, and both `firstKey` and `lastKey` must be null as well | #### Returns `Promise`<`boolean`\> +a flag to indicate whether there exists more trie node in the trie + #### Defined in -[packages/trie/src/trie.ts:1096](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L1096) +[packages/trie/src/trie.ts:244](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L244) ___ @@ -696,7 +687,7 @@ Resolves when finished walking trie. #### Defined in -[packages/trie/src/trie.ts:573](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L573) +[packages/trie/src/trie.ts:745](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L745) ___ @@ -720,7 +711,7 @@ Resolves when finished walking trie. #### Defined in -[packages/trie/src/trie.ts:584](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L584) +[packages/trie/src/trie.ts:756](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L756) ___ @@ -745,7 +736,7 @@ Resolves when finished walking trie. #### Defined in -[packages/trie/src/trie.ts:562](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L562) +[packages/trie/src/trie.ts:734](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L734) ___ @@ -765,22 +756,24 @@ ___ #### Defined in -[packages/trie/src/trie.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L190) +[packages/trie/src/trie.ts:382](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L382) ___ ### createFromProof -▸ `Static` **createFromProof**(`proof`, `trieOpts?`): `Promise`<[`Trie`](Trie.md)\> +▸ `Static` **createFromProof**(`proof`, `trieOpts?`, `shouldVerifyRoot?`): `Promise`<[`Trie`](Trie.md)\> -Create a trie from a given proof +Create a trie from a given (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof. A proof contains the encoded trie nodes +from the root node to the leaf node storing state data. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `proof` | [`Proof`](../README.md#proof) | proof to create trie from | -| `trieOpts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | trie opts to be applied to returned trie | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `proof` | [`Proof`](../README.md#proof) | `undefined` | an EIP-1186 proof to create trie from | +| `trieOpts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | `undefined` | trie opts to be applied to returned trie | +| `shouldVerifyRoot` | `boolean` | `false` | If `true`, verifies that the root key of the proof matches the trie root. Throws if this is not the case. | #### Returns @@ -790,7 +783,7 @@ new trie created from given proof #### Defined in -[packages/trie/src/trie.ts:156](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L156) +[packages/trie/src/trie.ts:144](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L144) ___ @@ -798,18 +791,19 @@ ___ ▸ `Static` **fromProof**(`proof`, `opts?`): `Promise`<[`Trie`](Trie.md)\> -Static version of fromProof function with the same behavior. +Static version of fromProof function. If a root is provided in the opts param, the proof will be checked to have the same expected root. An +(EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains the encoded trie nodes from the root node to the leaf node storing state data. **`Deprecated`** -Use `updateFromProof` +Use `createFromProof` #### Parameters -| Name | Type | -| :------ | :------ | -| `proof` | [`Proof`](../README.md#proof) | -| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `proof` | [`Proof`](../README.md#proof) | An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains the encoded trie nodes from the root node to the leaf node storing state data. | +| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | - | #### Returns @@ -817,7 +811,7 @@ Use `updateFromProof` #### Defined in -[packages/trie/src/trie.ts:236](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L236) +[packages/trie/src/trie.ts:220](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L220) ___ @@ -825,7 +819,8 @@ ___ ▸ `Static` **verifyProof**(`key`, `proof`, `opts?`): `Promise`<``null`` \| `Uint8Array`\> -Static version of verifyProof function with the same behavior. +Static version of verifyProof function with the same behavior. An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains the encoded trie nodes +from the root node to the leaf node storing state data. **`Throws`** @@ -835,9 +830,9 @@ If proof is found to be invalid. | Name | Type | Description | | :------ | :------ | :------ | -| `key` | `Uint8Array` | | -| `proof` | [`Proof`](../README.md#proof) | | -| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | Trie options | +| `key` | `Uint8Array` | Key that is being verified and that the proof is created for | +| `proof` | [`Proof`](../README.md#proof) | An (EIP-1186)[https://eips.ethereum.org/EIPS/eip-1186] proof contains the encoded trie nodes from the root node to the leaf node storing state data. | +| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | optional, the opts may include a custom hashing function to use with the trie for proof verification | #### Returns @@ -847,7 +842,7 @@ The value from the key, or null if valid proof of non-existence. #### Defined in -[packages/trie/src/trie.ts:256](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L256) +[packages/trie/src/trie.ts:166](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L166) ___ @@ -855,24 +850,29 @@ ___ ▸ `Static` **verifyRangeProof**(`rootHash`, `firstKey`, `lastKey`, `keys`, `values`, `proof`, `opts?`): `Promise`<`boolean`\> -Static version of [verifyRangeProof](../README.md#verifyrangeproof) function with the same behavior +A range proof is a proof that includes the encoded trie nodes from the root node to leaf node for one or more branches of a trie, +allowing an entire range of leaf nodes to be validated. This is useful in applications such as snap sync where contiguous ranges +of state trie data is received and validated for constructing world state, locally. Also see [verifyRangeProof](../README.md#verifyrangeproof). A static +version of this function also exists. #### Parameters -| Name | Type | -| :------ | :------ | -| `rootHash` | `Uint8Array` | -| `firstKey` | ``null`` \| `Uint8Array` | -| `lastKey` | ``null`` \| `Uint8Array` | -| `keys` | `Uint8Array`[] | -| `values` | `Uint8Array`[] | -| `proof` | ``null`` \| `Uint8Array`[] | -| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | +| Name | Type | Description | +| :------ | :------ | :------ | +| `rootHash` | `Uint8Array` | root hash of state trie this proof is being verified against. | +| `firstKey` | ``null`` \| `Uint8Array` | first key of range being proven. | +| `lastKey` | ``null`` \| `Uint8Array` | last key of range being proven. | +| `keys` | `Uint8Array`[] | key list of leaf data being proven. | +| `values` | `Uint8Array`[] | value list of leaf data being proven, one-to-one correspondence with keys. | +| `proof` | ``null`` \| `Uint8Array`[] | proof node list, if all-elements-proof where no proof is needed, proof should be null, and both `firstKey` and `lastKey` must be null as well | +| `opts?` | [`TrieOpts`](../interfaces/TrieOpts.md) | optional, the opts may include a custom hashing function to use with the trie for proof verification | #### Returns `Promise`<`boolean`\> +a flag to indicate whether there exists more trie node in the trie + #### Defined in -[packages/trie/src/trie.ts:167](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L167) +[packages/trie/src/trie.ts:194](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/trie.ts#L194) diff --git a/packages/trie/docs/classes/TrieReadStream.md b/packages/trie/docs/classes/TrieReadStream.md index b222024456..46ee7a87dc 100644 --- a/packages/trie/docs/classes/TrieReadStream.md +++ b/packages/trie/docs/classes/TrieReadStream.md @@ -81,7 +81,7 @@ Readable.constructor #### Defined in -[packages/trie/src/util/readStream.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/util/readStream.ts#L36) +[packages/trie/src/util/readStream.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/util/readStream.ts#L35) ## Properties @@ -324,7 +324,7 @@ Readable.\_read #### Defined in -[packages/trie/src/util/readStream.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/util/readStream.ts#L43) +[packages/trie/src/util/readStream.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/util/readStream.ts#L42) ___ diff --git a/packages/trie/docs/interfaces/CheckpointDBOpts.md b/packages/trie/docs/interfaces/CheckpointDBOpts.md index 5ccd5cb50e..b9fb7d8547 100644 --- a/packages/trie/docs/interfaces/CheckpointDBOpts.md +++ b/packages/trie/docs/interfaces/CheckpointDBOpts.md @@ -20,7 +20,7 @@ Cache size (default: 0) #### Defined in -[packages/trie/src/types.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L126) +[packages/trie/src/types.ts:132](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L132) ___ @@ -32,7 +32,7 @@ A database instance. #### Defined in -[packages/trie/src/types.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L116) +[packages/trie/src/types.ts:122](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L122) ___ @@ -44,4 +44,4 @@ ValueEncoding of the database (the values which are `put`/`get` in the db are of #### Defined in -[packages/trie/src/types.ts:121](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L121) +[packages/trie/src/types.ts:127](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L127) diff --git a/packages/trie/docs/interfaces/Path.md b/packages/trie/docs/interfaces/Path.md new file mode 100644 index 0000000000..a434f56a9f --- /dev/null +++ b/packages/trie/docs/interfaces/Path.md @@ -0,0 +1,41 @@ +[@ethereumjs/trie](../README.md) / Path + +# Interface: Path + +## Table of contents + +### Properties + +- [node](Path.md#node) +- [remaining](Path.md#remaining) +- [stack](Path.md#stack) + +## Properties + +### node + +• **node**: ``null`` \| [`TrieNode`](../README.md#trienode) + +#### Defined in + +[packages/trie/src/types.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L24) + +___ + +### remaining + +• **remaining**: [`Nibbles`](../README.md#nibbles) + +#### Defined in + +[packages/trie/src/types.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L25) + +___ + +### stack + +• **stack**: [`TrieNode`](../README.md#trienode)[] + +#### Defined in + +[packages/trie/src/types.ts:26](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L26) diff --git a/packages/trie/docs/interfaces/TrieOpts.md b/packages/trie/docs/interfaces/TrieOpts.md index ccba3e2d2e..16e9ae3f59 100644 --- a/packages/trie/docs/interfaces/TrieOpts.md +++ b/packages/trie/docs/interfaces/TrieOpts.md @@ -29,7 +29,7 @@ Default: 0 (deactivated) #### Defined in -[packages/trie/src/types.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L91) +[packages/trie/src/types.ts:97](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L97) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[packages/trie/src/types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L96) +[packages/trie/src/types.ts:102](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L102) ___ @@ -53,7 +53,7 @@ A database instance. #### Defined in -[packages/trie/src/types.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L36) +[packages/trie/src/types.ts:42](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L42) ___ @@ -68,7 +68,7 @@ e.g. all storage tries being stored in the outer account state DB) #### Defined in -[packages/trie/src/types.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L68) +[packages/trie/src/types.ts:74](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L74) ___ @@ -80,7 +80,7 @@ A `Uint8Array` for the root of a previously stored trie #### Defined in -[packages/trie/src/types.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L41) +[packages/trie/src/types.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L47) ___ @@ -101,7 +101,7 @@ instantiation with `useKeyHashing` set to `true`. #### Defined in -[packages/trie/src/types.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L55) +[packages/trie/src/types.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L61) ___ @@ -113,7 +113,7 @@ Hash function used for hashing trie node and securing key. #### Defined in -[packages/trie/src/types.ts:60](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L60) +[packages/trie/src/types.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L66) ___ @@ -126,7 +126,7 @@ unreachable nodes will be pruned (deleted) from the trie #### Defined in -[packages/trie/src/types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L84) +[packages/trie/src/types.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L90) ___ @@ -138,7 +138,7 @@ Store the root inside the database after every `write` operation #### Defined in -[packages/trie/src/types.ts:78](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L78) +[packages/trie/src/types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L84) ___ @@ -150,4 +150,4 @@ ValueEncoding of the database (the values which are `put`/`get` in the db are of #### Defined in -[packages/trie/src/types.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L73) +[packages/trie/src/types.ts:79](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L79) diff --git a/packages/trie/docs/interfaces/TrieShallowCopyOpts.md b/packages/trie/docs/interfaces/TrieShallowCopyOpts.md index 21fa522620..33b985c91a 100644 --- a/packages/trie/docs/interfaces/TrieShallowCopyOpts.md +++ b/packages/trie/docs/interfaces/TrieShallowCopyOpts.md @@ -17,7 +17,7 @@ #### Defined in -[packages/trie/src/types.ts:109](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L109) +[packages/trie/src/types.ts:115](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L115) ___ @@ -27,4 +27,4 @@ ___ #### Defined in -[packages/trie/src/types.ts:108](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L108) +[packages/trie/src/types.ts:114](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/trie/src/types.ts#L114) diff --git a/packages/trie/package.json b/packages/trie/package.json index 248ecb2bc2..a354ac31f3 100644 --- a/packages/trie/package.json +++ b/packages/trie/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/trie", - "version": "6.1.1", + "version": "6.2.0", "description": "Implementation of the modified merkle patricia tree as specified in Ethereum's yellow paper.", "keywords": [ "merkle", @@ -54,7 +54,7 @@ }, "dependencies": { "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@types/readable-stream": "^2.3.13", "debug": "^4.3.4", "lru-cache": "10.1.0", @@ -62,7 +62,7 @@ "readable-stream": "^3.6.0" }, "devDependencies": { - "@ethereumjs/genesis": "^0.2.1", + "@ethereumjs/genesis": "^0.2.2", "@types/benchmark": "^1.0.33", "abstract-level": "^1.0.3", "level": "^8.0.0", diff --git a/packages/tx/CHANGELOG.md b/packages/tx/CHANGELOG.md index 67b84771ee..de7c0520f6 100644 --- a/packages/tx/CHANGELOG.md +++ b/packages/tx/CHANGELOG.md @@ -6,6 +6,42 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 5.3.0 - 2024-03-05 + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3280). This bug has been fixed along with these releases and this library now references the updated trie library version. + ## 5.2.1 - 2024-02-08 - Hotfix release adding a missing `debug` dependency to the `@ethereumjs/trie` package (dependency), PR [#3271](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3271) diff --git a/packages/tx/README.md b/packages/tx/README.md index 1d58b90c85..f205171237 100644 --- a/packages/tx/README.md +++ b/packages/tx/README.md @@ -23,42 +23,43 @@ npm install @ethereumjs/tx ### KZG Setup -This library supports an experimental version of `EIP-4844` blob transactions (see usage instructions below) starting with `v4.1.0`. +This library now fully supports `EIP-4844` blob transactions (see usage instructions below) starting with `v5.2.0`. For blob transactions and other KZG related proof functionality (e.g. for EVM precompiles) KZG has to be manually installed and initialized in the `common` instance to be used in instantiating blob transactions. -#### Manual Installation +Note: starting with the `v5.3` release of this library and associated releases of upstream EthereumJS libraries the old `c-kzg` centered recommended setup has been replaced by using our own WASM build of the `c-kzg` library which has been released as a separate package [kzg-wasm](https://github.com/ethereumjs/kzg-wasm) on npm. -The following two manual installation steps for a KZG library and the trusted setup are needed. - -1. Install an additional dependency that supports the `kzg` interface defined in [the kzg interface](./src/kzg/kzg.ts). You can install the default option [c-kzg](https://github.com/ethereum/c-kzg-4844) by simply running `npm install c-kzg`. -2. Download the trusted setup required for the KZG module. It can be found [here](../client/src/trustedSetups/trusted_setup.txt) within the client package. +This new setup is now both browser compatible 🎉 and the official KZG setup file has been integrated by default and the new setup is now the default recommended setup to be used. #### KZG Initialization -Initialization can then be done like this (using the `c-kzg` module for our KZG dependency): +As a first step add the `kzg-wasm` package as a dependency to your `package.json` file and install the library. + +Initialization can then be done like the following: ```ts // ./examples/initKzg.ts -import * as kzg from 'c-kzg' +import { loadKZG } from 'kzg-wasm' import { Chain, Common, Hardfork } from '@ethereumjs/common' -import { initKZG } from '@ethereumjs/util' -// Instantiate KZG -initKZG(kzg, __dirname + '/../../client/src/trustedSetups/official.txt') +const main = async () => { + const kzg = await loadKZG() + + // Instantiate `common` + const common = new Common({ + chain: Chain.Mainnet, + hardfork: Hardfork.Cancun, + customCrypto: { kzg }, + }) -// Instantiate `common` -const common = new Common({ - chain: Chain.Mainnet, - hardfork: Hardfork.Cancun, - customCrypto: { kzg }, -}) + console.log(common.customCrypto.kzg) // should output the KZG API as an object +} -console.log(common.customCrypto.kzg) // should output the KZG API as an object +main() ``` -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 which can hopefully be released soon [TM]. +Note: 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. ## Usage @@ -124,39 +125,43 @@ See the following code snipped for an example on how to instantiate (using the ` import { Chain, Common, Hardfork } from '@ethereumjs/common' import { BlobEIP4844Transaction } from '@ethereumjs/tx' -import { bytesToHex, initKZG } from '@ethereumjs/util' -import * as kzg from 'c-kzg' - -initKZG(kzg, __dirname + '/../../client/src/trustedSetups/devnet6.txt') - -const common = new Common({ - chain: Chain.Mainnet, - hardfork: Hardfork.Shanghai, - eips: [4844], - customCrypto: { kzg }, -}) - -const txData = { - data: '0x1a8451e600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - gasLimit: '0x02625a00', - maxPriorityFeePerGas: '0x01', - maxFeePerGas: '0xff', - maxFeePerDataGas: '0xfff', - nonce: '0x00', - to: '0xcccccccccccccccccccccccccccccccccccccccc', - value: '0x0186a0', - v: '0x01', - r: '0xafb6e247b1c490e284053c87ab5f6b59e219d51f743f7a4d83e400782bc7e4b9', - s: '0x479a268e0e0acd4de3f1e28e4fac2a6b32a4195e8dfa9d19147abe8807aa6f64', - chainId: '0x01', - accessList: [], - type: '0x05', - blobsData: ['abcd'], +import { bytesToHex } from '@ethereumjs/util' +import { loadKZG } from 'kzg-wasm' + +const main = async () => { + const kzg = await loadKZG() + + const common = new Common({ + chain: Chain.Mainnet, + hardfork: Hardfork.Shanghai, + eips: [4844], + customCrypto: { kzg }, + }) + + const txData = { + data: '0x1a8451e600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + gasLimit: '0x02625a00', + maxPriorityFeePerGas: '0x01', + maxFeePerGas: '0xff', + maxFeePerDataGas: '0xfff', + nonce: '0x00', + to: '0xcccccccccccccccccccccccccccccccccccccccc', + value: '0x0186a0', + v: '0x01', + r: '0xafb6e247b1c490e284053c87ab5f6b59e219d51f743f7a4d83e400782bc7e4b9', + s: '0x479a268e0e0acd4de3f1e28e4fac2a6b32a4195e8dfa9d19147abe8807aa6f64', + chainId: '0x01', + accessList: [], + type: '0x05', + blobsData: ['abcd'], + } + + const tx = BlobEIP4844Transaction.fromTxData(txData, { common }) + + console.log(bytesToHex(tx.hash())) //0x3c3e7c5e09c250d2200bcc3530f4a9088d7e3fb4ea3f4fccfd09f535a3539e84 } -const tx = BlobEIP4844Transaction.fromTxData(txData, { common }) - -console.log(bytesToHex(tx.hash())) //0x3c3e7c5e09c250d2200bcc3530f4a9088d7e3fb4ea3f4fccfd09f535a3539e84 +main() ``` Note that `versionedHashes` and `kzgCommitments` have a real length of 32 bytes, `blobs` have a real length of `4096` bytes and values are trimmed here for brevity. diff --git a/packages/tx/docs/classes/AccessListEIP2930Transaction.md b/packages/tx/docs/classes/AccessListEIP2930Transaction.md index 9a381de720..e32c14b276 100644 --- a/packages/tx/docs/classes/AccessListEIP2930Transaction.md +++ b/packages/tx/docs/classes/AccessListEIP2930Transaction.md @@ -46,6 +46,7 @@ Typed transaction with optional access lists - [errorStr](AccessListEIP2930Transaction.md#errorstr) - [getBaseFee](AccessListEIP2930Transaction.md#getbasefee) - [getDataFee](AccessListEIP2930Transaction.md#getdatafee) +- [getEffectivePriorityFee](AccessListEIP2930Transaction.md#geteffectivepriorityfee) - [getHashedMessageToSign](AccessListEIP2930Transaction.md#gethashedmessagetosign) - [getMessageToSign](AccessListEIP2930Transaction.md#getmessagetosign) - [getMessageToVerifySignature](AccessListEIP2930Transaction.md#getmessagetoverifysignature) @@ -321,7 +322,7 @@ BaseTransaction.addSignature #### Defined in -[tx/src/eip2930Transaction.ts:283](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L283) +[tx/src/eip2930Transaction.ts:287](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L287) ___ @@ -341,7 +342,7 @@ BaseTransaction.errorStr #### Defined in -[tx/src/eip2930Transaction.ts:329](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L329) +[tx/src/eip2930Transaction.ts:333](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L333) ___ @@ -381,7 +382,31 @@ BaseTransaction.getDataFee #### Defined in -[tx/src/eip2930Transaction.ts:179](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L179) +[tx/src/eip2930Transaction.ts:183](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L183) + +___ + +### getEffectivePriorityFee + +▸ **getEffectivePriorityFee**(`baseFee?`): `bigint` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `baseFee?` | `bigint` | + +#### Returns + +`bigint` + +#### Overrides + +BaseTransaction.getEffectivePriorityFee + +#### Defined in + +[tx/src/eip2930Transaction.ts:176](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L176) ___ @@ -405,7 +430,7 @@ BaseTransaction.getHashedMessageToSign #### Defined in -[tx/src/eip2930Transaction.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L255) +[tx/src/eip2930Transaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L259) ___ @@ -433,7 +458,7 @@ BaseTransaction.getMessageToSign #### Defined in -[tx/src/eip2930Transaction.ts:244](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L244) +[tx/src/eip2930Transaction.ts:248](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L248) ___ @@ -453,7 +478,7 @@ BaseTransaction.getMessageToVerifySignature #### Defined in -[tx/src/eip2930Transaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L272) +[tx/src/eip2930Transaction.ts:276](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L276) ___ @@ -473,7 +498,7 @@ BaseTransaction.getSenderAddress #### Defined in -[tx/src/baseTransaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L272) +[tx/src/baseTransaction.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L279) ___ @@ -493,7 +518,7 @@ BaseTransaction.getSenderPublicKey #### Defined in -[tx/src/eip2930Transaction.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L279) +[tx/src/eip2930Transaction.ts:283](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L283) ___ @@ -513,7 +538,7 @@ BaseTransaction.getUpfrontCost #### Defined in -[tx/src/eip2930Transaction.ts:186](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L186) +[tx/src/eip2930Transaction.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L190) ___ @@ -558,7 +583,7 @@ BaseTransaction.hash #### Defined in -[tx/src/eip2930Transaction.ts:265](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L265) +[tx/src/eip2930Transaction.ts:269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L269) ___ @@ -576,7 +601,7 @@ BaseTransaction.isSigned #### Defined in -[tx/src/baseTransaction.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L247) +[tx/src/baseTransaction.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L254) ___ @@ -628,7 +653,7 @@ BaseTransaction.raw #### Defined in -[tx/src/eip2930Transaction.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L203) +[tx/src/eip2930Transaction.ts:207](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L207) ___ @@ -655,7 +680,7 @@ BaseTransaction.serialize #### Defined in -[tx/src/eip2930Transaction.ts:229](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L229) +[tx/src/eip2930Transaction.ts:233](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L233) ___ @@ -687,7 +712,7 @@ BaseTransaction.sign #### Defined in -[tx/src/baseTransaction.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L290) +[tx/src/baseTransaction.ts:297](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L297) ___ @@ -746,7 +771,7 @@ BaseTransaction.toCreationAddress #### Defined in -[tx/src/baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[tx/src/baseTransaction.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L223) ___ @@ -766,7 +791,7 @@ BaseTransaction.toJSON #### Defined in -[tx/src/eip2930Transaction.ts:314](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L314) +[tx/src/eip2930Transaction.ts:318](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip2930Transaction.ts#L318) ___ @@ -786,7 +811,7 @@ BaseTransaction.verifySignature #### Defined in -[tx/src/baseTransaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L259) +[tx/src/baseTransaction.ts:266](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L266) ___ diff --git a/packages/tx/docs/classes/BlobEIP4844Transaction.md b/packages/tx/docs/classes/BlobEIP4844Transaction.md index 384038d85a..a0df79aa7c 100644 --- a/packages/tx/docs/classes/BlobEIP4844Transaction.md +++ b/packages/tx/docs/classes/BlobEIP4844Transaction.md @@ -52,6 +52,7 @@ Typed transaction with a new gas fee market mechanism for transactions that incl - [errorStr](BlobEIP4844Transaction.md#errorstr) - [getBaseFee](BlobEIP4844Transaction.md#getbasefee) - [getDataFee](BlobEIP4844Transaction.md#getdatafee) +- [getEffectivePriorityFee](BlobEIP4844Transaction.md#geteffectivepriorityfee) - [getHashedMessageToSign](BlobEIP4844Transaction.md#gethashedmessagetosign) - [getMessageToSign](BlobEIP4844Transaction.md#getmessagetosign) - [getMessageToVerifySignature](BlobEIP4844Transaction.md#getmessagetoverifysignature) @@ -102,7 +103,7 @@ BaseTransaction<TransactionType.BlobEIP4844\>.constructor #### Defined in -[tx/src/eip4844Transaction.ts:103](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L103) +[tx/src/eip4844Transaction.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L104) ## Properties @@ -112,7 +113,7 @@ BaseTransaction<TransactionType.BlobEIP4844\>.constructor #### Defined in -[tx/src/eip4844Transaction.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L85) +[tx/src/eip4844Transaction.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L86) ___ @@ -122,7 +123,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L84) +[tx/src/eip4844Transaction.ts:85](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L85) ___ @@ -132,7 +133,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L91) +[tx/src/eip4844Transaction.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L92) ___ @@ -142,7 +143,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:92](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L92) +[tx/src/eip4844Transaction.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L93) ___ @@ -166,7 +167,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L83) +[tx/src/eip4844Transaction.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L84) ___ @@ -180,7 +181,7 @@ BaseTransaction.common #### Defined in -[tx/src/eip4844Transaction.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L90) +[tx/src/eip4844Transaction.ts:91](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L91) ___ @@ -218,7 +219,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:93](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L93) +[tx/src/eip4844Transaction.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L94) ___ @@ -228,7 +229,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L94) +[tx/src/eip4844Transaction.ts:95](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L95) ___ @@ -238,7 +239,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L88) +[tx/src/eip4844Transaction.ts:89](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L89) ___ @@ -248,7 +249,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L87) +[tx/src/eip4844Transaction.ts:88](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L88) ___ @@ -258,7 +259,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L86) +[tx/src/eip4844Transaction.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L87) ___ @@ -391,7 +392,7 @@ BaseTransaction.addSignature #### Defined in -[tx/src/eip4844Transaction.ts:532](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L532) +[tx/src/eip4844Transaction.ts:558](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L558) ___ @@ -411,7 +412,7 @@ BaseTransaction.errorStr #### Defined in -[tx/src/eip4844Transaction.ts:568](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L568) +[tx/src/eip4844Transaction.ts:594](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L594) ___ @@ -451,7 +452,33 @@ BaseTransaction.getDataFee #### Defined in -[tx/src/eip4844Transaction.ts:395](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L395) +[tx/src/eip4844Transaction.ts:421](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L421) + +___ + +### getEffectivePriorityFee + +▸ **getEffectivePriorityFee**(`baseFee`): `bigint` + +Returns the minimum of calculated priority fee (from maxFeePerGas and baseFee) and maxPriorityFeePerGas + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `baseFee` | `bigint` | Base fee retrieved from block | + +#### Returns + +`bigint` + +#### Overrides + +BaseTransaction.getEffectivePriorityFee + +#### Defined in + +[tx/src/eip4844Transaction.ts:224](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L224) ___ @@ -475,7 +502,7 @@ BaseTransaction.getHashedMessageToSign #### Defined in -[tx/src/eip4844Transaction.ts:492](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L492) +[tx/src/eip4844Transaction.ts:518](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L518) ___ @@ -503,7 +530,7 @@ BaseTransaction.getMessageToSign #### Defined in -[tx/src/eip4844Transaction.ts:481](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L481) +[tx/src/eip4844Transaction.ts:507](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L507) ___ @@ -521,7 +548,7 @@ BaseTransaction.getMessageToVerifySignature #### Defined in -[tx/src/eip4844Transaction.ts:506](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L506) +[tx/src/eip4844Transaction.ts:532](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L532) ___ @@ -541,7 +568,7 @@ BaseTransaction.getSenderAddress #### Defined in -[tx/src/baseTransaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L272) +[tx/src/baseTransaction.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L279) ___ @@ -561,7 +588,7 @@ BaseTransaction.getSenderPublicKey #### Defined in -[tx/src/eip4844Transaction.ts:513](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L513) +[tx/src/eip4844Transaction.ts:539](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L539) ___ @@ -587,7 +614,7 @@ BaseTransaction.getUpfrontCost #### Defined in -[tx/src/eip4844Transaction.ts:403](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L403) +[tx/src/eip4844Transaction.ts:429](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L429) ___ @@ -632,7 +659,7 @@ BaseTransaction.hash #### Defined in -[tx/src/eip4844Transaction.ts:502](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L502) +[tx/src/eip4844Transaction.ts:528](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L528) ___ @@ -650,7 +677,7 @@ BaseTransaction.isSigned #### Defined in -[tx/src/baseTransaction.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L247) +[tx/src/baseTransaction.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L254) ___ @@ -688,7 +715,7 @@ the number of blobs included with this transaction #### Defined in -[tx/src/eip4844Transaction.ts:587](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L587) +[tx/src/eip4844Transaction.ts:613](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L613) ___ @@ -718,7 +745,7 @@ BaseTransaction.raw #### Defined in -[tx/src/eip4844Transaction.ts:420](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L420) +[tx/src/eip4844Transaction.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L446) ___ @@ -745,7 +772,7 @@ BaseTransaction.serialize #### Defined in -[tx/src/eip4844Transaction.ts:449](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L449) +[tx/src/eip4844Transaction.ts:475](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L475) ___ @@ -761,7 +788,7 @@ the serialized form of a blob transaction in the network wrapper format (used fo #### Defined in -[tx/src/eip4844Transaction.ts:456](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L456) +[tx/src/eip4844Transaction.ts:482](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L482) ___ @@ -793,7 +820,7 @@ BaseTransaction.sign #### Defined in -[tx/src/baseTransaction.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L290) +[tx/src/baseTransaction.ts:297](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L297) ___ @@ -852,7 +879,7 @@ BaseTransaction.toCreationAddress #### Defined in -[tx/src/baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[tx/src/baseTransaction.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L223) ___ @@ -870,7 +897,7 @@ BaseTransaction.toJSON #### Defined in -[tx/src/eip4844Transaction.ts:517](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L517) +[tx/src/eip4844Transaction.ts:543](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L543) ___ @@ -890,7 +917,7 @@ BaseTransaction.verifySignature #### Defined in -[tx/src/baseTransaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L259) +[tx/src/baseTransaction.ts:266](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L266) ___ @@ -915,7 +942,7 @@ a BlobEIP4844Transaction #### Defined in -[tx/src/eip4844Transaction.ts:337](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L337) +[tx/src/eip4844Transaction.ts:358](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L358) ___ @@ -941,7 +968,7 @@ access_list, max_fee_per_data_gas, blob_versioned_hashes, y_parity, r, s])` #### Defined in -[tx/src/eip4844Transaction.ts:246](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L246) +[tx/src/eip4844Transaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L259) ___ @@ -962,7 +989,7 @@ ___ #### Defined in -[tx/src/eip4844Transaction.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L191) +[tx/src/eip4844Transaction.ts:192](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L192) ___ @@ -988,7 +1015,7 @@ accessList, signatureYParity, signatureR, signatureS]` #### Defined in -[tx/src/eip4844Transaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L272) +[tx/src/eip4844Transaction.ts:289](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L289) ___ @@ -1014,4 +1041,4 @@ the "minimal" representation of a BlobEIP4844Transaction (i.e. transaction objec #### Defined in -[tx/src/eip4844Transaction.ts:226](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L226) +[tx/src/eip4844Transaction.ts:235](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip4844Transaction.ts#L235) diff --git a/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md b/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md index c779794880..ed999030c6 100644 --- a/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md +++ b/packages/tx/docs/classes/FeeMarketEIP1559Transaction.md @@ -47,6 +47,7 @@ Typed transaction with a new gas fee market mechanism - [errorStr](FeeMarketEIP1559Transaction.md#errorstr) - [getBaseFee](FeeMarketEIP1559Transaction.md#getbasefee) - [getDataFee](FeeMarketEIP1559Transaction.md#getdatafee) +- [getEffectivePriorityFee](FeeMarketEIP1559Transaction.md#geteffectivepriorityfee) - [getHashedMessageToSign](FeeMarketEIP1559Transaction.md#gethashedmessagetosign) - [getMessageToSign](FeeMarketEIP1559Transaction.md#getmessagetosign) - [getMessageToVerifySignature](FeeMarketEIP1559Transaction.md#getmessagetoverifysignature) @@ -332,7 +333,7 @@ BaseTransaction.addSignature #### Defined in -[tx/src/eip1559Transaction.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L311) +[tx/src/eip1559Transaction.ts:319](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L319) ___ @@ -352,7 +353,7 @@ BaseTransaction.errorStr #### Defined in -[tx/src/eip1559Transaction.ts:359](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L359) +[tx/src/eip1559Transaction.ts:367](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L367) ___ @@ -396,6 +397,32 @@ BaseTransaction.getDataFee ___ +### getEffectivePriorityFee + +▸ **getEffectivePriorityFee**(`baseFee`): `bigint` + +Returns the minimum of calculated priority fee (from maxFeePerGas and baseFee) and maxPriorityFeePerGas + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `baseFee` | `bigint` | Base fee retrieved from block | + +#### Returns + +`bigint` + +#### Overrides + +BaseTransaction.getEffectivePriorityFee + +#### Defined in + +[tx/src/eip1559Transaction.ts:213](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L213) + +___ + ### getHashedMessageToSign ▸ **getHashedMessageToSign**(): `Uint8Array` @@ -416,7 +443,7 @@ BaseTransaction.getHashedMessageToSign #### Defined in -[tx/src/eip1559Transaction.ts:283](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L283) +[tx/src/eip1559Transaction.ts:291](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L291) ___ @@ -444,7 +471,7 @@ BaseTransaction.getMessageToSign #### Defined in -[tx/src/eip1559Transaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L272) +[tx/src/eip1559Transaction.ts:280](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L280) ___ @@ -464,7 +491,7 @@ BaseTransaction.getMessageToVerifySignature #### Defined in -[tx/src/eip1559Transaction.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L300) +[tx/src/eip1559Transaction.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L308) ___ @@ -484,7 +511,7 @@ BaseTransaction.getSenderAddress #### Defined in -[tx/src/baseTransaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L272) +[tx/src/baseTransaction.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L279) ___ @@ -504,7 +531,7 @@ BaseTransaction.getSenderPublicKey #### Defined in -[tx/src/eip1559Transaction.ts:307](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L307) +[tx/src/eip1559Transaction.ts:315](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L315) ___ @@ -530,7 +557,7 @@ BaseTransaction.getUpfrontCost #### Defined in -[tx/src/eip1559Transaction.ts:213](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L213) +[tx/src/eip1559Transaction.ts:221](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L221) ___ @@ -575,7 +602,7 @@ BaseTransaction.hash #### Defined in -[tx/src/eip1559Transaction.ts:293](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L293) +[tx/src/eip1559Transaction.ts:301](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L301) ___ @@ -593,7 +620,7 @@ BaseTransaction.isSigned #### Defined in -[tx/src/baseTransaction.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L247) +[tx/src/baseTransaction.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L254) ___ @@ -645,7 +672,7 @@ BaseTransaction.raw #### Defined in -[tx/src/eip1559Transaction.ts:230](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L230) +[tx/src/eip1559Transaction.ts:238](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L238) ___ @@ -672,7 +699,7 @@ BaseTransaction.serialize #### Defined in -[tx/src/eip1559Transaction.ts:257](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L257) +[tx/src/eip1559Transaction.ts:265](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L265) ___ @@ -704,7 +731,7 @@ BaseTransaction.sign #### Defined in -[tx/src/baseTransaction.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L290) +[tx/src/baseTransaction.ts:297](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L297) ___ @@ -763,7 +790,7 @@ BaseTransaction.toCreationAddress #### Defined in -[tx/src/baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[tx/src/baseTransaction.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L223) ___ @@ -783,7 +810,7 @@ BaseTransaction.toJSON #### Defined in -[tx/src/eip1559Transaction.ts:343](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L343) +[tx/src/eip1559Transaction.ts:351](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/eip1559Transaction.ts#L351) ___ @@ -803,7 +830,7 @@ BaseTransaction.verifySignature #### Defined in -[tx/src/baseTransaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L259) +[tx/src/baseTransaction.ts:266](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L266) ___ diff --git a/packages/tx/docs/classes/LegacyTransaction.md b/packages/tx/docs/classes/LegacyTransaction.md index f3bf0e4692..bedeb9e019 100644 --- a/packages/tx/docs/classes/LegacyTransaction.md +++ b/packages/tx/docs/classes/LegacyTransaction.md @@ -40,6 +40,7 @@ An Ethereum non-typed (legacy) transaction - [errorStr](LegacyTransaction.md#errorstr) - [getBaseFee](LegacyTransaction.md#getbasefee) - [getDataFee](LegacyTransaction.md#getdatafee) +- [getEffectivePriorityFee](LegacyTransaction.md#geteffectivepriorityfee) - [getHashedMessageToSign](LegacyTransaction.md#gethashedmessagetosign) - [getMessageToSign](LegacyTransaction.md#getmessagetosign) - [getMessageToVerifySignature](LegacyTransaction.md#getmessagetoverifysignature) @@ -285,7 +286,7 @@ BaseTransaction.addSignature #### Defined in -[tx/src/legacyTransaction.ts:273](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L273) +[tx/src/legacyTransaction.ts:277](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L277) ___ @@ -305,7 +306,7 @@ BaseTransaction.errorStr #### Defined in -[tx/src/legacyTransaction.ts:363](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L363) +[tx/src/legacyTransaction.ts:367](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L367) ___ @@ -345,7 +346,31 @@ BaseTransaction.getDataFee #### Defined in -[tx/src/legacyTransaction.ts:234](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L234) +[tx/src/legacyTransaction.ts:238](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L238) + +___ + +### getEffectivePriorityFee + +▸ **getEffectivePriorityFee**(`baseFee?`): `bigint` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `baseFee?` | `bigint` | + +#### Returns + +`bigint` + +#### Overrides + +BaseTransaction.getEffectivePriorityFee + +#### Defined in + +[tx/src/legacyTransaction.ts:150](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L150) ___ @@ -366,7 +391,7 @@ BaseTransaction.getHashedMessageToSign #### Defined in -[tx/src/legacyTransaction.ts:226](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L226) +[tx/src/legacyTransaction.ts:230](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L230) ___ @@ -396,7 +421,7 @@ BaseTransaction.getMessageToSign #### Defined in -[tx/src/legacyTransaction.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L203) +[tx/src/legacyTransaction.ts:207](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L207) ___ @@ -416,7 +441,7 @@ BaseTransaction.getMessageToVerifySignature #### Defined in -[tx/src/legacyTransaction.ts:258](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L258) +[tx/src/legacyTransaction.ts:262](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L262) ___ @@ -436,7 +461,7 @@ BaseTransaction.getSenderAddress #### Defined in -[tx/src/baseTransaction.ts:272](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L272) +[tx/src/baseTransaction.ts:279](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L279) ___ @@ -456,7 +481,7 @@ BaseTransaction.getSenderPublicKey #### Defined in -[tx/src/legacyTransaction.ts:269](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L269) +[tx/src/legacyTransaction.ts:273](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L273) ___ @@ -476,7 +501,7 @@ BaseTransaction.getUpfrontCost #### Defined in -[tx/src/legacyTransaction.ts:241](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L241) +[tx/src/legacyTransaction.ts:245](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L245) ___ @@ -521,7 +546,7 @@ BaseTransaction.hash #### Defined in -[tx/src/legacyTransaction.ts:251](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L251) +[tx/src/legacyTransaction.ts:255](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L255) ___ @@ -539,7 +564,7 @@ BaseTransaction.isSigned #### Defined in -[tx/src/baseTransaction.ts:247](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L247) +[tx/src/baseTransaction.ts:254](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L254) ___ @@ -591,7 +616,7 @@ BaseTransaction.raw #### Defined in -[tx/src/legacyTransaction.ts:163](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L163) +[tx/src/legacyTransaction.ts:167](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L167) ___ @@ -617,7 +642,7 @@ BaseTransaction.serialize #### Defined in -[tx/src/legacyTransaction.ts:186](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L186) +[tx/src/legacyTransaction.ts:190](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L190) ___ @@ -649,7 +674,7 @@ BaseTransaction.sign #### Defined in -[tx/src/baseTransaction.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L290) +[tx/src/baseTransaction.ts:297](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L297) ___ @@ -708,7 +733,7 @@ BaseTransaction.toCreationAddress #### Defined in -[tx/src/baseTransaction.ts:216](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L216) +[tx/src/baseTransaction.ts:223](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L223) ___ @@ -728,7 +753,7 @@ BaseTransaction.toJSON #### Defined in -[tx/src/legacyTransaction.ts:306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L306) +[tx/src/legacyTransaction.ts:310](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/legacyTransaction.ts#L310) ___ @@ -748,7 +773,7 @@ BaseTransaction.verifySignature #### Defined in -[tx/src/baseTransaction.ts:259](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L259) +[tx/src/baseTransaction.ts:266](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/src/baseTransaction.ts#L266) ___ diff --git a/packages/tx/package.json b/packages/tx/package.json index 189c4f4891..59df996343 100644 --- a/packages/tx/package.json +++ b/packages/tx/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/tx", - "version": "5.2.1", + "version": "5.3.0", "description": "Implementation of the various Ethereum Transaction Types", "keywords": [ "ethereum", @@ -57,9 +57,9 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/common": "^4.2.0", + "@ethereumjs/common": "^4.3.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "ethereum-cryptography": "^2.1.3" }, "devDependencies": { diff --git a/packages/util/CHANGELOG.md b/packages/util/CHANGELOG.md index 8c8d80377d..2e4fb43ece 100644 --- a/packages/util/CHANGELOG.md +++ b/packages/util/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 9.0.3 - 2024-03-05 + +- Allow optional `trustedSetupPath` for the `initKZG()` method, PR [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296) + ## 9.0.2 - 2024-02-08 ### Self-Contained (and Working 🙂) README Examples diff --git a/packages/util/docs/README.md b/packages/util/docs/README.md index 685c05a523..8333d27d8d 100644 --- a/packages/util/docs/README.md +++ b/packages/util/docs/README.md @@ -102,6 +102,8 @@ - [addHexPrefix](README.md#addhexprefix) - [arrayContainsArray](README.md#arraycontainsarray) - [bigInt64ToBytes](README.md#bigint64tobytes) +- [bigIntMax](README.md#bigintmax) +- [bigIntMin](README.md#bigintmin) - [bigIntToBytes](README.md#biginttobytes) - [bigIntToHex](README.md#biginttohex) - [bigIntToUnpaddedBytes](README.md#biginttounpaddedbytes) @@ -933,7 +935,51 @@ A Uint8Array of length 8 containing the bigint. #### Defined in -[packages/util/src/bytes.ts:517](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L517) +[packages/util/src/bytes.ts:529](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L529) + +___ + +### bigIntMax + +▸ **bigIntMax**(...`args`): `bigint` + +Calculates max bigint from an array of bigints + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...args` | `bigint`[] | array of bigints | + +#### Returns + +`bigint` + +#### Defined in + +[packages/util/src/bytes.ts:409](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L409) + +___ + +### bigIntMin + +▸ **bigIntMin**(...`args`): `bigint` + +Calculates min BigInt from an array of BigInts + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `...args` | `bigint`[] | array of bigints | + +#### Returns + +`bigint` + +#### Defined in + +[packages/util/src/bytes.ts:415](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L415) ___ @@ -1002,7 +1048,7 @@ Convert value from bigint to an unpadded Uint8Array #### Defined in -[packages/util/src/bytes.ts:411](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L411) +[packages/util/src/bytes.ts:423](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L423) ___ @@ -1093,7 +1139,7 @@ The 64-bit bigint read from the input Uint8Array. #### Defined in -[packages/util/src/bytes.ts:490](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L490) +[packages/util/src/bytes.ts:502](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L502) ___ @@ -1166,7 +1212,7 @@ The 32-bit integer read from the input Uint8Array. #### Defined in -[packages/util/src/bytes.ts:476](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L476) +[packages/util/src/bytes.ts:488](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L488) ___ @@ -1285,7 +1331,7 @@ A positive number if value1 is larger than value2, #### Defined in -[packages/util/src/bytes.ts:434](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L434) +[packages/util/src/bytes.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L446) ___ @@ -1339,7 +1385,7 @@ works like `Buffer.concat` #### Defined in -[packages/util/src/bytes.ts:458](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L458) +[packages/util/src/bytes.ts:470](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L470) ___ @@ -1792,14 +1838,14 @@ ___ ### initKZG -▸ **initKZG**(`kzgLib`, `trustedSetupPath`): `void` +▸ **initKZG**(`kzgLib`, `trustedSetupPath?`): `void` #### Parameters | Name | Type | Description | | :------ | :------ | :------ | | `kzgLib` | [`Kzg`](interfaces/Kzg.md) | a KZG implementation (defaults to c-kzg) | -| `trustedSetupPath` | `string` | the full path (e.g. "/home/linux/devnet4.txt") to a kzg trusted setup text file | +| `trustedSetupPath?` | `string` | the full path (e.g. "/home/linux/devnet4.txt") to a kzg trusted setup text file | #### Returns @@ -1834,7 +1880,7 @@ A Uint8Array of length 4 containing the integer. #### Defined in -[packages/util/src/bytes.ts:504](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L504) +[packages/util/src/bytes.ts:516](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L516) ___ @@ -1901,7 +1947,7 @@ Convert value from number to an unpadded Uint8Array #### Defined in -[packages/util/src/bytes.ts:421](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L421) +[packages/util/src/bytes.ts:433](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L433) ___ @@ -2258,7 +2304,7 @@ A Uint8Array of random bytes of specified length. #### Defined in -[packages/util/src/bytes.ts:446](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L446) +[packages/util/src/bytes.ts:458](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/util/src/bytes.ts#L458) ___ diff --git a/packages/util/docs/interfaces/Kzg.md b/packages/util/docs/interfaces/Kzg.md index 61308665c9..bbe40b4526 100644 --- a/packages/util/docs/interfaces/Kzg.md +++ b/packages/util/docs/interfaces/Kzg.md @@ -59,13 +59,13 @@ ___ ### loadTrustedSetup -▸ **loadTrustedSetup**(`filePath`): `void` +▸ **loadTrustedSetup**(`filePath?`): `void` #### Parameters | Name | Type | | :------ | :------ | -| `filePath` | `string` | +| `filePath?` | `string` | #### Returns diff --git a/packages/util/package.json b/packages/util/package.json index c9783cfcfd..098a31c1d6 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/util", - "version": "9.0.2", + "version": "9.0.3", "description": "A collection of utility functions for Ethereum", "keywords": [ "ethereum", diff --git a/packages/verkle/CHANGELOG.md b/packages/verkle/CHANGELOG.md index 459edbc1b3..536f107d59 100644 --- a/packages/verkle/CHANGELOG.md +++ b/packages/verkle/CHANGELOG.md @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [0.0.1] - 2023-10-15 +## 0.0.2 - 2024-03-05 + +- Fix a type error related to the `lru-cache` dependency, PR [#3285](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3285) +- Downstream dependency updates, see PR [#3297](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3297) + +## 0.0.1 - 2023-10-15 - Initial development release diff --git a/packages/verkle/docs/README.md b/packages/verkle/docs/README.md new file mode 100644 index 0000000000..d6f44f8765 --- /dev/null +++ b/packages/verkle/docs/README.md @@ -0,0 +1,372 @@ +@ethereumjs/verkle + +# @ethereumjs/verkle + +## Table of contents + +### Enumerations + +- [VerkleNodeType](enums/VerkleNodeType.md) + +### Classes + +- [BaseVerkleNode](classes/BaseVerkleNode.md) +- [CheckpointDB](classes/CheckpointDB.md) +- [InternalNode](classes/InternalNode.md) +- [LeafNode](classes/LeafNode.md) +- [PrioritizedTaskExecutor](classes/PrioritizedTaskExecutor.md) +- [VerkleTree](classes/VerkleTree.md) +- [WalkController](classes/WalkController.md) + +### Interfaces + +- [CheckpointDBOpts](interfaces/CheckpointDBOpts.md) +- [Fr](interfaces/Fr.md) +- [Point](interfaces/Point.md) +- [TypedVerkleNode](interfaces/TypedVerkleNode.md) +- [VerkleNodeInterface](interfaces/VerkleNodeInterface.md) +- [VerkleNodeOptions](interfaces/VerkleNodeOptions.md) +- [VerkleTreeOpts](interfaces/VerkleTreeOpts.md) + +### Type Aliases + +- [Checkpoint](README.md#checkpoint) +- [FoundNodeFunction](README.md#foundnodefunction) +- [Proof](README.md#proof) +- [VerkleNode](README.md#verklenode) +- [VerkleTreeOptsWithDefaults](README.md#verkletreeoptswithdefaults) + +### Variables + +- [NODE\_WIDTH](README.md#node_width) +- [POINT\_IDENTITY](README.md#point_identity) +- [ROOT\_DB\_KEY](README.md#root_db_key) + +### Functions + +- [decodeNode](README.md#decodenode) +- [decodeRawNode](README.md#decoderawnode) +- [getKey](README.md#getkey) +- [getStem](README.md#getstem) +- [isRawNode](README.md#israwnode) +- [matchingBytesLength](README.md#matchingbyteslength) +- [pedersenHash](README.md#pedersenhash) +- [verifyProof](README.md#verifyproof) +- [verifyUpdate](README.md#verifyupdate) + +## Type Aliases + +### Checkpoint + +Ƭ **Checkpoint**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `keyValueMap` | `Map`<`string`, `Uint8Array` \| `undefined`\> | +| `root` | `Uint8Array` | + +#### Defined in + +[types.ts:104](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L104) + +___ + +### FoundNodeFunction + +Ƭ **FoundNodeFunction**: (`nodeRef`: `Uint8Array`, `node`: [`VerkleNode`](README.md#verklenode) \| ``null``, `key`: `Uint8Array`, `walkController`: [`WalkController`](classes/WalkController.md)) => `void` + +#### Type declaration + +▸ (`nodeRef`, `node`, `key`, `walkController`): `void` + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `nodeRef` | `Uint8Array` | +| `node` | [`VerkleNode`](README.md#verklenode) \| ``null`` | +| `key` | `Uint8Array` | +| `walkController` | [`WalkController`](classes/WalkController.md) | + +##### Returns + +`void` + +#### Defined in + +[types.ts:111](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L111) + +___ + +### Proof + +Ƭ **Proof**: `Uint8Array`[] + +#### Defined in + +[types.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L61) + +___ + +### VerkleNode + +Ƭ **VerkleNode**: [`TypedVerkleNode`](interfaces/TypedVerkleNode.md)[[`VerkleNodeType`](enums/VerkleNodeType.md)] + +#### Defined in + +[node/types.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L15) + +___ + +### VerkleTreeOptsWithDefaults + +Ƭ **VerkleTreeOptsWithDefaults**: [`VerkleTreeOpts`](interfaces/VerkleTreeOpts.md) & { `cacheSize`: `number` ; `useRootPersistence`: `boolean` } + +#### Defined in + +[types.ts:87](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L87) + +## Variables + +### NODE\_WIDTH + +• `Const` **NODE\_WIDTH**: ``256`` + +#### Defined in + +[node/types.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L49) + +___ + +### POINT\_IDENTITY + +• `Const` **POINT\_IDENTITY**: [`Point`](interfaces/Point.md) + +#### Defined in + +[util/crypto.ts:81](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L81) + +___ + +### ROOT\_DB\_KEY + +• `Const` **ROOT\_DB\_KEY**: `Uint8Array` + +#### Defined in + +[types.ts:118](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L118) + +## Functions + +### decodeNode + +▸ **decodeNode**(`raw`): [`VerkleNode`](README.md#verklenode) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `raw` | `Uint8Array` | + +#### Returns + +[`VerkleNode`](README.md#verklenode) + +#### Defined in + +[node/util.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/util.ts#L20) + +___ + +### decodeRawNode + +▸ **decodeRawNode**(`raw`): [`VerkleNode`](README.md#verklenode) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `raw` | `Uint8Array`[] | + +#### Returns + +[`VerkleNode`](README.md#verklenode) + +#### Defined in + +[node/util.ts:7](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/util.ts#L7) + +___ + +### getKey + +▸ **getKey**(`stem`, `subIndex`): `Uint8Array` + +**`Dev`** + +Returns the tree key for a given verkle tree stem, and sub index. + +**`Dev`** + +Assumes that the verkle node width = 256 + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `stem` | `Uint8Array` | The 31-bytes verkle tree stem as a Uint8Array. | +| `subIndex` | `Uint8Array` | The sub index of the tree to generate the key for as a Uint8Array. | + +#### Returns + +`Uint8Array` + +The tree key as a Uint8Array. + +#### Defined in + +[util/crypto.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L67) + +___ + +### getStem + +▸ **getStem**(`address`, `treeIndex?`): `Uint8Array` + +**`Dev`** + +Returns the 31-bytes verkle tree stem for a given address and tree index. + +**`Dev`** + +Assumes that the verkle node width = 256 + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `address` | `Address` | `undefined` | The address to generate the tree key for. | +| `treeIndex` | `number` \| `bigint` | `0` | The index of the tree to generate the key for. Defaults to 0. | + +#### Returns + +`Uint8Array` + +The 31-bytes verkle tree stem as a Uint8Array. + +#### Defined in + +[util/crypto.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L43) + +___ + +### isRawNode + +▸ **isRawNode**(`node`): node is Uint8Array[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `node` | `Uint8Array` \| `Uint8Array`[] | + +#### Returns + +node is Uint8Array[] + +#### Defined in + +[node/util.ts:28](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/util.ts#L28) + +___ + +### matchingBytesLength + +▸ **matchingBytesLength**(`bytes1`, `bytes2`): `number` + +Compares two byte arrays and returns the count of consecutively matching items from the start. + +**`Function`** + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `bytes1` | `Uint8Array` | The first Uint8Array to compare. | +| `bytes2` | `Uint8Array` | The second Uint8Array to compare. | + +#### Returns + +`number` + +The count of consecutively matching items from the start. + +#### Defined in + +[util/bytes.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/bytes.ts#L9) + +___ + +### pedersenHash + +▸ **pedersenHash**(`input`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `input` | `Uint8Array` | + +#### Returns + +`Uint8Array` + +#### Defined in + +[util/crypto.ts:14](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L14) + +___ + +### verifyProof + +▸ **verifyProof**(`root`, `proof`, `keyValues`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `root` | `Uint8Array` | +| `proof` | `Uint8Array` | +| `keyValues` | `Map`<`any`, `any`\> | + +#### Returns + +`Uint8Array` + +#### Defined in + +[util/crypto.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L72) + +___ + +### verifyUpdate + +▸ **verifyUpdate**(`root`, `proof`, `keyValues`): `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `root` | `Uint8Array` | +| `proof` | `Uint8Array` | +| `keyValues` | `Map`<`any`, `any`\> | + +#### Returns + +`Uint8Array` + +#### Defined in + +[util/crypto.ts:28](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/crypto.ts#L28) diff --git a/packages/verkle/docs/classes/BaseVerkleNode.md b/packages/verkle/docs/classes/BaseVerkleNode.md new file mode 100644 index 0000000000..32d2438ad0 --- /dev/null +++ b/packages/verkle/docs/classes/BaseVerkleNode.md @@ -0,0 +1,174 @@ +[@ethereumjs/verkle](../README.md) / BaseVerkleNode + +# Class: BaseVerkleNode + +## Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`VerkleNodeType`](../enums/VerkleNodeType.md) | + +## Hierarchy + +- **`BaseVerkleNode`** + + ↳ [`InternalNode`](InternalNode.md) + + ↳ [`LeafNode`](LeafNode.md) + +## Implements + +- [`VerkleNodeInterface`](../interfaces/VerkleNodeInterface.md) + +## Table of contents + +### Constructors + +- [constructor](BaseVerkleNode.md#constructor) + +### Properties + +- [commitment](BaseVerkleNode.md#commitment) +- [depth](BaseVerkleNode.md#depth) + +### Methods + +- [commit](BaseVerkleNode.md#commit) +- [hash](BaseVerkleNode.md#hash) +- [insert](BaseVerkleNode.md#insert) +- [raw](BaseVerkleNode.md#raw) +- [serialize](BaseVerkleNode.md#serialize) + +## Constructors + +### constructor + +• **new BaseVerkleNode**<`T`\>(`options`) + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | extends [`VerkleNodeType`](../enums/VerkleNodeType.md) | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options` | [`VerkleNodeOptions`](../interfaces/VerkleNodeOptions.md)[`T`] | + +#### Defined in + +[node/baseVerkleNode.ts:11](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L11) + +## Properties + +### commitment + +• **commitment**: [`Point`](../interfaces/Point.md) + +#### Defined in + +[node/baseVerkleNode.ts:8](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L8) + +___ + +### depth + +• **depth**: `number` + +#### Defined in + +[node/baseVerkleNode.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L9) + +## Methods + +### commit + +▸ `Abstract` **commit**(): [`Point`](../interfaces/Point.md) + +#### Returns + +[`Point`](../interfaces/Point.md) + +#### Implementation of + +[VerkleNodeInterface](../interfaces/VerkleNodeInterface.md).[commit](../interfaces/VerkleNodeInterface.md#commit) + +#### Defined in + +[node/baseVerkleNode.ts:16](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L16) + +___ + +### hash + +▸ **hash**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Implementation of + +[VerkleNodeInterface](../interfaces/VerkleNodeInterface.md).[hash](../interfaces/VerkleNodeInterface.md#hash) + +#### Defined in + +[node/baseVerkleNode.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L19) + +___ + +### insert + +▸ `Abstract` **insert**(`key`, `value`, `nodeResolverFn`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `value` | `Uint8Array` | +| `nodeResolverFn` | () => `void` | + +#### Returns + +`void` + +#### Defined in + +[node/baseVerkleNode.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L23) + +___ + +### raw + +▸ `Abstract` **raw**(): `Uint8Array`[] + +#### Returns + +`Uint8Array`[] + +#### Defined in + +[node/baseVerkleNode.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L25) + +___ + +### serialize + +▸ **serialize**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +the RLP serialized node + +#### Implementation of + +[VerkleNodeInterface](../interfaces/VerkleNodeInterface.md).[serialize](../interfaces/VerkleNodeInterface.md#serialize) + +#### Defined in + +[node/baseVerkleNode.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L30) diff --git a/packages/verkle/docs/classes/CheckpointDB.md b/packages/verkle/docs/classes/CheckpointDB.md new file mode 100644 index 0000000000..76bf691d31 --- /dev/null +++ b/packages/verkle/docs/classes/CheckpointDB.md @@ -0,0 +1,376 @@ +[@ethereumjs/verkle](../README.md) / CheckpointDB + +# Class: CheckpointDB + +DB is a thin wrapper around the underlying levelup db, +which validates inputs and sets encoding type. + +## Implements + +- `DB` + +## Table of contents + +### Constructors + +- [constructor](CheckpointDB.md#constructor) + +### Properties + +- [\_stats](CheckpointDB.md#_stats) +- [cacheSize](CheckpointDB.md#cachesize) +- [checkpoints](CheckpointDB.md#checkpoints) +- [db](CheckpointDB.md#db) + +### Methods + +- [batch](CheckpointDB.md#batch) +- [checkpoint](CheckpointDB.md#checkpoint) +- [commit](CheckpointDB.md#commit) +- [del](CheckpointDB.md#del) +- [get](CheckpointDB.md#get) +- [hasCheckpoints](CheckpointDB.md#hascheckpoints) +- [open](CheckpointDB.md#open) +- [put](CheckpointDB.md#put) +- [revert](CheckpointDB.md#revert) +- [setCheckpoints](CheckpointDB.md#setcheckpoints) +- [shallowCopy](CheckpointDB.md#shallowcopy) +- [stats](CheckpointDB.md#stats) + +## Constructors + +### constructor + +• **new CheckpointDB**(`opts`) + +Initialize a DB instance. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts` | [`CheckpointDBOpts`](../interfaces/CheckpointDBOpts.md) | + +#### Defined in + +[db/checkpoint.ts:43](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L43) + +## Properties + +### \_stats + +• **\_stats**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `cache` | { `hits`: `number` = 0; `reads`: `number` = 0; `writes`: `number` = 0 } | +| `cache.hits` | `number` | +| `cache.reads` | `number` | +| `cache.writes` | `number` | +| `db` | { `hits`: `number` = 0; `reads`: `number` = 0; `writes`: `number` = 0 } | +| `db.hits` | `number` | +| `db.reads` | `number` | +| `db.writes` | `number` | + +#### Defined in + +[db/checkpoint.ts:27](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L27) + +___ + +### cacheSize + +• `Readonly` **cacheSize**: `number` + +#### Defined in + +[db/checkpoint.ts:14](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L14) + +___ + +### checkpoints + +• **checkpoints**: [`Checkpoint`](../README.md#checkpoint)[] + +#### Defined in + +[db/checkpoint.ts:12](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L12) + +___ + +### db + +• **db**: `DB`<`Uint8Array`, `Uint8Array`\> + +#### Defined in + +[db/checkpoint.ts:13](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L13) + +## Methods + +### batch + +▸ **batch**(`opStack`): `Promise`<`void`\> + +**`Inherit Doc`** + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opStack` | `BatchDBOp`<`Uint8Array`, `Uint8Array`\>[] | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +DB.batch + +#### Defined in + +[db/checkpoint.ts:217](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L217) + +___ + +### checkpoint + +▸ **checkpoint**(`root`): `void` + +Adds a new checkpoint to the stack + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `root` | `Uint8Array` | + +#### Returns + +`void` + +#### Defined in + +[db/checkpoint.ts:83](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L83) + +___ + +### commit + +▸ **commit**(): `Promise`<`void`\> + +Commits the latest checkpoint + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[db/checkpoint.ts:90](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L90) + +___ + +### del + +▸ **del**(`key`): `Promise`<`void`\> + +**`Inherit Doc`** + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +DB.del + +#### Defined in + +[db/checkpoint.ts:195](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L195) + +___ + +### get + +▸ **get**(`key`): `Promise`<`undefined` \| `Uint8Array`\> + +**`Inherit Doc`** + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | + +#### Returns + +`Promise`<`undefined` \| `Uint8Array`\> + +#### Implementation of + +DB.get + +#### Defined in + +[db/checkpoint.ts:134](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L134) + +___ + +### hasCheckpoints + +▸ **hasCheckpoints**(): `boolean` + +Is the DB during a checkpoint phase? + +#### Returns + +`boolean` + +#### Defined in + +[db/checkpoint.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L75) + +___ + +### open + +▸ **open**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +DB.open + +#### Defined in + +[db/checkpoint.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L267) + +___ + +### put + +▸ **put**(`key`, `value`): `Promise`<`void`\> + +**`Inherit Doc`** + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `value` | `Uint8Array` | + +#### Returns + +`Promise`<`void`\> + +#### Implementation of + +DB.put + +#### Defined in + +[db/checkpoint.ts:173](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L173) + +___ + +### revert + +▸ **revert**(): `Promise`<`Uint8Array`\> + +Reverts the latest checkpoint + +#### Returns + +`Promise`<`Uint8Array`\> + +#### Defined in + +[db/checkpoint.ts:126](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L126) + +___ + +### setCheckpoints + +▸ **setCheckpoints**(`checkpoints`): `void` + +Flush the checkpoints and use the given checkpoints instead. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `checkpoints` | [`Checkpoint`](../README.md#checkpoint)[] | + +#### Returns + +`void` + +#### Defined in + +[db/checkpoint.ts:61](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L61) + +___ + +### shallowCopy + +▸ **shallowCopy**(): [`CheckpointDB`](CheckpointDB.md) + +**`Inherit Doc`** + +#### Returns + +[`CheckpointDB`](CheckpointDB.md) + +#### Implementation of + +DB.shallowCopy + +#### Defined in + +[db/checkpoint.ts:263](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L263) + +___ + +### stats + +▸ **stats**(`reset?`): `Object` + +#### Parameters + +| Name | Type | Default value | +| :------ | :------ | :------ | +| `reset` | `boolean` | `true` | + +#### Returns + +`Object` + +| Name | Type | +| :------ | :------ | +| `cache` | { `hits`: `number` = 0; `reads`: `number` = 0; `writes`: `number` = 0 } | +| `cache.hits` | `number` | +| `cache.reads` | `number` | +| `cache.writes` | `number` | +| `db` | { `hits`: `number` = 0; `reads`: `number` = 0; `writes`: `number` = 0 } | +| `db.hits` | `number` | +| `db.reads` | `number` | +| `db.writes` | `number` | +| `size` | `number` | + +#### Defined in + +[db/checkpoint.ts:241](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/db/checkpoint.ts#L241) diff --git a/packages/verkle/docs/classes/InternalNode.md b/packages/verkle/docs/classes/InternalNode.md new file mode 100644 index 0000000000..a214dc30bf --- /dev/null +++ b/packages/verkle/docs/classes/InternalNode.md @@ -0,0 +1,339 @@ +[@ethereumjs/verkle](../README.md) / InternalNode + +# Class: InternalNode + +## Hierarchy + +- [`BaseVerkleNode`](BaseVerkleNode.md)<[`Internal`](../enums/VerkleNodeType.md#internal)\> + + ↳ **`InternalNode`** + +## Table of contents + +### Constructors + +- [constructor](InternalNode.md#constructor) + +### Properties + +- [children](InternalNode.md#children) +- [commitment](InternalNode.md#commitment) +- [copyOnWrite](InternalNode.md#copyonwrite) +- [depth](InternalNode.md#depth) +- [type](InternalNode.md#type) + +### Methods + +- [commit](InternalNode.md#commit) +- [cowChild](InternalNode.md#cowchild) +- [getChildren](InternalNode.md#getchildren) +- [hash](InternalNode.md#hash) +- [insert](InternalNode.md#insert) +- [insertStem](InternalNode.md#insertstem) +- [raw](InternalNode.md#raw) +- [serialize](InternalNode.md#serialize) +- [setChild](InternalNode.md#setchild) +- [create](InternalNode.md#create) +- [fromRawNode](InternalNode.md#fromrawnode) + +## Constructors + +### constructor + +• **new InternalNode**(`options`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options` | `VerkleInternalNodeOptions` | + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[constructor](BaseVerkleNode.md#constructor) + +#### Defined in + +[node/internalNode.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L19) + +## Properties + +### children + +• **children**: (``null`` \| [`VerkleNode`](../README.md#verklenode))[] + +#### Defined in + +[node/internalNode.ts:14](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L14) + +___ + +### commitment + +• **commitment**: [`Point`](../interfaces/Point.md) + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[commitment](BaseVerkleNode.md#commitment) + +#### Defined in + +[node/baseVerkleNode.ts:8](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L8) + +___ + +### copyOnWrite + +• **copyOnWrite**: `Record`<`string`, [`Point`](../interfaces/Point.md)\> + +#### Defined in + +[node/internalNode.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L15) + +___ + +### depth + +• **depth**: `number` + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[depth](BaseVerkleNode.md#depth) + +#### Defined in + +[node/baseVerkleNode.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L9) + +___ + +### type + +• **type**: [`VerkleNodeType`](../enums/VerkleNodeType.md) = `VerkleNodeType.Internal` + +#### Defined in + +[node/internalNode.ts:16](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L16) + +## Methods + +### commit + +▸ **commit**(): [`Point`](../interfaces/Point.md) + +#### Returns + +[`Point`](../interfaces/Point.md) + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[commit](BaseVerkleNode.md#commit) + +#### Defined in + +[node/internalNode.ts:25](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L25) + +___ + +### cowChild + +▸ **cowChild**(`_`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `_` | `number` | + +#### Returns + +`void` + +#### Defined in + +[node/internalNode.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L29) + +___ + +### getChildren + +▸ **getChildren**(`index`): ``null`` \| [`VerkleNode`](../README.md#verklenode) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +``null`` \| [`VerkleNode`](../README.md#verklenode) + +#### Defined in + +[node/internalNode.ts:63](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L63) + +___ + +### hash + +▸ **hash**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[hash](BaseVerkleNode.md#hash) + +#### Defined in + +[node/baseVerkleNode.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L19) + +___ + +### insert + +▸ **insert**(`key`, `value`, `resolver`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `value` | `Uint8Array` | +| `resolver` | () => `void` | + +#### Returns + +`void` + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[insert](BaseVerkleNode.md#insert) + +#### Defined in + +[node/internalNode.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L67) + +___ + +### insertStem + +▸ **insertStem**(`stem`, `values`, `resolver`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stem` | `Uint8Array` | +| `values` | `Uint8Array`[] | +| `resolver` | () => `void` | + +#### Returns + +`void` + +#### Defined in + +[node/internalNode.ts:73](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L73) + +___ + +### raw + +▸ **raw**(): `Uint8Array`[] + +#### Returns + +`Uint8Array`[] + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[raw](BaseVerkleNode.md#raw) + +#### Defined in + +[node/internalNode.ts:116](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L116) + +___ + +### serialize + +▸ **serialize**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +the RLP serialized node + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[serialize](BaseVerkleNode.md#serialize) + +#### Defined in + +[node/baseVerkleNode.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L30) + +___ + +### setChild + +▸ **setChild**(`index`, `child`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | +| `child` | [`VerkleNode`](../README.md#verklenode) | + +#### Returns + +`void` + +#### Defined in + +[node/internalNode.ts:33](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L33) + +___ + +### create + +▸ `Static` **create**(`depth`): [`InternalNode`](InternalNode.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `depth` | `number` | + +#### Returns + +[`InternalNode`](InternalNode.md) + +#### Defined in + +[node/internalNode.ts:54](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L54) + +___ + +### fromRawNode + +▸ `Static` **fromRawNode**(`rawNode`, `depth`): [`InternalNode`](InternalNode.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `rawNode` | `Uint8Array`[] | +| `depth` | `number` | + +#### Returns + +[`InternalNode`](InternalNode.md) + +#### Defined in + +[node/internalNode.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/internalNode.ts#L37) diff --git a/packages/verkle/docs/classes/LeafNode.md b/packages/verkle/docs/classes/LeafNode.md new file mode 100644 index 0000000000..67349ed7d4 --- /dev/null +++ b/packages/verkle/docs/classes/LeafNode.md @@ -0,0 +1,362 @@ +[@ethereumjs/verkle](../README.md) / LeafNode + +# Class: LeafNode + +## Hierarchy + +- [`BaseVerkleNode`](BaseVerkleNode.md)<[`Leaf`](../enums/VerkleNodeType.md#leaf)\> + + ↳ **`LeafNode`** + +## Table of contents + +### Constructors + +- [constructor](LeafNode.md#constructor) + +### Properties + +- [c1](LeafNode.md#c1) +- [c2](LeafNode.md#c2) +- [commitment](LeafNode.md#commitment) +- [depth](LeafNode.md#depth) +- [stem](LeafNode.md#stem) +- [type](LeafNode.md#type) +- [values](LeafNode.md#values) + +### Methods + +- [commit](LeafNode.md#commit) +- [getValue](LeafNode.md#getvalue) +- [hash](LeafNode.md#hash) +- [insert](LeafNode.md#insert) +- [insertMultiple](LeafNode.md#insertmultiple) +- [insertStem](LeafNode.md#insertstem) +- [raw](LeafNode.md#raw) +- [serialize](LeafNode.md#serialize) +- [setDepth](LeafNode.md#setdepth) +- [create](LeafNode.md#create) +- [fromRawNode](LeafNode.md#fromrawnode) + +## Constructors + +### constructor + +• **new LeafNode**(`options`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `options` | `VerkleLeafNodeOptions` | + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[constructor](BaseVerkleNode.md#constructor) + +#### Defined in + +[node/leafNode.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L15) + +## Properties + +### c1 + +• **c1**: [`Point`](../interfaces/Point.md) + +#### Defined in + +[node/leafNode.ts:11](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L11) + +___ + +### c2 + +• **c2**: [`Point`](../interfaces/Point.md) + +#### Defined in + +[node/leafNode.ts:12](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L12) + +___ + +### commitment + +• **commitment**: [`Point`](../interfaces/Point.md) + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[commitment](BaseVerkleNode.md#commitment) + +#### Defined in + +[node/baseVerkleNode.ts:8](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L8) + +___ + +### depth + +• **depth**: `number` + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[depth](BaseVerkleNode.md#depth) + +#### Defined in + +[node/baseVerkleNode.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L9) + +___ + +### stem + +• **stem**: `Uint8Array` + +#### Defined in + +[node/leafNode.ts:9](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L9) + +___ + +### type + +• **type**: [`VerkleNodeType`](../enums/VerkleNodeType.md) = `VerkleNodeType.Leaf` + +#### Defined in + +[node/leafNode.ts:13](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L13) + +___ + +### values + +• **values**: `Uint8Array`[] + +#### Defined in + +[node/leafNode.ts:10](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L10) + +## Methods + +### commit + +▸ **commit**(): [`Point`](../interfaces/Point.md) + +#### Returns + +[`Point`](../interfaces/Point.md) + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[commit](BaseVerkleNode.md#commit) + +#### Defined in + +[node/leafNode.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L48) + +___ + +### getValue + +▸ **getValue**(`index`): ``null`` \| `Uint8Array` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `index` | `number` | + +#### Returns + +``null`` \| `Uint8Array` + +#### Defined in + +[node/leafNode.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L52) + +___ + +### hash + +▸ **hash**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[hash](BaseVerkleNode.md#hash) + +#### Defined in + +[node/baseVerkleNode.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L19) + +___ + +### insert + +▸ **insert**(`key`, `value`, `nodeResolverFn`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `value` | `Uint8Array` | +| `nodeResolverFn` | () => `void` | + +#### Returns + +`void` + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[insert](BaseVerkleNode.md#insert) + +#### Defined in + +[node/leafNode.ts:56](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L56) + +___ + +### insertMultiple + +▸ **insertMultiple**(`key`, `values`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `values` | `Uint8Array`[] | + +#### Returns + +`void` + +#### Defined in + +[node/leafNode.ts:62](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L62) + +___ + +### insertStem + +▸ **insertStem**(`key`, `value`, `resolver`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | +| `value` | `Uint8Array`[] | +| `resolver` | () => `void` | + +#### Returns + +`void` + +#### Defined in + +[node/leafNode.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L66) + +___ + +### raw + +▸ **raw**(): `Uint8Array`[] + +#### Returns + +`Uint8Array`[] + +#### Overrides + +[BaseVerkleNode](BaseVerkleNode.md).[raw](BaseVerkleNode.md#raw) + +#### Defined in + +[node/leafNode.ts:71](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L71) + +___ + +### serialize + +▸ **serialize**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +the RLP serialized node + +#### Inherited from + +[BaseVerkleNode](BaseVerkleNode.md).[serialize](BaseVerkleNode.md#serialize) + +#### Defined in + +[node/baseVerkleNode.ts:30](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/baseVerkleNode.ts#L30) + +___ + +### setDepth + +▸ **setDepth**(`depth`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `depth` | `number` | + +#### Returns + +`void` + +#### Defined in + +[node/leafNode.ts:82](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L82) + +___ + +### create + +▸ `Static` **create**(`stem`, `values`): [`LeafNode`](LeafNode.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `stem` | `Uint8Array` | +| `values` | `Uint8Array`[] | + +#### Returns + +[`LeafNode`](LeafNode.md) + +#### Defined in + +[node/leafNode.ts:24](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L24) + +___ + +### fromRawNode + +▸ `Static` **fromRawNode**(`rawNode`, `depth`): [`LeafNode`](LeafNode.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `rawNode` | `Uint8Array`[] | +| `depth` | `number` | + +#### Returns + +[`LeafNode`](LeafNode.md) + +#### Defined in + +[node/leafNode.ts:28](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/leafNode.ts#L28) diff --git a/packages/verkle/docs/classes/PrioritizedTaskExecutor.md b/packages/verkle/docs/classes/PrioritizedTaskExecutor.md new file mode 100644 index 0000000000..cdb162e3f4 --- /dev/null +++ b/packages/verkle/docs/classes/PrioritizedTaskExecutor.md @@ -0,0 +1,3 @@ +[@ethereumjs/verkle](../README.md) / PrioritizedTaskExecutor + +# Class: PrioritizedTaskExecutor diff --git a/packages/verkle/docs/classes/VerkleTree.md b/packages/verkle/docs/classes/VerkleTree.md new file mode 100644 index 0000000000..68004575f7 --- /dev/null +++ b/packages/verkle/docs/classes/VerkleTree.md @@ -0,0 +1,585 @@ +[@ethereumjs/verkle](../README.md) / VerkleTree + +# Class: VerkleTree + +The basic verkle tree interface, use with `import { VerkleTree } from '@ethereumjs/verkle'`. + +## Table of contents + +### Constructors + +- [constructor](VerkleTree.md#constructor) + +### Properties + +- [EMPTY\_TREE\_ROOT](VerkleTree.md#empty_tree_root) + +### Methods + +- [batch](VerkleTree.md#batch) +- [checkRoot](VerkleTree.md#checkroot) +- [checkpoint](VerkleTree.md#checkpoint) +- [commit](VerkleTree.md#commit) +- [createProof](VerkleTree.md#createproof) +- [createReadStream](VerkleTree.md#createreadstream) +- [database](VerkleTree.md#database) +- [findLeafNode](VerkleTree.md#findleafnode) +- [findPath](VerkleTree.md#findpath) +- [flushCheckpoints](VerkleTree.md#flushcheckpoints) +- [fromProof](VerkleTree.md#fromproof) +- [get](VerkleTree.md#get) +- [hasCheckpoints](VerkleTree.md#hascheckpoints) +- [lookupNode](VerkleTree.md#lookupnode) +- [persistRoot](VerkleTree.md#persistroot) +- [put](VerkleTree.md#put) +- [revert](VerkleTree.md#revert) +- [root](VerkleTree.md#root) +- [saveStack](VerkleTree.md#savestack) +- [shallowCopy](VerkleTree.md#shallowcopy) +- [verifyProof](VerkleTree.md#verifyproof) +- [walkTree](VerkleTree.md#walktree) +- [create](VerkleTree.md#create) + +## Constructors + +### constructor + +• **new VerkleTree**(`opts?`) + +Creates a new verkle tree. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `opts?` | [`VerkleTreeOpts`](../interfaces/VerkleTreeOpts.md) | Options for instantiating the verkle tree Note: in most cases, the static [create](VerkleTree.md#create) constructor should be used. It uses the same API but provides sensible defaults | + +#### Defined in + +[verkleTree.ts:50](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L50) + +## Properties + +### EMPTY\_TREE\_ROOT + +• **EMPTY\_TREE\_ROOT**: `Uint8Array` + +The root for an empty tree + +#### Defined in + +[verkleTree.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L36) + +## Methods + +### batch + +▸ **batch**(`ops`): `Promise`<`void`\> + +The given hash of operations (key additions or deletions) are executed on the tree +(delete operations are only executed on DB with `deleteFromDB` set to `true`) + +**`Example`** + +```ts +const ops = [ + { type: 'del', key: Uint8Array.from('father') } + , { type: 'put', key: Uint8Array.from('name'), value: Uint8Array.from('Yuri Irsenovich Kim') } + , { type: 'put', key: Uint8Array.from('dob'), value: Uint8Array.from('16 February 1941') } + , { type: 'put', key: Uint8Array.from('spouse'), value: Uint8Array.from('Kim Young-sook') } + , { type: 'put', key: Uint8Array.from('occupation'), value: Uint8Array.from('Clown') } +] +await tree.batch(ops) +``` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `ops` | `BatchDBOp`<`Uint8Array`, `Uint8Array`\>[] | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:366](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L366) + +___ + +### checkRoot + +▸ **checkRoot**(`root`): `Promise`<`boolean`\> + +Checks if a given root exists. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `root` | `Uint8Array` | + +#### Returns + +`Promise`<`boolean`\> + +#### Defined in + +[verkleTree.ts:120](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L120) + +___ + +### checkpoint + +▸ **checkpoint**(): `void` + +Creates a checkpoint that can later be reverted to or committed. +After this is called, all changes can be reverted until `commit` is called. + +#### Returns + +`void` + +#### Defined in + +[verkleTree.ts:465](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L465) + +___ + +### commit + +▸ **commit**(): `Promise`<`void`\> + +Commits a checkpoint to disk, if current checkpoint is not nested. +If nested, only sets the parent checkpoint as current checkpoint. + +**`Throws`** + +If not during a checkpoint phase + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:474](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L474) + +___ + +### createProof + +▸ **createProof**(`key`): `Promise`<[`Proof`](../README.md#proof)\> + +Creates a proof from a tree and key that can be verified using [verifyProof](VerkleTree.md#verifyproof). + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `Uint8Array` | + +#### Returns + +`Promise`<[`Proof`](../README.md#proof)\> + +#### Defined in + +[verkleTree.ts:382](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L382) + +___ + +### createReadStream + +▸ **createReadStream**(): `any` + +The `data` event is given an `Object` that has two properties; the `key` and the `value`. Both should be Uint8Arrays. + +#### Returns + +`any` + +Returns a [stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_class_stream_readable) of the contents of the `tree` + +#### Defined in + +[verkleTree.ts:406](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L406) + +___ + +### database + +▸ **database**(`db?`): [`CheckpointDB`](CheckpointDB.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `db?` | `DB`<`Uint8Array`, `Uint8Array`\> | + +#### Returns + +[`CheckpointDB`](CheckpointDB.md) + +#### Defined in + +[verkleTree.ts:86](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L86) + +___ + +### findLeafNode + +▸ **findLeafNode**(`key`, `throwIfMissing?`): `Promise`<``null`` \| [`LeafNode`](LeafNode.md)\> + +Tries to find the leaf node leading up to the given key, or null if not found. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `key` | `Uint8Array` | `undefined` | the search key | +| `throwIfMissing` | `boolean` | `false` | if true, throws if any nodes are missing. Used for verifying proofs. (default: false) | + +#### Returns + +`Promise`<``null`` \| [`LeafNode`](LeafNode.md)\> + +#### Defined in + +[verkleTree.ts:267](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L267) + +___ + +### findPath + +▸ **findPath**(`key`, `throwIfMissing?`): `Promise`<`Path`\> + +Tries to find a path to the node for the given key. +It returns a `stack` of nodes to the closest node. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `key` | `Uint8Array` | `undefined` | the search key | +| `throwIfMissing` | `boolean` | `false` | if true, throws if any nodes are missing. Used for verifying proofs. (default: false) | + +#### Returns + +`Promise`<`Path`\> + +#### Defined in + +[verkleTree.ts:196](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L196) + +___ + +### flushCheckpoints + +▸ **flushCheckpoints**(): `void` + +Flushes all checkpoints, restoring the initial checkpoint state. + +#### Returns + +`void` + +#### Defined in + +[verkleTree.ts:504](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L504) + +___ + +### fromProof + +▸ **fromProof**(`proof`): `Promise`<`void`\> + +Saves the nodes from a proof into the tree. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `proof` | [`Proof`](../README.md#proof) | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:374](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L374) + +___ + +### get + +▸ **get**(`key`, `throwIfMissing?`): `Promise`<``null`` \| `Uint8Array`\> + +Gets a value given a `key` + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `key` | `Uint8Array` | `undefined` | the key to search for | +| `throwIfMissing` | `boolean` | `false` | if true, throws if any nodes are missing. Used for verifying proofs. (default: false) | + +#### Returns + +`Promise`<``null`` \| `Uint8Array`\> + +A Promise that resolves to `Uint8Array` if a value was found or `null` if no value was found. + +#### Defined in + +[verkleTree.ts:139](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L139) + +___ + +### hasCheckpoints + +▸ **hasCheckpoints**(): `boolean` + +Is the tree during a checkpoint phase? + +#### Returns + +`boolean` + +#### Defined in + +[verkleTree.ts:457](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L457) + +___ + +### lookupNode + +▸ **lookupNode**(`node`): `Promise`<``null`` \| [`VerkleNode`](../README.md#verklenode)\> + +Retrieves a node from db by hash. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `node` | `Uint8Array` \| `Uint8Array`[] | + +#### Returns + +`Promise`<``null`` \| [`VerkleNode`](../README.md#verklenode)\> + +#### Defined in + +[verkleTree.ts:289](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L289) + +___ + +### persistRoot + +▸ **persistRoot**(): `Promise`<`void`\> + +Persists the root hash in the underlying database + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:438](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L438) + +___ + +### put + +▸ **put**(`key`, `value`): `Promise`<`void`\> + +Stores a given `value` at the given `key` or do a delete if `value` is empty +(delete operations are only executed on DB with `deleteFromDB` set to `true`) + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `Uint8Array` | the key to store the value at | +| `value` | `Uint8Array` | the value to store | + +#### Returns + +`Promise`<`void`\> + +A Promise that resolves once value is stored. + +#### Defined in + +[verkleTree.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L159) + +___ + +### revert + +▸ **revert**(): `Promise`<`void`\> + +Reverts the tree to the state it was at when `checkpoint` was first called. +If during a nested checkpoint, sets root to most recent checkpoint, and sets +parent checkpoint as current. + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:490](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L490) + +___ + +### root + +▸ **root**(`value?`): `Uint8Array` + +Gets and/or Sets the current root of the `tree` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `value?` | ``null`` \| `Uint8Array` | + +#### Returns + +`Uint8Array` + +#### Defined in + +[verkleTree.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L101) + +___ + +### saveStack + +▸ **saveStack**(`key`, `stack`, `opStack`): `Promise`<`void`\> + +Saves a stack of nodes to the database. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `key` | `Uint8Array` | the key. Should follow the stack | +| `stack` | [`VerkleNode`](../README.md#verklenode)[] | a stack of nodes to the value given by the key | +| `opStack` | `PutBatch`<`Uint8Array`, `Uint8Array`\>[] | a stack of levelup operations to commit at the end of this function | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[verkleTree.ts:326](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L326) + +___ + +### shallowCopy + +▸ **shallowCopy**(`includeCheckpoints?`): [`VerkleTree`](VerkleTree.md) + +Returns a copy of the underlying tree. + +Note on db: the copy will create a reference to the +same underlying database. + +Note on cache: for memory reasons a copy will not +recreate a new LRU cache but initialize with cache +being deactivated. + +#### Parameters + +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `includeCheckpoints` | `boolean` | `true` | If true and during a checkpoint, the copy will contain the checkpointing metadata and will use the same scratch as underlying db. | + +#### Returns + +[`VerkleTree`](VerkleTree.md) + +#### Defined in + +[verkleTree.ts:422](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L422) + +___ + +### verifyProof + +▸ **verifyProof**(`rootHash`, `key`, `proof`): `Promise`<``null`` \| `Uint8Array`\> + +Verifies a proof. + +**`Throws`** + +If proof is found to be invalid. + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `rootHash` | `Uint8Array` | +| `key` | `Uint8Array` | +| `proof` | [`Proof`](../README.md#proof) | + +#### Returns + +`Promise`<``null`` \| `Uint8Array`\> + +The value from the key, or null if valid proof of non-existence. + +#### Defined in + +[verkleTree.ts:394](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L394) + +___ + +### walkTree + +▸ **walkTree**(`root`, `onFound`): `Promise`<`void`\> + +Walks a tree until finished. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `root` | `Uint8Array` | | +| `onFound` | [`FoundNodeFunction`](../README.md#foundnodefunction) | callback to call when a node is found. This schedules new tasks. If no tasks are available, the Promise resolves. | + +#### Returns + +`Promise`<`void`\> + +Resolves when finished walking tree. + +#### Defined in + +[verkleTree.ts:258](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L258) + +___ + +### create + +▸ `Static` **create**(`opts?`): `Promise`<[`VerkleTree`](VerkleTree.md)\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `opts?` | [`VerkleTreeOpts`](../interfaces/VerkleTreeOpts.md) | + +#### Returns + +`Promise`<[`VerkleTree`](VerkleTree.md)\> + +#### Defined in + +[verkleTree.ts:66](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/verkleTree.ts#L66) diff --git a/packages/verkle/docs/classes/WalkController.md b/packages/verkle/docs/classes/WalkController.md new file mode 100644 index 0000000000..c7b248f0fd --- /dev/null +++ b/packages/verkle/docs/classes/WalkController.md @@ -0,0 +1,147 @@ +[@ethereumjs/verkle](../README.md) / WalkController + +# Class: WalkController + +WalkController is an interface to control how the tree is being traversed. + +## Table of contents + +### Properties + +- [onNode](WalkController.md#onnode) +- [taskExecutor](WalkController.md#taskexecutor) +- [tree](WalkController.md#tree) + +### Methods + +- [allChildren](WalkController.md#allchildren) +- [pushChildrenAtIndex](WalkController.md#pushchildrenatindex) +- [pushNodeToQueue](WalkController.md#pushnodetoqueue) +- [newWalk](WalkController.md#newwalk) + +## Properties + +### onNode + +• `Readonly` **onNode**: [`FoundNodeFunction`](../README.md#foundnodefunction) + +#### Defined in + +[util/walkController.ts:13](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L13) + +___ + +### taskExecutor + +• `Readonly` **taskExecutor**: [`PrioritizedTaskExecutor`](PrioritizedTaskExecutor.md) + +#### Defined in + +[util/walkController.ts:14](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L14) + +___ + +### tree + +• `Readonly` **tree**: [`VerkleTree`](VerkleTree.md) + +#### Defined in + +[util/walkController.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L15) + +## Methods + +### allChildren + +▸ **allChildren**(`node`, `key?`): `void` + +Run all children of a node. Priority of these nodes are the key length of the children. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `node` | [`VerkleNode`](../README.md#verklenode) | Node to retrieve all children from of and call onNode on. | +| `key` | `Uint8Array` | The current `key` which would yield the `node` when trying to get this node with a `get` operation. | + +#### Returns + +`void` + +#### Defined in + +[util/walkController.ts:70](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L70) + +___ + +### pushChildrenAtIndex + +▸ **pushChildrenAtIndex**(`node`, `key?`, `childIndex`, `priority?`): `void` + +Push the child of an internal node to the event queue. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `node` | [`InternalNode`](InternalNode.md) | The node to select a children from. Should be an InternalNode. | +| `key` | `Uint8Array` | The current key which leads to the corresponding node. | +| `childIndex` | `number` | The child index to add to the event queue. | +| `priority?` | `number` | Optional priority of the event, defaults to the total key length. | + +#### Returns + +`void` + +#### Defined in + +[util/walkController.ts:117](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L117) + +___ + +### pushNodeToQueue + +▸ **pushNodeToQueue**(`nodeRef`, `key?`, `priority?`): `void` + +Push a node to the queue. If the queue has places left for tasks, the node is executed immediately, otherwise it is queued. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `nodeRef` | `Uint8Array` | Push a node reference to the event queue. This reference is a 32-byte keccak hash of the value corresponding to the `key`. | +| `key` | `Uint8Array` | The current key. | +| `priority?` | `number` | Optional priority, defaults to key length | + +#### Returns + +`void` + +#### Defined in + +[util/walkController.ts:94](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L94) + +___ + +### newWalk + +▸ `Static` **newWalk**(`onNode`, `tree`, `root`, `poolSize?`): `Promise`<`void`\> + +Async function to create and start a new walk over a tree. + +#### Parameters + +| Name | Type | Description | +| :------ | :------ | :------ | +| `onNode` | [`FoundNodeFunction`](../README.md#foundnodefunction) | The `FoundNodeFunction to call if a node is found. | +| `tree` | [`VerkleTree`](VerkleTree.md) | The tree to walk on. | +| `root` | `Uint8Array` | The root key to walk on. | +| `poolSize?` | `number` | Task execution pool size to prevent OOM errors. Defaults to 500. | + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[util/walkController.ts:40](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/util/walkController.ts#L40) diff --git a/packages/verkle/docs/enums/VerkleNodeType.md b/packages/verkle/docs/enums/VerkleNodeType.md new file mode 100644 index 0000000000..abe82c0976 --- /dev/null +++ b/packages/verkle/docs/enums/VerkleNodeType.md @@ -0,0 +1,30 @@ +[@ethereumjs/verkle](../README.md) / VerkleNodeType + +# Enumeration: VerkleNodeType + +## Table of contents + +### Enumeration Members + +- [Internal](VerkleNodeType.md#internal) +- [Leaf](VerkleNodeType.md#leaf) + +## Enumeration Members + +### Internal + +• **Internal** = ``0`` + +#### Defined in + +[node/types.ts:6](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L6) + +___ + +### Leaf + +• **Leaf** = ``1`` + +#### Defined in + +[node/types.ts:7](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L7) diff --git a/packages/verkle/docs/interfaces/CheckpointDBOpts.md b/packages/verkle/docs/interfaces/CheckpointDBOpts.md new file mode 100644 index 0000000000..967fe434eb --- /dev/null +++ b/packages/verkle/docs/interfaces/CheckpointDBOpts.md @@ -0,0 +1,34 @@ +[@ethereumjs/verkle](../README.md) / CheckpointDBOpts + +# Interface: CheckpointDBOpts + +## Table of contents + +### Properties + +- [cacheSize](CheckpointDBOpts.md#cachesize) +- [db](CheckpointDBOpts.md#db) + +## Properties + +### cacheSize + +• `Optional` **cacheSize**: `number` + +Cache size (default: 0) + +#### Defined in + +[types.ts:101](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L101) + +___ + +### db + +• **db**: `DB`<`Uint8Array`, `Uint8Array`\> + +A database instance. + +#### Defined in + +[types.ts:96](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L96) diff --git a/packages/verkle/docs/interfaces/Fr.md b/packages/verkle/docs/interfaces/Fr.md new file mode 100644 index 0000000000..2e57edb488 --- /dev/null +++ b/packages/verkle/docs/interfaces/Fr.md @@ -0,0 +1,3 @@ +[@ethereumjs/verkle](../README.md) / Fr + +# Interface: Fr diff --git a/packages/verkle/docs/interfaces/Point.md b/packages/verkle/docs/interfaces/Point.md new file mode 100644 index 0000000000..50109e8a42 --- /dev/null +++ b/packages/verkle/docs/interfaces/Point.md @@ -0,0 +1,300 @@ +[@ethereumjs/verkle](../README.md) / Point + +# Interface: Point + +## Table of contents + +### Methods + +- [add](Point.md#add) +- [bytes](Point.md#bytes) +- [bytesUncompressed](Point.md#bytesuncompressed) +- [double](Point.md#double) +- [equal](Point.md#equal) +- [isOnCurve](Point.md#isoncurve) +- [mapToBaseField](Point.md#maptobasefield) +- [mapToScalarField](Point.md#maptoscalarfield) +- [neg](Point.md#neg) +- [normalise](Point.md#normalise) +- [scalarMul](Point.md#scalarmul) +- [set](Point.md#set) +- [setBytes](Point.md#setbytes) +- [setBytesUncompressed](Point.md#setbytesuncompressed) +- [setIdentity](Point.md#setidentity) +- [sub](Point.md#sub) + +## Methods + +### add + +▸ **add**(`point1`, `point2`): [`Point`](Point.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `point1` | [`Point`](Point.md) | +| `point2` | [`Point`](Point.md) | + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:41](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L41) + +___ + +### bytes + +▸ **bytes**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Defined in + +[types.ts:13](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L13) + +___ + +### bytesUncompressed + +▸ **bytesUncompressed**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Defined in + +[types.ts:15](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L15) + +___ + +### double + +▸ **double**(`point1`): [`Point`](Point.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `point1` | [`Point`](Point.md) | + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:38](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L38) + +___ + +### equal + +▸ **equal**(`secondPoint`): `boolean` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `secondPoint` | [`Point`](Point.md) | + +#### Returns + +`boolean` + +#### Defined in + +[types.ts:32](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L32) + +___ + +### isOnCurve + +▸ **isOnCurve**(): `boolean` + +#### Returns + +`boolean` + +#### Defined in + +[types.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L47) + +___ + +### mapToBaseField + +▸ **mapToBaseField**(): [`Point`](Point.md) + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:26](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L26) + +___ + +### mapToScalarField + +▸ **mapToScalarField**(`field`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `field` | [`Fr`](Fr.md) | + +#### Returns + +`void` + +#### Defined in + +[types.ts:29](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L29) + +___ + +### neg + +▸ **neg**(): [`Point`](Point.md) + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:55](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L55) + +___ + +### normalise + +▸ **normalise**(): `void` + +#### Returns + +`void` + +#### Defined in + +[types.ts:49](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L49) + +___ + +### scalarMul + +▸ **scalarMul**(`point1`, `scalarMont`): [`Point`](Point.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `point1` | [`Point`](Point.md) | +| `scalarMont` | [`Fr`](Fr.md) | + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:58](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L58) + +___ + +### set + +▸ **set**(): [`Point`](Point.md) + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L52) + +___ + +### setBytes + +▸ **setBytes**(`bytes`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bytes` | `Uint8Array` | + +#### Returns + +`void` + +#### Defined in + +[types.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L20) + +___ + +### setBytesUncompressed + +▸ **setBytesUncompressed**(`bytes`, `trusted`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `bytes` | `Uint8Array` | +| `trusted` | `boolean` | + +#### Returns + +`void` + +#### Defined in + +[types.ts:23](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L23) + +___ + +### setIdentity + +▸ **setIdentity**(): [`Point`](Point.md) + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L35) + +___ + +### sub + +▸ **sub**(`point1`, `point2`): [`Point`](Point.md) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `point1` | [`Point`](Point.md) | +| `point2` | [`Point`](Point.md) | + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[types.ts:44](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L44) diff --git a/packages/verkle/docs/interfaces/TypedVerkleNode.md b/packages/verkle/docs/interfaces/TypedVerkleNode.md new file mode 100644 index 0000000000..ffa0e038e8 --- /dev/null +++ b/packages/verkle/docs/interfaces/TypedVerkleNode.md @@ -0,0 +1,30 @@ +[@ethereumjs/verkle](../README.md) / TypedVerkleNode + +# Interface: TypedVerkleNode + +## Table of contents + +### Properties + +- [0](TypedVerkleNode.md#0) +- [1](TypedVerkleNode.md#1) + +## Properties + +### 0 + +• **0**: [`InternalNode`](../classes/InternalNode.md) + +#### Defined in + +[node/types.ts:11](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L11) + +___ + +### 1 + +• **1**: [`LeafNode`](../classes/LeafNode.md) + +#### Defined in + +[node/types.ts:12](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L12) diff --git a/packages/verkle/docs/interfaces/VerkleNodeInterface.md b/packages/verkle/docs/interfaces/VerkleNodeInterface.md new file mode 100644 index 0000000000..925a518045 --- /dev/null +++ b/packages/verkle/docs/interfaces/VerkleNodeInterface.md @@ -0,0 +1,57 @@ +[@ethereumjs/verkle](../README.md) / VerkleNodeInterface + +# Interface: VerkleNodeInterface + +## Implemented by + +- [`BaseVerkleNode`](../classes/BaseVerkleNode.md) + +## Table of contents + +### Methods + +- [commit](VerkleNodeInterface.md#commit) +- [hash](VerkleNodeInterface.md#hash) +- [serialize](VerkleNodeInterface.md#serialize) + +## Methods + +### commit + +▸ **commit**(): [`Point`](Point.md) + +#### Returns + +[`Point`](Point.md) + +#### Defined in + +[node/types.ts:18](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L18) + +___ + +### hash + +▸ **hash**(): `any` + +#### Returns + +`any` + +#### Defined in + +[node/types.ts:19](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L19) + +___ + +### serialize + +▸ **serialize**(): `Uint8Array` + +#### Returns + +`Uint8Array` + +#### Defined in + +[node/types.ts:20](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L20) diff --git a/packages/verkle/docs/interfaces/VerkleNodeOptions.md b/packages/verkle/docs/interfaces/VerkleNodeOptions.md new file mode 100644 index 0000000000..070465d870 --- /dev/null +++ b/packages/verkle/docs/interfaces/VerkleNodeOptions.md @@ -0,0 +1,30 @@ +[@ethereumjs/verkle](../README.md) / VerkleNodeOptions + +# Interface: VerkleNodeOptions + +## Table of contents + +### Properties + +- [0](VerkleNodeOptions.md#0) +- [1](VerkleNodeOptions.md#1) + +## Properties + +### 0 + +• **0**: `VerkleInternalNodeOptions` + +#### Defined in + +[node/types.ts:45](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L45) + +___ + +### 1 + +• **1**: `VerkleLeafNodeOptions` + +#### Defined in + +[node/types.ts:46](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/node/types.ts#L46) diff --git a/packages/verkle/docs/interfaces/VerkleTreeOpts.md b/packages/verkle/docs/interfaces/VerkleTreeOpts.md new file mode 100644 index 0000000000..2983d0edc0 --- /dev/null +++ b/packages/verkle/docs/interfaces/VerkleTreeOpts.md @@ -0,0 +1,62 @@ +[@ethereumjs/verkle](../README.md) / VerkleTreeOpts + +# Interface: VerkleTreeOpts + +## Table of contents + +### Properties + +- [cacheSize](VerkleTreeOpts.md#cachesize) +- [db](VerkleTreeOpts.md#db) +- [root](VerkleTreeOpts.md#root) +- [useRootPersistence](VerkleTreeOpts.md#userootpersistence) + +## Properties + +### cacheSize + +• `Optional` **cacheSize**: `number` + +LRU cache for tree nodes to allow for faster node retrieval. + +Default: 0 (deactivated) + +#### Defined in + +[types.ts:84](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L84) + +___ + +### db + +• `Optional` **db**: `DB`<`Uint8Array`, `Uint8Array`\> + +A database instance. + +#### Defined in + +[types.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L67) + +___ + +### root + +• `Optional` **root**: `Uint8Array` + +A `Uint8Array` for the root of a previously stored tree + +#### Defined in + +[types.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L72) + +___ + +### useRootPersistence + +• `Optional` **useRootPersistence**: `boolean` + +Store the root inside the database after every `write` operation + +#### Defined in + +[types.ts:77](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/verkle/src/types.ts#L77) diff --git a/packages/verkle/package.json b/packages/verkle/package.json index 4e3e26da39..2a7e028bc4 100644 --- a/packages/verkle/package.json +++ b/packages/verkle/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/verkle", - "version": "0.0.1", + "version": "0.0.2", "description": "Implementation of verkle trees as used in Ethereum.", "keywords": [ "verkle", @@ -51,9 +51,9 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/rlp": "5.0.2", - "@ethereumjs/util": "9.0.2", - "lru-cache": "10.1.0", + "@ethereumjs/rlp": "^5.0.2", + "@ethereumjs/util": "^9.0.3", + "lru-cache": "^10.0.0", "rust-verkle-wasm": "^0.0.1" }, "engines": { diff --git a/packages/vm/CHANGELOG.md b/packages/vm/CHANGELOG.md index 6007f4912f..6877c0d6aa 100644 --- a/packages/vm/CHANGELOG.md +++ b/packages/vm/CHANGELOG.md @@ -6,6 +6,67 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 8.0.0 - 2024-03-05 + +### New EVM.create() Async Static Constructor / Mandatory VM.create() Constructor + +This is an in-between breaking release on both the EVM and VM packages due to a problematic top level await() discovery in the underlying `rustbn-wasm` library (see issue [#10](https://github.com/ethereumjs/rustbn-wasm/issues/10)) generally affecting the compatiblity of our libraries. + +The `EVM` direct constructor initialization with `new EVM()` now has been deprecated and replaced by an async static `create()` constructor, as it is already done in various other libraries in the EthereumJS monorepo, see PRs [#3304](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3304/) and [#3315](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3315). If you pass in a custom `EVM` along your `VM` initialization you **need to update your EVM initialization**. + +An EVM is now initialized like the following: + +```ts +import { hexToBytes } from '@ethereumjs/util' +import { EVM } from '@ethereumjs/evm' + +const evm = await EVM.create() +const res = await evm.runCode({ code: hexToBytes('0x6001') }) +``` + +For the `VM` there has been an async `create()` constructor before already and the main constructor was labelled as `deprecated`. While this main constructor was still working before, along with these releases **the main VM constructor is now "fully out of order" and VM initialization solely work with the async `create()` constructor**. + +Beyond solving this specific problem this generally allows for a cleaner and async-complete initialization of underlying libraries and is more future proof towards eventual upcoming async initialization additions. + +### 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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3294) and [#3296](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3296)! 🎉 + +Our WASM wizard @acolytec3 has spent the last two weeks and created a WASM build of the [c-kzg](https://github.com/benjaminion/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](https://github.com/ethereumjs/kzg-wasm) 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](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/tx/README.md#kzg-initialization) 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): + +```typescript +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](https://ceremony.ethereum.org/) (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](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3280). This bug has been fixed along with these releases and this library now references the updated trie library version. + +### Other Changes + +- Support for Preimage generation (verkle-related, experimental), new `reportPreimages` `VM.runTx()` option, PR [#3143](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3143) and [#3298](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3298) +- Early support for [EIP-2935](https://eips.ethereum.org/EIPS/eip-2935) - "Save historical block hashes in state" (Verkle related, likely subject to change), PRs [#3268](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3268) and [#3327](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3327) + ## 7.2.1 - 2024-02-08 - 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) diff --git a/packages/vm/README.md b/packages/vm/README.md index a6cb815537..814a0422c4 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -26,7 +26,7 @@ To obtain the latest version, simply require the project using `npm`: npm install @ethereumjs/vm ``` -**Note:** If you want to work with `EIP-4844` related functionality, you will have additional manual installation steps for the **KZG setup**, see related section below. +**Note:** Starting with the Dencun hardfork `EIP-4844` related functionality will become an integrated part of the EVM functionality with the activation of the point evaluation precompile. It is therefore strongly recommended to _always_ run the EVM with a KZG library installed and initialized, see [KZG Setup](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/tx/README.md#kzg-setup) for instructions. ## Usage @@ -60,7 +60,9 @@ const main = async () => { main() ``` -Note that there is an additional API method `VM.runBlock()` which allows to run the whole block and execute all included transactions along. +Additionally to the `VM.runTx()` method there is an API method `VM.runBlock()` which allows to run the whole block and execute all included transactions along. + +Note: with the switch from v7 to v8 the old direct `new VM()` constructor usage has been fully deprecated and a `VM` can now solely be instantiated with the async static `VM.create()` constructor. This also goes for the underlying `EVM` if you use a custom `EVM`. ### Building a Block @@ -312,9 +314,9 @@ main() For a list with supported EIPs see the [@ethereumjs/evm](https://github.com/ethereumjs/ethereumjs-monorepo/tree/master/packages/evm) documentation. -### EIP-4844 Shard Blob Transactions Support (experimental) +### EIP-4844 Shard Blob Transactions Support -This library supports an experimental version of the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) as being specified in the [01d3209](https://github.com/ethereum/EIPs/commit/01d320998d1d53d95f347b5f43feaf606f230703) EIP version from February 8, 2023 and deployed along `eip4844-devnet-4` (January 2023) starting with `v1.3.0`. +This library supports the blob transaction type introduced with [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844). #### Initialization diff --git a/packages/vm/docs/README.md b/packages/vm/docs/README.md index f6be667764..457d77a246 100644 --- a/packages/vm/docs/README.md +++ b/packages/vm/docs/README.md @@ -17,6 +17,7 @@ - [AfterBlockEvent](interfaces/AfterBlockEvent.md) - [AfterTxEvent](interfaces/AfterTxEvent.md) +- [ApplyBlockResult](interfaces/ApplyBlockResult.md) - [BaseTxReceipt](interfaces/BaseTxReceipt.md) - [BuildBlockOpts](interfaces/BuildBlockOpts.md) - [BuilderOpts](interfaces/BuilderOpts.md) @@ -124,4 +125,4 @@ Returns the encoded tx receipt. #### Defined in -[vm/src/runBlock.ts:592](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/runBlock.ts#L592) +[vm/src/runBlock.ts:689](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/runBlock.ts#L689) diff --git a/packages/vm/docs/classes/BlockBuilder.md b/packages/vm/docs/classes/BlockBuilder.md index b9de5da931..a5f41a6d0f 100644 --- a/packages/vm/docs/classes/BlockBuilder.md +++ b/packages/vm/docs/classes/BlockBuilder.md @@ -44,7 +44,7 @@ #### Defined in -[vm/src/buildBlock.ts:75](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L75) +[vm/src/buildBlock.ts:76](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L76) ## Properties @@ -56,7 +56,7 @@ The cumulative blob gas used by the blobs in a block #### Defined in -[vm/src/buildBlock.ts:51](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L51) +[vm/src/buildBlock.ts:52](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L52) ___ @@ -68,7 +68,7 @@ The cumulative gas used by the transactions added to the block. #### Defined in -[vm/src/buildBlock.ts:47](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L47) +[vm/src/buildBlock.ts:48](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L48) ## Accessors @@ -82,7 +82,7 @@ The cumulative gas used by the transactions added to the block. #### Defined in -[vm/src/buildBlock.ts:71](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L71) +[vm/src/buildBlock.ts:72](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L72) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[vm/src/buildBlock.ts:67](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L67) +[vm/src/buildBlock.ts:68](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L68) ## Methods @@ -123,7 +123,7 @@ the remaining gas in the block. #### Defined in -[vm/src/buildBlock.ts:202](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L202) +[vm/src/buildBlock.ts:203](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L203) ___ @@ -153,7 +153,7 @@ as the signer will be awarded the txs amount spent on gas as they are added. #### Defined in -[vm/src/buildBlock.ts:292](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L292) +[vm/src/buildBlock.ts:293](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L293) ___ @@ -167,7 +167,7 @@ ___ #### Defined in -[vm/src/buildBlock.ts:127](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L127) +[vm/src/buildBlock.ts:128](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L128) ___ @@ -181,7 +181,7 @@ ___ #### Defined in -[vm/src/buildBlock.ts:356](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L356) +[vm/src/buildBlock.ts:357](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L357) ___ @@ -197,7 +197,7 @@ Calculates and returns the logs bloom for the block. #### Defined in -[vm/src/buildBlock.ts:141](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L141) +[vm/src/buildBlock.ts:142](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L142) ___ @@ -213,7 +213,7 @@ Calculates and returns the receiptTrie for the block. #### Defined in -[vm/src/buildBlock.ts:153](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L153) +[vm/src/buildBlock.ts:154](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L154) ___ @@ -229,7 +229,7 @@ Reverts the checkpoint on the StateManager to reset the state from any transacti #### Defined in -[vm/src/buildBlock.ts:273](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L273) +[vm/src/buildBlock.ts:274](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L274) ___ @@ -245,4 +245,4 @@ Calculates and returns the transactionsTrie for the block. #### Defined in -[vm/src/buildBlock.ts:134](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L134) +[vm/src/buildBlock.ts:135](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L135) diff --git a/packages/vm/docs/classes/VM.md b/packages/vm/docs/classes/VM.md index 35bac65e4f..75a7725c36 100644 --- a/packages/vm/docs/classes/VM.md +++ b/packages/vm/docs/classes/VM.md @@ -21,7 +21,6 @@ This class is an AsyncEventEmitter, please consult the README to learn how to us - [buildBlock](VM.md#buildblock) - [errorStr](VM.md#errorstr) -- [init](VM.md#init) - [runBlock](VM.md#runblock) - [runTx](VM.md#runtx) - [shallowCopy](VM.md#shallowcopy) @@ -113,7 +112,7 @@ An instance of [BlockBuilder](BlockBuilder.md) with methods: #### Defined in -[vm/src/vm.ts:235](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L235) +[vm/src/vm.ts:222](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L222) ___ @@ -129,28 +128,7 @@ Return a compact error string representation of the object #### Defined in -[vm/src/vm.ts:277](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L277) - -___ - -### init - -▸ **init**(`__namedParameters?`): `Promise`<`void`\> - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `__namedParameters` | `Object` | -| `__namedParameters.genesisState?` | `GenesisState` | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -[vm/src/vm.ts:159](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L159) +[vm/src/vm.ts:264](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L264) ___ @@ -176,7 +154,7 @@ invalid. If an error is thrown from an event handler, the state may or may not b #### Defined in -[vm/src/vm.ts:204](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L204) +[vm/src/vm.ts:191](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L191) ___ @@ -202,7 +180,7 @@ reverted. #### Defined in -[vm/src/vm.ts:217](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L217) +[vm/src/vm.ts:204](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L204) ___ @@ -232,7 +210,7 @@ the `downlevelCaches` option to `false`. #### Defined in -[vm/src/vm.ts:252](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L252) +[vm/src/vm.ts:239](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/vm.ts#L239) ___ diff --git a/packages/vm/docs/enums/BuildStatus.md b/packages/vm/docs/enums/BuildStatus.md index bf6821718a..0dbc4cacb0 100644 --- a/packages/vm/docs/enums/BuildStatus.md +++ b/packages/vm/docs/enums/BuildStatus.md @@ -18,7 +18,7 @@ #### Defined in -[vm/src/buildBlock.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L35) +[vm/src/buildBlock.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L36) ___ @@ -28,7 +28,7 @@ ___ #### Defined in -[vm/src/buildBlock.ts:36](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L36) +[vm/src/buildBlock.ts:37](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L37) ___ @@ -38,4 +38,4 @@ ___ #### Defined in -[vm/src/buildBlock.ts:34](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L34) +[vm/src/buildBlock.ts:35](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/buildBlock.ts#L35) diff --git a/packages/vm/docs/interfaces/AfterBlockEvent.md b/packages/vm/docs/interfaces/AfterBlockEvent.md index 33d933f8d1..3ac5f6475e 100644 --- a/packages/vm/docs/interfaces/AfterBlockEvent.md +++ b/packages/vm/docs/interfaces/AfterBlockEvent.md @@ -17,6 +17,7 @@ Result of runBlock - [block](AfterBlockEvent.md#block) - [gasUsed](AfterBlockEvent.md#gasused) - [logsBloom](AfterBlockEvent.md#logsbloom) +- [preimages](AfterBlockEvent.md#preimages) - [receipts](AfterBlockEvent.md#receipts) - [receiptsRoot](AfterBlockEvent.md#receiptsroot) - [results](AfterBlockEvent.md#results) @@ -30,7 +31,7 @@ Result of runBlock #### Defined in -[vm/src/types.ts:311](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L311) +[vm/src/types.ts:331](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L331) ___ @@ -46,7 +47,7 @@ The gas used after executing the block #### Defined in -[vm/src/types.ts:298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L298) +[vm/src/types.ts:296](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L296) ___ @@ -62,7 +63,23 @@ The bloom filter of the LOGs (events) after executing the block #### Defined in -[vm/src/types.ts:302](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L302) +[vm/src/types.ts:326](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L326) + +___ + +### preimages + +• `Optional` **preimages**: `Map`<`string`, `Uint8Array`\> + +Preimages mapping of the touched accounts from the block (see reportPreimages option) + +#### Inherited from + +[RunBlockResult](RunBlockResult.md).[preimages](RunBlockResult.md#preimages) + +#### Defined in + +[vm/src/types.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L312) ___ @@ -78,7 +95,7 @@ Receipts generated for transactions in the block #### Defined in -[vm/src/types.ts:286](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L286) +[vm/src/types.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L304) ___ @@ -94,7 +111,7 @@ The receipt root after executing the block #### Defined in -[vm/src/types.ts:306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L306) +[vm/src/types.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L300) ___ @@ -110,7 +127,7 @@ Results of executing the transactions in the block #### Defined in -[vm/src/types.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L290) +[vm/src/types.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L308) ___ @@ -126,4 +143,4 @@ The stateRoot after executing the block #### Defined in -[vm/src/types.ts:294](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L294) +[vm/src/types.ts:322](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L322) diff --git a/packages/vm/docs/interfaces/AfterTxEvent.md b/packages/vm/docs/interfaces/AfterTxEvent.md index 8461ba3a8b..30f5293563 100644 --- a/packages/vm/docs/interfaces/AfterTxEvent.md +++ b/packages/vm/docs/interfaces/AfterTxEvent.md @@ -22,6 +22,7 @@ Execution result of a transaction - [execResult](AfterTxEvent.md#execresult) - [gasRefund](AfterTxEvent.md#gasrefund) - [minerValue](AfterTxEvent.md#minervalue) +- [preimages](AfterTxEvent.md#preimages) - [receipt](AfterTxEvent.md#receipt) - [totalGasSpent](AfterTxEvent.md#totalgasspent) - [transaction](AfterTxEvent.md#transaction) @@ -40,7 +41,7 @@ EIP-2930 access list generated for the tx (see `reportAccessList` option) #### Defined in -[vm/src/types.ts:400](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L400) +[vm/src/types.ts:427](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L427) ___ @@ -56,7 +57,7 @@ The amount of ether used by this transaction #### Defined in -[vm/src/types.ts:378](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L378) +[vm/src/types.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L405) ___ @@ -72,7 +73,7 @@ This is the blob gas units times the fee per blob gas for 4844 transactions #### Defined in -[vm/src/types.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L410) +[vm/src/types.ts:442](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L442) ___ @@ -88,7 +89,7 @@ Bloom filter resulted from transaction #### Defined in -[vm/src/types.ts:373](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L373) +[vm/src/types.ts:400](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L400) ___ @@ -104,7 +105,7 @@ Address of created account during transaction, if any #### Defined in -evm/dist/cjs/types.d.ts:245 +evm/dist/cjs/types.d.ts:248 ___ @@ -120,7 +121,7 @@ Contains the results from running the code, if any, as described in runCode #### Defined in -evm/dist/cjs/types.d.ts:249 +evm/dist/cjs/types.d.ts:252 ___ @@ -136,7 +137,7 @@ The amount of gas as that was refunded during the transaction (i.e. `gasUsed = t #### Defined in -[vm/src/types.ts:395](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L395) +[vm/src/types.ts:422](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L422) ___ @@ -152,7 +153,23 @@ The value that accrues to the miner by this transaction #### Defined in -[vm/src/types.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L405) +[vm/src/types.ts:437](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L437) + +___ + +### preimages + +• `Optional` **preimages**: `Map`<`string`, `Uint8Array`\> + +Preimages mapping of the touched accounts from the tx (see `reportPreimages` option) + +#### Inherited from + +[RunTxResult](RunTxResult.md).[preimages](RunTxResult.md#preimages) + +#### Defined in + +[vm/src/types.ts:432](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L432) ___ @@ -168,7 +185,7 @@ The tx receipt #### Defined in -[vm/src/types.ts:383](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L383) +[vm/src/types.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L410) ___ @@ -186,7 +203,7 @@ which consists of calldata cost, intrinsic cost and optionally the access list c #### Defined in -[vm/src/types.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L390) +[vm/src/types.ts:417](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L417) ___ @@ -198,4 +215,4 @@ The transaction which just got finished #### Defined in -[vm/src/types.ts:417](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L417) +[vm/src/types.ts:449](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L449) diff --git a/packages/vm/docs/interfaces/ApplyBlockResult.md b/packages/vm/docs/interfaces/ApplyBlockResult.md new file mode 100644 index 0000000000..5e31ef993f --- /dev/null +++ b/packages/vm/docs/interfaces/ApplyBlockResult.md @@ -0,0 +1,88 @@ +[@ethereumjs/vm](../README.md) / ApplyBlockResult + +# Interface: ApplyBlockResult + +Result of applyBlock + +## Table of contents + +### Properties + +- [bloom](ApplyBlockResult.md#bloom) +- [gasUsed](ApplyBlockResult.md#gasused) +- [preimages](ApplyBlockResult.md#preimages) +- [receipts](ApplyBlockResult.md#receipts) +- [receiptsRoot](ApplyBlockResult.md#receiptsroot) +- [results](ApplyBlockResult.md#results) + +## Properties + +### bloom + +• **bloom**: `Bloom` + +The Bloom filter + +#### Defined in + +[vm/src/types.ts:292](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L292) + +___ + +### gasUsed + +• **gasUsed**: `bigint` + +The gas used after executing the block + +#### Defined in + +[vm/src/types.ts:296](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L296) + +___ + +### preimages + +• `Optional` **preimages**: `Map`<`string`, `Uint8Array`\> + +Preimages mapping of the touched accounts from the block (see reportPreimages option) + +#### Defined in + +[vm/src/types.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L312) + +___ + +### receipts + +• **receipts**: [`TxReceipt`](../README.md#txreceipt)[] + +Receipts generated for transactions in the block + +#### Defined in + +[vm/src/types.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L304) + +___ + +### receiptsRoot + +• **receiptsRoot**: `Uint8Array` + +The receipt root after executing the block + +#### Defined in + +[vm/src/types.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L300) + +___ + +### results + +• **results**: [`RunTxResult`](RunTxResult.md)[] + +Results of executing the transactions in the block + +#### Defined in + +[vm/src/types.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L308) diff --git a/packages/vm/docs/interfaces/RunBlockOpts.md b/packages/vm/docs/interfaces/RunBlockOpts.md index bf4b9f679b..0c8ac173b3 100644 --- a/packages/vm/docs/interfaces/RunBlockOpts.md +++ b/packages/vm/docs/interfaces/RunBlockOpts.md @@ -11,6 +11,7 @@ Options for running a block. - [block](RunBlockOpts.md#block) - [clearCache](RunBlockOpts.md#clearcache) - [generate](RunBlockOpts.md#generate) +- [reportPreimages](RunBlockOpts.md#reportpreimages) - [root](RunBlockOpts.md#root) - [setHardfork](RunBlockOpts.md#sethardfork) - [skipBalance](RunBlockOpts.md#skipbalance) @@ -64,6 +65,19 @@ Defaults to `false`. ___ +### reportPreimages + +• `Optional` **reportPreimages**: `boolean` + +If true, adds a hashedKey -> preimages mapping of all touched accounts +to the `RunTxResult` returned. + +#### Defined in + +[vm/src/types.ts:282](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L282) + +___ + ### root • `Optional` **root**: `Uint8Array` diff --git a/packages/vm/docs/interfaces/RunBlockResult.md b/packages/vm/docs/interfaces/RunBlockResult.md index 718242b70c..80896213e9 100644 --- a/packages/vm/docs/interfaces/RunBlockResult.md +++ b/packages/vm/docs/interfaces/RunBlockResult.md @@ -6,9 +6,11 @@ Result of runBlock ## Hierarchy -- **`RunBlockResult`** +- `Omit`<[`ApplyBlockResult`](ApplyBlockResult.md), ``"bloom"``\> - ↳ [`AfterBlockEvent`](AfterBlockEvent.md) + ↳ **`RunBlockResult`** + + ↳↳ [`AfterBlockEvent`](AfterBlockEvent.md) ## Table of contents @@ -16,6 +18,7 @@ Result of runBlock - [gasUsed](RunBlockResult.md#gasused) - [logsBloom](RunBlockResult.md#logsbloom) +- [preimages](RunBlockResult.md#preimages) - [receipts](RunBlockResult.md#receipts) - [receiptsRoot](RunBlockResult.md#receiptsroot) - [results](RunBlockResult.md#results) @@ -29,9 +32,13 @@ Result of runBlock The gas used after executing the block +#### Inherited from + +Omit.gasUsed + #### Defined in -[vm/src/types.ts:298](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L298) +[vm/src/types.ts:296](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L296) ___ @@ -43,7 +50,23 @@ The bloom filter of the LOGs (events) after executing the block #### Defined in -[vm/src/types.ts:302](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L302) +[vm/src/types.ts:326](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L326) + +___ + +### preimages + +• `Optional` **preimages**: `Map`<`string`, `Uint8Array`\> + +Preimages mapping of the touched accounts from the block (see reportPreimages option) + +#### Inherited from + +Omit.preimages + +#### Defined in + +[vm/src/types.ts:312](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L312) ___ @@ -53,9 +76,13 @@ ___ Receipts generated for transactions in the block +#### Inherited from + +Omit.receipts + #### Defined in -[vm/src/types.ts:286](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L286) +[vm/src/types.ts:304](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L304) ___ @@ -65,9 +92,13 @@ ___ The receipt root after executing the block +#### Inherited from + +Omit.receiptsRoot + #### Defined in -[vm/src/types.ts:306](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L306) +[vm/src/types.ts:300](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L300) ___ @@ -77,9 +108,13 @@ ___ Results of executing the transactions in the block +#### Inherited from + +Omit.results + #### Defined in -[vm/src/types.ts:290](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L290) +[vm/src/types.ts:308](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L308) ___ @@ -91,4 +126,4 @@ The stateRoot after executing the block #### Defined in -[vm/src/types.ts:294](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L294) +[vm/src/types.ts:322](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L322) diff --git a/packages/vm/docs/interfaces/RunTxOpts.md b/packages/vm/docs/interfaces/RunTxOpts.md index ce4ec7e7a9..9c9f4b3edc 100644 --- a/packages/vm/docs/interfaces/RunTxOpts.md +++ b/packages/vm/docs/interfaces/RunTxOpts.md @@ -11,6 +11,7 @@ Options for the `runTx` method. - [block](RunTxOpts.md#block) - [blockGasUsed](RunTxOpts.md#blockgasused) - [reportAccessList](RunTxOpts.md#reportaccesslist) +- [reportPreimages](RunTxOpts.md#reportpreimages) - [skipBalance](RunTxOpts.md#skipbalance) - [skipBlockGasLimitValidation](RunTxOpts.md#skipblockgaslimitvalidation) - [skipHardForkValidation](RunTxOpts.md#skiphardforkvalidation) @@ -28,7 +29,7 @@ If omitted, a default blank block will be used. #### Defined in -[vm/src/types.ts:322](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L322) +[vm/src/types.ts:342](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L342) ___ @@ -40,7 +41,7 @@ To obtain an accurate tx receipt input the block gas used up until this tx. #### Defined in -[vm/src/types.ts:363](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L363) +[vm/src/types.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L390) ___ @@ -59,7 +60,20 @@ StateManager.generateAccessList must be implemented. #### Defined in -[vm/src/types.ts:358](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L358) +[vm/src/types.ts:379](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L379) + +___ + +### reportPreimages + +• `Optional` **reportPreimages**: `boolean` + +If true, adds a hashedKey -> preimages mapping of all touched accounts +to the `RunTxResult` returned. + +#### Defined in + +[vm/src/types.ts:385](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L385) ___ @@ -71,7 +85,7 @@ Skip balance checks if true. Adds transaction cost to balance to ensure executio #### Defined in -[vm/src/types.ts:334](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L334) +[vm/src/types.ts:355](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L355) ___ @@ -84,7 +98,7 @@ against the block's gas limit. #### Defined in -[vm/src/types.ts:340](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L340) +[vm/src/types.ts:361](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L361) ___ @@ -97,7 +111,7 @@ and tx #### Defined in -[vm/src/types.ts:346](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L346) +[vm/src/types.ts:367](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L367) ___ @@ -109,7 +123,7 @@ If true, skips the nonce check #### Defined in -[vm/src/types.ts:330](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L330) +[vm/src/types.ts:350](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L350) ___ @@ -121,4 +135,4 @@ An `@ethereumjs/tx` to run #### Defined in -[vm/src/types.ts:326](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L326) +[vm/src/types.ts:346](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L346) diff --git a/packages/vm/docs/interfaces/RunTxResult.md b/packages/vm/docs/interfaces/RunTxResult.md index 03ae20a10f..aa6bdc146e 100644 --- a/packages/vm/docs/interfaces/RunTxResult.md +++ b/packages/vm/docs/interfaces/RunTxResult.md @@ -24,6 +24,7 @@ Execution result of a transaction - [execResult](RunTxResult.md#execresult) - [gasRefund](RunTxResult.md#gasrefund) - [minerValue](RunTxResult.md#minervalue) +- [preimages](RunTxResult.md#preimages) - [receipt](RunTxResult.md#receipt) - [totalGasSpent](RunTxResult.md#totalgasspent) @@ -37,7 +38,7 @@ EIP-2930 access list generated for the tx (see `reportAccessList` option) #### Defined in -[vm/src/types.ts:400](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L400) +[vm/src/types.ts:427](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L427) ___ @@ -49,7 +50,7 @@ The amount of ether used by this transaction #### Defined in -[vm/src/types.ts:378](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L378) +[vm/src/types.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L405) ___ @@ -61,7 +62,7 @@ This is the blob gas units times the fee per blob gas for 4844 transactions #### Defined in -[vm/src/types.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L410) +[vm/src/types.ts:442](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L442) ___ @@ -73,7 +74,7 @@ Bloom filter resulted from transaction #### Defined in -[vm/src/types.ts:373](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L373) +[vm/src/types.ts:400](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L400) ___ @@ -89,7 +90,7 @@ EVMResult.createdAddress #### Defined in -evm/dist/cjs/types.d.ts:245 +evm/dist/cjs/types.d.ts:248 ___ @@ -105,7 +106,7 @@ EVMResult.execResult #### Defined in -evm/dist/cjs/types.d.ts:249 +evm/dist/cjs/types.d.ts:252 ___ @@ -117,7 +118,7 @@ The amount of gas as that was refunded during the transaction (i.e. `gasUsed = t #### Defined in -[vm/src/types.ts:395](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L395) +[vm/src/types.ts:422](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L422) ___ @@ -129,7 +130,19 @@ The value that accrues to the miner by this transaction #### Defined in -[vm/src/types.ts:405](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L405) +[vm/src/types.ts:437](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L437) + +___ + +### preimages + +• `Optional` **preimages**: `Map`<`string`, `Uint8Array`\> + +Preimages mapping of the touched accounts from the tx (see `reportPreimages` option) + +#### Defined in + +[vm/src/types.ts:432](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L432) ___ @@ -141,7 +154,7 @@ The tx receipt #### Defined in -[vm/src/types.ts:383](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L383) +[vm/src/types.ts:410](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L410) ___ @@ -155,4 +168,4 @@ which consists of calldata cost, intrinsic cost and optionally the access list c #### Defined in -[vm/src/types.ts:390](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L390) +[vm/src/types.ts:417](https://github.com/ethereumjs/ethereumjs-monorepo/blob/master/packages/vm/src/types.ts#L417) diff --git a/packages/vm/package.json b/packages/vm/package.json index 16a54f3e57..2eeaa91157 100644 --- a/packages/vm/package.json +++ b/packages/vm/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/vm", - "version": "7.2.1", + "version": "8.0.0", "description": "An Ethereum VM implementation", "keywords": [ "ethereum", @@ -63,15 +63,15 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/block": "^5.1.1", - "@ethereumjs/blockchain": "^7.1.0", - "@ethereumjs/common": "^4.2.0", - "@ethereumjs/evm": "^2.2.1", + "@ethereumjs/block": "^5.2.0", + "@ethereumjs/blockchain": "^7.2.0", + "@ethereumjs/common": "^4.3.0", + "@ethereumjs/evm": "^3.0.0", "@ethereumjs/rlp": "^5.0.2", - "@ethereumjs/statemanager": "^2.2.2", - "@ethereumjs/trie": "^6.1.1", - "@ethereumjs/tx": "^5.2.1", - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/statemanager": "^2.3.0", + "@ethereumjs/trie": "^6.2.0", + "@ethereumjs/tx": "^5.3.0", + "@ethereumjs/util": "^9.0.3", "debug": "^4.3.3", "ethereum-cryptography": "^2.1.3" }, diff --git a/packages/wallet/CHANGELOG.md b/packages/wallet/CHANGELOG.md index 2d23a08d3c..43e273a626 100644 --- a/packages/wallet/CHANGELOG.md +++ b/packages/wallet/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) (modification: no type change headlines) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 2.0.3 - 2024-03-05 + +Maintenance release with downstream dependency updates, see PR [#3297](https://github.com/ethereumjs/ethereumjs-monorepo/pull/3297) + ## 2.0.2 - 2024-02-08 ### Self-Contained (and Working 🙂) README Examples diff --git a/packages/wallet/package.json b/packages/wallet/package.json index d4fb1ae378..76c13a37d0 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -1,6 +1,6 @@ { "name": "@ethereumjs/wallet", - "version": "2.0.2", + "version": "2.0.3", "description": "Utilities for handling Ethereum keys", "keywords": [ "ethereum", @@ -47,7 +47,7 @@ "tsc": "../../config/cli/ts-compile.sh" }, "dependencies": { - "@ethereumjs/util": "^9.0.2", + "@ethereumjs/util": "^9.0.3", "@scure/base": "^1.1.5", "ethereum-cryptography": "^2.1.3", "js-md5": "^0.8.3",