Skip to content

Commit 47f388b

Browse files
ScottyPoiholgerd77
andauthored
Upgrade ethereum-cryptography / Remove Direct EVM @noble/curves Usage (#3668)
* mororepo: upgrade to ethereum-cryptography v3 * wallet: remove await from non-Promise * Direct ethereum-cryptography usage for BLS precompile in EVM * Direct ethereum-cryptography usage for BN254 precompile in EVM * Fix some docs, some code optimizations (EVM BLS/BN254 precompiles) * Remove direct EVM @noble/curves dependency * Rebuild package-lock.json --------- Co-authored-by: Holger Drewes <[email protected]>
1 parent ffc2c24 commit 47f388b

File tree

20 files changed

+102
-104
lines changed

20 files changed

+102
-104
lines changed

package-lock.json

Lines changed: 58 additions & 65 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
@@ -52,7 +52,7 @@
5252
"@ethereumjs/trie": "^6.2.1",
5353
"@ethereumjs/tx": "^5.4.0",
5454
"@ethereumjs/util": "^9.1.0",
55-
"ethereum-cryptography": "^2.2.1"
55+
"ethereum-cryptography": "^3.0.0"
5656
},
5757
"devDependencies": {
5858
"kzg-wasm": "^0.4.0"

packages/blockchain/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@ethereumjs/tx": "^5.4.0",
5555
"@ethereumjs/util": "^9.1.0",
5656
"debug": "^4.3.3",
57-
"ethereum-cryptography": "^2.2.1",
57+
"ethereum-cryptography": "^3.0.0",
5858
"lru-cache": "10.1.0"
5959
},
6060
"devDependencies": {

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"connect": "^3.7.0",
8181
"cors": "^2.8.5",
8282
"debug": "^4.3.3",
83-
"ethereum-cryptography": "^2.2.1",
83+
"ethereum-cryptography": "^3.0.0",
8484
"it-pipe": "^1.1.0",
8585
"jayson": "^4.0.0",
8686
"kzg-wasm": "^0.4.0",

packages/common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
},
5959
"dependencies": {
6060
"@ethereumjs/util": "^9.1.0",
61-
"ethereum-cryptography": "^2.2.1"
61+
"ethereum-cryptography": "^3.0.0"
6262
},
6363
"devDependencies": {
6464
"@polkadot/util": "^12.6.2",

packages/devp2p/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"@ethereumjs/util": "^9.1.0",
6565
"@scure/base": "^1.1.7",
6666
"debug": "^4.3.3",
67-
"ethereum-cryptography": "^2.2.1",
67+
"ethereum-cryptography": "^3.0.0",
6868
"lru-cache": "10.1.0",
6969
"scanf": "1.1.2",
7070
"snappyjs": "^0.6.1"

packages/ethash/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@ethereumjs/rlp": "^5.0.2",
5151
"@ethereumjs/util": "^9.1.0",
5252
"bigint-crypto-utils": "^3.2.2",
53-
"ethereum-cryptography": "^2.2.1"
53+
"ethereum-cryptography": "^3.0.0"
5454
},
5555
"devDependencies": {
5656
"@ethereumjs/common": "^4.4.0"

packages/evm/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@
6060
"@ethereumjs/statemanager": "^2.4.0",
6161
"@ethereumjs/tx": "^5.4.0",
6262
"@ethereumjs/util": "^9.1.0",
63-
"@noble/curves": "^1.5.0",
6463
"@types/debug": "^4.1.9",
6564
"debug": "^4.3.3",
66-
"ethereum-cryptography": "^2.2.1"
65+
"ethereum-cryptography": "^3.0.0"
6766
},
6867
"devDependencies": {
6968
"@ethersproject/abi": "^5.0.12",

packages/evm/src/opcodes/functions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import {
2323
bytesToHex,
2424
bytesToInt,
2525
concatBytes,
26+
equalsBytes,
2627
getVerkleTreeIndicesForStorageSlot,
2728
setLengthLeft,
2829
} from '@ethereumjs/util'
29-
import { equalBytes } from '@noble/curves/abstract/utils'
3030
import { keccak256 } from 'ethereum-cryptography/keccak.js'
3131

3232
import { EOFContainer, EOFContainerMode } from '../eof/container.js'
@@ -62,7 +62,7 @@ export interface AsyncOpHandler {
6262
export type OpHandler = SyncOpHandler | AsyncOpHandler
6363

6464
function getEIP7702DelegatedAddress(code: Uint8Array) {
65-
if (equalBytes(code.slice(0, 3), DELEGATION_7702_FLAG)) {
65+
if (equalsBytes(code.slice(0, 3), DELEGATION_7702_FLAG)) {
6666
return new Address(code.slice(3, 24))
6767
}
6868
}

0 commit comments

Comments
 (0)