Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4844 Browser Readiness Releases #3297

Merged
merged 22 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2db3a46
Add 4844-browser-readiness and KZG WASM setup instructions to tx CHAN…
holgerd77 Mar 1, 2024
e6a7ef6
Add all CHANGELOG files
holgerd77 Mar 1, 2024
cd8e468
Bump versions for block, blockchain, client and common, give internal…
holgerd77 Mar 1, 2024
3aa514d
Bump versions for devp2p, ethash, evm and genesis
holgerd77 Mar 1, 2024
4216d19
Bump versions for statemanager, trie, tx and util
holgerd77 Mar 1, 2024
827ee2c
Bump versions for verkle, vm and wallet
holgerd77 Mar 1, 2024
87a3a73
Add changes from Preimage PR #3143
holgerd77 Mar 1, 2024
8dbb720
Added monorepo-wide docs:build command to root package.json
holgerd77 Mar 1, 2024
dba0467
Rebuild docs
holgerd77 Mar 1, 2024
722c867
Update README and example files
holgerd77 Mar 1, 2024
9942083
Rebuild package-lock.json
holgerd77 Mar 11, 2024
207b015
Add various continued work PRs to the CHANGELOG entries
holgerd77 Mar 13, 2024
fd06cd2
Bump EVM to v3.0.0 and VM to v8.0.0 (in-between breaking releases due…
holgerd77 Mar 13, 2024
7f3024c
Rebuild package-lock.json
holgerd77 Mar 13, 2024
f5f5f4e
Add additional EVM/VM breaking release CHANGELOG notes, slight simpli…
holgerd77 Mar 13, 2024
414f59c
Add additional EVM/VM breaking release README notes
holgerd77 Mar 13, 2024
0e75cbd
Rebuild docs
holgerd77 Mar 13, 2024
dd5a9f3
Some TypeScript test fixes
holgerd77 Mar 13, 2024
9c7f2a7
More CHANGELOG additions
holgerd77 Mar 13, 2024
edd7cc0
Update CHANGELOG files (small PRs)
holgerd77 Mar 18, 2024
c9723ae
Update KZG related CHANGELOG and README entries and example code
holgerd77 Mar 18, 2024
dfe53cc
EVM: make main constructor protected
holgerd77 Mar 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 75 additions & 75 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
40 changes: 40 additions & 0 deletions packages/block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions packages/block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading
Loading