@aztec/prover-client 0.62.0 → 0.63.1
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/dest/mocks/fixtures.d.ts +2 -4
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +8 -15
- package/dest/mocks/test_context.d.ts +3 -2
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +16 -15
- package/dest/orchestrator/block-building-helpers.d.ts +5 -13
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +28 -16
- package/dest/orchestrator/orchestrator.d.ts +3 -2
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +23 -22
- package/dest/orchestrator/tx-proving-state.d.ts +3 -3
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +31 -22
- package/dest/prover-agent/memory-proving-queue.d.ts +8 -9
- package/dest/prover-agent/memory-proving-queue.d.ts.map +1 -1
- package/dest/prover-agent/memory-proving-queue.js +6 -9
- package/dest/prover-agent/prover-agent.d.ts +7 -6
- package/dest/prover-agent/prover-agent.d.ts.map +1 -1
- package/dest/prover-agent/prover-agent.js +18 -10
- package/dest/prover-agent/rpc.d.ts +4 -5
- package/dest/prover-agent/rpc.d.ts.map +1 -1
- package/dest/prover-agent/rpc.js +9 -72
- package/dest/proving_broker/proving_broker.d.ts +45 -0
- package/dest/proving_broker/proving_broker.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker.js +298 -0
- package/dest/proving_broker/proving_broker_interface.d.ts +61 -0
- package/dest/proving_broker/proving_broker_interface.d.ts.map +1 -0
- package/dest/proving_broker/proving_broker_interface.js +2 -0
- package/dest/proving_broker/proving_job_database/memory.d.ts +14 -0
- package/dest/proving_broker/proving_job_database/memory.d.ts.map +1 -0
- package/dest/proving_broker/proving_job_database/memory.js +35 -0
- package/dest/proving_broker/proving_job_database/persisted.d.ts +15 -0
- package/dest/proving_broker/proving_job_database/persisted.d.ts.map +1 -0
- package/dest/proving_broker/proving_job_database/persisted.js +34 -0
- package/dest/proving_broker/proving_job_database.d.ts +35 -0
- package/dest/proving_broker/proving_job_database.d.ts.map +1 -0
- package/dest/proving_broker/proving_job_database.js +2 -0
- package/dest/test/mock_prover.d.ts +5 -6
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +5 -8
- package/dest/tx-prover/tx-prover.js +2 -2
- package/package.json +13 -12
- package/src/mocks/fixtures.ts +12 -36
- package/src/mocks/test_context.ts +21 -32
- package/src/orchestrator/block-building-helpers.ts +35 -18
- package/src/orchestrator/orchestrator.ts +41 -27
- package/src/orchestrator/tx-proving-state.ts +45 -32
- package/src/prover-agent/memory-proving-queue.ts +15 -24
- package/src/prover-agent/prover-agent.ts +29 -16
- package/src/prover-agent/rpc.ts +9 -120
- package/src/proving_broker/proving_broker.ts +372 -0
- package/src/proving_broker/proving_broker_interface.ts +74 -0
- package/src/proving_broker/proving_job_database/memory.ts +43 -0
- package/src/proving_broker/proving_job_database/persisted.ts +44 -0
- package/src/proving_broker/proving_job_database.ts +44 -0
- package/src/test/mock_prover.ts +17 -15
- package/src/tx-prover/tx-prover.ts +1 -1
|
@@ -31,7 +31,7 @@ export class TxProver {
|
|
|
31
31
|
this.agent.setCircuitProver(circuitProver);
|
|
32
32
|
}
|
|
33
33
|
if (this.config.proverAgentConcurrency !== newConfig.proverAgentConcurrency) {
|
|
34
|
-
this.agent?.setMaxConcurrency(newConfig.proverAgentConcurrency);
|
|
34
|
+
await this.agent?.setMaxConcurrency(newConfig.proverAgentConcurrency);
|
|
35
35
|
}
|
|
36
36
|
if (!this.config.realProofs && newConfig.realProofs) {
|
|
37
37
|
// TODO(palla/prover-node): Reset padding tx here once we cache it at this class
|
|
@@ -90,4 +90,4 @@ export class TxProver {
|
|
|
90
90
|
return this.queue;
|
|
91
91
|
}
|
|
92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|
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
27
27
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
28
28
|
"bb": "node --no-warnings ./dest/bb/index.js",
|
|
29
|
-
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit"
|
|
29
|
+
"test": "LOG_LEVEL=${LOG_LEVEL:-silent} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit",
|
|
30
|
+
"test:debug": "LOG_LEVEL=debug DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --forceExit --testNamePattern prover/bb_prover/parity"
|
|
30
31
|
},
|
|
31
32
|
"jest": {
|
|
32
33
|
"moduleNameMapper": {
|
|
@@ -63,16 +64,16 @@
|
|
|
63
64
|
]
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@aztec/bb-prover": "0.
|
|
67
|
-
"@aztec/circuit-types": "0.
|
|
68
|
-
"@aztec/circuits.js": "0.
|
|
69
|
-
"@aztec/foundation": "0.
|
|
70
|
-
"@aztec/kv-store": "0.
|
|
71
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
72
|
-
"@aztec/protocol-contracts": "0.
|
|
73
|
-
"@aztec/simulator": "0.
|
|
74
|
-
"@aztec/telemetry-client": "0.
|
|
75
|
-
"@aztec/world-state": "0.
|
|
67
|
+
"@aztec/bb-prover": "0.63.1",
|
|
68
|
+
"@aztec/circuit-types": "0.63.1",
|
|
69
|
+
"@aztec/circuits.js": "0.63.1",
|
|
70
|
+
"@aztec/foundation": "0.63.1",
|
|
71
|
+
"@aztec/kv-store": "0.63.1",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "0.63.1",
|
|
73
|
+
"@aztec/protocol-contracts": "0.63.1",
|
|
74
|
+
"@aztec/simulator": "0.63.1",
|
|
75
|
+
"@aztec/telemetry-client": "0.63.1",
|
|
76
|
+
"@aztec/world-state": "0.63.1",
|
|
76
77
|
"@noir-lang/types": "portal:../../noir/packages/types",
|
|
77
78
|
"commander": "^12.1.0",
|
|
78
79
|
"lodash.chunk": "^4.2.0",
|
package/src/mocks/fixtures.ts
CHANGED
|
@@ -3,9 +3,8 @@ import {
|
|
|
3
3
|
type MerkleTreeReadOperations,
|
|
4
4
|
type MerkleTreeWriteOperations,
|
|
5
5
|
type ProcessedTx,
|
|
6
|
-
makeEmptyProcessedTx as makeEmptyProcessedTxFromHistoricalTreeRoots,
|
|
7
6
|
} from '@aztec/circuit-types';
|
|
8
|
-
import { makeBloatedProcessedTx
|
|
7
|
+
import { makeBloatedProcessedTx } from '@aztec/circuit-types/test';
|
|
9
8
|
import {
|
|
10
9
|
AztecAddress,
|
|
11
10
|
EthAddress,
|
|
@@ -14,9 +13,10 @@ import {
|
|
|
14
13
|
GlobalVariables,
|
|
15
14
|
MAX_NOTE_HASHES_PER_TX,
|
|
16
15
|
MAX_NULLIFIERS_PER_TX,
|
|
16
|
+
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
17
17
|
NULLIFIER_TREE_HEIGHT,
|
|
18
18
|
PUBLIC_DATA_SUBTREE_HEIGHT,
|
|
19
|
-
|
|
19
|
+
PublicDataWrite,
|
|
20
20
|
} from '@aztec/circuits.js';
|
|
21
21
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
22
22
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
@@ -97,49 +97,28 @@ export async function getSimulationProvider(
|
|
|
97
97
|
return new WASMSimulator();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
export const makeEmptyProcessedTx = (builderDb: MerkleTreeReadOperations, chainId: Fr, version: Fr) => {
|
|
104
|
-
const header = builderDb.getInitialHeader();
|
|
105
|
-
return makeEmptyProcessedTxFromHistoricalTreeRoots(
|
|
106
|
-
header,
|
|
107
|
-
chainId,
|
|
108
|
-
version,
|
|
109
|
-
getVKTreeRoot(),
|
|
110
|
-
protocolContractTreeRoot,
|
|
111
|
-
);
|
|
112
|
-
};
|
|
100
|
+
export const makeBloatedProcessedTxWithVKRoot = (builderDb: MerkleTreeReadOperations, seed = 0x1) =>
|
|
101
|
+
makeBloatedProcessedTx({ db: builderDb, vkTreeRoot: getVKTreeRoot(), protocolContractTreeRoot, seed });
|
|
113
102
|
|
|
114
103
|
// Updates the expectedDb trees based on the new note hashes, contracts, and nullifiers from these txs
|
|
115
104
|
export const updateExpectedTreesFromTxs = async (db: MerkleTreeWriteOperations, txs: ProcessedTx[]) => {
|
|
116
105
|
await db.appendLeaves(
|
|
117
106
|
MerkleTreeId.NOTE_HASH_TREE,
|
|
118
|
-
txs.flatMap(tx =>
|
|
119
|
-
padArrayEnd(
|
|
120
|
-
tx.data.end.noteHashes.filter(x => !x.isZero()),
|
|
121
|
-
Fr.zero(),
|
|
122
|
-
MAX_NOTE_HASHES_PER_TX,
|
|
123
|
-
),
|
|
124
|
-
),
|
|
107
|
+
txs.flatMap(tx => padArrayEnd(tx.txEffect.noteHashes, Fr.zero(), MAX_NOTE_HASHES_PER_TX)),
|
|
125
108
|
);
|
|
126
109
|
await db.batchInsert(
|
|
127
110
|
MerkleTreeId.NULLIFIER_TREE,
|
|
128
|
-
txs.flatMap(tx =>
|
|
129
|
-
padArrayEnd(
|
|
130
|
-
tx.data.end.nullifiers.filter(x => !x.isZero()),
|
|
131
|
-
Fr.zero(),
|
|
132
|
-
MAX_NULLIFIERS_PER_TX,
|
|
133
|
-
).map(x => x.toBuffer()),
|
|
134
|
-
),
|
|
111
|
+
txs.flatMap(tx => padArrayEnd(tx.txEffect.nullifiers, Fr.zero(), MAX_NULLIFIERS_PER_TX).map(x => x.toBuffer())),
|
|
135
112
|
NULLIFIER_TREE_HEIGHT,
|
|
136
113
|
);
|
|
137
114
|
for (const tx of txs) {
|
|
138
115
|
await db.batchInsert(
|
|
139
116
|
MerkleTreeId.PUBLIC_DATA_TREE,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
117
|
+
padArrayEnd(
|
|
118
|
+
tx.txEffect.publicDataWrites,
|
|
119
|
+
PublicDataWrite.empty(),
|
|
120
|
+
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
121
|
+
).map(write => write.toBuffer()),
|
|
143
122
|
PUBLIC_DATA_SUBTREE_HEIGHT,
|
|
144
123
|
);
|
|
145
124
|
}
|
|
@@ -157,6 +136,3 @@ export const makeGlobals = (blockNumber: number) => {
|
|
|
157
136
|
GasFees.empty(),
|
|
158
137
|
);
|
|
159
138
|
};
|
|
160
|
-
|
|
161
|
-
export const makeEmptyProcessedTestTx = (builderDb: MerkleTreeReadOperations): ProcessedTx =>
|
|
162
|
-
makeEmptyProcessedTx(builderDb, Fr.ZERO, Fr.ZERO);
|
|
@@ -8,14 +8,7 @@ import {
|
|
|
8
8
|
type Tx,
|
|
9
9
|
type TxValidator,
|
|
10
10
|
} from '@aztec/circuit-types';
|
|
11
|
-
import {
|
|
12
|
-
type CombinedConstantData,
|
|
13
|
-
type Gas,
|
|
14
|
-
type GlobalVariables,
|
|
15
|
-
Header,
|
|
16
|
-
type Nullifier,
|
|
17
|
-
type TxContext,
|
|
18
|
-
} from '@aztec/circuits.js';
|
|
11
|
+
import { type Gas, type GlobalVariables, Header } from '@aztec/circuits.js';
|
|
19
12
|
import { type Fr } from '@aztec/foundation/fields';
|
|
20
13
|
import { type DebugLogger } from '@aztec/foundation/log';
|
|
21
14
|
import { openTmpStore } from '@aztec/kv-store/utils';
|
|
@@ -24,7 +17,6 @@ import {
|
|
|
24
17
|
PublicExecutionResultBuilder,
|
|
25
18
|
type PublicExecutor,
|
|
26
19
|
PublicProcessor,
|
|
27
|
-
RealPublicKernelCircuitSimulator,
|
|
28
20
|
type SimulationProvider,
|
|
29
21
|
WASMSimulator,
|
|
30
22
|
type WorldStateDB,
|
|
@@ -37,6 +29,7 @@ import * as fs from 'fs/promises';
|
|
|
37
29
|
import { type MockProxy, mock } from 'jest-mock-extended';
|
|
38
30
|
|
|
39
31
|
import { TestCircuitProver } from '../../../bb-prover/src/test/test_circuit_prover.js';
|
|
32
|
+
import { type AvmPersistableStateManager } from '../../../simulator/src/avm/journal/journal.js';
|
|
40
33
|
import { ProvingOrchestrator } from '../orchestrator/index.js';
|
|
41
34
|
import { MemoryProvingQueue } from '../prover-agent/memory-proving-queue.js';
|
|
42
35
|
import { ProverAgent } from '../prover-agent/prover-agent.js';
|
|
@@ -75,23 +68,25 @@ export class TestContext {
|
|
|
75
68
|
|
|
76
69
|
const publicExecutor = mock<PublicExecutor>();
|
|
77
70
|
const worldStateDB = mock<WorldStateDB>();
|
|
78
|
-
const publicKernel = new RealPublicKernelCircuitSimulator(new WASMSimulator());
|
|
79
71
|
const telemetry = new NoopTelemetryClient();
|
|
80
72
|
|
|
81
|
-
|
|
73
|
+
// Separated dbs for public processor and prover - see public_processor for context
|
|
74
|
+
let publicDb: MerkleTreeWriteOperations;
|
|
75
|
+
let proverDb: MerkleTreeWriteOperations;
|
|
82
76
|
|
|
83
77
|
if (worldState === 'native') {
|
|
84
78
|
const ws = await NativeWorldStateService.tmp();
|
|
85
|
-
|
|
79
|
+
publicDb = await ws.fork();
|
|
80
|
+
proverDb = await ws.fork();
|
|
86
81
|
} else {
|
|
87
82
|
const ws = await MerkleTrees.new(openTmpStore(), telemetry);
|
|
88
|
-
|
|
83
|
+
publicDb = await ws.getLatest();
|
|
84
|
+
proverDb = await ws.getLatest();
|
|
89
85
|
}
|
|
90
86
|
|
|
91
87
|
const processor = PublicProcessor.create(
|
|
92
|
-
|
|
88
|
+
publicDb,
|
|
93
89
|
publicExecutor,
|
|
94
|
-
publicKernel,
|
|
95
90
|
globalVariables,
|
|
96
91
|
Header.empty(),
|
|
97
92
|
worldStateDB,
|
|
@@ -122,7 +117,7 @@ export class TestContext {
|
|
|
122
117
|
}
|
|
123
118
|
|
|
124
119
|
const queue = new MemoryProvingQueue(telemetry);
|
|
125
|
-
const orchestrator = new ProvingOrchestrator(
|
|
120
|
+
const orchestrator = new ProvingOrchestrator(proverDb, queue, telemetry);
|
|
126
121
|
const agent = new ProverAgent(localProver, proverCount);
|
|
127
122
|
|
|
128
123
|
queue.start();
|
|
@@ -134,7 +129,7 @@ export class TestContext {
|
|
|
134
129
|
processor,
|
|
135
130
|
simulationProvider,
|
|
136
131
|
globalVariables,
|
|
137
|
-
|
|
132
|
+
proverDb,
|
|
138
133
|
localProver,
|
|
139
134
|
agent,
|
|
140
135
|
orchestrator,
|
|
@@ -158,13 +153,11 @@ export class TestContext {
|
|
|
158
153
|
txValidator?: TxValidator<ProcessedTx>,
|
|
159
154
|
) {
|
|
160
155
|
const defaultExecutorImplementation = (
|
|
156
|
+
_stateManager: AvmPersistableStateManager,
|
|
161
157
|
execution: PublicExecutionRequest,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
_pendingNullifiers: Nullifier[],
|
|
166
|
-
transactionFee?: Fr,
|
|
167
|
-
_sideEffectCounter?: number,
|
|
158
|
+
_globalVariables: GlobalVariables,
|
|
159
|
+
allocatedGas: Gas,
|
|
160
|
+
_transactionFee?: Fr,
|
|
168
161
|
) => {
|
|
169
162
|
for (const tx of txs) {
|
|
170
163
|
const allCalls = tx.publicTeardownFunctionCall.isEmpty()
|
|
@@ -172,10 +165,8 @@ export class TestContext {
|
|
|
172
165
|
: [...tx.enqueuedPublicFunctionCalls, tx.publicTeardownFunctionCall];
|
|
173
166
|
for (const request of allCalls) {
|
|
174
167
|
if (execution.callContext.equals(request.callContext)) {
|
|
175
|
-
const result = PublicExecutionResultBuilder.
|
|
176
|
-
|
|
177
|
-
endGasLeft: availableGas,
|
|
178
|
-
transactionFee,
|
|
168
|
+
const result = PublicExecutionResultBuilder.empty().build({
|
|
169
|
+
endGasLeft: allocatedGas,
|
|
179
170
|
});
|
|
180
171
|
return Promise.resolve(result);
|
|
181
172
|
}
|
|
@@ -198,13 +189,11 @@ export class TestContext {
|
|
|
198
189
|
txHandler?: ProcessedTxHandler,
|
|
199
190
|
txValidator?: TxValidator<ProcessedTx>,
|
|
200
191
|
executorMock?: (
|
|
192
|
+
stateManager: AvmPersistableStateManager,
|
|
201
193
|
execution: PublicExecutionRequest,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
txContext: TxContext,
|
|
205
|
-
pendingNullifiers: Nullifier[],
|
|
194
|
+
globalVariables: GlobalVariables,
|
|
195
|
+
allocatedGas: Gas,
|
|
206
196
|
transactionFee?: Fr,
|
|
207
|
-
sideEffectCounter?: number,
|
|
208
197
|
) => Promise<PublicExecutionResult>,
|
|
209
198
|
) {
|
|
210
199
|
if (executorMock) {
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
Fr,
|
|
19
19
|
type GlobalVariables,
|
|
20
20
|
Header,
|
|
21
|
+
MAX_NOTE_HASHES_PER_TX,
|
|
21
22
|
MAX_NULLIFIERS_PER_TX,
|
|
22
23
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
23
24
|
MembershipWitness,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
PublicDataHint,
|
|
42
43
|
PublicDataTreeLeaf,
|
|
43
44
|
type PublicDataTreeLeafPreimage,
|
|
44
|
-
|
|
45
|
+
PublicDataWrite,
|
|
45
46
|
type RecursiveProof,
|
|
46
47
|
RootRollupInputs,
|
|
47
48
|
StateDiffHints,
|
|
@@ -57,7 +58,7 @@ import { type Tuple, assertLength, toFriendlyJSON } from '@aztec/foundation/seri
|
|
|
57
58
|
import { computeUnbalancedMerkleRoot } from '@aztec/foundation/trees';
|
|
58
59
|
import { getVKIndex, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types';
|
|
59
60
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
60
|
-
import {
|
|
61
|
+
import { computeFeePayerBalanceLeafSlot } from '@aztec/simulator';
|
|
61
62
|
import { type MerkleTreeReadOperations } from '@aztec/world-state';
|
|
62
63
|
|
|
63
64
|
import { inspect } from 'util';
|
|
@@ -97,18 +98,14 @@ export async function buildBaseRollupHints(
|
|
|
97
98
|
|
|
98
99
|
// Create data hint for reading fee payer initial balance in Fee Juice
|
|
99
100
|
// If no fee payer is set, read hint should be empty
|
|
100
|
-
// If there is already a public data write for this slot, also skip the read hint
|
|
101
|
-
const hintsBuilder = new HintsBuilder(db);
|
|
102
101
|
const leafSlot = computeFeePayerBalanceLeafSlot(tx.data.feePayer);
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
leafSlot.
|
|
106
|
-
? PublicDataHint.empty()
|
|
107
|
-
: await hintsBuilder.getPublicDataHint(leafSlot.toBigInt());
|
|
102
|
+
const feePayerFeeJuiceBalanceReadHint = tx.data.feePayer.isZero()
|
|
103
|
+
? PublicDataHint.empty()
|
|
104
|
+
: await getPublicDataHint(db, leafSlot.toBigInt());
|
|
108
105
|
|
|
109
106
|
// Update the note hash trees with the new items being inserted to get the new roots
|
|
110
107
|
// that will be used by the next iteration of the base rollup circuit, skipping the empty ones
|
|
111
|
-
const noteHashes = tx.
|
|
108
|
+
const noteHashes = padArrayEnd(tx.txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX);
|
|
112
109
|
await db.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, noteHashes);
|
|
113
110
|
|
|
114
111
|
// The read witnesses for a given TX should be generated before the writes of the same TX are applied.
|
|
@@ -123,7 +120,7 @@ export async function buildBaseRollupHints(
|
|
|
123
120
|
sortedNewLeavesIndexes,
|
|
124
121
|
} = await db.batchInsert(
|
|
125
122
|
MerkleTreeId.NULLIFIER_TREE,
|
|
126
|
-
tx.
|
|
123
|
+
padArrayEnd(tx.txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX).map(n => n.toBuffer()),
|
|
127
124
|
NULLIFIER_SUBTREE_HEIGHT,
|
|
128
125
|
);
|
|
129
126
|
if (nullifierWitnessLeaves === undefined) {
|
|
@@ -162,7 +159,7 @@ export async function buildBaseRollupHints(
|
|
|
162
159
|
publicDataSiblingPath,
|
|
163
160
|
});
|
|
164
161
|
|
|
165
|
-
const blockHash = tx.
|
|
162
|
+
const blockHash = tx.constants.historicalHeader.hash();
|
|
166
163
|
const archiveRootMembershipWitness = await getMembershipWitnessFor(
|
|
167
164
|
blockHash,
|
|
168
165
|
MerkleTreeId.ARCHIVE,
|
|
@@ -183,6 +180,26 @@ export async function buildBaseRollupHints(
|
|
|
183
180
|
});
|
|
184
181
|
}
|
|
185
182
|
|
|
183
|
+
async function getPublicDataHint(db: MerkleTreeWriteOperations, leafSlot: bigint) {
|
|
184
|
+
const { index } = (await db.getPreviousValueIndex(MerkleTreeId.PUBLIC_DATA_TREE, leafSlot)) ?? {};
|
|
185
|
+
if (index === undefined) {
|
|
186
|
+
throw new Error(`Cannot find the previous value index for public data ${leafSlot}.`);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const siblingPath = await db.getSiblingPath<typeof PUBLIC_DATA_TREE_HEIGHT>(MerkleTreeId.PUBLIC_DATA_TREE, index);
|
|
190
|
+
const membershipWitness = new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, index, siblingPath.toTuple());
|
|
191
|
+
|
|
192
|
+
const leafPreimage = (await db.getLeafPreimage(MerkleTreeId.PUBLIC_DATA_TREE, index)) as PublicDataTreeLeafPreimage;
|
|
193
|
+
if (!leafPreimage) {
|
|
194
|
+
throw new Error(`Cannot find the leaf preimage for public data tree at index ${index}.`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const exists = leafPreimage.slot.toBigInt() === leafSlot;
|
|
198
|
+
const value = exists ? leafPreimage.value : Fr.ZERO;
|
|
199
|
+
|
|
200
|
+
return new PublicDataHint(new Fr(leafSlot), value, membershipWitness, leafPreimage);
|
|
201
|
+
}
|
|
202
|
+
|
|
186
203
|
export function createMergeRollupInputs(
|
|
187
204
|
left: [BaseOrMergeRollupPublicInputs, RecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>, VerificationKeyAsFields],
|
|
188
205
|
right: [BaseOrMergeRollupPublicInputs, RecursiveProof<typeof NESTED_RECURSIVE_PROOF_LENGTH>, VerificationKeyAsFields],
|
|
@@ -398,15 +415,15 @@ export function makeEmptyMembershipWitness<N extends number>(height: N) {
|
|
|
398
415
|
);
|
|
399
416
|
}
|
|
400
417
|
|
|
401
|
-
|
|
418
|
+
async function processPublicDataUpdateRequests(tx: ProcessedTx, db: MerkleTreeWriteOperations) {
|
|
402
419
|
const allPublicDataUpdateRequests = padArrayEnd(
|
|
403
|
-
tx.
|
|
404
|
-
|
|
420
|
+
tx.txEffect.publicDataWrites,
|
|
421
|
+
PublicDataWrite.empty(),
|
|
405
422
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
406
423
|
);
|
|
407
424
|
|
|
408
425
|
const allPublicDataWrites = allPublicDataUpdateRequests.map(
|
|
409
|
-
({ leafSlot,
|
|
426
|
+
({ leafSlot, value }) => new PublicDataTreeLeaf(leafSlot, value),
|
|
410
427
|
);
|
|
411
428
|
const { lowLeavesWitnessData, newSubtreeSiblingPath, sortedNewLeaves, sortedNewLeavesIndexes } = await db.batchInsert(
|
|
412
429
|
MerkleTreeId.PUBLIC_DATA_TREE,
|
|
@@ -509,7 +526,7 @@ export function validatePartialState(
|
|
|
509
526
|
}
|
|
510
527
|
|
|
511
528
|
// Helper for comparing two trees snapshots
|
|
512
|
-
|
|
529
|
+
function validateSimulatedTree(
|
|
513
530
|
localTree: AppendOnlyTreeSnapshot,
|
|
514
531
|
simulatedTree: AppendOnlyTreeSnapshot,
|
|
515
532
|
name: TreeNames,
|
|
@@ -528,7 +545,7 @@ export function validateSimulatedTree(
|
|
|
528
545
|
}
|
|
529
546
|
|
|
530
547
|
export function validateTx(tx: ProcessedTx) {
|
|
531
|
-
const txHeader = tx.
|
|
548
|
+
const txHeader = tx.constants.historicalHeader;
|
|
532
549
|
if (txHeader.state.l1ToL2MessageTree.isZero()) {
|
|
533
550
|
throw new Error(`Empty L1 to L2 messages tree in tx: ${toFriendlyJSON(tx)}`);
|
|
534
551
|
}
|
|
@@ -2,15 +2,16 @@ import {
|
|
|
2
2
|
Body,
|
|
3
3
|
L2Block,
|
|
4
4
|
MerkleTreeId,
|
|
5
|
-
type PaddingProcessedTx,
|
|
6
5
|
type ProcessedTx,
|
|
7
6
|
type ServerCircuitProver,
|
|
8
7
|
type TxEffect,
|
|
9
8
|
makeEmptyProcessedTx,
|
|
10
|
-
makePaddingProcessedTx,
|
|
11
|
-
toTxEffect,
|
|
12
9
|
} from '@aztec/circuit-types';
|
|
13
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
type EpochProver,
|
|
12
|
+
type MerkleTreeWriteOperations,
|
|
13
|
+
type ProofAndVerificationKey,
|
|
14
|
+
} from '@aztec/circuit-types/interfaces';
|
|
14
15
|
import { type CircuitName } from '@aztec/circuit-types/stats';
|
|
15
16
|
import {
|
|
16
17
|
AVM_PROOF_LENGTH_IN_FIELDS,
|
|
@@ -32,7 +33,7 @@ import {
|
|
|
32
33
|
PrivateKernelEmptyInputData,
|
|
33
34
|
type RECURSIVE_PROOF_LENGTH,
|
|
34
35
|
type RecursiveProof,
|
|
35
|
-
|
|
36
|
+
RootParityInput,
|
|
36
37
|
RootParityInputs,
|
|
37
38
|
type VerificationKeyAsFields,
|
|
38
39
|
VerificationKeyData,
|
|
@@ -46,7 +47,7 @@ import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
|
46
47
|
import { type Tuple } from '@aztec/foundation/serialize';
|
|
47
48
|
import { pushTestData } from '@aztec/foundation/testing';
|
|
48
49
|
import { elapsed } from '@aztec/foundation/timer';
|
|
49
|
-
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types';
|
|
50
|
+
import { getVKIndex, getVKSiblingPath, getVKTreeRoot } from '@aztec/noir-protocol-circuits-types';
|
|
50
51
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
51
52
|
import { Attributes, type TelemetryClient, type Tracer, trackSpan, wrapCallbackInSpan } from '@aztec/telemetry-client';
|
|
52
53
|
|
|
@@ -95,7 +96,7 @@ const logger = createDebugLogger('aztec:prover:proving-orchestrator');
|
|
|
95
96
|
export class ProvingOrchestrator implements EpochProver {
|
|
96
97
|
private provingState: EpochProvingState | undefined = undefined;
|
|
97
98
|
private pendingProvingJobs: AbortController[] = [];
|
|
98
|
-
private
|
|
99
|
+
private paddingTxProof?: ProofAndVerificationKey<typeof NESTED_RECURSIVE_PROOF_LENGTH>;
|
|
99
100
|
|
|
100
101
|
private provingPromise: Promise<ProvingResult> | undefined = undefined;
|
|
101
102
|
private metrics: ProvingOrchestratorMetrics;
|
|
@@ -121,7 +122,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
121
122
|
* Resets the orchestrator's cached padding tx.
|
|
122
123
|
*/
|
|
123
124
|
public reset() {
|
|
124
|
-
this.
|
|
125
|
+
this.paddingTxProof = undefined;
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
public startNewEpoch(epochNumber: number, totalNumBlocks: number) {
|
|
@@ -415,9 +416,8 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
415
416
|
|
|
416
417
|
private async buildBlock(provingState: BlockProvingState, expectedHeader?: Header) {
|
|
417
418
|
// Collect all new nullifiers, commitments, and contracts from all txs in this block to build body
|
|
418
|
-
const gasFees = provingState.globalVariables.gasFees;
|
|
419
419
|
const nonEmptyTxEffects: TxEffect[] = provingState!.allTxs
|
|
420
|
-
.map(txProvingState =>
|
|
420
|
+
.map(txProvingState => txProvingState.processedTx.txEffect)
|
|
421
421
|
.filter(txEffect => !txEffect.isEmpty());
|
|
422
422
|
const body = new Body(nonEmptyTxEffects);
|
|
423
423
|
|
|
@@ -459,12 +459,12 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
459
459
|
private enqueuePaddingTxs(
|
|
460
460
|
provingState: BlockProvingState,
|
|
461
461
|
txInputs: Array<{ hints: BaseRollupHints; snapshot: TreeSnapshots }>,
|
|
462
|
-
|
|
462
|
+
paddingTx: ProcessedTx,
|
|
463
463
|
) {
|
|
464
|
-
if (this.
|
|
464
|
+
if (this.paddingTxProof) {
|
|
465
465
|
// We already have the padding transaction
|
|
466
466
|
logger.debug(`Enqueuing ${txInputs.length} padding transactions using existing padding tx`);
|
|
467
|
-
this.provePaddingTransactions(txInputs, this.
|
|
467
|
+
this.provePaddingTransactions(txInputs, paddingTx, this.paddingTxProof, provingState);
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
470
|
logger.debug(`Enqueuing deferred proving for padding txs to enqueue ${txInputs.length} paddings`);
|
|
@@ -480,14 +480,14 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
480
480
|
signal =>
|
|
481
481
|
this.prover.getEmptyPrivateKernelProof(
|
|
482
482
|
new PrivateKernelEmptyInputData(
|
|
483
|
-
|
|
483
|
+
paddingTx.constants.historicalHeader,
|
|
484
484
|
// Chain id and version should not change even if the proving state does, so it's safe to use them for the padding tx
|
|
485
485
|
// which gets cached across multiple runs of the orchestrator with different proving states. If they were to change,
|
|
486
486
|
// we'd have to clear out the paddingTx here and regenerate it when they do.
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
protocolContractTreeRoot,
|
|
487
|
+
paddingTx.constants.txContext.chainId,
|
|
488
|
+
paddingTx.constants.txContext.version,
|
|
489
|
+
paddingTx.constants.vkTreeRoot,
|
|
490
|
+
paddingTx.constants.protocolContractTreeRoot,
|
|
491
491
|
),
|
|
492
492
|
signal,
|
|
493
493
|
provingState.epochNumber,
|
|
@@ -495,8 +495,8 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
495
495
|
),
|
|
496
496
|
result => {
|
|
497
497
|
logger.debug(`Completed proof for padding tx, now enqueuing ${txInputs.length} padding txs`);
|
|
498
|
-
this.
|
|
499
|
-
this.provePaddingTransactions(txInputs, this.
|
|
498
|
+
this.paddingTxProof = { proof: result.proof, verificationKey: result.verificationKey };
|
|
499
|
+
this.provePaddingTransactions(txInputs, paddingTx, this.paddingTxProof, provingState);
|
|
500
500
|
},
|
|
501
501
|
);
|
|
502
502
|
}
|
|
@@ -504,12 +504,14 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
504
504
|
/**
|
|
505
505
|
* Prepares the cached sets of base rollup inputs for padding transactions and proves them
|
|
506
506
|
* @param txInputs - The base rollup inputs, start and end hash paths etc
|
|
507
|
-
* @param paddingTx - The padding tx, contains the header
|
|
507
|
+
* @param paddingTx - The padding tx, contains the header and public inputs used in the proof
|
|
508
|
+
* @param proofAndVk - The proof and vk of the paddingTx.
|
|
508
509
|
* @param provingState - The block proving state
|
|
509
510
|
*/
|
|
510
511
|
private provePaddingTransactions(
|
|
511
512
|
txInputs: Array<{ hints: BaseRollupHints; snapshot: TreeSnapshots }>,
|
|
512
|
-
paddingTx:
|
|
513
|
+
paddingTx: ProcessedTx,
|
|
514
|
+
proofAndVk: ProofAndVerificationKey<typeof NESTED_RECURSIVE_PROOF_LENGTH>,
|
|
513
515
|
provingState: BlockProvingState,
|
|
514
516
|
) {
|
|
515
517
|
// The padding tx contains the proof and vk, generated separately from the base inputs
|
|
@@ -517,7 +519,7 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
517
519
|
for (let i = 0; i < txInputs.length; i++) {
|
|
518
520
|
const { hints, snapshot } = txInputs[i];
|
|
519
521
|
const txProvingState = new TxProvingState(paddingTx, hints, snapshot);
|
|
520
|
-
txProvingState.assignTubeProof(
|
|
522
|
+
txProvingState.assignTubeProof(proofAndVk);
|
|
521
523
|
const txIndex = provingState.addNewTx(txProvingState);
|
|
522
524
|
this.enqueueBaseRollup(provingState, txIndex);
|
|
523
525
|
}
|
|
@@ -927,8 +929,14 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
927
929
|
},
|
|
928
930
|
signal => this.prover.getBaseParityProof(inputs, signal, provingState.epochNumber),
|
|
929
931
|
),
|
|
930
|
-
|
|
931
|
-
|
|
932
|
+
provingOutput => {
|
|
933
|
+
const rootParityInput = new RootParityInput(
|
|
934
|
+
provingOutput.proof,
|
|
935
|
+
provingOutput.verificationKey.keyAsFields,
|
|
936
|
+
getVKSiblingPath(getVKIndex(provingOutput.verificationKey)),
|
|
937
|
+
provingOutput.inputs,
|
|
938
|
+
);
|
|
939
|
+
provingState.setRootParityInputs(rootParityInput, index);
|
|
932
940
|
if (provingState.areRootParityInputsReady()) {
|
|
933
941
|
const rootParityInputs = new RootParityInputs(
|
|
934
942
|
provingState.rootParityInput as Tuple<
|
|
@@ -956,8 +964,14 @@ export class ProvingOrchestrator implements EpochProver {
|
|
|
956
964
|
},
|
|
957
965
|
signal => this.prover.getRootParityProof(inputs, signal, provingState.epochNumber),
|
|
958
966
|
),
|
|
959
|
-
|
|
960
|
-
|
|
967
|
+
provingOutput => {
|
|
968
|
+
const rootParityInput = new RootParityInput(
|
|
969
|
+
provingOutput.proof,
|
|
970
|
+
provingOutput.verificationKey.keyAsFields,
|
|
971
|
+
getVKSiblingPath(getVKIndex(provingOutput.verificationKey)),
|
|
972
|
+
provingOutput.inputs,
|
|
973
|
+
);
|
|
974
|
+
provingState!.finalRootParityInput = rootParityInput;
|
|
961
975
|
this.checkAndEnqueueBlockRootRollup(provingState);
|
|
962
976
|
},
|
|
963
977
|
);
|