Skip to content

Commit 974a5f4

Browse files
paulmillrgabrocheleauholgerd77
authored
Implement Verkle in JS (#3785)
* Implement Verkle in JS * Fix lint * Fix lint * monorepo: remove commented out imports * monorepo: remove verkle crypto wasm * Remove rustbn-wasm from statemanager dev dependencies --------- Co-authored-by: Gabriel Rocheleau <[email protected]> Co-authored-by: Holger Drewes <[email protected]>
1 parent c77fb81 commit 974a5f4

25 files changed

+55
-41
lines changed

package-lock.json

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/block/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
"devDependencies": {
5858
"@paulmillr/trusted-setups": "^0.1.2",
59-
"micro-eth-signer": "^0.11.0"
59+
"micro-eth-signer": "^0.12.1"
6060
},
6161
"engines": {
6262
"node": ">=18"

packages/client/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@
8585
"level": "^8.0.0",
8686
"mcl-wasm": "^1.5.0",
8787
"memory-level": "^1.0.0",
88-
"micro-eth-signer": "^0.11.0",
88+
"micro-eth-signer": "^0.12.1",
8989
"prom-client": "^15.1.0",
9090
"rustbn-wasm": "^0.4.0",
91-
"verkle-cryptography-wasm": "^0.4.8",
9291
"winston": "^3.3.3",
9392
"winston-daily-rotate-file": "^4.5.5",
9493
"yargs": "^17.7.1"

packages/client/src/execution/vmexecution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import {
2626
import { createVM, runBlock, runTx } from '@ethereumjs/vm'
2727
import { writeFileSync } from 'fs'
2828
import * as mcl from 'mcl-wasm'
29+
import * as verkle from 'micro-eth-signer/verkle'
2930
import { initRustBN } from 'rustbn-wasm'
30-
import { loadVerkleCrypto } from 'verkle-cryptography-wasm'
3131

3232
import { Event } from '../types.js'
3333
import { debugCodeReplayBlock } from '../util/debug.js'
@@ -42,6 +42,7 @@ import type { ExecutionOptions } from './execution.js'
4242
import type { Block } from '@ethereumjs/block'
4343
import type { PrefixedHexString } from '@ethereumjs/util'
4444
import type { RunBlockOpts, TxReceipt, VM } from '@ethereumjs/vm'
45+
const loadVerkleCrypto = () => Promise.resolve(verkle)
4546

4647
export enum ExecStatus {
4748
VALID = 'VALID',

packages/evm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"level": "^8.0.0",
7676
"mcl-wasm": "^1.5.0",
7777
"memory-level": "^1.0.0",
78-
"micro-eth-signer": "^0.11.0",
78+
"micro-eth-signer": "^0.12.1",
7979
"minimist": "^1.2.5",
8080
"node-dir": "^0.1.17",
8181
"rollup-plugin-visualizer": "^5.12.0",

packages/evm/test/verkle.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import {
88
setLengthLeft,
99
} from '@ethereumjs/util'
1010
import { createVerkleTree } from '@ethereumjs/verkle'
11-
import { loadVerkleCrypto } from 'verkle-cryptography-wasm'
11+
import * as verkle from 'micro-eth-signer/verkle'
1212
import { assert, beforeAll, describe, it } from 'vitest'
1313

1414
import { VerkleAccessWitness, createEVM } from '../src/index.js'
1515

1616
import type { VerkleCrypto } from '@ethereumjs/util'
17+
const loadVerkleCrypto = () => Promise.resolve(verkle)
1718

1819
describe('verkle tests', () => {
1920
let verkleCrypto: VerkleCrypto

packages/statemanager/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
"devDependencies": {
6464
"@ethereumjs/block": "^6.0.0-alpha.1",
6565
"@ethereumjs/genesis": "^0.3.0-alpha.1",
66-
"@types/debug": "^4.1.9",
67-
"rustbn-wasm": "^0.4.0",
68-
"verkle-cryptography-wasm": "^0.4.8"
66+
"@types/debug": "^4.1.9"
6967
}
7068
}

packages/statemanager/test/statefulVerkleStateManager.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ import {
1010
setLengthLeft,
1111
} from '@ethereumjs/util'
1212
import { createVerkleTree } from '@ethereumjs/verkle'
13-
import { loadVerkleCrypto } from 'verkle-cryptography-wasm'
13+
import * as verkle from 'micro-eth-signer/verkle'
1414
import { assert, beforeAll, describe, it } from 'vitest'
1515

1616
import { Caches } from '../src/index.js'
1717
import { StatefulVerkleStateManager } from '../src/statefulVerkleStateManager.js'
1818

1919
import type { PrefixedHexString, VerkleCrypto } from '@ethereumjs/util'
20+
const loadVerkleCrypto = () => Promise.resolve(verkle)
2021

2122
describe('Verkle Tree API tests', () => {
2223
let verkleCrypto: VerkleCrypto

packages/statemanager/test/statelessVerkleStateManager.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
hexToBytes,
1414
randomBytes,
1515
} from '@ethereumjs/util'
16-
import { loadVerkleCrypto } from 'verkle-cryptography-wasm'
16+
import * as verkle from 'micro-eth-signer/verkle'
1717
import { assert, beforeAll, describe, it, test } from 'vitest'
1818

1919
import { CacheType, Caches, StatelessVerkleStateManager } from '../src/index.js'
@@ -22,6 +22,7 @@ import { testnetVerkleKaustinenData } from './testdata/testnetVerkleKaustinen.js
2222
import { verkleKaustinen6Block72Data } from './testdata/verkleKaustinen6Block72.js'
2323

2424
import type { VerkleCrypto } from '@ethereumjs/util'
25+
const loadVerkleCrypto = () => Promise.resolve(verkle)
2526

2627
describe('StatelessVerkleStateManager: Kaustinen Verkle Block', () => {
2728
let verkleCrypto: VerkleCrypto

packages/tx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/minimist": "^1.2.0",
6464
"@types/node-dir": "^0.0.34",
6565
"@paulmillr/trusted-setups": "^0.1.2",
66-
"micro-eth-signer": "^0.11.0",
66+
"micro-eth-signer": "^0.12.1",
6767
"minimist": "^1.2.0",
6868
"node-dir": "^0.1.16",
6969
"yargs": "^17.7.1"

0 commit comments

Comments
 (0)