Skip to content

Commit 6d72034

Browse files
committed
fix: feed a valid sha-truncated inHash in bb_prover_parity test
ParityPublicInputs requires inHash to be a 31-byte (top-byte-zero) sha frontier root; the InboxParity circuit passes in_hash through unconstrained, so a raw Fr.random() input reappears in the output and fails the constructor check. Compute inHash from the messages instead.
1 parent 1c0e514 commit 6d72034

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

yarn-project/prover-client/src/test/bb_prover_parity.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { createLogger } from '@aztec/foundation/log';
55
import type { ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/server';
66
import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
77
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
8-
import { L1ToL2MessageSponge } from '@aztec/stdlib/messaging';
8+
import { L1ToL2MessageSponge, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
99
import { INBOX_PARITY_SIZES, InboxParityPrivateInputs, type InboxParitySize } from '@aztec/stdlib/parity';
1010

1111
import { TestContext } from '../mocks/test_context.js';
@@ -48,7 +48,9 @@ describe('prover/bb_prover/parity', () => {
4848
// Fill the rung with real messages so `numMessages === size` (the largest circuit for that rung).
4949
const messages = Array.from({ length: size }, () => Fr.random());
5050
const proverId = Fr.random();
51-
const inHash = Fr.random();
51+
// The in_hash is a sha256 frontier root (top byte zeroed to fit the field), which `ParityPublicInputs` enforces;
52+
// compute it from the messages rather than using a raw random field.
53+
const inHash = computeInHashFromL1ToL2Messages(messages);
5254

5355
const inputs = InboxParityPrivateInputs.fromMessages(
5456
messages,

0 commit comments

Comments
 (0)