Skip to content

Commit 25cceeb

Browse files
committed
Revert "add ckzg to client for getpayloadv5 ttest"
This reverts commit d0b0404.
1 parent 447cc64 commit 25cceeb

File tree

3 files changed

+0
-100
lines changed

3 files changed

+0
-100
lines changed

package-lock.json

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

packages/client/bin/utils.ts

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ import type { Address, PrefixedHexString } from '@ethereumjs/util'
5757
import type { Logger } from '../src/logging.ts'
5858
import type { ClientOpts } from '../src/types.ts'
5959

60-
import * as ckzg from 'c-kzg'
61-
6260
export type Account = [address: Address, privateKey: Uint8Array]
6361

6462
const networks = Object.keys(Chain).map((network) => network.toLowerCase())
@@ -631,65 +629,6 @@ function generateAccount(): Account {
631629

632630
export async function getCryptoFunctions(useJsCrypto: boolean): Promise<CustomCrypto> {
633631
const cryptoFunctions: CustomCrypto = {}
634-
ckzg.loadTrustedSetup(0)
635-
const cKzg = {
636-
blobToKzgCommitment: (blob: string) => {
637-
const blobBytes = hexToBytes(blob as PrefixedHexString)
638-
const commitmentBytes = ckzg.blobToKzgCommitment(blobBytes)
639-
return bytesToHex(commitmentBytes) as string
640-
},
641-
computeBlobProof: (blob: string, commitment: string) => {
642-
const blobBytes = hexToBytes(blob as PrefixedHexString)
643-
const commitmentBytes = hexToBytes(commitment as PrefixedHexString)
644-
const proofBytes = ckzg.computeBlobKzgProof(blobBytes, commitmentBytes)
645-
return bytesToHex(proofBytes) as string
646-
},
647-
verifyProof: (commitment: string, z: string, y: string, proof: string) => {
648-
const commitmentBytes = hexToBytes(commitment as PrefixedHexString)
649-
const zBytes = hexToBytes(z as PrefixedHexString)
650-
const yBytes = hexToBytes(y as PrefixedHexString)
651-
const proofBytes = hexToBytes(proof as PrefixedHexString)
652-
return ckzg.verifyKzgProof(commitmentBytes, zBytes, yBytes, proofBytes)
653-
},
654-
verifyBlobProofBatch: (blobs: string[], commitments: string[], proofs: string[]) => {
655-
const blobsBytes = blobs.map((blb) => hexToBytes(blb as PrefixedHexString))
656-
const commitmentsBytes = commitments.map((cmt) => hexToBytes(cmt as PrefixedHexString))
657-
const proofsBytes = proofs.map((prf) => hexToBytes(prf as PrefixedHexString))
658-
return ckzg.verifyBlobKzgProofBatch(blobsBytes, commitmentsBytes, proofsBytes)
659-
},
660-
computeCells: (blob: string) => {
661-
const blobBytes = hexToBytes(blob as PrefixedHexString)
662-
const cellsBytes = ckzg.computeCells(blobBytes)
663-
return cellsBytes.map((cellBytes) => bytesToHex(cellBytes)) as string[]
664-
},
665-
computeCellsAndProofs: (blob: string) => {
666-
const blobBytes = hexToBytes(blob as PrefixedHexString)
667-
const [cellsBytes, proofsBytes] = ckzg.computeCellsAndKzgProofs(blobBytes)
668-
return [
669-
cellsBytes.map((cellBytes) => bytesToHex(cellBytes)),
670-
proofsBytes.map((prfBytes) => bytesToHex(prfBytes)),
671-
] as [string[], string[]]
672-
},
673-
recoverCellsAndProofs: (indices: number[], cells: string[]) => {
674-
const cellsBytes = cells.map((cell) => hexToBytes(cell as PrefixedHexString))
675-
const [allCellsBytes, allProofsBytes] = ckzg.recoverCellsAndKzgProofs(indices, cellsBytes)
676-
return [
677-
allCellsBytes.map((cellBytes) => bytesToHex(cellBytes)),
678-
allProofsBytes.map((prfBytes) => bytesToHex(prfBytes)),
679-
] as [string[], string[]]
680-
},
681-
verifyCellKzgProofBatch: (
682-
commitments: string[],
683-
indices: number[],
684-
cells: string[],
685-
proofs: string[],
686-
) => {
687-
const commitmentsBytes = commitments.map((commit) => hexToBytes(commit as PrefixedHexString))
688-
const cellsBytes = cells.map((cell) => hexToBytes(cell as PrefixedHexString))
689-
const proofsBytes = proofs.map((prf) => hexToBytes(prf as PrefixedHexString))
690-
return ckzg.verifyCellKzgProofBatch(commitmentsBytes, indices, cellsBytes, proofsBytes)
691-
},
692-
}
693632

694633
const kzg = new microEthKZG(trustedSetup)
695634
// Initialize WASM crypto if JS crypto is not specified
@@ -736,8 +675,6 @@ export async function getCryptoFunctions(useJsCrypto: boolean): Promise<CustomCr
736675
}
737676
}
738677
cryptoFunctions.kzg = kzg
739-
// override with cKzg for debugging
740-
cryptoFunctions.kzg = cKzg
741678
cryptoFunctions.verkle = verkle
742679
return cryptoFunctions
743680
}

packages/client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"@scure/base": "^1.2.4",
7373
"abstract-level": "^3.0.1",
7474
"body-parser": "^1.20.3",
75-
"c-kzg": "^4.1.0",
7675
"chalk": "^5.4.1",
7776
"connect": "^3.7.0",
7877
"cors": "^2.8.5",

0 commit comments

Comments
 (0)