Skip to content

Commit 9e83482

Browse files
committed
new
1 parent ef2d578 commit 9e83482

File tree

12 files changed

+35
-2465
lines changed

12 files changed

+35
-2465
lines changed

ethereum/contracts/src/generated-verifier/GetTransactionUltraPLONKVerifier.sol

Lines changed: 1 addition & 2449 deletions
Large diffs are not rendered by default.

ethereum/oracles/src/ethereum/alchemyClientActions/getTransactionReceipts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ export async function getTransactionReceipts(
2828

2929
if (!receipts) throw new Error(`No receipts found for block number ${params.blockNumber}`);
3030

31-
return receipts.map(formatTransactionReceipt);
31+
return receipts.map((receipt) => formatTransactionReceipt(receipt));
3232
}

ethereum/oracles/src/ethereum/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class TxRlpEncoder {
8282
}
8383

8484
private static accessListToFields(accessList: AccessList): RecursiveArray<Hex> {
85-
return accessList.map(({ address, storageKeys }) => [address, storageKeys]);
85+
return accessList.map(({ address, storageKeys }) => [address, [...storageKeys]]);
8686
}
8787

8888
private static signatureToFields(baseTx: TxBase): Hex[] {

ethereum/oracles/src/noir/circuit/barretenberg.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@ export class Barretenberg {
1919
await $`${this.binaryPath} proof_as_fields -k ${vkPath} -p ${proofWithInputsPath} -o ${proofAsFieldsPath}`;
2020
}
2121

22+
public async prove(bytecodePath: string, witnessPath: string, proofPath: string) {
23+
await $`${this.binaryPath} prove -b ${bytecodePath} -w ${witnessPath} -o ${proofPath}`;
24+
}
25+
2226
private constructor(private binaryPath: string) {}
2327
}

ethereum/oracles/src/noir/circuit/nargoProver.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { InputMap } from '@noir-lang/noirc_abi';
66
import { readFile, unlink, writeFile } from 'fs/promises';
77
import { addHexPrefix } from '../../util/hex.js';
88
import { type Hex } from 'viem';
9+
import { Barretenberg } from './barretenberg.js';
910

1011
// IMPORTANT: The proof paths used here are not unique to the `proofId` - therefore they can be overridden in parallel proof generation.
1112
// https://github.com/noir-lang/noir/issues/5037
@@ -35,8 +36,21 @@ export class NargoProver {
3536
return path.join(this.circuit.root, 'proofs', `${this.circuit.name}.proof`);
3637
}
3738

39+
private get witnessPath(): string {
40+
return path.join(this.circuit.packagePath(), 'target', `${this.proverName}.gz`);
41+
}
42+
43+
private get bytecodePath(): string {
44+
return path.join(this.circuit.root, 'target', `${this.circuit.name}.json`);
45+
}
46+
3847
public async executeProveCommand(): Promise<void> {
39-
await $`nargo prove --package ${this.circuit.name} --oracle-resolver http://localhost:5555 -p ${this.proverName} -v ${this.verifierName}`;
48+
// Generate witness using nargo execute
49+
await $`nargo execute --package ${this.circuit.name} --oracle-resolver http://localhost:5555 -p ${this.proverName}`;
50+
51+
// Generate proof from witness using bb
52+
const bb = await Barretenberg.create();
53+
await bb.prove(this.bytecodePath, this.witnessPath, this.proofPath);
4054
}
4155

4256
public async prove(inputs: InputMap): Promise<Hex> {

ethereum/oracles/src/noir/oracles/rpc/accountOracle/encode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, it } from 'vitest';
22
import { loadProofFixture } from '../../../../historyAPIFixtures.js';
3-
import accountAsFields from './fixtures/accountAsFields.json';
3+
import accountAsFields from './fixtures/accountAsFields.json' with { type: "json" };
44
import { ForeignCallOutput } from '@noir-lang/noir_js';
55
import { encodeAccount, getValue } from './encode.js';
66
import { Hex } from 'viem';

ethereum/tests/src/get_account.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { beforeEach, describe, expect, it } from 'vitest';
22
import { updateNestedField, incHexStr } from 'noir-ethereum-api-oracles';
33
import { Abi, InputMap, abiEncode } from '@noir-lang/noirc_abi';
44

5-
import getAccountVerifier from '../../contracts/out/GetAccountUltraPLONKVerifier.sol/UltraVerifier.json';
6-
import getAccount from '../../../target/get_account.json';
5+
import getAccountVerifier from '../../contracts/out/GetAccountUltraPLONKVerifier.sol/UltraVerifier.json' with { type: "json" };
6+
import getAccount from '../../../target/get_account.json' with { type: "json" };
77

88
import { readProofData } from './proofDataReader.js';
99
import { FoundryArtefact, deploySolidityProofVerifier } from './solidityVerifier.js';

ethereum/tests/src/get_header.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { beforeEach, describe, expect, it } from 'vitest';
22
import { updateNestedField, incHexStr } from 'noir-ethereum-api-oracles';
33
import { Abi, InputMap, abiEncode } from '@noir-lang/noirc_abi';
44

5-
import getHeaderVerifier from '../../contracts/out/GetHeaderUltraPLONKVerifier.sol/UltraVerifier.json';
6-
import getHeader from '../../../target/get_header.json';
5+
import getHeaderVerifier from '../../contracts/out/GetHeaderUltraPLONKVerifier.sol/UltraVerifier.json' with { type: "json" };
6+
import getHeader from '../../../target/get_header.json' with { type: "json" };
77

88
import { readProofData } from './proofDataReader.js';
99
import { FoundryArtefact, deploySolidityProofVerifier } from './solidityVerifier.js';

ethereum/tests/src/get_log.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { beforeEach, describe, expect, it } from 'vitest';
22
import { updateNestedField, incHexStr } from 'noir-ethereum-api-oracles';
33
import { Abi, InputMap, abiEncode } from '@noir-lang/noirc_abi';
44

5-
import getLogVerifier from '../../contracts/out/GetLogUltraPLONKVerifier.sol/UltraVerifier.json';
6-
import getLog from '../../../target/get_log.json';
5+
import getLogVerifier from '../../contracts/out/GetLogUltraPLONKVerifier.sol/UltraVerifier.json' with { type: "json" };
6+
import getLog from '../../../target/get_log.json' with { type: "json" };
77

88
import { readProofData } from './proofDataReader.js';
99
import { FoundryArtefact, deploySolidityProofVerifier } from './solidityVerifier.js';

ethereum/tests/src/get_receipt.e2e.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { beforeEach, describe, expect, it } from 'vitest';
22
import { updateNestedField, incHexStr } from 'noir-ethereum-api-oracles';
33
import { Abi, InputMap, abiEncode } from '@noir-lang/noirc_abi';
44

5-
import getReceiptVerifier from '../../contracts/out/GetReceiptUltraPLONKVerifier.sol/UltraVerifier.json';
6-
import getReceipt from '../../../target/get_receipt.json';
5+
import getReceiptVerifier from '../../contracts/out/GetReceiptUltraPLONKVerifier.sol/UltraVerifier.json' with { type: "json" };
6+
import getReceipt from '../../../target/get_receipt.json' with { type: "json" };
77

88
import { readProofData } from './proofDataReader.js';
99
import { FoundryArtefact, deploySolidityProofVerifier } from './solidityVerifier.js';

0 commit comments

Comments
 (0)