@aztec/stdlib 3.0.0-nightly.20250925 → 3.0.0-nightly.20250927
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/abi/event_metadata_definition.d.ts +8 -0
- package/dest/abi/event_metadata_definition.d.ts.map +1 -0
- package/dest/abi/event_metadata_definition.js +1 -0
- package/dest/abi/index.d.ts +1 -0
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/avm/avm_accumulated_data.d.ts +1 -0
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +4 -0
- package/dest/avm/index.d.ts +0 -1
- package/dest/avm/index.d.ts.map +1 -1
- package/dest/avm/index.js +0 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +0 -5
- package/dest/contract/contract_class_metadata.d.ts +8 -0
- package/dest/contract/contract_class_metadata.d.ts.map +1 -0
- package/dest/contract/contract_class_metadata.js +1 -0
- package/dest/contract/contract_metadata.d.ts +7 -0
- package/dest/contract/contract_metadata.d.ts.map +1 -0
- package/dest/contract/contract_metadata.js +1 -0
- package/dest/contract/index.d.ts +2 -0
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +2 -0
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +18 -0
- package/dest/file-store/s3.d.ts +25 -0
- package/dest/file-store/s3.d.ts.map +1 -0
- package/dest/file-store/s3.js +187 -0
- package/dest/interfaces/aztec-node-admin.d.ts +6 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/client.d.ts +0 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +0 -1
- package/dest/interfaces/proving-job.d.ts +5 -5
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +4 -0
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -0
- package/dest/interfaces/validator.d.ts +6 -1
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +2 -1
- package/dest/logs/contract_class_log.d.ts +1 -1
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +1 -3
- package/dest/rollup/avm_proof_data.d.ts +2 -12
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +0 -24
- package/dest/rollup/base_rollup_hints.d.ts +16 -25
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +26 -32
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +13 -13
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.js +20 -20
- package/dest/rollup/index.d.ts +2 -1
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +2 -1
- package/dest/rollup/public_tube_private_inputs.d.ts +4 -2
- package/dest/rollup/public_tube_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tube_private_inputs.js +7 -3
- package/dest/rollup/public_tube_public_inputs.d.ts +20 -0
- package/dest/rollup/public_tube_public_inputs.d.ts.map +1 -0
- package/dest/rollup/public_tube_public_inputs.js +41 -0
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +5 -5
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.js +3 -3
- package/dest/rollup/{state_diff_hints.d.ts → tree_snapshot_diff_hints.d.ts} +22 -38
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -0
- package/dest/rollup/tree_snapshot_diff_hints.js +75 -0
- package/dest/rollup/tx_rollup_public_inputs.d.ts +4 -4
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.js +7 -7
- package/dest/tests/factories.d.ts +6 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +26 -28
- package/dest/tx/tx_effect.d.ts +3 -33
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +58 -191
- package/package.json +9 -8
- package/src/abi/event_metadata_definition.ts +8 -0
- package/src/abi/index.ts +1 -0
- package/src/avm/avm_accumulated_data.ts +10 -0
- package/src/avm/index.ts +0 -1
- package/src/block/body.ts +1 -7
- package/src/contract/contract_class_metadata.ts +8 -0
- package/src/contract/contract_metadata.ts +7 -0
- package/src/contract/index.ts +2 -0
- package/src/file-store/factory.ts +15 -0
- package/src/file-store/s3.ts +186 -0
- package/src/interfaces/client.ts +0 -1
- package/src/interfaces/proving-job.ts +4 -4
- package/src/interfaces/server_circuit_prover.ts +2 -7
- package/src/interfaces/slasher.ts +2 -0
- package/src/interfaces/validator.ts +5 -1
- package/src/logs/contract_class_log.ts +2 -3
- package/src/rollup/avm_proof_data.ts +2 -31
- package/src/rollup/base_rollup_hints.ts +20 -28
- package/src/rollup/block_root_rollup_private_inputs.ts +14 -14
- package/src/rollup/index.ts +2 -1
- package/src/rollup/public_tube_private_inputs.ts +10 -3
- package/src/rollup/public_tube_public_inputs.ts +52 -0
- package/src/rollup/public_tx_base_rollup_private_inputs.ts +6 -5
- package/src/rollup/{state_diff_hints.ts → tree_snapshot_diff_hints.ts} +26 -41
- package/src/rollup/tx_rollup_public_inputs.ts +4 -4
- package/src/tests/factories.ts +31 -43
- package/src/tx/tx_effect.ts +59 -204
- package/dest/avm/public_data_hint.d.ts +0 -16
- package/dest/avm/public_data_hint.d.ts.map +0 -1
- package/dest/avm/public_data_hint.js +0 -27
- package/dest/interfaces/pxe.d.ts +0 -235
- package/dest/interfaces/pxe.d.ts.map +0 -1
- package/dest/interfaces/pxe.js +0 -13
- package/dest/rollup/state_diff_hints.d.ts.map +0 -1
- package/dest/rollup/state_diff_hints.js +0 -85
- package/src/avm/public_data_hint.ts +0 -38
- package/src/interfaces/pxe.ts +0 -284
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { MAX_NULLIFIERS_PER_TX, NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, NULLIFIER_TREE_HEIGHT, PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
6
|
-
import { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '../trees/index.js';
|
|
7
|
-
/**
|
|
8
|
-
* Hints used while proving state diff validity for the private base rollup.
|
|
9
|
-
*/ export class PrivateBaseStateDiffHints {
|
|
10
|
-
nullifierPredecessorPreimages;
|
|
11
|
-
nullifierPredecessorMembershipWitnesses;
|
|
12
|
-
sortedNullifiers;
|
|
13
|
-
sortedNullifierIndexes;
|
|
14
|
-
noteHashSubtreeSiblingPath;
|
|
15
|
-
nullifierSubtreeSiblingPath;
|
|
16
|
-
feeWriteLowLeafPreimage;
|
|
17
|
-
feeWriteLowLeafMembershipWitness;
|
|
18
|
-
feeWriteSiblingPath;
|
|
19
|
-
constructor(/**
|
|
20
|
-
* The nullifiers which need to be updated to perform the batch insertion of the new nullifiers.
|
|
21
|
-
* See `StandardIndexedTree.batchInsert` function for more details.
|
|
22
|
-
*/ nullifierPredecessorPreimages, /**
|
|
23
|
-
* Membership witnesses for the nullifiers which need to be updated to perform the batch insertion of the new
|
|
24
|
-
* nullifiers.
|
|
25
|
-
*/ nullifierPredecessorMembershipWitnesses, /**
|
|
26
|
-
* The nullifiers to be inserted in the tree, sorted high to low.
|
|
27
|
-
*/ sortedNullifiers, /**
|
|
28
|
-
* The indexes of the sorted nullifiers to the original ones.
|
|
29
|
-
*/ sortedNullifierIndexes, /**
|
|
30
|
-
* Sibling path "pointing to" where the new note hash subtree should be inserted into the note hash tree.
|
|
31
|
-
*/ noteHashSubtreeSiblingPath, /**
|
|
32
|
-
* Sibling path "pointing to" where the new nullifiers subtree should be inserted into the nullifier tree.
|
|
33
|
-
*/ nullifierSubtreeSiblingPath, /**
|
|
34
|
-
* Low leaf for the fee write in the public data tree.
|
|
35
|
-
*/ feeWriteLowLeafPreimage, /**
|
|
36
|
-
* Membership witness for the low leaf for the fee write in the public data tree.
|
|
37
|
-
*/ feeWriteLowLeafMembershipWitness, /**
|
|
38
|
-
* Sibling path "pointing to" where the fee write should be inserted into the public data tree.
|
|
39
|
-
*/ feeWriteSiblingPath){
|
|
40
|
-
this.nullifierPredecessorPreimages = nullifierPredecessorPreimages;
|
|
41
|
-
this.nullifierPredecessorMembershipWitnesses = nullifierPredecessorMembershipWitnesses;
|
|
42
|
-
this.sortedNullifiers = sortedNullifiers;
|
|
43
|
-
this.sortedNullifierIndexes = sortedNullifierIndexes;
|
|
44
|
-
this.noteHashSubtreeSiblingPath = noteHashSubtreeSiblingPath;
|
|
45
|
-
this.nullifierSubtreeSiblingPath = nullifierSubtreeSiblingPath;
|
|
46
|
-
this.feeWriteLowLeafPreimage = feeWriteLowLeafPreimage;
|
|
47
|
-
this.feeWriteLowLeafMembershipWitness = feeWriteLowLeafMembershipWitness;
|
|
48
|
-
this.feeWriteSiblingPath = feeWriteSiblingPath;
|
|
49
|
-
}
|
|
50
|
-
static from(fields) {
|
|
51
|
-
return new PrivateBaseStateDiffHints(...PrivateBaseStateDiffHints.getFields(fields));
|
|
52
|
-
}
|
|
53
|
-
static getFields(fields) {
|
|
54
|
-
return [
|
|
55
|
-
fields.nullifierPredecessorPreimages,
|
|
56
|
-
fields.nullifierPredecessorMembershipWitnesses,
|
|
57
|
-
fields.sortedNullifiers,
|
|
58
|
-
fields.sortedNullifierIndexes,
|
|
59
|
-
fields.noteHashSubtreeSiblingPath,
|
|
60
|
-
fields.nullifierSubtreeSiblingPath,
|
|
61
|
-
fields.feeWriteLowLeafPreimage,
|
|
62
|
-
fields.feeWriteLowLeafMembershipWitness,
|
|
63
|
-
fields.feeWriteSiblingPath
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Serializes the state diff hints to a buffer.
|
|
68
|
-
* @returns A buffer of the serialized state diff hints.
|
|
69
|
-
*/ toBuffer() {
|
|
70
|
-
return serializeToBuffer(...PrivateBaseStateDiffHints.getFields(this));
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Deserializes the state diff hints from a buffer.
|
|
74
|
-
* @param buffer - A buffer to deserialize from.
|
|
75
|
-
* @returns A new PrivateBaseStateDiffHints instance.
|
|
76
|
-
*/ static fromBuffer(buffer) {
|
|
77
|
-
const reader = BufferReader.asReader(buffer);
|
|
78
|
-
return new PrivateBaseStateDiffHints(reader.readArray(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage), reader.readArray(MAX_NULLIFIERS_PER_TX, {
|
|
79
|
-
fromBuffer: (buffer)=>MembershipWitness.fromBuffer(buffer, NULLIFIER_TREE_HEIGHT)
|
|
80
|
-
}), reader.readArray(MAX_NULLIFIERS_PER_TX, Fr), reader.readNumbers(MAX_NULLIFIERS_PER_TX), reader.readArray(NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, Fr), reader.readArray(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, Fr), reader.readObject(PublicDataTreeLeafPreimage), MembershipWitness.fromBuffer(reader, PUBLIC_DATA_TREE_HEIGHT), reader.readArray(PUBLIC_DATA_TREE_HEIGHT, Fr));
|
|
81
|
-
}
|
|
82
|
-
static empty() {
|
|
83
|
-
return new PrivateBaseStateDiffHints(makeTuple(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage.empty), makeTuple(MAX_NULLIFIERS_PER_TX, ()=>MembershipWitness.empty(NULLIFIER_TREE_HEIGHT)), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero), makeTuple(MAX_NULLIFIERS_PER_TX, ()=>0), makeTuple(NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH, Fr.zero), makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, Fr.zero), PublicDataTreeLeafPreimage.empty(), MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT), makeTuple(PUBLIC_DATA_TREE_HEIGHT, Fr.zero));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { PUBLIC_DATA_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
|
-
|
|
6
|
-
import { PublicDataTreeLeafPreimage } from '../trees/index.js';
|
|
7
|
-
|
|
8
|
-
export class PublicDataHint {
|
|
9
|
-
constructor(
|
|
10
|
-
public leafSlot: Fr,
|
|
11
|
-
public value: Fr,
|
|
12
|
-
public membershipWitness: MembershipWitness<typeof PUBLIC_DATA_TREE_HEIGHT>,
|
|
13
|
-
public leafPreimage: PublicDataTreeLeafPreimage,
|
|
14
|
-
) {}
|
|
15
|
-
|
|
16
|
-
static empty() {
|
|
17
|
-
return new PublicDataHint(
|
|
18
|
-
Fr.ZERO,
|
|
19
|
-
Fr.ZERO,
|
|
20
|
-
MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT),
|
|
21
|
-
PublicDataTreeLeafPreimage.empty(),
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
26
|
-
const reader = BufferReader.asReader(buffer);
|
|
27
|
-
return new PublicDataHint(
|
|
28
|
-
reader.readObject(Fr),
|
|
29
|
-
reader.readObject(Fr),
|
|
30
|
-
MembershipWitness.fromBuffer(reader, PUBLIC_DATA_TREE_HEIGHT),
|
|
31
|
-
reader.readObject(PublicDataTreeLeafPreimage),
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
toBuffer() {
|
|
36
|
-
return serializeToBuffer(this.leafSlot, this.value, this.membershipWitness, this.leafPreimage);
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/interfaces/pxe.ts
DELETED
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
import { type AbiType, AbiTypeSchema, type ContractArtifact } from '../abi/abi.js';
|
|
6
|
-
import type { EventSelector } from '../abi/event_selector.js';
|
|
7
|
-
import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
8
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
9
|
-
import {
|
|
10
|
-
CompleteAddress,
|
|
11
|
-
type ContractClassWithId,
|
|
12
|
-
type ContractInstanceWithAddress,
|
|
13
|
-
type PartialAddress,
|
|
14
|
-
type ProtocolContractAddresses,
|
|
15
|
-
} from '../contract/index.js';
|
|
16
|
-
import { UniqueNote } from '../note/extended_note.js';
|
|
17
|
-
import type { NotesFilter } from '../note/notes_filter.js';
|
|
18
|
-
import { schemas } from '../schemas/schemas.js';
|
|
19
|
-
import { SimulationOverrides, TxExecutionRequest, TxSimulationResult } from '../tx/index.js';
|
|
20
|
-
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
21
|
-
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
22
|
-
|
|
23
|
-
// docs:start:pxe-interface
|
|
24
|
-
/**
|
|
25
|
-
* Private eXecution Environment (PXE) runs locally for each user, providing functionality for all the operations
|
|
26
|
-
* needed to interact with the Aztec network, including account management, private data management,
|
|
27
|
-
* transaction local simulation, and access to an Aztec node. This interface, as part of a Wallet,
|
|
28
|
-
* is exposed to dapps for interacting with the network on behalf of the user.
|
|
29
|
-
*/
|
|
30
|
-
export interface PXE {
|
|
31
|
-
/**
|
|
32
|
-
* Registers a user account in PXE given its master encryption private key.
|
|
33
|
-
* Once a new account is registered, the PXE Service will trial-decrypt all published notes on
|
|
34
|
-
* the chain and store those that correspond to the registered account. Will do nothing if the
|
|
35
|
-
* account is already registered.
|
|
36
|
-
*
|
|
37
|
-
* @param secretKey - Secret key of the corresponding user master public key.
|
|
38
|
-
* @param partialAddress - The partial address of the account contract corresponding to the account being registered.
|
|
39
|
-
* @returns The complete address of the account.
|
|
40
|
-
*/
|
|
41
|
-
registerAccount(secretKey: Fr, partialAddress: PartialAddress): Promise<CompleteAddress>;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Retrieves the user accounts registered on this PXE Service.
|
|
45
|
-
* @returns An array of the accounts registered on this PXE Service.
|
|
46
|
-
*/
|
|
47
|
-
getRegisteredAccounts(): Promise<CompleteAddress[]>;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Registers a user contact in PXE.
|
|
51
|
-
*
|
|
52
|
-
* Once a new contact is registered, the PXE Service will be able to receive notes tagged from this contact.
|
|
53
|
-
* Will do nothing if the account is already registered.
|
|
54
|
-
*
|
|
55
|
-
* @param address - Address of the user to add to the address book
|
|
56
|
-
* @returns The address address of the account.
|
|
57
|
-
*/
|
|
58
|
-
registerSender(address: AztecAddress): Promise<AztecAddress>;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves the addresses stored as senders on this PXE Service.
|
|
62
|
-
* @returns An array of the senders on this PXE Service.
|
|
63
|
-
*/
|
|
64
|
-
getSenders(): Promise<AztecAddress[]>;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Removes a sender in the address book.
|
|
68
|
-
*/
|
|
69
|
-
removeSender(address: AztecAddress): Promise<void>;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Registers a contract class in the PXE without registering any associated contract instance with it.
|
|
73
|
-
*
|
|
74
|
-
* @param artifact - The build artifact for the contract class.
|
|
75
|
-
*/
|
|
76
|
-
registerContractClass(artifact: ContractArtifact): Promise<void>;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Adds deployed contracts to the PXE Service. Deployed contract information is used to access the
|
|
80
|
-
* contract code when simulating local transactions. This is automatically called by aztec.js when
|
|
81
|
-
* deploying a contract. Dapps that wish to interact with contracts already deployed should register
|
|
82
|
-
* these contracts in their users' PXE Service through this method.
|
|
83
|
-
*
|
|
84
|
-
* @param contract - A contract instance to register, with an optional artifact which can be omitted if the contract class has already been registered.
|
|
85
|
-
*/
|
|
86
|
-
registerContract(contract: { instance: ContractInstanceWithAddress; artifact?: ContractArtifact }): Promise<void>;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Updates a deployed contract in the PXE Service. This is used to update the contract artifact when
|
|
90
|
-
* an update has happened, so the new code can be used in the simulation of local transactions.
|
|
91
|
-
* This is called by aztec.js when instantiating a contract in a given address with a mismatching artifact.
|
|
92
|
-
* @param contractAddress - The address of the contract to update.
|
|
93
|
-
* @param artifact - The updated artifact for the contract.
|
|
94
|
-
* @throws If the artifact's contract class is not found in the PXE or if the contract class is different from
|
|
95
|
-
* the current one (current one from the point of view of the node to which the PXE is connected).
|
|
96
|
-
*/
|
|
97
|
-
updateContract(contractAddress: AztecAddress, artifact: ContractArtifact): Promise<void>;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Retrieves the addresses of contracts added to this PXE Service.
|
|
101
|
-
* @returns An array of contracts addresses registered on this PXE Service.
|
|
102
|
-
*/
|
|
103
|
-
getContracts(): Promise<AztecAddress[]>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Proves the private portion of a simulated transaction, ready to send to the network
|
|
107
|
-
* (where validators prove the public portion).
|
|
108
|
-
*
|
|
109
|
-
* @param txRequest - An authenticated tx request ready for proving
|
|
110
|
-
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
111
|
-
* @throws If contract code not found, or public simulation reverts.
|
|
112
|
-
* Also throws if simulatePublic is true and public simulation reverts.
|
|
113
|
-
*/
|
|
114
|
-
proveTx(txRequest: TxExecutionRequest): Promise<TxProvingResult>;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Simulates a transaction based on the provided preauthenticated execution request.
|
|
118
|
-
* This will run a local simulation of private execution (and optionally of public as well), run the
|
|
119
|
-
* kernel circuits to ensure adherence to protocol rules (without generating a proof), and return the
|
|
120
|
-
* simulation results .
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* Note that this is used with `ContractFunctionInteraction::simulateTx` to bypass certain checks.
|
|
124
|
-
* In that case, the transaction returned is only potentially ready to be sent to the network for execution.
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
128
|
-
* @param simulatePublic - Whether to simulate the public part of the transaction.
|
|
129
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
130
|
-
* @param skipFeeEnforcement - (Optional) If false, fees are enforced.
|
|
131
|
-
* @param overrides - (Optional) State overrides for the simulation, such as msgSender, contract instances and artifacts.
|
|
132
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
133
|
-
* @returns A simulated transaction result object that includes public and private return values.
|
|
134
|
-
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
135
|
-
* Also throws if simulatePublic is true and public simulation reverts.
|
|
136
|
-
*/
|
|
137
|
-
simulateTx(
|
|
138
|
-
txRequest: TxExecutionRequest,
|
|
139
|
-
simulatePublic: boolean,
|
|
140
|
-
skipTxValidation?: boolean,
|
|
141
|
-
skipFeeEnforcement?: boolean,
|
|
142
|
-
overrides?: SimulationOverrides,
|
|
143
|
-
scopes?: AztecAddress[],
|
|
144
|
-
): Promise<TxSimulationResult>;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
|
|
148
|
-
*
|
|
149
|
-
* @param txRequest - An authenticated tx request ready for simulation
|
|
150
|
-
* @param msgSender - (Optional) The message sender to use for the simulation.
|
|
151
|
-
* @param skipTxValidation - (Optional) If false, this function throws if the transaction is unable to be included in a block at the current state.
|
|
152
|
-
* @returns A trace of the program execution with gate counts.
|
|
153
|
-
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
154
|
-
*/
|
|
155
|
-
profileTx(
|
|
156
|
-
txRequest: TxExecutionRequest,
|
|
157
|
-
profileMode: 'gates' | 'execution-steps' | 'full',
|
|
158
|
-
skipProofGeneration?: boolean,
|
|
159
|
-
msgSender?: AztecAddress,
|
|
160
|
-
): Promise<TxProfileResult>;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Gets notes registered in this PXE based on the provided filter.
|
|
164
|
-
* @param filter - The filter to apply to the notes.
|
|
165
|
-
* @returns The requested notes.
|
|
166
|
-
*/
|
|
167
|
-
getNotes(filter: NotesFilter): Promise<UniqueNote[]>;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Simulate the execution of a contract utility function.
|
|
171
|
-
*
|
|
172
|
-
* @param functionName - The name of the utility contract function to be called.
|
|
173
|
-
* @param args - The arguments to be provided to the function.
|
|
174
|
-
* @param to - The address of the contract to be called.
|
|
175
|
-
* @param authwits - (Optional) The authentication witnesses required for the function call.
|
|
176
|
-
* @param from - (Optional) The msg sender to set for the call.
|
|
177
|
-
* @param scopes - (Optional) The accounts whose notes we can access in this call. Currently optional and will
|
|
178
|
-
* default to all.
|
|
179
|
-
* @returns The result of the utility function call, structured based on the function ABI.
|
|
180
|
-
*/
|
|
181
|
-
simulateUtility(
|
|
182
|
-
functionName: string,
|
|
183
|
-
args: any[],
|
|
184
|
-
to: AztecAddress,
|
|
185
|
-
authwits?: AuthWitness[],
|
|
186
|
-
from?: AztecAddress,
|
|
187
|
-
scopes?: AztecAddress[],
|
|
188
|
-
): Promise<UtilitySimulationResult>;
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Returns information about this PXE.
|
|
192
|
-
*/
|
|
193
|
-
getPXEInfo(): Promise<PXEInfo>;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Returns the contract metadata given an address.
|
|
197
|
-
* The metadata consists of its contract instance, which includes the contract class identifier,
|
|
198
|
-
* initialization hash, deployment salt, and public keys hash; whether the contract instance has been initialized;
|
|
199
|
-
* and whether the contract instance with the given address has been publicly deployed.
|
|
200
|
-
* @remark - it queries the node to check whether the contract instance has been initialized / publicly deployed through a node.
|
|
201
|
-
* This query is not dependent on the PXE.
|
|
202
|
-
* @param address - The address that the contract instance resides at.
|
|
203
|
-
* @returns - It returns the contract metadata
|
|
204
|
-
* TODO(@spalladino): Should we return the public keys in plain as well here?
|
|
205
|
-
*/
|
|
206
|
-
getContractMetadata(address: AztecAddress): Promise<ContractMetadata>;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Returns the contract class metadata given a contract class id.
|
|
210
|
-
* The metadata consists of its contract class, whether it has been publicly registered, and its artifact.
|
|
211
|
-
* @remark - it queries the node to check whether the contract class with the given id has been publicly registered.
|
|
212
|
-
* @param id - Identifier of the class.
|
|
213
|
-
* @param includeArtifact - Identifier of the class.
|
|
214
|
-
* @returns - It returns the contract class metadata, with the artifact field being optional, and will only be returned if true is passed in
|
|
215
|
-
* for `includeArtifact`
|
|
216
|
-
* TODO(@spalladino): The PXE actually holds artifacts and not classes, what should we return? Also,
|
|
217
|
-
* should the pxe query the node for contract public info, and merge it with its own definitions?
|
|
218
|
-
* TODO(@spalladino): This method is strictly needed to decide whether to publicly register a class or not
|
|
219
|
-
* during a public deployment. We probably want a nicer and more general API for this, but it'll have to
|
|
220
|
-
* do for the time being.
|
|
221
|
-
*/
|
|
222
|
-
getContractClassMetadata(id: Fr, includeArtifact?: boolean): Promise<ContractClassMetadata>;
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Returns the private events given search parameters.
|
|
226
|
-
* @param contractAddress - The address of the contract to get events from.
|
|
227
|
-
* @param eventMetadata - Metadata of the event. This should be the class generated from the contract. e.g. Contract.events.Event
|
|
228
|
-
* @param from - The block number to search from.
|
|
229
|
-
* @param numBlocks - The amount of blocks to search.
|
|
230
|
-
* @param recipients - The addresses that decrypted the logs.
|
|
231
|
-
* @returns - The deserialized events.
|
|
232
|
-
*/
|
|
233
|
-
getPrivateEvents<T>(
|
|
234
|
-
contractAddress: AztecAddress,
|
|
235
|
-
eventMetadata: EventMetadataDefinition,
|
|
236
|
-
from: number,
|
|
237
|
-
numBlocks: number,
|
|
238
|
-
recipients: AztecAddress[],
|
|
239
|
-
): Promise<T[]>;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Stops the PXE's job queue.
|
|
243
|
-
*/
|
|
244
|
-
stop(): Promise<void>;
|
|
245
|
-
}
|
|
246
|
-
// docs:end:pxe-interface
|
|
247
|
-
|
|
248
|
-
export type EventMetadataDefinition = {
|
|
249
|
-
eventSelector: EventSelector;
|
|
250
|
-
abiType: AbiType;
|
|
251
|
-
fieldNames: string[];
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
export const EventMetadataDefinitionSchema = z.object({
|
|
255
|
-
eventSelector: schemas.EventSelector,
|
|
256
|
-
abiType: AbiTypeSchema,
|
|
257
|
-
fieldNames: z.array(z.string()),
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
/** This is used in getting events via the filter */
|
|
261
|
-
export enum EventType {
|
|
262
|
-
Encrypted = 'Encrypted',
|
|
263
|
-
Unencrypted = 'Unencrypted',
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/** Provides basic information about the running PXE. */
|
|
267
|
-
export interface PXEInfo {
|
|
268
|
-
/** Version as tracked in the aztec-packages repository. */
|
|
269
|
-
pxeVersion: string;
|
|
270
|
-
/** Protocol contract addresses */
|
|
271
|
-
protocolContractAddresses: ProtocolContractAddresses;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export interface ContractMetadata {
|
|
275
|
-
contractInstance?: ContractInstanceWithAddress | undefined;
|
|
276
|
-
isContractInitialized: boolean;
|
|
277
|
-
isContractPublished: boolean;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export interface ContractClassMetadata {
|
|
281
|
-
contractClass?: ContractClassWithId | undefined;
|
|
282
|
-
isContractClassPubliclyRegistered: boolean;
|
|
283
|
-
artifact?: ContractArtifact | undefined;
|
|
284
|
-
}
|