@aztec/stdlib 3.0.0-nightly.20250917 → 3.0.0-nightly.20250919
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 +6 -0
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +6 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +11 -6
- package/dest/avm/avm_proving_request.d.ts +7 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +4 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +16 -5
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +8 -5
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +14 -7
- package/dest/block/l2_block_code_to_purge.d.ts +3 -14
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +23 -13
- package/dest/block/l2_block_header.d.ts +100 -0
- package/dest/block/l2_block_header.d.ts.map +1 -0
- package/dest/block/l2_block_header.js +146 -0
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +1 -1
- package/dest/block/published_l2_block.d.ts +2 -2
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +1 -3
- package/dest/interfaces/block-builder.d.ts +2 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/epoch-prover.d.ts +26 -9
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +233 -125
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +120 -102
- package/dest/interfaces/pxe.d.ts +192 -90
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +5 -31
- package/dest/interfaces/server_circuit_prover.d.ts +31 -27
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +3 -2
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_context_inputs.d.ts +2 -2
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
- package/dest/p2p/consensus_payload.d.ts +7 -6
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +7 -6
- 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 +4 -3
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proof_data.js +2 -2
- package/dest/proofs/proving_request_type.d.ts +16 -11
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +16 -11
- package/dest/rollup/base_rollup_hints.d.ts +12 -3
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +11 -5
- package/dest/rollup/block_constant_data.d.ts +20 -6
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.js +15 -7
- package/dest/rollup/{block_merge_rollup.d.ts → block_merge_rollup_private_inputs.d.ts} +17 -10
- 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} +14 -13
- package/dest/rollup/block_rollup_public_inputs.d.ts +124 -0
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/block_rollup_public_inputs.js +85 -0
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +236 -0
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/block_root_rollup_private_inputs.js +257 -0
- package/dest/rollup/checkpoint_constant_data.d.ts +54 -0
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -0
- package/dest/rollup/checkpoint_constant_data.js +55 -0
- package/dest/{tx/proposed_block_header.d.ts → rollup/checkpoint_header.d.ts} +11 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -0
- package/dest/{tx/proposed_block_header.js → rollup/checkpoint_header.js} +9 -9
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +30 -0
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.js +37 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +105 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.js +105 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +123 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +178 -0
- package/dest/rollup/epoch_constant_data.d.ts +19 -2
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.js +20 -7
- package/dest/rollup/index.d.ts +14 -12
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +14 -12
- 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_public_inputs.d.ts +46 -0
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/root_rollup_public_inputs.js +71 -0
- 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} +12 -12
- 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} +14 -14
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +28 -68
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +90 -115
- package/dest/tests/mocks.d.ts +3 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -3
- package/dest/tx/block_header.d.ts +12 -13
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +16 -21
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +0 -1
- package/dest/tx/index.d.ts +0 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -3
- package/dest/tx/tx_constant_data.d.ts +4 -4
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +6 -6
- package/dest/tx/tx_effect.d.ts +0 -3
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -7
- package/package.json +8 -8
- package/src/avm/avm_circuit_public_inputs.ts +10 -0
- package/src/block/body.ts +23 -6
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +18 -8
- package/src/block/l2_block_code_to_purge.ts +30 -31
- package/src/block/l2_block_header.ts +232 -0
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +1 -1
- package/src/block/test/l2_tips_store_test_suite.ts +1 -2
- package/src/interfaces/block-builder.ts +2 -6
- package/src/interfaces/epoch-prover.ts +35 -11
- package/src/interfaces/proving-job.ts +199 -123
- package/src/interfaces/pxe.ts +3 -138
- package/src/interfaces/server_circuit_prover.ts +83 -52
- package/src/interfaces/validator.ts +3 -2
- package/src/kernel/private_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_context_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
- package/src/p2p/consensus_payload.ts +8 -7
- 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 +5 -8
- package/src/proofs/proving_request_type.ts +14 -8
- package/src/rollup/base_rollup_hints.ts +9 -1
- package/src/rollup/block_constant_data.ts +13 -3
- package/src/rollup/{block_merge_rollup.ts → block_merge_rollup_private_inputs.ts} +15 -11
- package/src/rollup/block_rollup_public_inputs.ts +123 -0
- package/src/rollup/block_root_rollup_private_inputs.ts +312 -0
- package/src/rollup/checkpoint_constant_data.ts +84 -0
- package/src/{tx/proposed_block_header.ts → rollup/checkpoint_header.ts} +16 -17
- package/src/rollup/checkpoint_merge_rollup_private_inputs.ts +49 -0
- package/src/rollup/{block_root_or_block_merge_public_inputs.ts → checkpoint_rollup_public_inputs.ts} +26 -52
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +218 -0
- package/src/rollup/epoch_constant_data.ts +32 -8
- package/src/rollup/index.ts +14 -12
- 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} +8 -104
- 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} +12 -12
- package/src/stats/stats.ts +18 -12
- package/src/tests/factories.ts +144 -199
- package/src/tests/mocks.ts +6 -13
- package/src/tx/block_header.ts +17 -32
- package/src/tx/global_variables.ts +0 -1
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +3 -3
- package/src/tx/tx_constant_data.ts +4 -4
- package/src/tx/tx_effect.ts +2 -7
- 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_or_block_merge_public_inputs.d.ts +0 -134
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +0 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +0 -125
- package/dest/rollup/block_root_rollup.d.ts +0 -283
- package/dest/rollup/block_root_rollup.d.ts.map +0 -1
- package/dest/rollup/block_root_rollup.js +0 -306
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +0 -51
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/empty_block_root_rollup_inputs.js +0 -65
- package/dest/rollup/merge_rollup.d.ts.map +0 -1
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
- package/dest/rollup/previous_rollup_block_data.d.ts +0 -47
- package/dest/rollup/previous_rollup_block_data.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_block_data.js +0 -37
- 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/root_rollup.d.ts +0 -106
- package/dest/rollup/root_rollup.d.ts.map +0 -1
- package/dest/rollup/root_rollup.js +0 -147
- package/dest/tx/proposed_block_header.d.ts.map +0 -1
- package/src/parity/root_parity_input.ts +0 -71
- package/src/rollup/block_root_rollup.ts +0 -380
- package/src/rollup/empty_block_root_rollup_inputs.ts +0 -80
- package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
- package/src/rollup/previous_rollup_block_data.ts +0 -48
- package/src/rollup/previous_rollup_data.ts +0 -48
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,7 +7,6 @@ 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,
|
|
@@ -23,12 +20,10 @@ import {
|
|
|
23
20
|
ProtocolContractAddressesSchema,
|
|
24
21
|
} from '../contract/index.js';
|
|
25
22
|
import { GasFees } from '../gas/gas_fees.js';
|
|
26
|
-
import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
|
|
27
23
|
import { UniqueNote } from '../note/extended_note.js';
|
|
28
24
|
import { type NotesFilter, NotesFilterSchema } from '../note/notes_filter.js';
|
|
29
25
|
import { AbiDecodedSchema, optional, schemas } from '../schemas/schemas.js';
|
|
30
26
|
import {
|
|
31
|
-
type IndexedTxEffect,
|
|
32
27
|
PrivateExecutionResult,
|
|
33
28
|
SimulationOverrides,
|
|
34
29
|
Tx,
|
|
@@ -36,16 +31,9 @@ import {
|
|
|
36
31
|
TxHash,
|
|
37
32
|
TxReceipt,
|
|
38
33
|
TxSimulationResult,
|
|
39
|
-
indexedTxSchema,
|
|
40
34
|
} from '../tx/index.js';
|
|
41
35
|
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
42
36
|
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
37
|
|
|
50
38
|
// docs:start:pxe-interface
|
|
51
39
|
/**
|
|
@@ -55,21 +43,6 @@ import {
|
|
|
55
43
|
* is exposed to dapps for interacting with the network on behalf of the user.
|
|
56
44
|
*/
|
|
57
45
|
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
46
|
/**
|
|
74
47
|
* Registers a user account in PXE given its master encryption private key.
|
|
75
48
|
* Once a new account is registered, the PXE Service will trial-decrypt all published notes on
|
|
@@ -220,26 +193,6 @@ export interface PXE {
|
|
|
220
193
|
*/
|
|
221
194
|
getTxReceipt(txHash: TxHash): Promise<TxReceipt>;
|
|
222
195
|
|
|
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
196
|
/**
|
|
244
197
|
* Gets notes registered in this PXE based on the provided filter.
|
|
245
198
|
* @param filter - The filter to apply to the notes.
|
|
@@ -247,35 +200,6 @@ export interface PXE {
|
|
|
247
200
|
*/
|
|
248
201
|
getNotes(filter: NotesFilter): Promise<UniqueNote[]>;
|
|
249
202
|
|
|
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
203
|
/**
|
|
280
204
|
* Method to fetch the current base fees.
|
|
281
205
|
* @returns The current base fees.
|
|
@@ -303,32 +227,6 @@ export interface PXE {
|
|
|
303
227
|
scopes?: AztecAddress[],
|
|
304
228
|
): Promise<UtilitySimulationResult>;
|
|
305
229
|
|
|
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
230
|
/**
|
|
333
231
|
* Returns the information about the server's node. Includes current Node version, compatible Noir version,
|
|
334
232
|
* L1 chain identifier, rollup version, and L1 address of the rollup contract.
|
|
@@ -386,15 +284,6 @@ export interface PXE {
|
|
|
386
284
|
numBlocks: number,
|
|
387
285
|
recipients: AztecAddress[],
|
|
388
286
|
): 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
287
|
}
|
|
399
288
|
// docs:end:pxe-interface
|
|
400
289
|
|
|
@@ -404,7 +293,7 @@ export type EventMetadataDefinition = {
|
|
|
404
293
|
fieldNames: string[];
|
|
405
294
|
};
|
|
406
295
|
|
|
407
|
-
const EventMetadataDefinitionSchema = z.object({
|
|
296
|
+
export const EventMetadataDefinitionSchema = z.object({
|
|
408
297
|
eventSelector: schemas.EventSelector,
|
|
409
298
|
abiType: AbiTypeSchema,
|
|
410
299
|
fieldNames: z.array(z.string()),
|
|
@@ -436,13 +325,13 @@ export interface ContractClassMetadata {
|
|
|
436
325
|
artifact?: ContractArtifact | undefined;
|
|
437
326
|
}
|
|
438
327
|
|
|
439
|
-
const ContractMetadataSchema = z.object({
|
|
328
|
+
export const ContractMetadataSchema = z.object({
|
|
440
329
|
contractInstance: z.union([ContractInstanceWithAddressSchema, z.undefined()]),
|
|
441
330
|
isContractInitialized: z.boolean(),
|
|
442
331
|
isContractPublished: z.boolean(),
|
|
443
332
|
}) satisfies ZodFor<ContractMetadata>;
|
|
444
333
|
|
|
445
|
-
const ContractClassMetadataSchema = z.object({
|
|
334
|
+
export const ContractClassMetadataSchema = z.object({
|
|
446
335
|
contractClass: z.union([ContractClassWithIdSchema, z.undefined()]),
|
|
447
336
|
isContractClassPubliclyRegistered: z.boolean(),
|
|
448
337
|
artifact: z.union([ContractArtifactSchema, z.undefined()]),
|
|
@@ -454,8 +343,6 @@ const PXEInfoSchema = z.object({
|
|
|
454
343
|
}) satisfies ZodFor<PXEInfo>;
|
|
455
344
|
|
|
456
345
|
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
346
|
registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema),
|
|
460
347
|
getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)),
|
|
461
348
|
registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress),
|
|
@@ -494,21 +381,7 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
494
381
|
.returns(TxSimulationResult.schema),
|
|
495
382
|
sendTx: z.function().args(Tx.schema).returns(TxHash.schema),
|
|
496
383
|
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
384
|
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
385
|
getCurrentBaseFees: z.function().returns(GasFees.schema),
|
|
513
386
|
|
|
514
387
|
simulateUtility: z
|
|
@@ -522,10 +395,6 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
522
395
|
optional(z.array(schemas.AztecAddress)),
|
|
523
396
|
)
|
|
524
397
|
.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
398
|
getNodeInfo: z.function().returns(NodeInfoSchema),
|
|
530
399
|
getPXEInfo: z.function().returns(PXEInfoSchema),
|
|
531
400
|
getContractMetadata: z.function().args(schemas.AztecAddress).returns(ContractMetadataSchema),
|
|
@@ -534,8 +403,4 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
534
403
|
.function()
|
|
535
404
|
.args(schemas.AztecAddress, EventMetadataDefinitionSchema, z.number(), z.number(), z.array(schemas.AztecAddress))
|
|
536
405
|
.returns(z.array(AbiDecodedSchema)),
|
|
537
|
-
getPublicEvents: z
|
|
538
|
-
.function()
|
|
539
|
-
.args(EventMetadataDefinitionSchema, z.number(), z.number())
|
|
540
|
-
.returns(z.array(AbiDecodedSchema)),
|
|
541
406
|
};
|
|
@@ -7,19 +7,32 @@ 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 {
|
|
15
|
-
import type {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import type {
|
|
12
|
+
import type { ParityRootPrivateInputs } from '../parity/parity_root_private_inputs.js';
|
|
13
|
+
import type { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
14
|
+
import type { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
15
|
+
import type {
|
|
16
|
+
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
17
|
+
BlockRootFirstRollupPrivateInputs,
|
|
18
|
+
BlockRootRollupPrivateInputs,
|
|
19
|
+
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
20
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
21
|
+
} from '../rollup/block_root_rollup_private_inputs.js';
|
|
22
|
+
import type { CheckpointMergeRollupPrivateInputs } from '../rollup/checkpoint_merge_rollup_private_inputs.js';
|
|
23
|
+
import type { CheckpointRollupPublicInputs } from '../rollup/checkpoint_rollup_public_inputs.js';
|
|
24
|
+
import type {
|
|
25
|
+
CheckpointPaddingRollupPrivateInputs,
|
|
26
|
+
CheckpointRootRollupPrivateInputs,
|
|
27
|
+
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
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';
|
|
23
36
|
import type { Tx } from '../tx/tx.js';
|
|
24
37
|
import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from './proving-job.js';
|
|
25
38
|
|
|
@@ -32,7 +45,7 @@ export interface ServerCircuitProver {
|
|
|
32
45
|
* @param input - Input to the circuit.
|
|
33
46
|
*/
|
|
34
47
|
getBaseParityProof(
|
|
35
|
-
inputs:
|
|
48
|
+
inputs: ParityBasePrivateInputs,
|
|
36
49
|
signal?: AbortSignal,
|
|
37
50
|
epochNumber?: number,
|
|
38
51
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -42,7 +55,7 @@ export interface ServerCircuitProver {
|
|
|
42
55
|
* @param input - Input to the circuit.
|
|
43
56
|
*/
|
|
44
57
|
getRootParityProof(
|
|
45
|
-
inputs:
|
|
58
|
+
inputs: ParityRootPrivateInputs,
|
|
46
59
|
signal?: AbortSignal,
|
|
47
60
|
epochNumber?: number,
|
|
48
61
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -62,84 +75,102 @@ export interface ServerCircuitProver {
|
|
|
62
75
|
* Creates a proof for the given input.
|
|
63
76
|
* @param input - Input to the circuit.
|
|
64
77
|
*/
|
|
65
|
-
|
|
66
|
-
baseRollupInput:
|
|
78
|
+
getPrivateTxBaseRollupProof(
|
|
79
|
+
baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
67
80
|
signal?: AbortSignal,
|
|
68
81
|
epochNumber?: number,
|
|
69
|
-
): Promise<
|
|
70
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
71
|
-
>;
|
|
82
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
72
83
|
|
|
73
|
-
|
|
74
|
-
inputs:
|
|
84
|
+
getPublicTxBaseRollupProof(
|
|
85
|
+
inputs: PublicTxBaseRollupPrivateInputs,
|
|
75
86
|
signal?: AbortSignal,
|
|
76
87
|
epochNumber?: number,
|
|
77
|
-
): Promise<
|
|
78
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
79
|
-
>;
|
|
88
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
80
89
|
|
|
81
90
|
/**
|
|
82
91
|
* Creates a proof for the given input.
|
|
83
92
|
* @param input - Input to the circuit.
|
|
84
93
|
*/
|
|
85
|
-
|
|
86
|
-
input:
|
|
94
|
+
getTxMergeRollupProof(
|
|
95
|
+
input: TxMergeRollupPrivateInputs,
|
|
87
96
|
signal?: AbortSignal,
|
|
88
97
|
epochNumber?: number,
|
|
89
|
-
): Promise<
|
|
90
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
91
|
-
>;
|
|
98
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
92
99
|
|
|
93
100
|
/**
|
|
94
101
|
* Creates a proof for the given input.
|
|
95
102
|
* @param input - Input to the circuit.
|
|
96
103
|
*/
|
|
104
|
+
getBlockRootFirstRollupProof(
|
|
105
|
+
input: BlockRootFirstRollupPrivateInputs,
|
|
106
|
+
signal?: AbortSignal,
|
|
107
|
+
epochNumber?: number,
|
|
108
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
109
|
+
|
|
110
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
111
|
+
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
112
|
+
signal?: AbortSignal,
|
|
113
|
+
epochNumber?: number,
|
|
114
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
115
|
+
|
|
116
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
117
|
+
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
118
|
+
signal?: AbortSignal,
|
|
119
|
+
epochNumber?: number,
|
|
120
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
121
|
+
|
|
97
122
|
getBlockRootRollupProof(
|
|
98
|
-
input:
|
|
123
|
+
input: BlockRootRollupPrivateInputs,
|
|
99
124
|
signal?: AbortSignal,
|
|
100
125
|
epochNumber?: number,
|
|
101
|
-
): Promise<
|
|
102
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
103
|
-
>;
|
|
126
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
104
127
|
|
|
105
|
-
|
|
106
|
-
input:
|
|
128
|
+
getBlockRootSingleTxRollupProof(
|
|
129
|
+
input: BlockRootSingleTxRollupPrivateInputs,
|
|
107
130
|
signal?: AbortSignal,
|
|
108
131
|
epochNumber?: number,
|
|
109
|
-
): Promise<
|
|
110
|
-
PublicInputsAndRecursiveProof<BlockRootOrBlockMergePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
111
|
-
>;
|
|
132
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
112
133
|
|
|
113
134
|
/**
|
|
114
135
|
* Creates a proof for the given input.
|
|
115
136
|
* @param input - Input to the circuit.
|
|
116
137
|
*/
|
|
117
|
-
|
|
118
|
-
input:
|
|
138
|
+
getBlockMergeRollupProof(
|
|
139
|
+
input: BlockMergeRollupPrivateInputs,
|
|
140
|
+
signal?: AbortSignal,
|
|
141
|
+
epochNumber?: number,
|
|
142
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
143
|
+
|
|
144
|
+
getCheckpointRootRollupProof(
|
|
145
|
+
input: CheckpointRootRollupPrivateInputs,
|
|
119
146
|
signal?: AbortSignal,
|
|
120
147
|
epochNumber?: number,
|
|
121
148
|
): Promise<
|
|
122
|
-
PublicInputsAndRecursiveProof<
|
|
149
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
123
150
|
>;
|
|
124
151
|
|
|
125
|
-
|
|
126
|
-
input:
|
|
152
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
153
|
+
input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
127
154
|
signal?: AbortSignal,
|
|
128
155
|
epochNumber?: number,
|
|
129
156
|
): Promise<
|
|
130
|
-
PublicInputsAndRecursiveProof<
|
|
157
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
131
158
|
>;
|
|
132
159
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
160
|
+
getCheckpointPaddingRollupProof(
|
|
161
|
+
input: CheckpointPaddingRollupPrivateInputs,
|
|
162
|
+
signal?: AbortSignal,
|
|
163
|
+
epochNumber?: number,
|
|
164
|
+
): Promise<
|
|
165
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
166
|
+
>;
|
|
167
|
+
|
|
168
|
+
getCheckpointMergeRollupProof(
|
|
169
|
+
input: CheckpointMergeRollupPrivateInputs,
|
|
139
170
|
signal?: AbortSignal,
|
|
140
171
|
epochNumber?: number,
|
|
141
172
|
): Promise<
|
|
142
|
-
PublicInputsAndRecursiveProof<
|
|
173
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
143
174
|
>;
|
|
144
175
|
|
|
145
176
|
/**
|
|
@@ -147,7 +178,7 @@ export interface ServerCircuitProver {
|
|
|
147
178
|
* @param input - Input to the circuit.
|
|
148
179
|
*/
|
|
149
180
|
getRootRollupProof(
|
|
150
|
-
input:
|
|
181
|
+
input: RootRollupPrivateInputs,
|
|
151
182
|
signal?: AbortSignal,
|
|
152
183
|
epochNumber?: number,
|
|
153
184
|
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
@@ -5,12 +5,13 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
5
5
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
6
6
|
import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
8
|
-
import type {
|
|
8
|
+
import type { StateReference, Tx } from '@aztec/stdlib/tx';
|
|
9
9
|
|
|
10
10
|
import type { PeerId } from '@libp2p/interface';
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
|
|
13
13
|
import type { CommitteeAttestationsAndSigners } from '../block/index.js';
|
|
14
|
+
import type { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Validator client configuration
|
|
@@ -59,7 +60,7 @@ export interface Validator {
|
|
|
59
60
|
// Block validation responsibilities
|
|
60
61
|
createBlockProposal(
|
|
61
62
|
blockNumber: number,
|
|
62
|
-
header:
|
|
63
|
+
header: CheckpointHeader,
|
|
63
64
|
archive: Fr,
|
|
64
65
|
stateReference: StateReference,
|
|
65
66
|
txs: Tx[],
|
|
@@ -127,11 +127,11 @@ export class PrivateCircuitPublicInputs {
|
|
|
127
127
|
/**
|
|
128
128
|
* Header of a block whose state is used during private execution (not the block the transaction is included in).
|
|
129
129
|
*/
|
|
130
|
-
public
|
|
130
|
+
public anchorBlockHeader: BlockHeader,
|
|
131
131
|
/**
|
|
132
132
|
* Transaction context.
|
|
133
133
|
*
|
|
134
|
-
* Note: The chainId and version in the txContext are not redundant to the values in self.
|
|
134
|
+
* Note: The chainId and version in the txContext are not redundant to the values in self.anchor_block_header.global_variables because
|
|
135
135
|
* they can be different in case of a protocol upgrade. In such a situation we could be using header from a block
|
|
136
136
|
* before the upgrade took place but be using the updated protocol to execute and prove the transaction.
|
|
137
137
|
*/
|
|
@@ -261,7 +261,7 @@ export class PrivateCircuitPublicInputs {
|
|
|
261
261
|
this.contractClassLogsHashes.isEmpty() &&
|
|
262
262
|
this.startSideEffectCounter.isZero() &&
|
|
263
263
|
this.endSideEffectCounter.isZero() &&
|
|
264
|
-
this.
|
|
264
|
+
this.anchorBlockHeader.isEmpty() &&
|
|
265
265
|
this.txContext.isEmpty()
|
|
266
266
|
);
|
|
267
267
|
}
|
|
@@ -292,7 +292,7 @@ export class PrivateCircuitPublicInputs {
|
|
|
292
292
|
fields.contractClassLogsHashes,
|
|
293
293
|
fields.startSideEffectCounter,
|
|
294
294
|
fields.endSideEffectCounter,
|
|
295
|
-
fields.
|
|
295
|
+
fields.anchorBlockHeader,
|
|
296
296
|
fields.txContext,
|
|
297
297
|
] as const;
|
|
298
298
|
}
|
|
@@ -324,7 +324,7 @@ export class PrivateCircuitPublicInputs {
|
|
|
324
324
|
this.contractClassLogsHashes,
|
|
325
325
|
this.startSideEffectCounter,
|
|
326
326
|
this.endSideEffectCounter,
|
|
327
|
-
this.
|
|
327
|
+
this.anchorBlockHeader,
|
|
328
328
|
this.txContext,
|
|
329
329
|
]);
|
|
330
330
|
}
|
|
@@ -8,7 +8,7 @@ import { TxContext } from '../tx/tx_context.js';
|
|
|
8
8
|
export class PrivateContextInputs {
|
|
9
9
|
constructor(
|
|
10
10
|
public callContext: CallContext,
|
|
11
|
-
public
|
|
11
|
+
public anchorBlockHeader: BlockHeader,
|
|
12
12
|
public txContext: TxContext,
|
|
13
13
|
public startSideEffectCounter: number,
|
|
14
14
|
) {}
|
|
@@ -18,6 +18,6 @@ export class PrivateContextInputs {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
public toFields(): Fr[] {
|
|
21
|
-
return serializeToFields([this.callContext, this.
|
|
21
|
+
return serializeToFields([this.callContext, this.anchorBlockHeader, this.txContext, this.startSideEffectCounter]);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -170,7 +170,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
170
170
|
throw new Error('Private tail public inputs is not for rollup circuit.');
|
|
171
171
|
}
|
|
172
172
|
const constants = new TxConstantData(
|
|
173
|
-
this.constants.
|
|
173
|
+
this.constants.anchorBlockHeader,
|
|
174
174
|
this.constants.txContext,
|
|
175
175
|
this.constants.vkTreeRoot,
|
|
176
176
|
this.constants.protocolContractTreeRoot,
|
|
@@ -8,7 +8,8 @@ import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
import type { L2Block } from '../block/l2_block.js';
|
|
11
|
-
import {
|
|
11
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
12
|
+
import { StateReference } from '../tx/state_reference.js';
|
|
12
13
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
13
14
|
|
|
14
15
|
export class ConsensusPayload implements Signable {
|
|
@@ -16,7 +17,7 @@ export class ConsensusPayload implements Signable {
|
|
|
16
17
|
|
|
17
18
|
constructor(
|
|
18
19
|
/** The proposed block header the attestation is made over */
|
|
19
|
-
public readonly header:
|
|
20
|
+
public readonly header: CheckpointHeader,
|
|
20
21
|
/** The archive root after the block is added */
|
|
21
22
|
public readonly archive: Fr,
|
|
22
23
|
/** The state reference after the block is added */
|
|
@@ -26,7 +27,7 @@ export class ConsensusPayload implements Signable {
|
|
|
26
27
|
static get schema() {
|
|
27
28
|
return z
|
|
28
29
|
.object({
|
|
29
|
-
header:
|
|
30
|
+
header: CheckpointHeader.schema,
|
|
30
31
|
archive: schemas.Fr,
|
|
31
32
|
stateReference: StateReference.schema,
|
|
32
33
|
})
|
|
@@ -66,7 +67,7 @@ export class ConsensusPayload implements Signable {
|
|
|
66
67
|
static fromBuffer(buf: Buffer | BufferReader): ConsensusPayload {
|
|
67
68
|
const reader = BufferReader.asReader(buf);
|
|
68
69
|
const payload = new ConsensusPayload(
|
|
69
|
-
reader.readObject(
|
|
70
|
+
reader.readObject(CheckpointHeader),
|
|
70
71
|
reader.readObject(Fr),
|
|
71
72
|
reader.readObject(StateReference),
|
|
72
73
|
);
|
|
@@ -78,15 +79,15 @@ export class ConsensusPayload implements Signable {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
static fromBlock(block: L2Block): ConsensusPayload {
|
|
81
|
-
return new ConsensusPayload(block.header.
|
|
82
|
+
return new ConsensusPayload(block.header.toCheckpointHeader(), block.archive.root, block.header.state);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
static empty(): ConsensusPayload {
|
|
85
|
-
return new ConsensusPayload(
|
|
86
|
+
return new ConsensusPayload(CheckpointHeader.empty(), Fr.ZERO, StateReference.empty());
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
static random(): ConsensusPayload {
|
|
89
|
-
return new ConsensusPayload(
|
|
90
|
+
return new ConsensusPayload(CheckpointHeader.random(), Fr.random(), StateReference.random());
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
/**
|
package/src/parity/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './parity_base_private_inputs.js';
|
|
2
2
|
export * from './parity_public_inputs.js';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './root_parity_inputs.js';
|
|
3
|
+
export * from './parity_root_private_inputs.js';
|
|
@@ -4,7 +4,7 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
|
4
4
|
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
6
|
|
|
7
|
-
export class
|
|
7
|
+
export class ParityBasePrivateInputs {
|
|
8
8
|
constructor(
|
|
9
9
|
/** Aggregated proof of all the parity circuit iterations. */
|
|
10
10
|
public readonly msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>,
|
|
@@ -16,11 +16,11 @@ export class BaseParityInputs {
|
|
|
16
16
|
array: Tuple<Fr, typeof NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP>,
|
|
17
17
|
index: number,
|
|
18
18
|
vkTreeRoot: Fr,
|
|
19
|
-
):
|
|
19
|
+
): ParityBasePrivateInputs {
|
|
20
20
|
const start = index * NUM_MSGS_PER_BASE_PARITY;
|
|
21
21
|
const end = start + NUM_MSGS_PER_BASE_PARITY;
|
|
22
22
|
const msgs = array.slice(start, end);
|
|
23
|
-
return new
|
|
23
|
+
return new ParityBasePrivateInputs(msgs as Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>, vkTreeRoot);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/** Serializes the inputs to a buffer. */
|
|
@@ -39,7 +39,7 @@ export class BaseParityInputs {
|
|
|
39
39
|
*/
|
|
40
40
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
41
41
|
const reader = BufferReader.asReader(buffer);
|
|
42
|
-
return new
|
|
42
|
+
return new ParityBasePrivateInputs(reader.readArray(NUM_MSGS_PER_BASE_PARITY, Fr), Fr.fromBuffer(reader));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -48,7 +48,7 @@ export class BaseParityInputs {
|
|
|
48
48
|
* @returns - The deserialized inputs.
|
|
49
49
|
*/
|
|
50
50
|
static fromString(str: string) {
|
|
51
|
-
return
|
|
51
|
+
return ParityBasePrivateInputs.fromBuffer(hexToBuffer(str));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/** Returns a buffer representation for JSON serialization. */
|
|
@@ -58,6 +58,6 @@ export class BaseParityInputs {
|
|
|
58
58
|
|
|
59
59
|
/** Creates an instance from a hex string. */
|
|
60
60
|
static get schema() {
|
|
61
|
-
return bufferSchemaFor(
|
|
61
|
+
return bufferSchemaFor(ParityBasePrivateInputs);
|
|
62
62
|
}
|
|
63
63
|
}
|