@aztec/prover-client 0.0.0-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dest/bin/get-proof-inputs.d.ts +2 -0
- package/dest/bin/get-proof-inputs.d.ts.map +1 -0
- package/dest/bin/get-proof-inputs.js +51 -0
- package/dest/block_builder/index.d.ts +6 -0
- package/dest/block_builder/index.d.ts.map +1 -0
- package/dest/block_builder/index.js +1 -0
- package/dest/block_builder/light.d.ts +33 -0
- package/dest/block_builder/light.d.ts.map +1 -0
- package/dest/block_builder/light.js +82 -0
- package/dest/config.d.ts +17 -0
- package/dest/config.d.ts.map +1 -0
- package/dest/config.js +39 -0
- package/dest/index.d.ts +4 -0
- package/dest/index.d.ts.map +1 -0
- package/dest/index.js +2 -0
- package/dest/mocks/fixtures.d.ts +20 -0
- package/dest/mocks/fixtures.d.ts.map +1 -0
- package/dest/mocks/fixtures.js +77 -0
- package/dest/mocks/test_context.d.ts +55 -0
- package/dest/mocks/test_context.d.ts.map +1 -0
- package/dest/mocks/test_context.js +193 -0
- package/dest/orchestrator/block-building-helpers.d.ts +55 -0
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -0
- package/dest/orchestrator/block-building-helpers.js +285 -0
- package/dest/orchestrator/block-proving-state.d.ts +76 -0
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/block-proving-state.js +269 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +60 -0
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/epoch-proving-state.js +163 -0
- package/dest/orchestrator/index.d.ts +2 -0
- package/dest/orchestrator/index.d.ts.map +1 -0
- package/dest/orchestrator/index.js +1 -0
- package/dest/orchestrator/orchestrator.d.ts +110 -0
- package/dest/orchestrator/orchestrator.d.ts.map +1 -0
- package/dest/orchestrator/orchestrator.js +690 -0
- package/dest/orchestrator/orchestrator_metrics.d.ts +8 -0
- package/dest/orchestrator/orchestrator_metrics.d.ts.map +1 -0
- package/dest/orchestrator/orchestrator_metrics.js +17 -0
- package/dest/orchestrator/tx-proving-state.d.ts +34 -0
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/tx-proving-state.js +94 -0
- package/dest/prover-client/factory.d.ts +6 -0
- package/dest/prover-client/factory.d.ts.map +1 -0
- package/dest/prover-client/factory.js +5 -0
- package/dest/prover-client/index.d.ts +3 -0
- package/dest/prover-client/index.d.ts.map +1 -0
- package/dest/prover-client/index.js +2 -0
- package/dest/prover-client/prover-client.d.ts +42 -0
- package/dest/prover-client/prover-client.d.ts.map +1 -0
- package/dest/prover-client/prover-client.js +110 -0
- package/dest/prover-client/server-epoch-prover.d.ts +28 -0
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -0
- package/dest/prover-client/server-epoch-prover.js +40 -0
- package/dest/proving_broker/broker_prover_facade.d.ts +46 -0
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -0
- package/dest/proving_broker/broker_prover_facade.js +344 -0
- package/dest/proving_broker/config.d.ts +83 -0
- package/dest/proving_broker/config.d.ts.map +1 -0
- package/dest/proving_broker/config.js +104 -0
- package/dest/proving_broker/factory.d.ts +5 -0
- package/dest/proving_broker/factory.d.ts.map +1 -0
- package/dest/proving_broker/factory.js +9 -0
- package/dest/proving_broker/fixtures.d.ts +5 -0
- package/dest/proving_broker/fixtures.d.ts.map +1 -0
- package/dest/proving_broker/fixtures.js +12 -0
- package/dest/proving_broker/index.d.ts +10 -0
- package/dest/proving_broker/index.d.ts.map +1 -0
- package/dest/proving_broker/index.js +9 -0
- package/dest/proving_broker/proof_store/factory.d.ts +6 -0
- package/dest/proving_broker/proof_store/factory.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/factory.js +36 -0
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts +14 -0
- package/dest/proving_broker/proof_store/gcs_proof_store.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/gcs_proof_store.js +51 -0
- package/dest/proving_broker/proof_store/index.d.ts +4 -0
- package/dest/proving_broker/proof_store/index.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/index.js +3 -0
- package/dest/proving_broker/proof_store/inline_proof_store.d.ts +15 -0
- package/dest/proving_broker/proof_store/inline_proof_store.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/inline_proof_store.js +41 -0
- package/dest/proving_broker/proof_store/proof_store.d.ts +36 -0
- package/dest/proving_broker/proof_store/proof_store.d.ts.map +1 -0
- package/dest/proving_broker/proof_store/proof_store.js +3 -0
- package/dest/proving_broker/proving_agent.d.ts +46 -0
- package/dest/proving_broker/proving_agent.d.ts.map +1 -0
- package/dest/proving_broker/proving_agent.js +134 -0
- package/dest/proving_broker/proving_agent_instrumentation.d.ts +8 -0
- package/dest/proving_broker/proving_agent_instrumentation.d.ts.map +1 -0
- package/dest/proving_broker/proving_agent_instrumentation.js +16 -0
- package/dest/proving_broker/proving_broker.d.ts +64 -0
- package/dest/proving_broker/proving_broker.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker.js +570 -0
- package/dest/proving_broker/proving_broker_database/memory.d.ts +16 -0
- package/dest/proving_broker/proving_broker_database/memory.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker_database/memory.js +54 -0
- package/dest/proving_broker/proving_broker_database/persisted.d.ts +25 -0
- package/dest/proving_broker/proving_broker_database/persisted.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker_database/persisted.js +182 -0
- package/dest/proving_broker/proving_broker_database.d.ts +39 -0
- package/dest/proving_broker/proving_broker_database.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker_database.js +3 -0
- package/dest/proving_broker/proving_broker_instrumentation.d.ts +29 -0
- package/dest/proving_broker/proving_broker_instrumentation.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker_instrumentation.js +110 -0
- package/dest/proving_broker/proving_job_controller.d.ts +33 -0
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -0
- package/dest/proving_broker/proving_job_controller.js +166 -0
- package/dest/proving_broker/rpc.d.ts +27 -0
- package/dest/proving_broker/rpc.d.ts.map +1 -0
- package/dest/proving_broker/rpc.js +66 -0
- package/dest/test/mock_prover.d.ts +35 -0
- package/dest/test/mock_prover.d.ts.map +1 -0
- package/dest/test/mock_prover.js +82 -0
- package/package.json +112 -0
- package/src/bin/get-proof-inputs.ts +59 -0
- package/src/block_builder/index.ts +6 -0
- package/src/block_builder/light.ts +101 -0
- package/src/config.ts +55 -0
- package/src/index.ts +4 -0
- package/src/mocks/fixtures.ts +117 -0
- package/src/mocks/test_context.ts +257 -0
- package/src/orchestrator/block-building-helpers.ts +553 -0
- package/src/orchestrator/block-proving-state.ts +379 -0
- package/src/orchestrator/epoch-proving-state.ts +252 -0
- package/src/orchestrator/index.ts +1 -0
- package/src/orchestrator/orchestrator.ts +971 -0
- package/src/orchestrator/orchestrator_metrics.ts +22 -0
- package/src/orchestrator/tx-proving-state.ts +139 -0
- package/src/prover-client/factory.ts +14 -0
- package/src/prover-client/index.ts +2 -0
- package/src/prover-client/prover-client.ts +162 -0
- package/src/prover-client/server-epoch-prover.ts +51 -0
- package/src/proving_broker/broker_prover_facade.ts +585 -0
- package/src/proving_broker/config.ts +138 -0
- package/src/proving_broker/factory.ts +18 -0
- package/src/proving_broker/fixtures.ts +15 -0
- package/src/proving_broker/index.ts +9 -0
- package/src/proving_broker/proof_store/factory.ts +42 -0
- package/src/proving_broker/proof_store/gcs_proof_store.ts +72 -0
- package/src/proving_broker/proof_store/index.ts +3 -0
- package/src/proving_broker/proof_store/inline_proof_store.ts +63 -0
- package/src/proving_broker/proof_store/proof_store.ts +54 -0
- package/src/proving_broker/proving_agent.ts +181 -0
- package/src/proving_broker/proving_agent_instrumentation.ts +21 -0
- package/src/proving_broker/proving_broker.ts +687 -0
- package/src/proving_broker/proving_broker_database/memory.ts +63 -0
- package/src/proving_broker/proving_broker_database/persisted.ts +218 -0
- package/src/proving_broker/proving_broker_database.ts +44 -0
- package/src/proving_broker/proving_broker_instrumentation.ts +145 -0
- package/src/proving_broker/proving_job_controller.ts +194 -0
- package/src/proving_broker/rpc.ts +95 -0
- package/src/test/mock_prover.ts +253 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib';
|
|
2
|
+
import {
|
|
3
|
+
type ARCHIVE_HEIGHT,
|
|
4
|
+
BLOBS_PER_BLOCK,
|
|
5
|
+
FIELDS_PER_BLOB,
|
|
6
|
+
type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH,
|
|
7
|
+
type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
8
|
+
NUM_BASE_PARITY_PER_ROOT_PARITY,
|
|
9
|
+
type RECURSIVE_PROOF_LENGTH,
|
|
10
|
+
VK_TREE_HEIGHT,
|
|
11
|
+
} from '@aztec/constants';
|
|
12
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
13
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
14
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
15
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
16
|
+
import { MembershipWitness, type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees';
|
|
17
|
+
import { getVKIndex, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
18
|
+
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
19
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
20
|
+
import type { PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
21
|
+
import { type ParityPublicInputs, RootParityInput, RootParityInputs } from '@aztec/stdlib/parity';
|
|
22
|
+
import {
|
|
23
|
+
type BaseOrMergeRollupPublicInputs,
|
|
24
|
+
type BlockRootOrBlockMergePublicInputs,
|
|
25
|
+
BlockRootRollupBlobData,
|
|
26
|
+
BlockRootRollupData,
|
|
27
|
+
BlockRootRollupInputs,
|
|
28
|
+
ConstantRollupData,
|
|
29
|
+
EmptyBlockRootRollupInputs,
|
|
30
|
+
MergeRollupInputs,
|
|
31
|
+
PreviousRollupData,
|
|
32
|
+
SingleTxBlockRootRollupInputs,
|
|
33
|
+
} from '@aztec/stdlib/rollup';
|
|
34
|
+
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
35
|
+
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
36
|
+
import { type BlockHeader, type GlobalVariables, StateReference } from '@aztec/stdlib/tx';
|
|
37
|
+
|
|
38
|
+
import { buildBlobHints, buildHeaderFromCircuitOutputs } from './block-building-helpers.js';
|
|
39
|
+
import type { EpochProvingState } from './epoch-proving-state.js';
|
|
40
|
+
import type { TxProvingState } from './tx-proving-state.js';
|
|
41
|
+
|
|
42
|
+
export type TreeSnapshots = Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The current state of the proving schedule for a given block. Managed by ProvingState.
|
|
46
|
+
* Contains the raw inputs and intermediate state to generate every constituent proof in the tree.
|
|
47
|
+
*/
|
|
48
|
+
export class BlockProvingState {
|
|
49
|
+
private baseOrMergeProvingOutputs: UnbalancedTreeStore<
|
|
50
|
+
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
51
|
+
> = new UnbalancedTreeStore(0);
|
|
52
|
+
private baseParityProvingOutputs: (PublicInputsAndRecursiveProof<ParityPublicInputs> | undefined)[];
|
|
53
|
+
private rootParityProvingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs> | undefined;
|
|
54
|
+
private blockRootProvingOutput:
|
|
55
|
+
| PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
56
|
+
| undefined;
|
|
57
|
+
public blockRootRollupStarted: boolean = false;
|
|
58
|
+
public block: L2Block | undefined;
|
|
59
|
+
public spongeBlobState: SpongeBlob | undefined;
|
|
60
|
+
public totalNumTxs: number;
|
|
61
|
+
private txs: TxProvingState[] = [];
|
|
62
|
+
public error: string | undefined;
|
|
63
|
+
|
|
64
|
+
constructor(
|
|
65
|
+
public readonly index: number,
|
|
66
|
+
public readonly globalVariables: GlobalVariables,
|
|
67
|
+
public readonly newL1ToL2Messages: Fr[],
|
|
68
|
+
private readonly l1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
69
|
+
private readonly l1ToL2MessageTreeSnapshotAfterInsertion: AppendOnlyTreeSnapshot,
|
|
70
|
+
private readonly lastArchiveSnapshot: AppendOnlyTreeSnapshot,
|
|
71
|
+
private readonly newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
72
|
+
private readonly previousBlockHeader: BlockHeader,
|
|
73
|
+
private readonly parentEpoch: EpochProvingState,
|
|
74
|
+
) {
|
|
75
|
+
this.baseParityProvingOutputs = Array.from({ length: NUM_BASE_PARITY_PER_ROOT_PARITY }).map(_ => undefined);
|
|
76
|
+
this.totalNumTxs = 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public get blockNumber() {
|
|
80
|
+
return this.globalVariables.blockNumber.toNumber();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public startNewBlock(numTxs: number, numBlobFields: number) {
|
|
84
|
+
if (this.spongeBlobState) {
|
|
85
|
+
throw new Error(`Block ${this.blockNumber} already initalised.`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
this.baseOrMergeProvingOutputs = new UnbalancedTreeStore(numTxs);
|
|
89
|
+
// Initialise the sponge which will eventually absorb all tx effects to be added to the blob.
|
|
90
|
+
// Like l1 to l2 messages, we need to know beforehand how many effects will be absorbed.
|
|
91
|
+
this.spongeBlobState = SpongeBlob.init(numBlobFields);
|
|
92
|
+
this.totalNumTxs = numTxs;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Adds a transaction to the proving state, returns it's index
|
|
96
|
+
public addNewTx(tx: TxProvingState) {
|
|
97
|
+
if (!this.spongeBlobState) {
|
|
98
|
+
throw new Error(`Invalid block proving state, call startNewBlock before adding transactions.`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const txIndex = this.txs.length;
|
|
102
|
+
this.txs[txIndex] = tx;
|
|
103
|
+
return txIndex;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public setBaseRollupProof(
|
|
107
|
+
txIndex: number,
|
|
108
|
+
provingOutput: PublicInputsAndRecursiveProof<
|
|
109
|
+
BaseOrMergeRollupPublicInputs,
|
|
110
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
111
|
+
>,
|
|
112
|
+
): TreeNodeLocation {
|
|
113
|
+
return this.baseOrMergeProvingOutputs.setLeaf(txIndex, provingOutput);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
public setMergeRollupProof(
|
|
117
|
+
location: TreeNodeLocation,
|
|
118
|
+
provingOutput: PublicInputsAndRecursiveProof<
|
|
119
|
+
BaseOrMergeRollupPublicInputs,
|
|
120
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
121
|
+
>,
|
|
122
|
+
) {
|
|
123
|
+
this.baseOrMergeProvingOutputs.setNode(location, provingOutput);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Stores a set of root parity inputs at the given index
|
|
127
|
+
public setBaseParityProof(index: number, provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>) {
|
|
128
|
+
if (index >= NUM_BASE_PARITY_PER_ROOT_PARITY) {
|
|
129
|
+
throw new Error(
|
|
130
|
+
`Unable to set a base parity proofs at index ${index}. Expected at most ${NUM_BASE_PARITY_PER_ROOT_PARITY} proofs.`,
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
this.baseParityProvingOutputs[index] = provingOutput;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public setRootParityProof(provingOutput: PublicInputsAndRecursiveProof<ParityPublicInputs>) {
|
|
137
|
+
this.rootParityProvingOutput = provingOutput;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
public setBlockRootRollupProof(
|
|
141
|
+
provingOutput: PublicInputsAndRecursiveProof<
|
|
142
|
+
BlockRootOrBlockMergePublicInputs,
|
|
143
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
144
|
+
>,
|
|
145
|
+
) {
|
|
146
|
+
this.blockRootProvingOutput = provingOutput;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Returns the complete set of transaction proving state objects
|
|
150
|
+
public get allTxs() {
|
|
151
|
+
return this.txs;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Returns the block number as an epoch number. Used for prioritizing proof requests. */
|
|
155
|
+
public get epochNumber(): number {
|
|
156
|
+
return this.parentEpoch.epochNumber;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
public getParentLocation(location: TreeNodeLocation) {
|
|
160
|
+
return this.baseOrMergeProvingOutputs.getParentLocation(location);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public getMergeRollupInputs(mergeLocation: TreeNodeLocation) {
|
|
164
|
+
const [left, right] = this.baseOrMergeProvingOutputs.getChildren(mergeLocation);
|
|
165
|
+
if (!left || !right) {
|
|
166
|
+
throw new Error('At lease one child is not ready.');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return new MergeRollupInputs([this.#getPreviousRollupData(left), this.#getPreviousRollupData(right)]);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public async getBlockRootRollupTypeAndInputs(proverId: Fr) {
|
|
173
|
+
if (!this.rootParityProvingOutput) {
|
|
174
|
+
throw new Error('Root parity is not ready.');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const proofs = this.#getChildProofsForBlockRoot();
|
|
178
|
+
const nonEmptyProofs = proofs.filter(p => !!p);
|
|
179
|
+
if (proofs.length !== nonEmptyProofs.length) {
|
|
180
|
+
throw new Error('At lease one child is not ready for the block root.');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const data = this.#getBlockRootRollupData(proverId);
|
|
184
|
+
|
|
185
|
+
if (this.totalNumTxs === 0) {
|
|
186
|
+
const constants = ConstantRollupData.from({
|
|
187
|
+
lastArchive: this.lastArchiveSnapshot,
|
|
188
|
+
globalVariables: this.globalVariables,
|
|
189
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
190
|
+
protocolContractTreeRoot,
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
rollupType: 'empty-block-root-rollup' satisfies CircuitName,
|
|
195
|
+
inputs: EmptyBlockRootRollupInputs.from({
|
|
196
|
+
data,
|
|
197
|
+
constants,
|
|
198
|
+
isPadding: false,
|
|
199
|
+
}),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const previousRollupData = await Promise.all(nonEmptyProofs.map(p => this.#getPreviousRollupData(p!)));
|
|
204
|
+
const blobData = await this.#getBlockRootRollupBlobData();
|
|
205
|
+
|
|
206
|
+
if (previousRollupData.length === 1) {
|
|
207
|
+
return {
|
|
208
|
+
rollupType: 'single-tx-block-root-rollup' satisfies CircuitName,
|
|
209
|
+
inputs: new SingleTxBlockRootRollupInputs(previousRollupData as [PreviousRollupData], data, blobData),
|
|
210
|
+
};
|
|
211
|
+
} else {
|
|
212
|
+
return {
|
|
213
|
+
rollupType: 'block-root-rollup' satisfies CircuitName,
|
|
214
|
+
inputs: new BlockRootRollupInputs(
|
|
215
|
+
previousRollupData as [PreviousRollupData, PreviousRollupData],
|
|
216
|
+
data,
|
|
217
|
+
blobData,
|
|
218
|
+
),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public async getPaddingBlockRootInputs(proverId: Fr) {
|
|
224
|
+
if (!this.rootParityProvingOutput) {
|
|
225
|
+
throw new Error('Root parity is not ready.');
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Use the new block header and archive of the current block as the previous header and archiver of the next padding block.
|
|
229
|
+
const newBlockHeader = await this.buildHeaderFromProvingOutputs();
|
|
230
|
+
const newArchive = this.blockRootProvingOutput!.inputs.newArchive;
|
|
231
|
+
|
|
232
|
+
const data = BlockRootRollupData.from({
|
|
233
|
+
l1ToL2Roots: this.#getRootParityData(this.rootParityProvingOutput!),
|
|
234
|
+
l1ToL2MessageSubtreeSiblingPath: this.l1ToL2MessageSubtreeSiblingPath,
|
|
235
|
+
newArchiveSiblingPath: this.newArchiveSiblingPath,
|
|
236
|
+
previousBlockHeader: newBlockHeader,
|
|
237
|
+
proverId,
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
const constants = ConstantRollupData.from({
|
|
241
|
+
lastArchive: newArchive,
|
|
242
|
+
globalVariables: this.globalVariables,
|
|
243
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
244
|
+
protocolContractTreeRoot,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
return EmptyBlockRootRollupInputs.from({
|
|
248
|
+
data,
|
|
249
|
+
constants,
|
|
250
|
+
isPadding: true,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
public getRootParityInputs() {
|
|
255
|
+
if (!this.baseParityProvingOutputs.every(p => !!p)) {
|
|
256
|
+
throw new Error('At lease one base parity is not ready.');
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const children = this.baseParityProvingOutputs.map(p => this.#getRootParityData(p!));
|
|
260
|
+
return new RootParityInputs(
|
|
261
|
+
children as Tuple<RootParityInput<typeof RECURSIVE_PROOF_LENGTH>, typeof NUM_BASE_PARITY_PER_ROOT_PARITY>,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Returns a specific transaction proving state
|
|
266
|
+
public getTxProvingState(txIndex: number) {
|
|
267
|
+
return this.txs[txIndex];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
public async buildHeaderFromProvingOutputs(logger?: Logger) {
|
|
271
|
+
const previousRollupData =
|
|
272
|
+
this.totalNumTxs === 0
|
|
273
|
+
? []
|
|
274
|
+
: await Promise.all(this.#getChildProofsForBlockRoot().map(p => this.#getPreviousRollupData(p!)));
|
|
275
|
+
|
|
276
|
+
let endPartialState = this.previousBlockHeader.state.partial;
|
|
277
|
+
if (this.totalNumTxs !== 0) {
|
|
278
|
+
const previousRollupData = this.#getChildProofsForBlockRoot();
|
|
279
|
+
const lastRollup = previousRollupData[previousRollupData.length - 1];
|
|
280
|
+
if (!lastRollup) {
|
|
281
|
+
throw new Error('End state of the block is not available. Last rollup is not ready yet.');
|
|
282
|
+
}
|
|
283
|
+
endPartialState = lastRollup.inputs.end;
|
|
284
|
+
}
|
|
285
|
+
const endState = new StateReference(this.l1ToL2MessageTreeSnapshotAfterInsertion, endPartialState);
|
|
286
|
+
|
|
287
|
+
return buildHeaderFromCircuitOutputs(
|
|
288
|
+
previousRollupData.map(d => d.baseOrMergeRollupPublicInputs),
|
|
289
|
+
this.rootParityProvingOutput!.inputs,
|
|
290
|
+
this.blockRootProvingOutput!.inputs,
|
|
291
|
+
endState,
|
|
292
|
+
logger,
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
public isReadyForMergeRollup(location: TreeNodeLocation) {
|
|
297
|
+
return this.baseOrMergeProvingOutputs.getSibling(location) !== undefined;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// Returns true if we have sufficient inputs to execute the block root rollup
|
|
301
|
+
public isReadyForBlockRootRollup() {
|
|
302
|
+
const childProofs = this.#getChildProofsForBlockRoot();
|
|
303
|
+
return this.block !== undefined && this.rootParityProvingOutput !== undefined && childProofs.every(p => !!p);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Returns true if we have sufficient root parity inputs to execute the root parity circuit
|
|
307
|
+
public isReadyForRootParity() {
|
|
308
|
+
return this.baseParityProvingOutputs.every(p => !!p);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
public isComplete() {
|
|
312
|
+
return !!this.blockRootProvingOutput;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Returns whether the proving state is still valid
|
|
316
|
+
public verifyState() {
|
|
317
|
+
return this.parentEpoch.verifyState();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
public reject(reason: string) {
|
|
321
|
+
this.error = reason;
|
|
322
|
+
this.parentEpoch.reject(reason);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
#getBlockRootRollupData(proverId: Fr) {
|
|
326
|
+
return BlockRootRollupData.from({
|
|
327
|
+
l1ToL2Roots: this.#getRootParityData(this.rootParityProvingOutput!),
|
|
328
|
+
l1ToL2MessageSubtreeSiblingPath: this.l1ToL2MessageSubtreeSiblingPath,
|
|
329
|
+
newArchiveSiblingPath: this.newArchiveSiblingPath,
|
|
330
|
+
previousBlockHeader: this.previousBlockHeader,
|
|
331
|
+
proverId,
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
async #getBlockRootRollupBlobData() {
|
|
336
|
+
const txEffects = this.txs.map(txProvingState => txProvingState.processedTx.txEffect);
|
|
337
|
+
const { blobFields, blobCommitments, blobsHash } = await buildBlobHints(txEffects);
|
|
338
|
+
return BlockRootRollupBlobData.from({
|
|
339
|
+
blobFields: padArrayEnd(blobFields, Fr.ZERO, FIELDS_PER_BLOB * BLOBS_PER_BLOCK),
|
|
340
|
+
blobCommitments: padArrayEnd(blobCommitments, [Fr.ZERO, Fr.ZERO], BLOBS_PER_BLOCK),
|
|
341
|
+
blobsHash,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
#getChildProofsForBlockRoot() {
|
|
346
|
+
if (this.totalNumTxs === 0) {
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const rootLocation = { level: 0, index: 0 };
|
|
351
|
+
// If there's only 1 tx, its base rollup proof will be stored at the root.
|
|
352
|
+
return this.totalNumTxs === 1
|
|
353
|
+
? [this.baseOrMergeProvingOutputs.getNode(rootLocation)]
|
|
354
|
+
: this.baseOrMergeProvingOutputs.getChildren(rootLocation);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
#getPreviousRollupData({
|
|
358
|
+
inputs,
|
|
359
|
+
proof,
|
|
360
|
+
verificationKey,
|
|
361
|
+
}: PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>) {
|
|
362
|
+
const leafIndex = getVKIndex(verificationKey.keyAsFields);
|
|
363
|
+
return new PreviousRollupData(
|
|
364
|
+
inputs,
|
|
365
|
+
proof,
|
|
366
|
+
verificationKey.keyAsFields,
|
|
367
|
+
new MembershipWitness(VK_TREE_HEIGHT, BigInt(leafIndex), getVKSiblingPath(leafIndex)),
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
#getRootParityData({ inputs, proof, verificationKey }: PublicInputsAndRecursiveProof<ParityPublicInputs>) {
|
|
372
|
+
return new RootParityInput(
|
|
373
|
+
proof,
|
|
374
|
+
verificationKey.keyAsFields,
|
|
375
|
+
getVKSiblingPath(getVKIndex(verificationKey)),
|
|
376
|
+
inputs,
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ARCHIVE_HEIGHT,
|
|
3
|
+
type L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH,
|
|
4
|
+
type NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
|
+
type TUBE_PROOF_LENGTH,
|
|
6
|
+
VK_TREE_HEIGHT,
|
|
7
|
+
} from '@aztec/constants';
|
|
8
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
9
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
10
|
+
import { MembershipWitness, type TreeNodeLocation, UnbalancedTreeStore } from '@aztec/foundation/trees';
|
|
11
|
+
import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
12
|
+
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
13
|
+
import type { Proof } from '@aztec/stdlib/proofs';
|
|
14
|
+
import {
|
|
15
|
+
BlockMergeRollupInputs,
|
|
16
|
+
type BlockRootOrBlockMergePublicInputs,
|
|
17
|
+
PreviousRollupBlockData,
|
|
18
|
+
RootRollupInputs,
|
|
19
|
+
type RootRollupPublicInputs,
|
|
20
|
+
} from '@aztec/stdlib/rollup';
|
|
21
|
+
import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
|
|
22
|
+
import type { BlockHeader, GlobalVariables } from '@aztec/stdlib/tx';
|
|
23
|
+
|
|
24
|
+
import { BlockProvingState } from './block-proving-state.js';
|
|
25
|
+
|
|
26
|
+
export type TreeSnapshots = Map<MerkleTreeId, AppendOnlyTreeSnapshot>;
|
|
27
|
+
|
|
28
|
+
enum PROVING_STATE_LIFECYCLE {
|
|
29
|
+
PROVING_STATE_CREATED,
|
|
30
|
+
PROVING_STATE_FULL,
|
|
31
|
+
PROVING_STATE_RESOLVED,
|
|
32
|
+
PROVING_STATE_REJECTED,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ProvingResult = { status: 'success' } | { status: 'failure'; reason: string };
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The current state of the proving schedule for an epoch.
|
|
39
|
+
* Contains the raw inputs and intermediate state to generate every constituent proof in the tree.
|
|
40
|
+
* Carries an identifier so we can identify if the proving state is discarded and a new one started.
|
|
41
|
+
* Captures resolve and reject callbacks to provide a promise base interface to the consumer of our proving.
|
|
42
|
+
*/
|
|
43
|
+
export class EpochProvingState {
|
|
44
|
+
private blockRootOrMergeProvingOutputs: UnbalancedTreeStore<
|
|
45
|
+
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
46
|
+
>;
|
|
47
|
+
private paddingBlockRootProvingOutput:
|
|
48
|
+
| PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
49
|
+
| undefined;
|
|
50
|
+
private rootRollupProvingOutput: PublicInputsAndRecursiveProof<RootRollupPublicInputs> | undefined;
|
|
51
|
+
private provingStateLifecycle = PROVING_STATE_LIFECYCLE.PROVING_STATE_CREATED;
|
|
52
|
+
|
|
53
|
+
// Map from tx hash to tube proof promise. Used when kickstarting tube proofs before tx processing.
|
|
54
|
+
public readonly cachedTubeProofs = new Map<string, Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>>>();
|
|
55
|
+
|
|
56
|
+
public blocks: (BlockProvingState | undefined)[] = [];
|
|
57
|
+
|
|
58
|
+
constructor(
|
|
59
|
+
public readonly epochNumber: number,
|
|
60
|
+
public readonly firstBlockNumber: number,
|
|
61
|
+
public readonly totalNumBlocks: number,
|
|
62
|
+
private completionCallback: (result: ProvingResult) => void,
|
|
63
|
+
private rejectionCallback: (reason: string) => void,
|
|
64
|
+
) {
|
|
65
|
+
this.blockRootOrMergeProvingOutputs = new UnbalancedTreeStore(totalNumBlocks);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Adds a block to the proving state, returns its index
|
|
69
|
+
// Will update the proving life cycle if this is the last block
|
|
70
|
+
public startNewBlock(
|
|
71
|
+
globalVariables: GlobalVariables,
|
|
72
|
+
l1ToL2Messages: Fr[],
|
|
73
|
+
l1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
74
|
+
l1ToL2MessageTreeSnapshotAfterInsertion: AppendOnlyTreeSnapshot,
|
|
75
|
+
lastArchiveSnapshot: AppendOnlyTreeSnapshot,
|
|
76
|
+
newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
77
|
+
previousBlockHeader: BlockHeader,
|
|
78
|
+
): BlockProvingState {
|
|
79
|
+
const index = globalVariables.blockNumber.toNumber() - this.firstBlockNumber;
|
|
80
|
+
const block = new BlockProvingState(
|
|
81
|
+
index,
|
|
82
|
+
globalVariables,
|
|
83
|
+
l1ToL2Messages,
|
|
84
|
+
l1ToL2MessageSubtreeSiblingPath,
|
|
85
|
+
l1ToL2MessageTreeSnapshotAfterInsertion,
|
|
86
|
+
lastArchiveSnapshot,
|
|
87
|
+
newArchiveSiblingPath,
|
|
88
|
+
previousBlockHeader,
|
|
89
|
+
this,
|
|
90
|
+
);
|
|
91
|
+
this.blocks[index] = block;
|
|
92
|
+
if (this.blocks.filter(b => !!b).length === this.totalNumBlocks) {
|
|
93
|
+
this.provingStateLifecycle = PROVING_STATE_LIFECYCLE.PROVING_STATE_FULL;
|
|
94
|
+
}
|
|
95
|
+
return block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Returns true if this proving state is still valid, false otherwise
|
|
99
|
+
public verifyState() {
|
|
100
|
+
return (
|
|
101
|
+
this.provingStateLifecycle === PROVING_STATE_LIFECYCLE.PROVING_STATE_CREATED ||
|
|
102
|
+
this.provingStateLifecycle === PROVING_STATE_LIFECYCLE.PROVING_STATE_FULL
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Returns true if we are still able to accept blocks, false otherwise
|
|
107
|
+
public isAcceptingBlocks() {
|
|
108
|
+
return this.provingStateLifecycle === PROVING_STATE_LIFECYCLE.PROVING_STATE_CREATED;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public setBlockRootRollupProof(
|
|
112
|
+
blockIndex: number,
|
|
113
|
+
proof: PublicInputsAndRecursiveProof<
|
|
114
|
+
BlockRootOrBlockMergePublicInputs,
|
|
115
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
116
|
+
>,
|
|
117
|
+
): TreeNodeLocation {
|
|
118
|
+
return this.blockRootOrMergeProvingOutputs.setLeaf(blockIndex, proof);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
public setBlockMergeRollupProof(
|
|
122
|
+
location: TreeNodeLocation,
|
|
123
|
+
proof: PublicInputsAndRecursiveProof<
|
|
124
|
+
BlockRootOrBlockMergePublicInputs,
|
|
125
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
126
|
+
>,
|
|
127
|
+
) {
|
|
128
|
+
this.blockRootOrMergeProvingOutputs.setNode(location, proof);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public setRootRollupProof(proof: PublicInputsAndRecursiveProof<RootRollupPublicInputs>) {
|
|
132
|
+
this.rootRollupProvingOutput = proof;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public setPaddingBlockRootProof(
|
|
136
|
+
proof: PublicInputsAndRecursiveProof<
|
|
137
|
+
BlockRootOrBlockMergePublicInputs,
|
|
138
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
139
|
+
>,
|
|
140
|
+
) {
|
|
141
|
+
this.paddingBlockRootProvingOutput = proof;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public getParentLocation(location: TreeNodeLocation) {
|
|
145
|
+
return this.blockRootOrMergeProvingOutputs.getParentLocation(location);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public getBlockMergeRollupInputs(mergeLocation: TreeNodeLocation) {
|
|
149
|
+
const [left, right] = this.blockRootOrMergeProvingOutputs.getChildren(mergeLocation);
|
|
150
|
+
if (!left || !right) {
|
|
151
|
+
throw new Error('At lease one child is not ready.');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return new BlockMergeRollupInputs([this.#getPreviousRollupData(left), this.#getPreviousRollupData(right)]);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public getRootRollupInputs(proverId: Fr) {
|
|
158
|
+
const [left, right] = this.#getChildProofsForRoot();
|
|
159
|
+
if (!left || !right) {
|
|
160
|
+
throw new Error('At lease one child is not ready.');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return RootRollupInputs.from({
|
|
164
|
+
previousRollupData: [this.#getPreviousRollupData(left), this.#getPreviousRollupData(right)],
|
|
165
|
+
proverId,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
public getPaddingBlockRootInputs(proverId: Fr) {
|
|
170
|
+
if (!this.blocks[0]?.isComplete()) {
|
|
171
|
+
throw new Error('Epoch needs one completed block in order to be padded.');
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return this.blocks[0].getPaddingBlockRootInputs(proverId);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Returns a specific transaction proving state
|
|
178
|
+
public getBlockProvingStateByBlockNumber(blockNumber: number) {
|
|
179
|
+
return this.blocks.find(block => block?.blockNumber === blockNumber);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
public getEpochProofResult(): { proof: Proof; publicInputs: RootRollupPublicInputs } {
|
|
183
|
+
if (!this.rootRollupProvingOutput) {
|
|
184
|
+
throw new Error('Unable to get epoch proof result. Root rollup is not ready.');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return {
|
|
188
|
+
proof: this.rootRollupProvingOutput.proof.binaryProof,
|
|
189
|
+
publicInputs: this.rootRollupProvingOutput.inputs,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public isReadyForBlockMerge(location: TreeNodeLocation) {
|
|
194
|
+
return this.blockRootOrMergeProvingOutputs.getSibling(location) !== undefined;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Returns true if we have sufficient inputs to execute the block root rollup
|
|
198
|
+
public isReadyForRootRollup() {
|
|
199
|
+
const childProofs = this.#getChildProofsForRoot();
|
|
200
|
+
return childProofs.every(p => !!p);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Attempts to reject the proving state promise with a reason of 'cancelled'
|
|
204
|
+
public cancel() {
|
|
205
|
+
this.reject('Proving cancelled');
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Attempts to reject the proving state promise with the given reason
|
|
209
|
+
// Does nothing if not in a valid state
|
|
210
|
+
public reject(reason: string) {
|
|
211
|
+
if (!this.verifyState()) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
this.provingStateLifecycle = PROVING_STATE_LIFECYCLE.PROVING_STATE_REJECTED;
|
|
215
|
+
this.rejectionCallback(reason);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Attempts to resolve the proving state promise with the given result
|
|
219
|
+
// Does nothing if not in a valid state
|
|
220
|
+
public resolve(result: ProvingResult) {
|
|
221
|
+
if (!this.verifyState()) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
this.provingStateLifecycle = PROVING_STATE_LIFECYCLE.PROVING_STATE_RESOLVED;
|
|
225
|
+
this.completionCallback(result);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
#getChildProofsForRoot() {
|
|
229
|
+
const rootLocation = { level: 0, index: 0 };
|
|
230
|
+
// If there's only 1 block, its block root proof will be stored at the root.
|
|
231
|
+
return this.totalNumBlocks === 1
|
|
232
|
+
? [this.blockRootOrMergeProvingOutputs.getNode(rootLocation), this.paddingBlockRootProvingOutput]
|
|
233
|
+
: this.blockRootOrMergeProvingOutputs.getChildren(rootLocation);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
#getPreviousRollupData({
|
|
237
|
+
inputs,
|
|
238
|
+
proof,
|
|
239
|
+
verificationKey,
|
|
240
|
+
}: PublicInputsAndRecursiveProof<
|
|
241
|
+
BlockRootOrBlockMergePublicInputs,
|
|
242
|
+
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
243
|
+
>) {
|
|
244
|
+
const leafIndex = getVKIndex(verificationKey.keyAsFields);
|
|
245
|
+
return new PreviousRollupBlockData(
|
|
246
|
+
inputs,
|
|
247
|
+
proof,
|
|
248
|
+
verificationKey.keyAsFields,
|
|
249
|
+
new MembershipWitness(VK_TREE_HEIGHT, BigInt(leafIndex), getVKSiblingPath(leafIndex)),
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProvingOrchestrator } from './orchestrator.js';
|