Skip to content

Commit 8f692f1

Browse files
committed
fix(fast-inbox): include the message-only block-root proof in the ProvingJobResult schema (A-1375)
BLOCK_ROOT_MSGS_ONLY_ROLLUP was added to the enum, the ProvingJobInputs union, and the result type map, but omitted from the ProvingJobResult discriminated union. A checkpoint that builds a message-only block produces this proof output, which the proof store then fails to decode with an invalid-discriminator error, stalling proving. Add the missing union member, mirroring the other block-root results. Adds a schema round-trip regression test.
1 parent ebd2182 commit 8f692f1

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

yarn-project/stdlib/src/interfaces/proving-job-source.test.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH } from '@aztec/constants';
22
import { EpochNumber } from '@aztec/foundation/branded-types';
3+
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
34
import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test';
45

56
import { ProvingRequestType } from '../proofs/proving_request_type.js';
67
import { makeRecursiveProof } from '../proofs/recursive_proof.js';
8+
import { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
79
import { TxRollupPublicInputs } from '../rollup/tx_rollup_public_inputs.js';
10+
import { makeBlockRollupPublicInputs } from '../tests/factories.js';
811
import { VerificationKeyData } from '../vks/verification_key.js';
912
import { type ProvingJobSource, ProvingJobSourceSchema } from './proving-job-source.js';
1013
import {
1114
type ProofUri,
1215
type ProvingJob,
13-
type ProvingJobResult,
16+
ProvingJobResult,
1417
type ProvingRequestResultFor,
1518
makePublicInputsAndRecursiveProof,
1619
} from './proving-job.js';
@@ -63,6 +66,28 @@ describe('ProvingJobSourceSchema', () => {
6366
});
6467
});
6568

69+
describe('ProvingJobResult', () => {
70+
it('round-trips a message-only block-root rollup result through the schema', () => {
71+
// The message-only block-root proof type must survive serialization: a checkpoint that builds a message-only
72+
// block produces this result, and the proof store decodes it via the ProvingJobResult schema. Omitting it from
73+
// the union throws "Invalid discriminator value" and stalls proving.
74+
const result: ProvingJobResult = {
75+
type: ProvingRequestType.BLOCK_ROOT_MSGS_ONLY_ROLLUP,
76+
result: makePublicInputsAndRecursiveProof<
77+
BlockRollupPublicInputs,
78+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
79+
>(
80+
makeBlockRollupPublicInputs(),
81+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
82+
VerificationKeyData.makeFakeRollupHonk(),
83+
),
84+
};
85+
86+
const roundTripped = jsonParseWithSchema<ProvingJobResult>(jsonStringify(result), ProvingJobResult);
87+
expect(roundTripped.type).toEqual(ProvingRequestType.BLOCK_ROOT_MSGS_ONLY_ROLLUP);
88+
});
89+
});
90+
6691
class MockProvingJobSource implements ProvingJobSource {
6792
getProvingJob(): Promise<ProvingJob | undefined> {
6893
return Promise.resolve({

yarn-project/stdlib/src/interfaces/proving-job.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ export const ProvingJobResult = z.discriminatedUnion('type', [
277277
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
278278
),
279279
}),
280+
z.object({
281+
type: z.literal(ProvingRequestType.BLOCK_ROOT_MSGS_ONLY_ROLLUP),
282+
result: schemaForPublicInputsAndRecursiveProof(
283+
BlockRollupPublicInputs.schema,
284+
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
285+
),
286+
}),
280287
z.object({
281288
type: z.literal(ProvingRequestType.BLOCK_MERGE_ROLLUP),
282289
result: schemaForPublicInputsAndRecursiveProof(

0 commit comments

Comments
 (0)