@aztec/stdlib 3.0.0-nightly.20250918 → 3.0.0-nightly.20250920
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/avm/avm.d.ts +8 -16
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.d.ts +9 -21
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +15 -22
- package/dest/avm/avm_circuit_public_inputs.d.ts +6 -12
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +9 -18
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/interfaces/block-builder.d.ts +1 -0
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/epoch-prover.d.ts +4 -4
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +78 -88
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +40 -84
- package/dest/interfaces/pxe.d.ts +193 -118
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +6 -37
- package/dest/interfaces/server_circuit_prover.d.ts +18 -17
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts +9 -12
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +18 -23
- package/dest/logs/public_log.d.ts +23 -10
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +117 -42
- package/dest/parity/index.d.ts +2 -3
- package/dest/parity/index.d.ts.map +1 -1
- package/dest/parity/index.js +2 -3
- package/dest/parity/{base_parity_inputs.d.ts → parity_base_private_inputs.d.ts} +6 -6
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -0
- package/dest/parity/{base_parity_inputs.js → parity_base_private_inputs.js} +5 -5
- package/dest/parity/parity_root_private_inputs.d.ts +39 -0
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -0
- package/dest/parity/{root_parity_inputs.js → parity_root_private_inputs.js} +12 -13
- package/dest/proofs/proof_data.d.ts +3 -2
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.d.ts +5 -5
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +5 -5
- package/dest/rollup/{block_merge_rollup.d.ts → block_merge_rollup_private_inputs.d.ts} +10 -4
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{block_merge_rollup.js → block_merge_rollup_private_inputs.js} +1 -1
- package/dest/rollup/{block_root_rollup.d.ts → block_root_rollup_private_inputs.d.ts} +23 -34
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{block_root_rollup.js → block_root_rollup_private_inputs.js} +7 -7
- package/dest/rollup/{checkpoint_merge_rollup.d.ts → checkpoint_merge_rollup_private_inputs.d.ts} +6 -6
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{checkpoint_root_rollup.d.ts → checkpoint_root_rollup_private_inputs.d.ts} +14 -8
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/index.d.ts +10 -11
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +10 -11
- package/dest/rollup/{private_base_rollup_inputs.d.ts → private_tx_base_rollup_private_inputs.d.ts} +7 -7
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{private_base_rollup_inputs.js → private_tx_base_rollup_private_inputs.js} +6 -6
- package/dest/rollup/{public_base_rollup_inputs.d.ts → public_tx_base_rollup_private_inputs.d.ts} +7 -7
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{public_base_rollup_inputs.js → public_tx_base_rollup_private_inputs.js} +6 -6
- package/dest/rollup/root_rollup_private_inputs.d.ts +67 -0
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/root_rollup_private_inputs.js +69 -0
- package/dest/rollup/{root_rollup.d.ts → root_rollup_public_inputs.d.ts} +2 -65
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/{root_rollup.js → root_rollup_public_inputs.js} +1 -66
- package/dest/rollup/{merge_rollup.d.ts → tx_merge_rollup_private_inputs.d.ts} +11 -10
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{merge_rollup.js → tx_merge_rollup_private_inputs.js} +14 -13
- package/dest/rollup/{base_or_merge_rollup_public_inputs.d.ts → tx_rollup_public_inputs.d.ts} +11 -11
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/{base_or_merge_rollup_public_inputs.js → tx_rollup_public_inputs.js} +13 -13
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +16 -31
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +32 -49
- package/dest/tx/processed_tx.js +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +9 -10
- package/package.json +8 -8
- package/src/avm/avm_accumulated_data.ts +15 -29
- package/src/interfaces/block-builder.ts +1 -0
- package/src/interfaces/epoch-prover.ts +3 -3
- package/src/interfaces/proving-job.ts +54 -93
- package/src/interfaces/pxe.ts +4 -184
- package/src/interfaces/server_circuit_prover.ts +24 -29
- package/src/logs/log_with_tx_data.ts +14 -24
- package/src/logs/public_log.ts +120 -58
- package/src/parity/index.ts +2 -3
- package/src/parity/{base_parity_inputs.ts → parity_base_private_inputs.ts} +6 -6
- package/src/parity/{root_parity_inputs.ts → parity_root_private_inputs.ts} +16 -18
- package/src/proofs/proof_data.ts +4 -2
- package/src/proofs/proving_request_type.ts +6 -5
- package/src/rollup/{block_merge_rollup.ts → block_merge_rollup_private_inputs.ts} +5 -3
- package/src/rollup/{block_root_rollup.ts → block_root_rollup_private_inputs.ts} +13 -26
- package/src/rollup/{checkpoint_merge_rollup.ts → checkpoint_merge_rollup_private_inputs.ts} +3 -4
- package/src/rollup/{checkpoint_root_rollup.ts → checkpoint_root_rollup_private_inputs.ts} +6 -4
- package/src/rollup/index.ts +10 -11
- package/src/rollup/{private_base_rollup_inputs.ts → private_tx_base_rollup_private_inputs.ts} +9 -9
- package/src/rollup/{public_base_rollup_inputs.ts → public_tx_base_rollup_private_inputs.ts} +9 -9
- package/src/rollup/root_rollup_private_inputs.ts +90 -0
- package/src/rollup/{root_rollup.ts → root_rollup_public_inputs.ts} +1 -86
- package/src/rollup/{merge_rollup.ts → tx_merge_rollup_private_inputs.ts} +13 -9
- package/src/rollup/{base_or_merge_rollup_public_inputs.ts → tx_rollup_public_inputs.ts} +11 -11
- package/src/stats/stats.ts +18 -17
- package/src/tests/factories.ts +33 -80
- package/src/tx/processed_tx.ts +1 -1
- package/src/tx/tx_effect.ts +9 -8
- package/dest/parity/base_parity_inputs.d.ts.map +0 -1
- package/dest/parity/root_parity_input.d.ts +0 -52
- package/dest/parity/root_parity_input.d.ts.map +0 -1
- package/dest/parity/root_parity_input.js +0 -50
- package/dest/parity/root_parity_inputs.d.ts +0 -37
- package/dest/parity/root_parity_inputs.d.ts.map +0 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +0 -1
- package/dest/rollup/block_merge_rollup.d.ts.map +0 -1
- package/dest/rollup/block_root_rollup.d.ts.map +0 -1
- package/dest/rollup/checkpoint_merge_rollup.d.ts.map +0 -1
- package/dest/rollup/checkpoint_root_rollup.d.ts.map +0 -1
- package/dest/rollup/merge_rollup.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_data.d.ts +0 -47
- package/dest/rollup/previous_rollup_data.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_data.js +0 -37
- package/dest/rollup/private_base_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/public_base_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/rollup_proof_data.d.ts +0 -10
- package/dest/rollup/rollup_proof_data.d.ts.map +0 -1
- package/dest/rollup/rollup_proof_data.js +0 -1
- package/dest/rollup/root_rollup.d.ts.map +0 -1
- package/src/parity/root_parity_input.ts +0 -71
- package/src/rollup/previous_rollup_data.ts +0 -48
- package/src/rollup/rollup_proof_data.ts +0 -12
- /package/dest/rollup/{checkpoint_merge_rollup.js → checkpoint_merge_rollup_private_inputs.js} +0 -0
- /package/dest/rollup/{checkpoint_root_rollup.js → checkpoint_root_rollup_private_inputs.js} +0 -0
package/src/interfaces/pxe.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
2
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
2
|
import type { ApiSchemaFor, ZodFor } from '@aztec/foundation/schemas';
|
|
4
|
-
import { SiblingPath } from '@aztec/foundation/trees';
|
|
5
3
|
|
|
6
4
|
import { z } from 'zod';
|
|
7
5
|
|
|
@@ -9,43 +7,22 @@ import { type AbiType, AbiTypeSchema, type ContractArtifact, ContractArtifactSch
|
|
|
9
7
|
import type { EventSelector } from '../abi/event_selector.js';
|
|
10
8
|
import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
11
9
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
12
|
-
import { L2Block } from '../block/l2_block.js';
|
|
13
10
|
import {
|
|
14
11
|
CompleteAddress,
|
|
15
12
|
type ContractClassWithId,
|
|
16
13
|
ContractClassWithIdSchema,
|
|
17
14
|
type ContractInstanceWithAddress,
|
|
18
15
|
ContractInstanceWithAddressSchema,
|
|
19
|
-
type NodeInfo,
|
|
20
|
-
NodeInfoSchema,
|
|
21
16
|
type PartialAddress,
|
|
22
17
|
type ProtocolContractAddresses,
|
|
23
18
|
ProtocolContractAddressesSchema,
|
|
24
19
|
} from '../contract/index.js';
|
|
25
|
-
import { GasFees } from '../gas/gas_fees.js';
|
|
26
|
-
import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
|
|
27
20
|
import { UniqueNote } from '../note/extended_note.js';
|
|
28
21
|
import { type NotesFilter, NotesFilterSchema } from '../note/notes_filter.js';
|
|
29
22
|
import { AbiDecodedSchema, optional, schemas } from '../schemas/schemas.js';
|
|
30
|
-
import {
|
|
31
|
-
type IndexedTxEffect,
|
|
32
|
-
PrivateExecutionResult,
|
|
33
|
-
SimulationOverrides,
|
|
34
|
-
Tx,
|
|
35
|
-
TxExecutionRequest,
|
|
36
|
-
TxHash,
|
|
37
|
-
TxReceipt,
|
|
38
|
-
TxSimulationResult,
|
|
39
|
-
indexedTxSchema,
|
|
40
|
-
} from '../tx/index.js';
|
|
23
|
+
import { PrivateExecutionResult, SimulationOverrides, TxExecutionRequest, TxSimulationResult } from '../tx/index.js';
|
|
41
24
|
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
42
25
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
43
|
-
import {
|
|
44
|
-
type GetContractClassLogsResponse,
|
|
45
|
-
GetContractClassLogsResponseSchema,
|
|
46
|
-
type GetPublicLogsResponse,
|
|
47
|
-
GetPublicLogsResponseSchema,
|
|
48
|
-
} from './get_logs_response.js';
|
|
49
26
|
|
|
50
27
|
// docs:start:pxe-interface
|
|
51
28
|
/**
|
|
@@ -55,21 +32,6 @@ import {
|
|
|
55
32
|
* is exposed to dapps for interacting with the network on behalf of the user.
|
|
56
33
|
*/
|
|
57
34
|
export interface PXE {
|
|
58
|
-
/**
|
|
59
|
-
* Returns whether an L1 to L2 message is synced by archiver.
|
|
60
|
-
* @param l1ToL2Message - The L1 to L2 message to check.
|
|
61
|
-
* @returns Whether the message is synced and ready to be included in a block.
|
|
62
|
-
* @deprecated Use `waitForL1ToL2MessageReady` and `isL1ToL2MessageReady` instead.
|
|
63
|
-
*/
|
|
64
|
-
isL1ToL2MessageSynced(l1ToL2Message: Fr): Promise<boolean>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Returns the L2 block number in which this L1 to L2 message becomes available, or undefined if not found.
|
|
68
|
-
* @param l1ToL2Message - The L1 to L2 message to check.
|
|
69
|
-
* @returns The L2 block number or undefined if not synced yet.
|
|
70
|
-
*/
|
|
71
|
-
getL1ToL2MessageBlock(l1ToL2Message: Fr): Promise<number | undefined>;
|
|
72
|
-
|
|
73
35
|
/**
|
|
74
36
|
* Registers a user account in PXE given its master encryption private key.
|
|
75
37
|
* Once a new account is registered, the PXE Service will trial-decrypt all published notes on
|
|
@@ -203,43 +165,6 @@ export interface PXE {
|
|
|
203
165
|
msgSender?: AztecAddress,
|
|
204
166
|
): Promise<TxProfileResult>;
|
|
205
167
|
|
|
206
|
-
/**
|
|
207
|
-
* Sends a transaction to an Aztec node to be broadcasted to the network and mined.
|
|
208
|
-
* @param tx - The transaction as created via `proveTx`.
|
|
209
|
-
* @returns A hash of the transaction, used to identify it.
|
|
210
|
-
*/
|
|
211
|
-
sendTx(tx: Tx): Promise<TxHash>;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Fetches a transaction receipt for a given transaction hash. Returns a mined receipt if it was added
|
|
215
|
-
* to the chain, a pending receipt if it's still in the mempool of the connected Aztec node, or a dropped
|
|
216
|
-
* receipt if not found in the connected Aztec node.
|
|
217
|
-
*
|
|
218
|
-
* @param txHash - The transaction hash.
|
|
219
|
-
* @returns A receipt of the transaction.
|
|
220
|
-
*/
|
|
221
|
-
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Gets a tx effect.
|
|
225
|
-
* @param txHash - The hash of the tx corresponding to the tx effect.
|
|
226
|
-
* @returns The requested tx effect with block info (or undefined if not found).
|
|
227
|
-
*/
|
|
228
|
-
getTxEffect(txHash: TxHash): Promise<IndexedTxEffect | undefined>;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Gets the storage value at the given contract storage slot.
|
|
232
|
-
*
|
|
233
|
-
* @remarks The storage slot here refers to the slot as it is defined in Noir not the index in the merkle tree.
|
|
234
|
-
* Aztec's version of `eth_getStorageAt`.
|
|
235
|
-
*
|
|
236
|
-
* @param contract - Address of the contract to query.
|
|
237
|
-
* @param slot - Slot to query.
|
|
238
|
-
* @returns Storage value at the given contract slot.
|
|
239
|
-
* @throws If the contract is not deployed.
|
|
240
|
-
*/
|
|
241
|
-
getPublicStorageAt(contract: AztecAddress, slot: Fr): Promise<Fr>;
|
|
242
|
-
|
|
243
168
|
/**
|
|
244
169
|
* Gets notes registered in this PXE based on the provided filter.
|
|
245
170
|
* @param filter - The filter to apply to the notes.
|
|
@@ -247,41 +172,6 @@ export interface PXE {
|
|
|
247
172
|
*/
|
|
248
173
|
getNotes(filter: NotesFilter): Promise<UniqueNote[]>;
|
|
249
174
|
|
|
250
|
-
/**
|
|
251
|
-
* Fetches an L1 to L2 message from the node.
|
|
252
|
-
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
253
|
-
* @param messageHash - Hash of the message.
|
|
254
|
-
* @param secret - Secret used to compute a nullifier.
|
|
255
|
-
* @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
|
|
256
|
-
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
257
|
-
*/
|
|
258
|
-
getL1ToL2MembershipWitness(
|
|
259
|
-
contractAddress: AztecAddress,
|
|
260
|
-
messageHash: Fr,
|
|
261
|
-
secret: Fr,
|
|
262
|
-
): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>]>;
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Gets the membership witness for a message that was emitted at a particular block
|
|
266
|
-
* @param blockNumber - The block number in which to search for the message
|
|
267
|
-
* @param l2Tol1Message - The message to search for
|
|
268
|
-
* @returns The membership witness for the message
|
|
269
|
-
*/
|
|
270
|
-
getL2ToL1MembershipWitness(blockNumber: number, l2Tol1Message: Fr): Promise<[bigint, SiblingPath<number>]>;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Get the given block.
|
|
274
|
-
* @param number - The block number being requested.
|
|
275
|
-
* @returns The blocks requested.
|
|
276
|
-
*/
|
|
277
|
-
getBlock(number: number): Promise<L2Block | undefined>;
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Method to fetch the current base fees.
|
|
281
|
-
* @returns The current base fees.
|
|
282
|
-
*/
|
|
283
|
-
getCurrentBaseFees(): Promise<GasFees>;
|
|
284
|
-
|
|
285
175
|
/**
|
|
286
176
|
* Simulate the execution of a contract utility function.
|
|
287
177
|
*
|
|
@@ -303,39 +193,6 @@ export interface PXE {
|
|
|
303
193
|
scopes?: AztecAddress[],
|
|
304
194
|
): Promise<UtilitySimulationResult>;
|
|
305
195
|
|
|
306
|
-
/**
|
|
307
|
-
* Gets public logs based on the provided filter.
|
|
308
|
-
* @param filter - The filter to apply to the logs.
|
|
309
|
-
* @returns The requested logs.
|
|
310
|
-
*/
|
|
311
|
-
getPublicLogs(filter: LogFilter): Promise<GetPublicLogsResponse>;
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Gets contract class logs based on the provided filter.
|
|
315
|
-
* @param filter - The filter to apply to the logs.
|
|
316
|
-
* @returns The requested logs.
|
|
317
|
-
*/
|
|
318
|
-
getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Fetches the current block number.
|
|
322
|
-
* @returns The block number.
|
|
323
|
-
*/
|
|
324
|
-
getBlockNumber(): Promise<number>;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Fetches the current proven block number.
|
|
328
|
-
* @returns The block number.
|
|
329
|
-
*/
|
|
330
|
-
getProvenBlockNumber(): Promise<number>;
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* Returns the information about the server's node. Includes current Node version, compatible Noir version,
|
|
334
|
-
* L1 chain identifier, rollup version, and L1 address of the rollup contract.
|
|
335
|
-
* @returns - The node information.
|
|
336
|
-
*/
|
|
337
|
-
getNodeInfo(): Promise<NodeInfo>;
|
|
338
|
-
|
|
339
196
|
/**
|
|
340
197
|
* Returns information about this PXE.
|
|
341
198
|
*/
|
|
@@ -386,15 +243,6 @@ export interface PXE {
|
|
|
386
243
|
numBlocks: number,
|
|
387
244
|
recipients: AztecAddress[],
|
|
388
245
|
): Promise<T[]>;
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* Returns the public events given search parameters.
|
|
392
|
-
* @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
393
|
-
* @param from - The block number to search from.
|
|
394
|
-
* @param limit - The amount of blocks to search.
|
|
395
|
-
* @returns - The deserialized events.
|
|
396
|
-
*/
|
|
397
|
-
getPublicEvents<T>(eventMetadata: EventMetadataDefinition, from: number, limit: number): Promise<T[]>;
|
|
398
246
|
}
|
|
399
247
|
// docs:end:pxe-interface
|
|
400
248
|
|
|
@@ -404,7 +252,7 @@ export type EventMetadataDefinition = {
|
|
|
404
252
|
fieldNames: string[];
|
|
405
253
|
};
|
|
406
254
|
|
|
407
|
-
const EventMetadataDefinitionSchema = z.object({
|
|
255
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
408
256
|
eventSelector: schemas.EventSelector,
|
|
409
257
|
abiType: AbiTypeSchema,
|
|
410
258
|
fieldNames: z.array(z.string()),
|
|
@@ -436,13 +284,13 @@ export interface ContractClassMetadata {
|
|
|
436
284
|
artifact?: ContractArtifact | undefined;
|
|
437
285
|
}
|
|
438
286
|
|
|
439
|
-
const ContractMetadataSchema = z.object({
|
|
287
|
+
export const ContractMetadataSchema = z.object({
|
|
440
288
|
contractInstance: z.union([ContractInstanceWithAddressSchema, z.undefined()]),
|
|
441
289
|
isContractInitialized: z.boolean(),
|
|
442
290
|
isContractPublished: z.boolean(),
|
|
443
291
|
}) satisfies ZodFor<ContractMetadata>;
|
|
444
292
|
|
|
445
|
-
const ContractClassMetadataSchema = z.object({
|
|
293
|
+
export const ContractClassMetadataSchema = z.object({
|
|
446
294
|
contractClass: z.union([ContractClassWithIdSchema, z.undefined()]),
|
|
447
295
|
isContractClassPubliclyRegistered: z.boolean(),
|
|
448
296
|
artifact: z.union([ContractArtifactSchema, z.undefined()]),
|
|
@@ -454,8 +302,6 @@ const PXEInfoSchema = z.object({
|
|
|
454
302
|
}) satisfies ZodFor<PXEInfo>;
|
|
455
303
|
|
|
456
304
|
export const PXESchema: ApiSchemaFor<PXE> = {
|
|
457
|
-
isL1ToL2MessageSynced: z.function().args(schemas.Fr).returns(z.boolean()),
|
|
458
|
-
getL1ToL2MessageBlock: z.function().args(schemas.Fr).returns(z.number().optional()),
|
|
459
305
|
registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema),
|
|
460
306
|
getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)),
|
|
461
307
|
registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress),
|
|
@@ -492,24 +338,7 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
492
338
|
optional(z.array(schemas.AztecAddress)),
|
|
493
339
|
)
|
|
494
340
|
.returns(TxSimulationResult.schema),
|
|
495
|
-
sendTx: z.function().args(Tx.schema).returns(TxHash.schema),
|
|
496
|
-
getTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema),
|
|
497
|
-
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
498
|
-
getPublicStorageAt: z.function().args(schemas.AztecAddress, schemas.Fr).returns(schemas.Fr),
|
|
499
341
|
getNotes: z.function().args(NotesFilterSchema).returns(z.array(UniqueNote.schema)),
|
|
500
|
-
getL1ToL2MembershipWitness: z
|
|
501
|
-
.function()
|
|
502
|
-
.args(schemas.AztecAddress, schemas.Fr, schemas.Fr)
|
|
503
|
-
.returns(z.tuple([schemas.BigInt, SiblingPath.schemaFor(L1_TO_L2_MSG_TREE_HEIGHT)])),
|
|
504
|
-
getL2ToL1MembershipWitness: z
|
|
505
|
-
.function()
|
|
506
|
-
.args(z.number(), schemas.Fr)
|
|
507
|
-
.returns(z.tuple([schemas.BigInt, SiblingPath.schema])),
|
|
508
|
-
getBlock: z
|
|
509
|
-
.function()
|
|
510
|
-
.args(z.number())
|
|
511
|
-
.returns(z.union([L2Block.schema, z.undefined()])),
|
|
512
|
-
getCurrentBaseFees: z.function().returns(GasFees.schema),
|
|
513
342
|
|
|
514
343
|
simulateUtility: z
|
|
515
344
|
.function()
|
|
@@ -522,11 +351,6 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
522
351
|
optional(z.array(schemas.AztecAddress)),
|
|
523
352
|
)
|
|
524
353
|
.returns(UtilitySimulationResult.schema),
|
|
525
|
-
getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
|
|
526
|
-
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
527
|
-
getBlockNumber: z.function().returns(z.number()),
|
|
528
|
-
getProvenBlockNumber: z.function().returns(z.number()),
|
|
529
|
-
getNodeInfo: z.function().returns(NodeInfoSchema),
|
|
530
354
|
getPXEInfo: z.function().returns(PXEInfoSchema),
|
|
531
355
|
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
532
356
|
getContractClassMetadata: z.function().args(schemas.Fr, optional(z.boolean())).returns(ContractClassMetadataSchema),
|
|
@@ -534,8 +358,4 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
534
358
|
.function()
|
|
535
359
|
.args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress))
|
|
536
360
|
.returns(z.array(AbiDecodedSchema)),
|
|
537
|
-
getPublicEvents: z
|
|
538
|
-
.function()
|
|
539
|
-
.args(EventMetadataDefinitionSchema, z.number(), z.number())
|
|
540
|
-
.returns(z.array(AbiDecodedSchema)),
|
|
541
361
|
};
|
|
@@ -7,11 +7,10 @@ import type {
|
|
|
7
7
|
|
|
8
8
|
import type { AvmCircuitInputs } from '../avm/avm.js';
|
|
9
9
|
import type { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
|
|
10
|
-
import type {
|
|
10
|
+
import type { ParityBasePrivateInputs } from '../parity/parity_base_private_inputs.js';
|
|
11
11
|
import type { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup.js';
|
|
12
|
+
import type { ParityRootPrivateInputs } from '../parity/parity_root_private_inputs.js';
|
|
13
|
+
import type { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
15
14
|
import type { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
16
15
|
import type {
|
|
17
16
|
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
@@ -19,19 +18,21 @@ import type {
|
|
|
19
18
|
BlockRootRollupPrivateInputs,
|
|
20
19
|
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
21
20
|
BlockRootSingleTxRollupPrivateInputs,
|
|
22
|
-
} from '../rollup/
|
|
23
|
-
import type { CheckpointMergeRollupPrivateInputs } from '../rollup/
|
|
21
|
+
} from '../rollup/block_root_rollup_private_inputs.js';
|
|
22
|
+
import type { CheckpointMergeRollupPrivateInputs } from '../rollup/checkpoint_merge_rollup_private_inputs.js';
|
|
24
23
|
import type { CheckpointRollupPublicInputs } from '../rollup/checkpoint_rollup_public_inputs.js';
|
|
25
24
|
import type {
|
|
26
25
|
CheckpointPaddingRollupPrivateInputs,
|
|
27
26
|
CheckpointRootRollupPrivateInputs,
|
|
28
27
|
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
29
|
-
} from '../rollup/
|
|
30
|
-
import type {
|
|
31
|
-
import type {
|
|
32
|
-
import type {
|
|
33
|
-
import type {
|
|
34
|
-
import type {
|
|
28
|
+
} from '../rollup/checkpoint_root_rollup_private_inputs.js';
|
|
29
|
+
import type { PrivateTxBaseRollupPrivateInputs } from '../rollup/private_tx_base_rollup_private_inputs.js';
|
|
30
|
+
import type { PublicTubePrivateInputs } from '../rollup/public_tube_private_inputs.js';
|
|
31
|
+
import type { PublicTxBaseRollupPrivateInputs } from '../rollup/public_tx_base_rollup_private_inputs.js';
|
|
32
|
+
import type { RootRollupPrivateInputs } from '../rollup/root_rollup_private_inputs.js';
|
|
33
|
+
import type { RootRollupPublicInputs } from '../rollup/root_rollup_public_inputs.js';
|
|
34
|
+
import type { TxMergeRollupPrivateInputs } from '../rollup/tx_merge_rollup_private_inputs.js';
|
|
35
|
+
import type { TxRollupPublicInputs } from '../rollup/tx_rollup_public_inputs.js';
|
|
35
36
|
import type { Tx } from '../tx/tx.js';
|
|
36
37
|
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from './proving-job.js';
|
|
37
38
|
|
|
@@ -44,7 +45,7 @@ export interface ServerCircuitProver {
|
|
|
44
45
|
* @param input - Input to the circuit.
|
|
45
46
|
*/
|
|
46
47
|
getBaseParityProof(
|
|
47
|
-
inputs:
|
|
48
|
+
inputs: ParityBasePrivateInputs,
|
|
48
49
|
signal?: AbortSignal,
|
|
49
50
|
epochNumber?: number,
|
|
50
51
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -54,7 +55,7 @@ export interface ServerCircuitProver {
|
|
|
54
55
|
* @param input - Input to the circuit.
|
|
55
56
|
*/
|
|
56
57
|
getRootParityProof(
|
|
57
|
-
inputs:
|
|
58
|
+
inputs: ParityRootPrivateInputs,
|
|
58
59
|
signal?: AbortSignal,
|
|
59
60
|
epochNumber?: number,
|
|
60
61
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -74,33 +75,27 @@ export interface ServerCircuitProver {
|
|
|
74
75
|
* Creates a proof for the given input.
|
|
75
76
|
* @param input - Input to the circuit.
|
|
76
77
|
*/
|
|
77
|
-
|
|
78
|
-
baseRollupInput:
|
|
78
|
+
getPrivateTxBaseRollupProof(
|
|
79
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
79
80
|
signal?: AbortSignal,
|
|
80
81
|
epochNumber?: number,
|
|
81
|
-
): Promise<
|
|
82
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
83
|
-
>;
|
|
82
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
inputs:
|
|
84
|
+
getPublicTxBaseRollupProof(
|
|
85
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
87
86
|
signal?: AbortSignal,
|
|
88
87
|
epochNumber?: number,
|
|
89
|
-
): Promise<
|
|
90
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
91
|
-
>;
|
|
88
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
92
89
|
|
|
93
90
|
/**
|
|
94
91
|
* Creates a proof for the given input.
|
|
95
92
|
* @param input - Input to the circuit.
|
|
96
93
|
*/
|
|
97
|
-
|
|
98
|
-
input:
|
|
94
|
+
getTxMergeRollupProof(
|
|
95
|
+
input: TxMergeRollupPrivateInputs,
|
|
99
96
|
signal?: AbortSignal,
|
|
100
97
|
epochNumber?: number,
|
|
101
|
-
): Promise<
|
|
102
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
103
|
-
>;
|
|
98
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
104
99
|
|
|
105
100
|
/**
|
|
106
101
|
* Creates a proof for the given input.
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN
|
|
1
|
+
import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
// This is used as a response for PXE's custom getPublicLogByTag oracle.
|
|
6
|
+
export class PublicLogWithTxData {
|
|
7
|
+
constructor(
|
|
8
|
+
public logPayload: Fr[],
|
|
9
|
+
public txHash: TxHash,
|
|
10
|
+
public uniqueNoteHashesInTx: Fr[],
|
|
11
|
+
public firstNullifierInTx: Fr,
|
|
12
|
+
) {}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// This is used as a response for PXE's custom getPrivateLogByTag oracle.
|
|
16
|
+
export class PrivateLogWithTxData {
|
|
8
17
|
constructor(
|
|
9
18
|
public logPayload: Fr[],
|
|
10
19
|
public txHash: TxHash,
|
|
11
20
|
public uniqueNoteHashesInTx: Fr[],
|
|
12
21
|
public firstNullifierInTx: Fr,
|
|
13
|
-
private maxLogContentLength: N,
|
|
14
22
|
) {}
|
|
15
23
|
|
|
16
24
|
toNoirSerialization(): (Fr | Fr[])[] {
|
|
17
25
|
return [
|
|
18
|
-
...toBoundedVecSerialization(this.logPayload,
|
|
26
|
+
...toBoundedVecSerialization(this.logPayload, PRIVATE_LOG_CIPHERTEXT_LEN),
|
|
19
27
|
this.txHash.hash,
|
|
20
28
|
...toBoundedVecSerialization(this.uniqueNoteHashesInTx, MAX_NOTE_HASHES_PER_TX),
|
|
21
29
|
this.firstNullifierInTx,
|
|
22
30
|
];
|
|
23
31
|
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// This is used as a response for PXE's custom getPublicLogByTag oracle.
|
|
27
|
-
export class PublicLogWithTxData extends LogWithTxData<typeof PUBLIC_LOG_PLAINTEXT_LEN> {
|
|
28
|
-
constructor(logContent: Fr[], txHash: TxHash, uniqueNoteHashesInTx: Fr[], firstNullifierInTx: Fr) {
|
|
29
|
-
super(logContent, txHash, uniqueNoteHashesInTx, firstNullifierInTx, PUBLIC_LOG_PLAINTEXT_LEN);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static noirSerializationOfEmpty(): (Fr | Fr[])[] {
|
|
33
|
-
return new PublicLogWithTxData([], TxHash.zero(), [], new Fr(0)).toNoirSerialization();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// This is used as a response for PXE's custom getPrivateLogByTag oracle.
|
|
38
|
-
export class PrivateLogWithTxData extends LogWithTxData<typeof PRIVATE_LOG_CIPHERTEXT_LEN> {
|
|
39
|
-
constructor(logContent: Fr[], txHash: TxHash, uniqueNoteHashesInTx: Fr[], firstNullifierInTx: Fr) {
|
|
40
|
-
super(logContent, txHash, uniqueNoteHashesInTx, firstNullifierInTx, PRIVATE_LOG_CIPHERTEXT_LEN);
|
|
41
|
-
}
|
|
42
32
|
|
|
43
33
|
static noirSerializationOfEmpty(): (Fr | Fr[])[] {
|
|
44
34
|
return new PrivateLogWithTxData([], TxHash.zero(), [], new Fr(0)).toNoirSerialization();
|