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

chore: Use realistic size Client IVC proofs during simulations #11692

Merged
merged 9 commits into from
Feb 12, 2025
11 changes: 11 additions & 0 deletions yarn-project/circuits.js/src/structs/client_ivc_proof.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { randomBytes } from '@aztec/foundation/crypto';
import { bufferSchemaFor } from '@aztec/foundation/schemas';
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';

const CLIENT_IVC_PROOF_LENGTH = 172052;
const CLIENT_IVC_VK_LENGTH = 2730;

/**
* TODO(https://github.com/AztecProtocol/aztec-packages/issues/7370) refactory this to
* eventually we read all these VKs from the data tree instead of passing them
Expand All @@ -26,6 +30,13 @@ export class ClientIvcProof {
return new ClientIvcProof(Buffer.alloc(1, fill), Buffer.alloc(1, fill));
}

static random() {
return new ClientIvcProof(
Buffer.from(randomBytes(CLIENT_IVC_PROOF_LENGTH)),
Buffer.from(randomBytes(CLIENT_IVC_VK_LENGTH)),
);
}

static get schema() {
return bufferSchemaFor(ClientIvcProof);
}
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/kernel_prover/kernel_prover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export class KernelProver {
const ivcProof = await this.proofCreator.createClientIvcProof(acirs, witnessStack);
tailOutput.clientIvcProof = ivcProof;
} else {
tailOutput.clientIvcProof = ClientIvcProof.empty();
tailOutput.clientIvcProof = ClientIvcProof.random();
}

return tailOutput;
Expand Down