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

feat: Integrate new proving systems in e2e #6971

Merged
merged 246 commits into from
Jul 11, 2024
Merged
Changes from 1 commit
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
be738f9
Start
codygunton Jun 3, 2024
77fd1d3
More TODOs
codygunton Jun 3, 2024
c051062
Merge branch 'master' into cg-lde/integrate-client-ivc
ledwards2225 Jun 3, 2024
d6e34c9
luke: some LONDONTODO comments
ledwards2225 Jun 3, 2024
4d823cb
More thinking
codygunton Jun 4, 2024
11bc182
added new flow
lucasxia01 Jun 4, 2024
c0edfae
More
codygunton Jun 4, 2024
070abed
some comments and fix build
ledwards2225 Jun 4, 2024
f308681
write full.test circuit data to a fixtures file
ledwards2225 Jun 5, 2024
bb0cc2b
Try to do real proving; no executionResult;
codygunton Jun 5, 2024
eba2b37
I want to merge
maramihali Jun 5, 2024
46e2f1d
Merge remote-tracking branch 'origin/master' into mm/rollup-tube
maramihali Jun 5, 2024
baaa716
hacking towards getting a folding ivc proof
ludamad Jun 5, 2024
f7f2414
flow work
maramihali Jun 6, 2024
653c67b
introduce libdeflate, turned off for wasm
ludamad Jun 6, 2024
52053ac
fix wasm build
ludamad Jun 6, 2024
df3dcb8
needs shared transcript
maramihali Jun 6, 2024
f3aa95b
stash
ludamad Jun 6, 2024
da714fe
support disabling aztec vm in non-wasm builds
ludamad Jun 6, 2024
8715cbd
Change sumcheck, tests pass
codygunton Jun 6, 2024
cd048ea
almost working ivc
ludamad Jun 6, 2024
95cdb6e
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
ludamad Jun 6, 2024
b14723f
Fix problem ultra_honk_tests
codygunton Jun 6, 2024
b038df5
added fake write_vk_honk and prove_honk_output_all commands
lucasxia01 Jun 6, 2024
dd50460
pad ZM
ledwards2225 Jun 6, 2024
2daabbd
use local for MAX_LOG so everything builds
ledwards2225 Jun 6, 2024
20b3184
updates to make transcrpt tests pass (eccvm hack)
ledwards2225 Jun 6, 2024
5c54954
Add and use DISABLE_AZTEC_VM
codygunton Jun 7, 2024
5aa6e11
attempt to fix program stacks
ludamad Jun 7, 2024
5bb2145
Merge github.com:AztecProtocol/aztec-packages into cg-lde-ad/integrat…
ludamad Jun 7, 2024
729c7fc
serialisation and deserialisation work
maramihali Jun 7, 2024
a6bb02c
verifying!
ludamad Jun 7, 2024
0db641c
Merge remote-tracking branch 'origin/master' into mm/rollup-tube
maramihali Jun 7, 2024
844cfd9
Merge branch 'master' into cg-lde-ad/integrate-client-ivc
ludamad Jun 7, 2024
92d3475
Merge remote-tracking branch 'origin/mm/rollup-tube' into cg-lde-ad/i…
ludamad Jun 7, 2024
2f016d9
lots of hacking towards client ivc proving
ludamad Jun 7, 2024
5c762de
prove_then_verify flow acir test passes
codygunton Jun 7, 2024
2b3634c
fix bad merge
ludamad Jun 7, 2024
95267a7
Merge remote-tracking branch 'origin/cg/constant-honk-proof-size' int…
lucasxia01 Jun 7, 2024
8dd3b82
hacking and changing constants to use honk in rollup circuits
lucasxia01 Jun 7, 2024
128197e
bump arithmetic
ludamad Jun 7, 2024
fea3b18
replace tail proof with ivc, get verifier failure
ludamad Jun 7, 2024
9414601
add prove tube script for testing the tube related flows
maramihali Jun 10, 2024
6985494
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
codygunton Jun 10, 2024
6dad5ad
stuff
maramihali Jun 10, 2024
c7c759f
Merge remote-tracking branch 'origin/master' into mm/tube-typescript
maramihali Jun 10, 2024
30c10e9
fix bad merge
ludamad Jun 7, 2024
93ec8df
fix errors
maramihali Jun 10, 2024
4c73e3a
removed aggregation obj and got the base rollup test passing
lucasxia01 Jun 10, 2024
8bcf0d1
Toward client ivc proof size
codygunton Jun 11, 2024
dfec90d
Merge remote-tracking branch 'origin/master' into lx/honk-in-rollup
codygunton Jun 11, 2024
f6df506
client ivc proof hacking
ludamad Jun 11, 2024
b193e7a
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
ludamad Jun 11, 2024
5494185
tube works, need to add proof as json
maramihali Jun 11, 2024
ec09910
Merge remote-tracking branch 'origin/master' into mm/tube-typescript
maramihali Jun 11, 2024
1051138
Hacking
ludamad Jun 11, 2024
45be902
Merge remote-tracking branch 'origin/master' into mm/tube-typescript
maramihali Jun 11, 2024
7490944
cleanup
maramihali Jun 11, 2024
1fb8657
fix comment
maramihali Jun 11, 2024
2d55f5d
add tube test
maramihali Jun 11, 2024
1c9506d
remove vk hacks
maramihali Jun 11, 2024
c3674f9
Step toward adding new constants
codygunton Jun 11, 2024
af0a9e7
Kernel data uses tube proof length
codygunton Jun 11, 2024
4ceb5d4
Create PaddingProcessedTxFromTube and change constants; fail at mapRe…
codygunton Jun 11, 2024
5777f0d
Introduce tube proof length
codygunton Jun 12, 2024
40d25f2
add notes
codygunton Jun 12, 2024
fb8ab2c
squash; prove_then_verify flow acir test passes
codygunton Jun 12, 2024
8039b6b
add serialization for hacky ivc proofs
ludamad Jun 12, 2024
6e62157
Merge branch 'cg/constant-honk-proof-size' into lx/honk-in-rollup
codygunton Jun 12, 2024
d658799
Merge remote-tracking branch 'origin/master' into mm/tube-typescript
maramihali Jun 12, 2024
f6fe71e
serialization for clientivcproof
ludamad Jun 12, 2024
2b5518a
Fix merge
codygunton Jun 12, 2024
ad41ab5
Merge remote-tracking branch 'origin/lx/honk-in-rollup' into mm-lx/li…
maramihali Jun 12, 2024
305b534
bb changes
ludamad Jun 12, 2024
92eab29
Merge remote-tracking branch 'origin/mm/tube-typescript' into cg-lde-…
ludamad Jun 12, 2024
6f671b6
Merge branch 'master' into cg-lde-ad/integrate-client-ivc
ludamad Jun 12, 2024
3da2f66
post merge
ludamad Jun 12, 2024
da5c7e2
Merge remote-tracking branch 'origin/cg-lde-ad/integrate-client-ivc' …
ludamad Jun 12, 2024
a69b11d
working tube
ludamad Jun 12, 2024
d200329
pain after merging
ludamad Jun 12, 2024
19b5464
WIP
codygunton Jun 12, 2024
22574b6
proof
ludamad Jun 12, 2024
17372c3
refactoring, _2 suffix to _msgpack, extra file writing methods
ludamad Jun 12, 2024
99b9b7e
Merge branch 'master' into cg/constant-honk-proof-size
codygunton Jun 12, 2024
3bec7b1
things run, a path is wrong
maramihali Jun 12, 2024
be4412f
fix wrong path
maramihali Jun 12, 2024
6b050fa
bb_prover_base_rollup passed with creating tube
maramihali Jun 13, 2024
8e6d43f
summer time cleaning: add some comments, remove unnecessary stuff tha…
maramihali Jun 13, 2024
c251b9a
Fix tube (for me)
codygunton Jun 17, 2024
2a53d79
Reinstate public part of full test; it passes but...
codygunton Jun 18, 2024
7ff8124
Reinstate public part of full test; it passes but...
codygunton Jun 18, 2024
0fb7ef9
Merge branch 'cg-lde-ad/integrate-client-ivc' of github.com:AztecProt…
ludamad Jun 18, 2024
c427376
proof cache fix to not reprove
ludamad Jun 18, 2024
4becd59
ability for proofs to be sent out
ludamad Jun 18, 2024
861f2a1
use dir
ludamad Jun 18, 2024
15de17c
Merge remote-tracking branch 'origin/mm-lx/linking-work' into cg-lde-…
ludamad Jun 18, 2024
69d3505
Merge
ludamad Jun 18, 2024
e748edd
use test circuit verifier for now
ludamad Jun 19, 2024
a9745fa
disable cleanup for now
ludamad Jun 19, 2024
6fa276b
Remove recursive verifications; passes tube verification (+caching bu…
codygunton Jun 20, 2024
fd23590
try to implement tube caching
ludamad Jun 20, 2024
f3a11a1
wire TubeInputs
ludamad Jun 20, 2024
1b58393
Patch from Adam
codygunton Jun 20, 2024
84ebc99
WIP try to bring verifiers back for public (proof construction makes …
codygunton Jun 21, 2024
2edb0e8
Make stdlib Zm verifier test; it fails.
codygunton Jun 23, 2024
3e6e746
Trying to debug
codygunton Jun 24, 2024
8ffeda0
It passes
codygunton Jun 24, 2024
15beef5
WIP including sumcheck (need more stuff from lx/)
codygunton Jun 24, 2024
c22a8e7
getting it to build (with hacks)
lucasxia01 Jun 24, 2024
63dd3bc
modified dummy rounds to be end of sumcheck, native ultra_honk tests …
lucasxia01 Jun 24, 2024
7afccfe
passed dummy_round to univariate_eval - recursive verifier test passes
lucasxia01 Jun 24, 2024
0dd7530
cherrypicked - Implement vk hash and check
codygunton Jun 21, 2024
d6e1efb
moved recursive verifier changes to this branch from honk-in-rollup
lucasxia01 Jun 24, 2024
fe85e03
updating acir/prover.toml of test programs - prove_then_verify flow p…
lucasxia01 Jun 24, 2024
25d0a15
don't pass the witness to the write_vk_honk flow
lucasxia01 Jun 24, 2024
ebe4115
Detect rec ver vk changes in test
codygunton Jun 24, 2024
0036183
Note bad values
codygunton Jun 25, 2024
5db6800
check outer circuit vk not inner
ledwards2225 Jun 25, 2024
cc9962a
Try running public stuff
codygunton Jun 25, 2024
302945a
Merge branch 'master' into cg/constant-honk-proof-size
ledwards2225 Jun 25, 2024
ff23a57
missed test suite updates
ledwards2225 Jun 25, 2024
ad22a00
add back in PCS round missed in merge
ledwards2225 Jun 25, 2024
3e881e3
Merge branch 'master' into cg/constant-honk-proof-size
ledwards2225 Jun 25, 2024
d138cbc
fix wrapping size_t exponent in ZM
ledwards2225 Jun 25, 2024
41e8e50
update Prover.toml and disable tube acir test for now
ledwards2225 Jun 25, 2024
48605a7
Merge branch 'cg/constant-honk-proof-size' into cg-lde-ad/integrate-c…
codygunton Jun 26, 2024
6f1767a
Fix AcirHonkRecursionConstraint.TestFullRecursiveComposition
codygunton Jun 26, 2024
dcd01e3
updating proof size and prover toml
ledwards2225 Jun 26, 2024
e4c553b
moving changes to honk_recursion_constraint over from other branch
lucasxia01 Jun 26, 2024
503adcc
revert rebuild script changes
ledwards2225 Jun 26, 2024
d23f83d
Fix typescript IVC. Tube
codygunton Jun 26, 2024
d520d8f
Build AVM
codygunton Jun 26, 2024
87c9984
Adjust logging
codygunton Jun 26, 2024
fd378aa
vk hash agrees for verify_honk_proof thru sumcheck
ledwards2225 Jun 26, 2024
84ba6fa
infinite llopy?
ledwards2225 Jun 26, 2024
5fe6080
Build avm
codygunton Jun 26, 2024
61b6744
No infinite llopy
codygunton Jun 26, 2024
4ede58a
Pow in Zm uses witness
codygunton Jun 26, 2024
6d460c0
Skip it
codygunton Jun 26, 2024
5ca1060
prove_then_verify passes!
codygunton Jun 26, 2024
08d7f98
Merge branch 'cg/constant-honk-proof-size' into cg-lde-ad/integrate-c…
codygunton Jun 26, 2024
97d7112
Fix bootstrap
codygunton Jun 26, 2024
5e4ea9d
Merge branch 'master' into cg/constant-honk-proof-size
ledwards2225 Jun 26, 2024
41677b7
revert rebuild changes
ledwards2225 Jun 26, 2024
60006b3
Fix build bb-prover and prover-client
codygunton Jun 26, 2024
ecf2cec
delete recusion kernel pinning and fix build
ledwards2225 Jun 26, 2024
938c39e
Merge remote-tracking branch 'origin/cg/constant-honk-proof-size' int…
codygunton Jun 26, 2024
a6831b4
Update constants
codygunton Jun 26, 2024
137ab4e
fix gcc
ledwards2225 Jun 26, 2024
6fe0cc1
AVM fails to verify
codygunton Jun 27, 2024
82810ff
SkipAVM verification; Tube verifies; PUBLIC_KERNEL_NON_TAIL does not
codygunton Jun 27, 2024
b1fbd1e
remove lookup delta, maybe fix build?
ledwards2225 Jun 27, 2024
8c48c76
Merge branch 'master' into cg/constant-honk-proof-size
lucasxia01 Jun 27, 2024
97f736b
Trying to cut out tube proving from public side; one base parity does…
codygunton Jun 27, 2024
3d871a7
Merge remote-tracking branch 'origin/cg/constant-honk-proof-size' int…
lucasxia01 Jun 27, 2024
1732337
passes base rollup test, different error in full test (actually 1 out…
lucasxia01 Jun 27, 2024
20ea9aa
runInDirectory
ludamad Jun 27, 2024
4ac928d
Merge remote-tracking branch 'origin/lx/ultrahonk-in-rollup' into cg-…
codygunton Jun 27, 2024
cc6e1a6
Post-merge fix
codygunton Jun 27, 2024
aeb461a
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
codygunton Jun 27, 2024
2aaf7f5
Fix build
codygunton Jun 27, 2024
25f161f
Revert this that demonstrates base & full rollup tests pass
codygunton Jun 27, 2024
81eb07c
Revert "Revert this that demonstrates base & full rollup tests pass"
codygunton Jun 27, 2024
a0b1150
pxe/kernel_prover.ts: conditional artifact fofor PrivateKernelTailToP…
ludamad Jun 27, 2024
70008b8
Merge github.com:AztecProtocol/aztec-packages into cg-lde-ad/integrat…
ludamad Jun 27, 2024
1623459
Merge remote-tracking branch 'origin/cg-lde-ad/integrate-client-ivc' …
ludamad Jun 27, 2024
8040b0e
Change to mirror change in base rollup!
codygunton Jun 27, 2024
3972408
cleanup and trying to get tube proof in
ludamad Jun 27, 2024
026d7c6
fix compile
ludamad Jun 28, 2024
e96145d
log
ludamad Jun 28, 2024
9d1802e
log
ludamad Jun 28, 2024
a7c184d
Fix kernel
codygunton Jun 28, 2024
2e224f7
Cleanup and note // PUBLIC KERNEl
codygunton Jun 28, 2024
6776c26
debug adjustment
ludamad Jun 28, 2024
e8f0657
We get to the public kernel tail
codygunton Jun 28, 2024
6bd6dc8
It passed
codygunton Jun 28, 2024
c6a1495
It passed a second time
codygunton Jun 28, 2024
e5a7944
Delete logs to get better sense of PR size
codygunton Jun 28, 2024
b46e174
Remove huge log
codygunton Jun 28, 2024
704c756
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
codygunton Jun 28, 2024
8d0d6f1
Fix Bb build from "accept all incoming changes"
codygunton Jun 28, 2024
1f4dbf3
Perhaps I was overzealous checking out all of Bb
codygunton Jun 29, 2024
7fa4f0a
It fails
codygunton Jun 29, 2024
204235c
Passes again!--TODO: handle agg object.
codygunton Jun 29, 2024
25149e9
Remove log
codygunton Jun 29, 2024
0a7671f
Some cleanup
codygunton Jun 29, 2024
419acbf
Clean up logs, comments, todos. It passes
codygunton Jun 29, 2024
28c2f4c
Remove log
codygunton Jun 29, 2024
c74c41f
Merge branch 'master' into cg-lde-ad/integrate-client-ivc
ledwards2225 Jul 1, 2024
1acb679
formatting in nr protocol circuits
ledwards2225 Jul 1, 2024
b047ada
max block size tracker
ledwards2225 Jul 1, 2024
94e7677
increment poseidon external size
ledwards2225 Jul 1, 2024
d272c74
honk recursion constraint test fix
lucasxia01 Jul 1, 2024
bb2b0b3
decrease fixed block sizes where possible
ledwards2225 Jul 1, 2024
fd506b7
bump srs sizes in fold and verify
ledwards2225 Jul 2, 2024
abfc338
Merge branch 'master' into cg-lde-ad/integrate-client-ivc
ledwards2225 Jul 2, 2024
cfcf053
verify honk proof test program inputs/circuit fixed
lucasxia01 Jul 2, 2024
b2887db
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
lucasxia01 Jul 2, 2024
1ddce94
try skip
ludamad Jul 2, 2024
23f3dba
try fix runner
ludamad Jul 3, 2024
efb0389
adding some bberg issues, fxing some LONDONTODOS, cleaning up
ledwards2225 Jul 3, 2024
824e867
add aggregation obj todos
lucasxia01 Jul 3, 2024
0a6f120
ci
ludamad Jul 3, 2024
f96b69c
Revert "try fix runner"
ludamad Jul 3, 2024
e87a4f6
redo earthly-ci fix
ludamad Jul 3, 2024
1cceac5
feat(ivc): make private kernels only prove thru IVC flow (#7348)
ludamad Jul 8, 2024
32f44ba
fixes for public_processor.test.ts
ludamad Jul 8, 2024
555c2dd
fix gates_report script to use honk
lucasxia01 Jul 8, 2024
de800b0
fix: revert bad invalidation
ludamad Jul 8, 2024
0059685
Merge remote-tracking branch 'origin/cg-lde-ad/integrate-client-ivc' …
ludamad Jul 8, 2024
51adb5d
fix kernel_prover.test.ts
ludamad Jul 8, 2024
165cb85
Increase tester ttl
ludamad Jul 8, 2024
6a69fe0
try proving test fix
ludamad Jul 8, 2024
f32a3a3
some cleanup (yarn formatting and console.errors)
lucasxia01 Jul 8, 2024
bd01afc
p2p fixes
ludamad Jul 8, 2024
6a4274b
Undo STACK call
ludamad Jul 8, 2024
650636e
Proof yarn format fix
ludamad Jul 8, 2024
fd23db5
ci
ludamad Jul 9, 2024
a8538b8
try delay 2 pxes e2e to avoid race condition
ludamad Jul 9, 2024
a860ce2
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
ludamad Jul 9, 2024
7984a0b
merge conflict fixing
ludamad Jul 9, 2024
64b2032
try write_vk_ultra_honk
ludamad Jul 9, 2024
335ac76
its building
ludamad Jul 9, 2024
926e1e8
remake constants
ludamad Jul 9, 2024
f6be505
building again
ludamad Jul 9, 2024
2beb482
Ultrahonk
ludamad Jul 10, 2024
5458ea6
bb hash
ludamad Jul 10, 2024
865e7c4
bb hash
ludamad Jul 10, 2024
e75f148
disabled
ludamad Jul 10, 2024
f5b675c
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
ludamad Jul 10, 2024
29003ff
fixes
ludamad Jul 10, 2024
8ef64b5
fixes
ludamad Jul 10, 2024
12dc35c
Revert "try write_vk_ultra_honk"
ludamad Jul 10, 2024
57c7b9c
fix vk mismerge
ludamad Jul 10, 2024
2bf44ff
fix
ludamad Jul 10, 2024
2b984af
honking
ludamad Jul 10, 2024
e86bd9b
Merge branch 'fixes' into cg-lde-ad/integrate-client-ivc
ludamad Jul 10, 2024
bbfb6e3
nargo fmt
ludamad Jul 10, 2024
7aded71
try to change vk hash?
ludamad Jul 10, 2024
f5e7f68
full test rever t master
ludamad Jul 10, 2024
79eac15
yarn formatting:fix
ludamad Jul 10, 2024
4e8d769
fix expect-error
ludamad Jul 10, 2024
b3c91a0
yarn formatting:fix
ludamad Jul 10, 2024
26174fd
yarn formatting:fix
ludamad Jul 10, 2024
549ecb4
ci
ludamad Jul 10, 2024
b3e0a21
Merge remote-tracking branch 'origin/master' into cg-lde-ad/integrate…
ludamad Jul 10, 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
Prev Previous commit
Next Next commit
Try to do real proving; no executionResult;
(note: need to set BB_BINARY_PATH
               and BB_WORKING_DIRECTORY)
codygunton committed Jun 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit bb0cc2bcd72fbad68a1d73a55c0da603d5ccb518
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@
"editor.defaultFormatter": "hashicorp.terraform"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
2 changes: 2 additions & 0 deletions yarn-project/bb-prover/src/bb/execute.ts
Original file line number Diff line number Diff line change
@@ -225,6 +225,8 @@ export async function generateProof(

try {
// Write the bytecode to the working directory
log(`bytecodePath ${bytecodePath}`);
log(`outputPath ${outputPath}`);
await fs.writeFile(bytecodePath, bytecode); // FOLDINGSTACK: circuit bytecode is written to a file here
// FOLDINGSTACK: input to bb execution is 3 paths: 1) where to write proof/vk, 2) bytecode path, 3) witness path. Maybe the easiest
// (also most correct?) thing to do is to simply store vectors of bytecode/witness paths, then send those all in one go to BB for
38 changes: 19 additions & 19 deletions yarn-project/bb-prover/src/prover/bb_native_proof_creator.ts
Original file line number Diff line number Diff line change
@@ -316,25 +316,25 @@ export class BBNativeProofCreator implements ProofCreator {

await fs.writeFile(inputsWitnessFile, compressedBincodedWitness); // FOLDINGSTACK: witness is written to a file here

// LONDONTODO(FoldingStack): Every circuit processed by full.test passes through this method during proof construction. Here I'm just writing the
// acir data (acir bytecode + witness) to a test fixtures file in bberg. (This should be all that's needed to construct corresponding bberg circuits).
// Hoping this provides a quick way to start playing around with accumulation. Probably easiest to start in the integration tests suite. That's where
// I'll plan to pick up tomorrow unless something else makes more sense by the time I get back to it. Once things are working there we can work to
// fill in the real pieces, e.g. better organization/serialization of this data, a proper flow in the bb binary (which is maybe just the existing
// flow if we end up serializing into a WitnessStack). One issue is going to be that the kernel circuits will have recursive verifiers. Might be easy
// enough to just 'delete' those op codes from the acir representation, but might also make sense to have versions of the kernels without recursion
// since we'll need them soon enough anyway.
let fixturesDir = path.resolve(this.bbBinaryPath, '../../../../', 'e2e_fixtures/folding_stack');
// Get circuit name; replace colons with underscores
const circuitName = (appCircuitName ? appCircuitName : circuitType).replace(/:/g, '_');
const stackItemDir = path.join(fixturesDir, circuitName);
await fs.mkdir(stackItemDir, { recursive: true });
// Write the acir bytecode and witness data to file
const bytecodePath = `${stackItemDir}/bytecode`;
const witnessPath = `${stackItemDir}/witness.gz`;
this.log.info(`Writing data for ${circuitName} to ${fixturesDir}`);
await fs.writeFile(bytecodePath, bytecode);
await fs.writeFile(witnessPath, compressedBincodedWitness); // FOLDINGSTACK: witness is written to a file here
// // LONDONTODO(FoldingStack): Every circuit processed by full.test passes through this method during proof construction. Here I'm just writing the
// // acir data (acir bytecode + witness) to a test fixtures file in bberg. (This should be all that's needed to construct corresponding bberg circuits).
// // Hoping this provides a quick way to start playing around with accumulation. Probably easiest to start in the integration tests suite. That's where
// // I'll plan to pick up tomorrow unless something else makes more sense by the time I get back to it. Once things are working there we can work to
// // fill in the real pieces, e.g. better organization/serialization of this data, a proper flow in the bb binary (which is maybe just the existing
// // flow if we end up serializing into a WitnessStack). One issue is going to be that the kernel circuits will have recursive verifiers. Might be easy
// // enough to just 'delete' those op codes from the acir representation, but might also make sense to have versions of the kernels without recursion
// // since we'll need them soon enough anyway.
// let fixturesDir = path.resolve(this.bbBinaryPath, '../../../../', 'e2e_fixtures/folding_stack');
// // Get circuit name; replace colons with underscores
// const circuitName = (appCircuitName ? appCircuitName : circuitType).replace(/:/g, '_');
// const stackItemDir = path.join(fixturesDir, circuitName);
// await fs.mkdir(stackItemDir, { recursive: true });
// // Write the acir bytecode and witness data to file
// const bytecodePath = `${stackItemDir}/bytecode`;
// const witnessPath = `${stackItemDir}/witness.gz`;
// this.log.info(`Writing data for ${circuitName} to ${fixturesDir}`);
// await fs.writeFile(bytecodePath, bytecode);
// await fs.writeFile(witnessPath, compressedBincodedWitness); // FOLDINGSTACK: witness is written to a file here

this.log.debug(`Written ${inputsWitnessFile}`);

534 changes: 272 additions & 262 deletions yarn-project/pxe/src/kernel_prover/kernel_prover.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Note, type ProofCreator } from '@aztec/circuit-types';
import { type BBNativeProofCreator } from '@aztec/bb-prover';
import { BBNativeProofCreator } from '@aztec/bb-prover';
// import { createConsoleLogger } from '@aztec/foundation/log';
// import { createDebugLogger } from '@aztec/foundation/log';
import {
FunctionData,
FunctionSelector,
@@ -31,15 +33,16 @@ import { mock } from 'jest-mock-extended';
import { KernelProver } from './kernel_prover.js';
import { type ProvingDataOracle } from './proving_data_oracle.js';

// const log = createDebugLogger('aztec:native_kernel_prover_tests');

describe('Kernel Prover Native', () => {
let txRequest: TxRequest;
let oracle: ReturnType<typeof mock<ProvingDataOracle>>;
// LONDONTODO(Client): replace with non-mocked and see what happens? This means we fake it
let proofCreator: ReturnType<typeof mock<ProofCreator>>;
let proofCreator: BBNativeProofCreator;
let prover: KernelProver;
let dependencies: { [name: string]: string[] } = {};

const contractAddress = AztecAddress.fromBigInt(987654n);
// const contractAddress = AztecAddress.fromBigInt(987654n);

const notesAndSlots: NoteAndSlot[] = Array(10)
.fill(null)
@@ -50,9 +53,9 @@ describe('Kernel Prover Native', () => {
owner: { x: Fr.random(), y: Fr.random() },
}));

const createFakeSiloedCommitment = (commitment: Fr) => new Fr(commitment.value + 1n);
// const createFakeSiloedCommitment = (commitment: Fr) => new Fr(commitment.value + 1n);
const generateFakeCommitment = (noteAndSlot: NoteAndSlot) => noteAndSlot.note.items[0];
const generateFakeSiloedCommitment = (note: NoteAndSlot) => createFakeSiloedCommitment(generateFakeCommitment(note));
// const generateFakeSiloedCommitment = (note: NoteAndSlot) => createFakeSiloedCommitment(generateFakeCommitment(note));

const createExecutionResult = (fnName: string, newNoteIndices: number[] = []): ExecutionResult => {
const publicInputs = PrivateCircuitPublicInputs.empty();
@@ -84,60 +87,60 @@ describe('Kernel Prover Native', () => {
};
};

const createProofOutput = (newNoteIndices: number[]) => {
const publicInputs = PrivateKernelCircuitPublicInputs.empty();
const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, ScopedNoteHash.empty);
for (let i = 0; i < newNoteIndices.length; i++) {
noteHashes[i] = new NoteHash(generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]), 0).scope(
0,
contractAddress,
);
}

publicInputs.end.newNoteHashes = noteHashes;
return {
publicInputs,
proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const createProofOutputFinal = (newNoteIndices: number[]) => {
const publicInputs = PrivateKernelTailCircuitPublicInputs.empty();
const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, () => Fr.ZERO);
for (let i = 0; i < newNoteIndices.length; i++) {
noteHashes[i] = generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]);
}
publicInputs.forRollup!.end.newNoteHashes = noteHashes;

return {
publicInputs,
proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const createAppCircuitProofOutput = () => {
return {
proof: makeRecursiveProof<typeof RECURSIVE_PROOF_LENGTH>(RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const expectExecution = (fns: string[]) => {
const callStackItemsInit = proofCreator.createProofInit.mock.calls.map(args =>
String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
);
const callStackItemsInner = proofCreator.createProofInner.mock.calls.map(args =>
String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
);

expect(proofCreator.createProofInit).toHaveBeenCalledTimes(Math.min(1, fns.length));
expect(proofCreator.createProofInner).toHaveBeenCalledTimes(Math.max(0, fns.length - 1));
expect(callStackItemsInit.concat(callStackItemsInner)).toEqual(fns);
proofCreator.createProofInner.mockClear();
proofCreator.createProofInit.mockClear();
};
// const createProofOutput = (newNoteIndices: number[]) => {
// const publicInputs = PrivateKernelCircuitPublicInputs.empty();
// const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, ScopedNoteHash.empty);
// for (let i = 0; i < newNoteIndices.length; i++) {
// noteHashes[i] = new NoteHash(generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]), 0).scope(
// 0,
// contractAddress,
// );
// }

// publicInputs.end.newNoteHashes = noteHashes;
// return {
// publicInputs,
// proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const createProofOutputFinal = (newNoteIndices: number[]) => {
// const publicInputs = PrivateKernelTailCircuitPublicInputs.empty();
// const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, () => Fr.ZERO);
// for (let i = 0; i < newNoteIndices.length; i++) {
// noteHashes[i] = generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]);
// }
// publicInputs.forRollup!.end.newNoteHashes = noteHashes;

// return {
// publicInputs,
// proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const createAppCircuitProofOutput = () => {
// return {
// proof: makeRecursiveProof<typeof RECURSIVE_PROOF_LENGTH>(RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const expectExecution = (fns: string[]) => {
// const callStackItemsInit = proofCreator.createProofInit.mock.calls.map(args =>
// String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
// );
// const callStackItemsInner = proofCreator.createProofInner.mock.calls.map(args =>
// String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
// );

// expect(proofCreator.createProofInit).toHaveBeenCalledTimes(Math.min(1, fns.length));
// expect(proofCreator.createProofInner).toHaveBeenCalledTimes(Math.max(0, fns.length - 1));
// expect(callStackItemsInit.concat(callStackItemsInner)).toEqual(fns);
// proofCreator.createProofInner.mockClear();
// proofCreator.createProofInit.mockClear();
// };

const prove = (executionResult: ExecutionResult) => prover.prove(txRequest, executionResult);

@@ -159,220 +162,227 @@ describe('Kernel Prover Native', () => {
privateFunctionsRoot: Fr.random(),
});

proofCreator = mock<ProofCreator>();
proofCreator.getSiloedCommitments.mockImplementation(publicInputs =>
Promise.resolve(publicInputs.newNoteHashes.map(com => createFakeSiloedCommitment(com.value))),
const {
// BB_RELEASE_DIR = 'barretenberg/cpp/build/bin',
BB_BINARY_PATH,
// TEMP_DIR = tmpdir(),
BB_WORKING_DIRECTORY = '',
} = process.env;

proofCreator = new BBNativeProofCreator(
BB_BINARY_PATH!,
BB_WORKING_DIRECTORY
);
proofCreator.createProofInit.mockResolvedValue(createProofOutput([]));
proofCreator.createProofInner.mockResolvedValue(createProofOutput([]));
proofCreator.createProofReset.mockResolvedValue(createProofOutput([]));
proofCreator.createProofTail.mockResolvedValue(createProofOutputFinal([]));
proofCreator.createAppCircuitProof.mockResolvedValue(createAppCircuitProofOutput());
// proofCreator.getSiloedCommitments.mockImplementation(publicInputs =>
// Promise.resolve(publicInputs.newNoteHashes.map(com => createFakeSiloedCommitment(com.value))),
// );
// proofCreator.createProofInit.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofInner.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofReset.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofTail.mockResolvedValue(createProofOutputFinal([]));
// proofCreator.createAppCircuitProof.mockResolvedValue(createAppCircuitProofOutput());

prover = new KernelProver(oracle, proofCreator);
});

// LONDONTODO(Client): Iterate on this and not the updated full test?
it('should create proofs in correct order', async () => {
{
dependencies = { a: [] };
const executionResult = createExecutionResult('a');
await prove(executionResult);
expectExecution(['a']);
// expectExecution(['a']);
}

{
dependencies = {
a: ['b', 'd'],
b: ['c'],
};
const executionResult = createExecutionResult('a');
await prove(executionResult);
expectExecution(['a', 'b', 'c', 'd']);
}

{
dependencies = {
k: ['m', 'o'],
m: ['q'],
o: ['n', 'p', 'r'],
};
const executionResult = createExecutionResult('k');
await prove(executionResult);
expectExecution(['k', 'm', 'q', 'o', 'n', 'p', 'r']);
}
// {
// dependencies = {
// a: ['b', 'd'],
// b: ['c'],
// };
// const executionResult = createExecutionResult('a');
// await prove(executionResult);
// // expectExecution(['a', 'b', 'c', 'd']);
// }

// {
// dependencies = {
// k: ['m', 'o'],
// m: ['q'],
// o: ['n', 'p', 'r'],
// };
// const executionResult = createExecutionResult('k');
// await prove(executionResult);
// // expectExecution(['k', 'm', 'q', 'o', 'n', 'p', 'r']);
// }
});
});

describe('Kernel Prover Mocked', () => {
let txRequest: TxRequest;
let oracle: ReturnType<typeof mock<ProvingDataOracle>>;
// LONDONTODO(Client): replace with non-mocked and see what happens? This means we fake it
let proofCreator: ReturnType<typeof mock<ProofCreator>>;
let prover: KernelProver;
let dependencies: { [name: string]: string[] } = {};

const contractAddress = AztecAddress.fromBigInt(987654n);

const notesAndSlots: NoteAndSlot[] = Array(10)
.fill(null)
.map(() => ({
note: new Note([Fr.random(), Fr.random(), Fr.random()]),
storageSlot: Fr.random(),
noteTypeId: Fr.random(),
owner: { x: Fr.random(), y: Fr.random() },
}));

const createFakeSiloedCommitment = (commitment: Fr) => new Fr(commitment.value + 1n);
const generateFakeCommitment = (noteAndSlot: NoteAndSlot) => noteAndSlot.note.items[0];
const generateFakeSiloedCommitment = (note: NoteAndSlot) => createFakeSiloedCommitment(generateFakeCommitment(note));

const createExecutionResult = (fnName: string, newNoteIndices: number[] = []): ExecutionResult => {
const publicInputs = PrivateCircuitPublicInputs.empty();
publicInputs.newNoteHashes = makeTuple(
MAX_NEW_NOTE_HASHES_PER_CALL,
i =>
i < newNoteIndices.length
? new NoteHash(generateFakeCommitment(notesAndSlots[newNoteIndices[i]]), 0)
: NoteHash.empty(),
0,
);
const functionData = FunctionData.empty();
functionData.selector = new FunctionSelector(fnName.charCodeAt(0));
return {
callStackItem: new PrivateCallStackItem(AztecAddress.ZERO, functionData, publicInputs),
nestedExecutions: (dependencies[fnName] || []).map(name => createExecutionResult(name)), // LONDONTODO(Client): recursive call
vk: VerificationKey.makeFake().toBuffer(),
newNotes: newNoteIndices.map(idx => notesAndSlots[idx]),
nullifiedNoteHashCounters: new Map(),
noteHashLeafIndexMap: new Map(),
returnValues: [],
acir: Buffer.alloc(0), // LONDONTODO(Client): returning an empty circuit - doesn't ever appear to be populated with smthng nontrivial
partialWitness: new Map(),
enqueuedPublicFunctionCalls: [],
publicTeardownFunctionCall: PublicCallRequest.empty(),
noteEncryptedLogs: [],
encryptedLogs: [],
unencryptedLogs: [],
};
};

const createProofOutput = (newNoteIndices: number[]) => {
const publicInputs = PrivateKernelCircuitPublicInputs.empty();
const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, ScopedNoteHash.empty);
for (let i = 0; i < newNoteIndices.length; i++) {
noteHashes[i] = new NoteHash(generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]), 0).scope(
0,
contractAddress,
);
}

publicInputs.end.newNoteHashes = noteHashes;
return {
publicInputs,
proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const createProofOutputFinal = (newNoteIndices: number[]) => {
const publicInputs = PrivateKernelTailCircuitPublicInputs.empty();
const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, () => Fr.ZERO);
for (let i = 0; i < newNoteIndices.length; i++) {
noteHashes[i] = generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]);
}
publicInputs.forRollup!.end.newNoteHashes = noteHashes;

return {
publicInputs,
proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const createAppCircuitProofOutput = () => {
return {
proof: makeRecursiveProof<typeof RECURSIVE_PROOF_LENGTH>(RECURSIVE_PROOF_LENGTH),
verificationKey: VerificationKeyAsFields.makeEmpty(),
};
};

const expectExecution = (fns: string[]) => {
const callStackItemsInit = proofCreator.createProofInit.mock.calls.map(args =>
String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
);
const callStackItemsInner = proofCreator.createProofInner.mock.calls.map(args =>
String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
);

expect(proofCreator.createProofInit).toHaveBeenCalledTimes(Math.min(1, fns.length));
expect(proofCreator.createProofInner).toHaveBeenCalledTimes(Math.max(0, fns.length - 1));
expect(callStackItemsInit.concat(callStackItemsInner)).toEqual(fns);
proofCreator.createProofInner.mockClear();
proofCreator.createProofInit.mockClear();
};

const prove = (executionResult: ExecutionResult) => prover.prove(txRequest, executionResult);

beforeEach(() => {
txRequest = makeTxRequest();

oracle = mock<ProvingDataOracle>();
// TODO(dbanks12): will need to mock oracle.getNoteMembershipWitness() to test non-transient reads
oracle.getVkMembershipWitness.mockResolvedValue(MembershipWitness.random(VK_TREE_HEIGHT));

oracle.getContractAddressPreimage.mockResolvedValue({
contractClassId: Fr.random(),
publicKeysHash: Fr.random(),
saltedInitializationHash: Fr.random(),
});
oracle.getContractClassIdPreimage.mockResolvedValue({
artifactHash: Fr.random(),
publicBytecodeCommitment: Fr.random(),
privateFunctionsRoot: Fr.random(),
});

proofCreator = mock<ProofCreator>();
proofCreator.getSiloedCommitments.mockImplementation(publicInputs =>
Promise.resolve(publicInputs.newNoteHashes.map(com => createFakeSiloedCommitment(com.value))),
);
proofCreator.createProofInit.mockResolvedValue(createProofOutput([]));
proofCreator.createProofInner.mockResolvedValue(createProofOutput([]));
proofCreator.createProofReset.mockResolvedValue(createProofOutput([]));
proofCreator.createProofTail.mockResolvedValue(createProofOutputFinal([]));
proofCreator.createAppCircuitProof.mockResolvedValue(createAppCircuitProofOutput());

prover = new KernelProver(oracle, proofCreator);
});

// LONDONTODO(Client): Iterate on this and not the updated full test?
it('should create proofs in correct order', async () => {
{
dependencies = { a: [] };
const executionResult = createExecutionResult('a');
await prove(executionResult);
expectExecution(['a']);
}

{
dependencies = {
a: ['b', 'd'],
b: ['c'],
};
const executionResult = createExecutionResult('a');
await prove(executionResult);
expectExecution(['a', 'b', 'c', 'd']);
}

{
dependencies = {
k: ['m', 'o'],
m: ['q'],
o: ['n', 'p', 'r'],
};
const executionResult = createExecutionResult('k');
await prove(executionResult);
expectExecution(['k', 'm', 'q', 'o', 'n', 'p', 'r']);
}
});
});
// describe('Kernel Prover Mocked', () => {
// let txRequest: TxRequest;
// let oracle: ReturnType<typeof mock<ProvingDataOracle>>;
// let proofCreator: ReturnType<typeof mock<ProofCreator>>;
// let prover: KernelProver;
// let dependencies: { [name: string]: string[] } = {};

// const contractAddress = AztecAddress.fromBigInt(987654n);

// const notesAndSlots: NoteAndSlot[] = Array(10)
// .fill(null)
// .map(() => ({
// note: new Note([Fr.random(), Fr.random(), Fr.random()]),
// storageSlot: Fr.random(),
// noteTypeId: Fr.random(),
// owner: { x: Fr.random(), y: Fr.random() },
// }));

// const createFakeSiloedCommitment = (commitment: Fr) => new Fr(commitment.value + 1n);
// const generateFakeCommitment = (noteAndSlot: NoteAndSlot) => noteAndSlot.note.items[0];
// const generateFakeSiloedCommitment = (note: NoteAndSlot) => createFakeSiloedCommitment(generateFakeCommitment(note));

// const createExecutionResult = (fnName: string, newNoteIndices: number[] = []): ExecutionResult => {
// const publicInputs = PrivateCircuitPublicInputs.empty();
// publicInputs.newNoteHashes = makeTuple(
// MAX_NEW_NOTE_HASHES_PER_CALL,
// i =>
// i < newNoteIndices.length
// ? new NoteHash(generateFakeCommitment(notesAndSlots[newNoteIndices[i]]), 0)
// : NoteHash.empty(),
// 0,
// );
// const functionData = FunctionData.empty();
// functionData.selector = new FunctionSelector(fnName.charCodeAt(0));
// return {
// callStackItem: new PrivateCallStackItem(AztecAddress.ZERO, functionData, publicInputs),
// nestedExecutions: (dependencies[fnName] || []).map(name => createExecutionResult(name)), // LONDONTODO(Client): recursive call
// vk: VerificationKey.makeFake().toBuffer(),
// newNotes: newNoteIndices.map(idx => notesAndSlots[idx]),
// nullifiedNoteHashCounters: new Map(),
// noteHashLeafIndexMap: new Map(),
// returnValues: [],
// acir: Buffer.alloc(0), // LONDONTODO(Client): returning an empty circuit - doesn't ever appear to be populated with smthng nontrivial
// partialWitness: new Map(),
// enqueuedPublicFunctionCalls: [],
// publicTeardownFunctionCall: PublicCallRequest.empty(),
// noteEncryptedLogs: [],
// encryptedLogs: [],
// unencryptedLogs: [],
// };
// };

// const createProofOutput = (newNoteIndices: number[]) => {
// const publicInputs = PrivateKernelCircuitPublicInputs.empty();
// const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, ScopedNoteHash.empty);
// for (let i = 0; i < newNoteIndices.length; i++) {
// noteHashes[i] = new NoteHash(generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]), 0).scope(
// 0,
// contractAddress,
// );
// }

// publicInputs.end.newNoteHashes = noteHashes;
// return {
// publicInputs,
// proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const createProofOutputFinal = (newNoteIndices: number[]) => {
// const publicInputs = PrivateKernelTailCircuitPublicInputs.empty();
// const noteHashes = makeTuple(MAX_NEW_NOTE_HASHES_PER_TX, () => Fr.ZERO);
// for (let i = 0; i < newNoteIndices.length; i++) {
// noteHashes[i] = generateFakeSiloedCommitment(notesAndSlots[newNoteIndices[i]]);
// }
// publicInputs.forRollup!.end.newNoteHashes = noteHashes;

// return {
// publicInputs,
// proof: makeRecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const createAppCircuitProofOutput = () => {
// return {
// proof: makeRecursiveProof<typeof RECURSIVE_PROOF_LENGTH>(RECURSIVE_PROOF_LENGTH),
// verificationKey: VerificationKeyAsFields.makeEmpty(),
// };
// };

// const expectExecution = (fns: string[]) => {
// const callStackItemsInit = proofCreator.createProofInit.mock.calls.map(args =>
// String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
// );
// const callStackItemsInner = proofCreator.createProofInner.mock.calls.map(args =>
// String.fromCharCode(args[0].privateCall.callStackItem.functionData.selector.value),
// );

// expect(proofCreator.createProofInit).toHaveBeenCalledTimes(Math.min(1, fns.length));
// expect(proofCreator.createProofInner).toHaveBeenCalledTimes(Math.max(0, fns.length - 1));
// expect(callStackItemsInit.concat(callStackItemsInner)).toEqual(fns);
// proofCreator.createProofInner.mockClear();
// proofCreator.createProofInit.mockClear();
// };

// const prove = (executionResult: ExecutionResult) => prover.prove(txRequest, executionResult);

// beforeEach(() => {
// txRequest = makeTxRequest();

// oracle = mock<ProvingDataOracle>();
// // TODO(dbanks12): will need to mock oracle.getNoteMembershipWitness() to test non-transient reads
// oracle.getVkMembershipWitness.mockResolvedValue(MembershipWitness.random(VK_TREE_HEIGHT));

// oracle.getContractAddressPreimage.mockResolvedValue({
// contractClassId: Fr.random(),
// publicKeysHash: Fr.random(),
// saltedInitializationHash: Fr.random(),
// });
// oracle.getContractClassIdPreimage.mockResolvedValue({
// artifactHash: Fr.random(),
// publicBytecodeCommitment: Fr.random(),
// privateFunctionsRoot: Fr.random(),
// });

// proofCreator = mock<ProofCreator>();
// proofCreator.getSiloedCommitments.mockImplementation(publicInputs =>
// Promise.resolve(publicInputs.newNoteHashes.map(com => createFakeSiloedCommitment(com.value))),
// );
// proofCreator.createProofInit.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofInner.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofReset.mockResolvedValue(createProofOutput([]));
// proofCreator.createProofTail.mockResolvedValue(createProofOutputFinal([]));
// proofCreator.createAppCircuitProof.mockResolvedValue(createAppCircuitProofOutput());

// prover = new KernelProver(oracle, proofCreator);
// });

// it('should create proofs in correct order', async () => {
// {
// dependencies = { a: [] };
// const executionResult = createExecutionResult('a');
// await prove(executionResult);
// expectExecution(['a']);
// }

// {
// dependencies = {
// a: ['b', 'd'],
// b: ['c'],
// };
// const executionResult = createExecutionResult('a');
// await prove(executionResult);
// expectExecution(['a', 'b', 'c', 'd']);
// }

// {
// dependencies = {
// k: ['m', 'o'],
// m: ['q'],
// o: ['n', 'p', 'r'],
// };
// const executionResult = createExecutionResult('k');
// await prove(executionResult);
// expectExecution(['k', 'm', 'q', 'o', 'n', 'p', 'r']);
// }
// });
// });

Unchanged files with check annotations Beta

format-check:
FROM +build
RUN yarn formatting

Check failure on line 220 in yarn-project/Earthfile

GitHub Actions / yarn-project-formatting

Error

The command RUN yarn formatting did not complete successfully. Exit code 1
test:
FROM +build
RUN yarn test

Check failure on line 224 in yarn-project/Earthfile

GitHub Actions / yarn-project-test

Error

The command RUN yarn test did not complete successfully. Exit code 1
run-e2e:
ARG test