@aztec/simulator 0.77.0-testnet-ignition.26 → 0.77.0-testnet-ignition.28
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/private/index.js +2 -2
- package/dest/private/private_execution.js +18 -16
- package/dest/private/{client_execution_context.js → private_execution_oracle.js} +24 -19
- package/dest/private/simulator.js +12 -14
- package/dest/private/{view_data_oracle.js → unconstrained_execution_oracle.js} +32 -34
- package/dest/public/public_tx_simulator/public_tx_simulator.js +21 -12
- package/package.json +14 -14
- package/src/private/{db_oracle.ts → execution_data_provider.ts} +28 -2
- package/src/private/index.ts +6 -2
- package/src/private/private_execution.ts +21 -20
- package/src/private/{client_execution_context.ts → private_execution_oracle.ts} +41 -26
- package/src/private/simulator.ts +20 -24
- package/src/private/unconstrained_execution.ts +2 -2
- package/src/private/{view_data_oracle.ts → unconstrained_execution_oracle.ts} +42 -35
- package/src/public/public_tx_simulator/public_tx_simulator.ts +29 -16
- package/dest/client.d.ts +0 -5
- package/dest/client.d.ts.map +0 -1
- package/dest/common/db_interfaces.d.ts +0 -80
- package/dest/common/db_interfaces.d.ts.map +0 -1
- package/dest/common/debug_fn_name.d.ts +0 -5
- package/dest/common/debug_fn_name.d.ts.map +0 -1
- package/dest/common/errors.d.ts +0 -54
- package/dest/common/errors.d.ts.map +0 -1
- package/dest/common/index.d.ts +0 -4
- package/dest/common/index.d.ts.map +0 -1
- package/dest/common/message_load_oracle_inputs.d.ts +0 -15
- package/dest/common/message_load_oracle_inputs.d.ts.map +0 -1
- package/dest/common/stats/index.d.ts +0 -2
- package/dest/common/stats/index.d.ts.map +0 -1
- package/dest/common/stats/stats.d.ts +0 -4
- package/dest/common/stats/stats.d.ts.map +0 -1
- package/dest/private/acvm/acvm.d.ts +0 -35
- package/dest/private/acvm/acvm.d.ts.map +0 -1
- package/dest/private/acvm/acvm_types.d.ts +0 -10
- package/dest/private/acvm/acvm_types.d.ts.map +0 -1
- package/dest/private/acvm/deserialize.d.ts +0 -36
- package/dest/private/acvm/deserialize.d.ts.map +0 -1
- package/dest/private/acvm/index.d.ts +0 -6
- package/dest/private/acvm/index.d.ts.map +0 -1
- package/dest/private/acvm/oracle/index.d.ts +0 -14
- package/dest/private/acvm/oracle/index.d.ts.map +0 -1
- package/dest/private/acvm/oracle/oracle.d.ts +0 -49
- package/dest/private/acvm/oracle/oracle.d.ts.map +0 -1
- package/dest/private/acvm/oracle/typed_oracle.d.ts +0 -83
- package/dest/private/acvm/oracle/typed_oracle.d.ts.map +0 -1
- package/dest/private/acvm/serialize.d.ts +0 -24
- package/dest/private/acvm/serialize.d.ts.map +0 -1
- package/dest/private/client_execution_context.d.ts +0 -217
- package/dest/private/client_execution_context.d.ts.map +0 -1
- package/dest/private/db_oracle.d.ts +0 -238
- package/dest/private/db_oracle.d.ts.map +0 -1
- package/dest/private/execution_note_cache.d.ts +0 -93
- package/dest/private/execution_note_cache.d.ts.map +0 -1
- package/dest/private/hashed_values_cache.d.ts +0 -28
- package/dest/private/hashed_values_cache.d.ts.map +0 -1
- package/dest/private/index.d.ts +0 -13
- package/dest/private/index.d.ts.map +0 -1
- package/dest/private/pick_notes.d.ts +0 -85
- package/dest/private/pick_notes.d.ts.map +0 -1
- package/dest/private/private_execution.d.ts +0 -24
- package/dest/private/private_execution.d.ts.map +0 -1
- package/dest/private/providers/acvm_native.d.ts +0 -40
- package/dest/private/providers/acvm_native.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm.d.ts +0 -15
- package/dest/private/providers/acvm_wasm.d.ts.map +0 -1
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts +0 -19
- package/dest/private/providers/acvm_wasm_with_blobs.d.ts.map +0 -1
- package/dest/private/providers/factory.d.ts +0 -12
- package/dest/private/providers/factory.d.ts.map +0 -1
- package/dest/private/providers/simulation_provider.d.ts +0 -19
- package/dest/private/providers/simulation_provider.d.ts.map +0 -1
- package/dest/private/simulator.d.ts +0 -36
- package/dest/private/simulator.d.ts.map +0 -1
- package/dest/private/unconstrained_execution.d.ts +0 -10
- package/dest/private/unconstrained_execution.d.ts.map +0 -1
- package/dest/private/view_data_oracle.d.ts +0 -164
- package/dest/private/view_data_oracle.d.ts.map +0 -1
- package/dest/public/avm/avm_context.d.ts +0 -41
- package/dest/public/avm/avm_context.d.ts.map +0 -1
- package/dest/public/avm/avm_contract_call_result.d.ts +0 -30
- package/dest/public/avm/avm_contract_call_result.d.ts.map +0 -1
- package/dest/public/avm/avm_execution_environment.d.ts +0 -21
- package/dest/public/avm/avm_execution_environment.d.ts.map +0 -1
- package/dest/public/avm/avm_gas.d.ts +0 -60
- package/dest/public/avm/avm_gas.d.ts.map +0 -1
- package/dest/public/avm/avm_machine_state.d.ts +0 -93
- package/dest/public/avm/avm_machine_state.d.ts.map +0 -1
- package/dest/public/avm/avm_memory_types.d.ts +0 -264
- package/dest/public/avm/avm_memory_types.d.ts.map +0 -1
- package/dest/public/avm/avm_simulator.d.ts +0 -40
- package/dest/public/avm/avm_simulator.d.ts.map +0 -1
- package/dest/public/avm/bytecode_utils.d.ts +0 -5
- package/dest/public/avm/bytecode_utils.d.ts.map +0 -1
- package/dest/public/avm/errors.d.ts +0 -122
- package/dest/public/avm/errors.d.ts.map +0 -1
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts +0 -21
- package/dest/public/avm/fixtures/avm_simulation_tester.d.ts.map +0 -1
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts +0 -36
- package/dest/public/avm/fixtures/base_avm_simulation_tester.d.ts.map +0 -1
- package/dest/public/avm/fixtures/index.d.ts +0 -84
- package/dest/public/avm/fixtures/index.d.ts.map +0 -1
- package/dest/public/avm/fixtures/simple_contract_data_source.d.ts +0 -35
- package/dest/public/avm/fixtures/simple_contract_data_source.d.ts.map +0 -1
- package/dest/public/avm/index.d.ts +0 -4
- package/dest/public/avm/index.d.ts.map +0 -1
- package/dest/public/avm/journal/index.d.ts +0 -2
- package/dest/public/avm/journal/index.d.ts.map +0 -1
- package/dest/public/avm/journal/journal.d.ts +0 -209
- package/dest/public/avm/journal/journal.d.ts.map +0 -1
- package/dest/public/avm/journal/nullifiers.d.ts +0 -64
- package/dest/public/avm/journal/nullifiers.d.ts.map +0 -1
- package/dest/public/avm/journal/public_storage.d.ts +0 -66
- package/dest/public/avm/journal/public_storage.d.ts.map +0 -1
- package/dest/public/avm/opcodes/accrued_substate.d.ts +0 -75
- package/dest/public/avm/opcodes/accrued_substate.d.ts.map +0 -1
- package/dest/public/avm/opcodes/addressing_mode.d.ts +0 -27
- package/dest/public/avm/opcodes/addressing_mode.d.ts.map +0 -1
- package/dest/public/avm/opcodes/arithmetic.d.ts +0 -37
- package/dest/public/avm/opcodes/arithmetic.d.ts.map +0 -1
- package/dest/public/avm/opcodes/bitwise.d.ts +0 -50
- package/dest/public/avm/opcodes/bitwise.d.ts.map +0 -1
- package/dest/public/avm/opcodes/comparators.d.ts +0 -25
- package/dest/public/avm/opcodes/comparators.d.ts.map +0 -1
- package/dest/public/avm/opcodes/contract.d.ts +0 -21
- package/dest/public/avm/opcodes/contract.d.ts.map +0 -1
- package/dest/public/avm/opcodes/control_flow.d.ts +0 -41
- package/dest/public/avm/opcodes/control_flow.d.ts.map +0 -1
- package/dest/public/avm/opcodes/conversion.d.ts +0 -17
- package/dest/public/avm/opcodes/conversion.d.ts.map +0 -1
- package/dest/public/avm/opcodes/ec_add.d.ts +0 -19
- package/dest/public/avm/opcodes/ec_add.d.ts.map +0 -1
- package/dest/public/avm/opcodes/environment_getters.d.ts +0 -28
- package/dest/public/avm/opcodes/environment_getters.d.ts.map +0 -1
- package/dest/public/avm/opcodes/external_calls.d.ts +0 -50
- package/dest/public/avm/opcodes/external_calls.d.ts.map +0 -1
- package/dest/public/avm/opcodes/hashing.d.ts +0 -36
- package/dest/public/avm/opcodes/hashing.d.ts.map +0 -1
- package/dest/public/avm/opcodes/index.d.ts +0 -16
- package/dest/public/avm/opcodes/index.d.ts.map +0 -1
- package/dest/public/avm/opcodes/instruction.d.ts +0 -70
- package/dest/public/avm/opcodes/instruction.d.ts.map +0 -1
- package/dest/public/avm/opcodes/instruction_impl.d.ts +0 -19
- package/dest/public/avm/opcodes/instruction_impl.d.ts.map +0 -1
- package/dest/public/avm/opcodes/memory.d.ts +0 -74
- package/dest/public/avm/opcodes/memory.d.ts.map +0 -1
- package/dest/public/avm/opcodes/misc.d.ts +0 -17
- package/dest/public/avm/opcodes/misc.d.ts.map +0 -1
- package/dest/public/avm/opcodes/storage.d.ts +0 -24
- package/dest/public/avm/opcodes/storage.d.ts.map +0 -1
- package/dest/public/avm/serialization/buffer_cursor.d.ts +0 -28
- package/dest/public/avm/serialization/buffer_cursor.d.ts.map +0 -1
- package/dest/public/avm/serialization/bytecode_serialization.d.ts +0 -21
- package/dest/public/avm/serialization/bytecode_serialization.d.ts.map +0 -1
- package/dest/public/avm/serialization/instruction_serialization.d.ts +0 -104
- package/dest/public/avm/serialization/instruction_serialization.d.ts.map +0 -1
- package/dest/public/avm/test_utils.d.ts +0 -18
- package/dest/public/avm/test_utils.d.ts.map +0 -1
- package/dest/public/bytecode_errors.d.ts +0 -4
- package/dest/public/bytecode_errors.d.ts.map +0 -1
- package/dest/public/execution.d.ts +0 -108
- package/dest/public/execution.d.ts.map +0 -1
- package/dest/public/executor_metrics.d.ts +0 -13
- package/dest/public/executor_metrics.d.ts.map +0 -1
- package/dest/public/fixtures/index.d.ts +0 -3
- package/dest/public/fixtures/index.d.ts.map +0 -1
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts +0 -32
- package/dest/public/fixtures/public_tx_simulation_tester.d.ts.map +0 -1
- package/dest/public/fixtures/utils.d.ts +0 -13
- package/dest/public/fixtures/utils.d.ts.map +0 -1
- package/dest/public/index.d.ts +0 -10
- package/dest/public/index.d.ts.map +0 -1
- package/dest/public/public_db_sources.d.ts +0 -129
- package/dest/public/public_db_sources.d.ts.map +0 -1
- package/dest/public/public_processor/public_processor.d.ts +0 -74
- package/dest/public/public_processor/public_processor.d.ts.map +0 -1
- package/dest/public/public_processor/public_processor_metrics.d.ts +0 -27
- package/dest/public/public_processor/public_processor_metrics.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/public_tx_context.d.ts +0 -137
- package/dest/public/public_tx_simulator/public_tx_context.d.ts.map +0 -1
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +0 -102
- package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +0 -1
- package/dest/public/side_effect_errors.d.ts +0 -4
- package/dest/public/side_effect_errors.d.ts.map +0 -1
- package/dest/public/side_effect_trace.d.ts +0 -132
- package/dest/public/side_effect_trace.d.ts.map +0 -1
- package/dest/public/side_effect_trace_interface.d.ts +0 -34
- package/dest/public/side_effect_trace_interface.d.ts.map +0 -1
- package/dest/public/tx_contract_cache.d.ts +0 -41
- package/dest/public/tx_contract_cache.d.ts.map +0 -1
- package/dest/public/unique_class_ids.d.ts +0 -37
- package/dest/public/unique_class_ids.d.ts.map +0 -1
- package/dest/public/utils.d.ts +0 -5
- package/dest/public/utils.d.ts.map +0 -1
- package/dest/server.d.ts +0 -6
- package/dest/server.d.ts.map +0 -1
- package/dest/test/utils.d.ts +0 -13
- package/dest/test/utils.d.ts.map +0 -1
- /package/dest/private/{db_oracle.js → execution_data_provider.js} +0 -0
|
@@ -5,7 +5,6 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
5
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
6
|
import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
|
|
7
7
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
8
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
9
8
|
import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
10
9
|
import { IndexedTaggingSecret, LogWithTxData } from '@aztec/stdlib/logs';
|
|
11
10
|
import type { NoteStatus } from '@aztec/stdlib/note';
|
|
@@ -13,21 +12,19 @@ import { type MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness }
|
|
|
13
12
|
import type { BlockHeader, Capsule } from '@aztec/stdlib/tx';
|
|
14
13
|
|
|
15
14
|
import { type NoteData, TypedOracle } from './acvm/index.js';
|
|
16
|
-
import type {
|
|
15
|
+
import type { ExecutionDataProvider } from './execution_data_provider.js';
|
|
17
16
|
import { pickNotes } from './pick_notes.js';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
* The
|
|
21
|
-
* It only reads data from data sources. Nothing will be updated or created during this simulation.
|
|
19
|
+
* The oracle for an unconstrained function execution.
|
|
22
20
|
*/
|
|
23
|
-
export class
|
|
21
|
+
export class UnconstrainedExecutionOracle extends TypedOracle {
|
|
24
22
|
constructor(
|
|
25
23
|
protected readonly contractAddress: AztecAddress,
|
|
26
24
|
/** List of transient auth witnesses to be used during this simulation */
|
|
27
25
|
protected readonly authWitnesses: AuthWitness[],
|
|
28
26
|
protected readonly capsules: Capsule[],
|
|
29
|
-
protected readonly
|
|
30
|
-
protected readonly aztecNode: AztecNode,
|
|
27
|
+
protected readonly executionDataProvider: ExecutionDataProvider,
|
|
31
28
|
protected log = createLogger('simulator:client_view_context'),
|
|
32
29
|
protected readonly scopes?: AztecAddress[],
|
|
33
30
|
) {
|
|
@@ -35,7 +32,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
public override getBlockNumber(): Promise<number> {
|
|
38
|
-
return this.
|
|
35
|
+
return this.executionDataProvider.getBlockNumber();
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
public override getContractAddress(): Promise<AztecAddress> {
|
|
@@ -43,11 +40,11 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
43
40
|
}
|
|
44
41
|
|
|
45
42
|
public override getChainId(): Promise<Fr> {
|
|
46
|
-
return Promise.resolve(this.
|
|
43
|
+
return Promise.resolve(this.executionDataProvider.getChainId().then(id => new Fr(id)));
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
public override getVersion(): Promise<Fr> {
|
|
50
|
-
return Promise.resolve(this.
|
|
47
|
+
return Promise.resolve(this.executionDataProvider.getVersion().then(v => new Fr(v)));
|
|
51
48
|
}
|
|
52
49
|
|
|
53
50
|
/**
|
|
@@ -57,7 +54,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
57
54
|
* @throws If the keys are not registered in the key store.
|
|
58
55
|
*/
|
|
59
56
|
public override getKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest> {
|
|
60
|
-
return this.
|
|
57
|
+
return this.executionDataProvider.getKeyValidationRequest(pkMHash, this.contractAddress);
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
/**
|
|
@@ -68,7 +65,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
68
65
|
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
69
66
|
*/
|
|
70
67
|
public override getMembershipWitness(blockNumber: number, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]> {
|
|
71
|
-
return this.
|
|
68
|
+
return this.executionDataProvider.getMembershipWitness(blockNumber, treeId, leafValue);
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
/**
|
|
@@ -81,7 +78,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
81
78
|
blockNumber: number,
|
|
82
79
|
nullifier: Fr,
|
|
83
80
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
84
|
-
return await this.
|
|
81
|
+
return await this.executionDataProvider.getNullifierMembershipWitness(blockNumber, nullifier);
|
|
85
82
|
}
|
|
86
83
|
|
|
87
84
|
/**
|
|
@@ -97,7 +94,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
97
94
|
blockNumber: number,
|
|
98
95
|
nullifier: Fr,
|
|
99
96
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
100
|
-
return await this.
|
|
97
|
+
return await this.executionDataProvider.getLowNullifierMembershipWitness(blockNumber, nullifier);
|
|
101
98
|
}
|
|
102
99
|
|
|
103
100
|
/**
|
|
@@ -110,7 +107,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
110
107
|
blockNumber: number,
|
|
111
108
|
leafSlot: Fr,
|
|
112
109
|
): Promise<PublicDataWitness | undefined> {
|
|
113
|
-
return await this.
|
|
110
|
+
return await this.executionDataProvider.getPublicDataTreeWitness(blockNumber, leafSlot);
|
|
114
111
|
}
|
|
115
112
|
|
|
116
113
|
/**
|
|
@@ -119,7 +116,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
119
116
|
* @returns Block extracted from a block with block number `blockNumber`.
|
|
120
117
|
*/
|
|
121
118
|
public override async getBlockHeader(blockNumber: number): Promise<BlockHeader | undefined> {
|
|
122
|
-
const block = await this.
|
|
119
|
+
const block = await this.executionDataProvider.getBlock(blockNumber);
|
|
123
120
|
if (!block) {
|
|
124
121
|
return undefined;
|
|
125
122
|
}
|
|
@@ -133,7 +130,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
133
130
|
* @throws An error if the account is not registered in the database.
|
|
134
131
|
*/
|
|
135
132
|
public override getCompleteAddress(account: AztecAddress): Promise<CompleteAddress> {
|
|
136
|
-
return this.
|
|
133
|
+
return this.executionDataProvider.getCompleteAddress(account);
|
|
137
134
|
}
|
|
138
135
|
|
|
139
136
|
/**
|
|
@@ -142,7 +139,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
142
139
|
* @returns A contract instance.
|
|
143
140
|
*/
|
|
144
141
|
public override getContractInstance(address: AztecAddress): Promise<ContractInstance> {
|
|
145
|
-
return this.
|
|
142
|
+
return this.executionDataProvider.getContractInstance(address);
|
|
146
143
|
}
|
|
147
144
|
|
|
148
145
|
/**
|
|
@@ -153,7 +150,8 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
153
150
|
*/
|
|
154
151
|
public override getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined> {
|
|
155
152
|
return Promise.resolve(
|
|
156
|
-
this.authWitnesses.find(w => w.requestHash.equals(messageHash))?.witness ??
|
|
153
|
+
this.authWitnesses.find(w => w.requestHash.equals(messageHash))?.witness ??
|
|
154
|
+
this.executionDataProvider.getAuthWitness(messageHash),
|
|
157
155
|
);
|
|
158
156
|
}
|
|
159
157
|
|
|
@@ -194,7 +192,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
194
192
|
offset: number,
|
|
195
193
|
status: NoteStatus,
|
|
196
194
|
): Promise<NoteData[]> {
|
|
197
|
-
const dbNotes = await this.
|
|
195
|
+
const dbNotes = await this.executionDataProvider.getNotes(this.contractAddress, storageSlot, status, this.scopes);
|
|
198
196
|
return pickNotes<NoteData>(dbNotes, {
|
|
199
197
|
selects: selectByIndexes.slice(0, numSelects).map((index, i) => ({
|
|
200
198
|
selector: { index, offset: selectByOffsets[i], length: selectByLengths[i] },
|
|
@@ -217,12 +215,12 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
217
215
|
*/
|
|
218
216
|
public override async checkNullifierExists(innerNullifier: Fr) {
|
|
219
217
|
const nullifier = await siloNullifier(this.contractAddress, innerNullifier!);
|
|
220
|
-
const index = await this.
|
|
218
|
+
const index = await this.executionDataProvider.getNullifierIndex(nullifier);
|
|
221
219
|
return index !== undefined;
|
|
222
220
|
}
|
|
223
221
|
|
|
224
222
|
/**
|
|
225
|
-
* Fetches a message from the
|
|
223
|
+
* Fetches a message from the executionDataProvider, given its key.
|
|
226
224
|
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
227
225
|
* @param messageHash - Hash of the message.
|
|
228
226
|
* @param secret - Secret used to compute a nullifier.
|
|
@@ -230,7 +228,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
230
228
|
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
231
229
|
*/
|
|
232
230
|
public override async getL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr) {
|
|
233
|
-
return await this.
|
|
231
|
+
return await this.executionDataProvider.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
|
|
234
232
|
}
|
|
235
233
|
|
|
236
234
|
/**
|
|
@@ -249,7 +247,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
249
247
|
const values = [];
|
|
250
248
|
for (let i = 0n; i < numberOfElements; i++) {
|
|
251
249
|
const storageSlot = new Fr(startStorageSlot.value + i);
|
|
252
|
-
const value = await this.
|
|
250
|
+
const value = await this.executionDataProvider.getPublicStorageAt(blockNumber, contractAddress, storageSlot);
|
|
253
251
|
|
|
254
252
|
this.log.debug(
|
|
255
253
|
`Oracle storage read: slot=${storageSlot.toString()} address-${contractAddress.toString()} value=${value}`,
|
|
@@ -279,21 +277,21 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
279
277
|
sender: AztecAddress,
|
|
280
278
|
recipient: AztecAddress,
|
|
281
279
|
): Promise<IndexedTaggingSecret> {
|
|
282
|
-
return await this.
|
|
280
|
+
return await this.executionDataProvider.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient);
|
|
283
281
|
}
|
|
284
282
|
|
|
285
283
|
public override async syncNotes() {
|
|
286
|
-
const taggedLogsByRecipient = await this.
|
|
284
|
+
const taggedLogsByRecipient = await this.executionDataProvider.syncTaggedLogs(
|
|
287
285
|
this.contractAddress,
|
|
288
|
-
await this.
|
|
286
|
+
await this.executionDataProvider.getBlockNumber(),
|
|
289
287
|
this.scopes,
|
|
290
288
|
);
|
|
291
289
|
|
|
292
290
|
for (const [recipient, taggedLogs] of taggedLogsByRecipient.entries()) {
|
|
293
|
-
await this.
|
|
291
|
+
await this.executionDataProvider.processTaggedLogs(taggedLogs, AztecAddress.fromString(recipient));
|
|
294
292
|
}
|
|
295
293
|
|
|
296
|
-
await this.
|
|
294
|
+
await this.executionDataProvider.removeNullifiedNotes(this.contractAddress);
|
|
297
295
|
}
|
|
298
296
|
|
|
299
297
|
public override async deliverNote(
|
|
@@ -311,11 +309,20 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
311
309
|
throw new Error(`Got a note delivery request from ${contractAddress}, expected ${this.contractAddress}`);
|
|
312
310
|
}
|
|
313
311
|
|
|
314
|
-
await this.
|
|
312
|
+
await this.executionDataProvider.deliverNote(
|
|
313
|
+
contractAddress,
|
|
314
|
+
storageSlot,
|
|
315
|
+
nonce,
|
|
316
|
+
content,
|
|
317
|
+
noteHash,
|
|
318
|
+
nullifier,
|
|
319
|
+
txHash,
|
|
320
|
+
recipient,
|
|
321
|
+
);
|
|
315
322
|
}
|
|
316
323
|
|
|
317
324
|
public override getLogByTag(tag: Fr): Promise<LogWithTxData | null> {
|
|
318
|
-
return this.
|
|
325
|
+
return this.executionDataProvider.getLogByTag(tag);
|
|
319
326
|
}
|
|
320
327
|
|
|
321
328
|
public override storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]): Promise<void> {
|
|
@@ -323,7 +330,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
323
330
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
324
331
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
325
332
|
}
|
|
326
|
-
return this.
|
|
333
|
+
return this.executionDataProvider.storeCapsule(this.contractAddress, slot, capsule);
|
|
327
334
|
}
|
|
328
335
|
|
|
329
336
|
public override async loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null> {
|
|
@@ -333,7 +340,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
333
340
|
}
|
|
334
341
|
return (
|
|
335
342
|
this.capsules.find(c => c.contractAddress.equals(contractAddress) && c.storageSlot.equals(slot))?.data ??
|
|
336
|
-
(await this.
|
|
343
|
+
(await this.executionDataProvider.loadCapsule(this.contractAddress, slot))
|
|
337
344
|
);
|
|
338
345
|
}
|
|
339
346
|
|
|
@@ -342,7 +349,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
342
349
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
343
350
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
344
351
|
}
|
|
345
|
-
return this.
|
|
352
|
+
return this.executionDataProvider.deleteCapsule(this.contractAddress, slot);
|
|
346
353
|
}
|
|
347
354
|
|
|
348
355
|
public override copyCapsule(
|
|
@@ -355,7 +362,7 @@ export class ViewDataOracle extends TypedOracle {
|
|
|
355
362
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
356
363
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
357
364
|
}
|
|
358
|
-
return this.
|
|
365
|
+
return this.executionDataProvider.copyCapsule(this.contractAddress, srcSlot, dstSlot, numEntries);
|
|
359
366
|
}
|
|
360
367
|
|
|
361
368
|
// TODO(#11849): consider replacing this oracle with a pure Noir implementation of aes decryption.
|
|
@@ -4,7 +4,7 @@ import { Timer } from '@aztec/foundation/timer';
|
|
|
4
4
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
5
5
|
import { computeFeePayerBalanceStorageSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
6
6
|
import type { AvmProvingRequest, RevertCode } from '@aztec/stdlib/avm';
|
|
7
|
-
import
|
|
7
|
+
import { SimulationError } from '@aztec/stdlib/errors';
|
|
8
8
|
import type { Gas, GasUsed } from '@aztec/stdlib/gas';
|
|
9
9
|
import type { MerkleTreeReadOperations } from '@aztec/stdlib/interfaces/server';
|
|
10
10
|
import type { PublicCallRequest } from '@aztec/stdlib/kernel';
|
|
@@ -101,16 +101,20 @@ export class PublicTxSimulator {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const revertStart = process.hrtime.bigint();
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
const success = await this.insertRevertiblesFromPrivate(context);
|
|
105
|
+
if (success) {
|
|
106
|
+
// add new contracts to the contracts db so that their functions may be found and called
|
|
107
|
+
await this.worldStateDB.addNewRevertibleContracts(tx);
|
|
108
|
+
const revertEnd = process.hrtime.bigint();
|
|
109
|
+
this.metrics.recordPrivateEffectsInsertion(Number(revertEnd - revertStart) / 1_000, 'revertible');
|
|
110
|
+
|
|
111
|
+
// Only proceed with app logic if there was no revert during revertible insertion
|
|
112
|
+
if (context.hasPhase(TxExecutionPhase.APP_LOGIC)) {
|
|
113
|
+
const appLogicResult: ProcessedPhase = await this.simulateAppLogicPhase(context);
|
|
114
|
+
processedPhases.push(appLogicResult);
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
this.log.debug(`Revertible insertions failed. Skipping app logic.`);
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
if (context.hasPhase(TxExecutionPhase.TEARDOWN)) {
|
|
@@ -390,7 +394,7 @@ export class PublicTxSimulator {
|
|
|
390
394
|
} catch (e) {
|
|
391
395
|
if (e instanceof NullifierCollisionError) {
|
|
392
396
|
throw new NullifierCollisionError(
|
|
393
|
-
`Nullifier collision encountered when inserting non-revertible nullifiers from private.\nDetails: ${e.message}\
|
|
397
|
+
`Nullifier collision encountered when inserting non-revertible nullifiers from private.\nDetails: ${e.message}\nStack:${e.stack}`,
|
|
394
398
|
);
|
|
395
399
|
}
|
|
396
400
|
}
|
|
@@ -405,7 +409,7 @@ export class PublicTxSimulator {
|
|
|
405
409
|
* Insert the revertible accumulated data from private into the public state.
|
|
406
410
|
* Start by forking state so we can rollback to the end of setup if app logic or teardown reverts.
|
|
407
411
|
*/
|
|
408
|
-
public async insertRevertiblesFromPrivate(context: PublicTxContext) {
|
|
412
|
+
public async insertRevertiblesFromPrivate(context: PublicTxContext): /*success=*/ Promise<boolean> {
|
|
409
413
|
// Fork the state manager so we can rollback to end of setup if app logic reverts.
|
|
410
414
|
await context.state.fork();
|
|
411
415
|
const stateManager = context.state.getActiveStateManager();
|
|
@@ -413,10 +417,18 @@ export class PublicTxSimulator {
|
|
|
413
417
|
await stateManager.writeSiloedNullifiersFromPrivate(context.revertibleAccumulatedDataFromPrivate.nullifiers);
|
|
414
418
|
} catch (e) {
|
|
415
419
|
if (e instanceof NullifierCollisionError) {
|
|
416
|
-
//
|
|
417
|
-
|
|
418
|
-
|
|
420
|
+
// Instead of throwing, revert the app_logic phase
|
|
421
|
+
context.revert(
|
|
422
|
+
TxExecutionPhase.APP_LOGIC,
|
|
423
|
+
new SimulationError(
|
|
424
|
+
`Nullifier collision encountered when inserting revertible nullifiers from private\nDetails: ${e.message}\nError stack: ${e.stack}`,
|
|
425
|
+
[],
|
|
426
|
+
),
|
|
427
|
+
/*culprit=*/ 'insertRevertiblesFromPrivate',
|
|
419
428
|
);
|
|
429
|
+
return /*success=*/ false;
|
|
430
|
+
} else {
|
|
431
|
+
throw e;
|
|
420
432
|
}
|
|
421
433
|
}
|
|
422
434
|
for (const noteHash of context.revertibleAccumulatedDataFromPrivate.noteHashes) {
|
|
@@ -425,6 +437,7 @@ export class PublicTxSimulator {
|
|
|
425
437
|
await stateManager.writeSiloedNoteHash(noteHash);
|
|
426
438
|
}
|
|
427
439
|
}
|
|
440
|
+
return /*success=*/ true;
|
|
428
441
|
}
|
|
429
442
|
|
|
430
443
|
private async payFee(context: PublicTxContext) {
|
package/dest/client.d.ts
DELETED
package/dest/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AACrF,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
|
-
import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
|
|
7
|
-
import type { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
8
|
-
/**
|
|
9
|
-
* Database interface for providing access to public state.
|
|
10
|
-
*/
|
|
11
|
-
export interface PublicStateDB {
|
|
12
|
-
/**
|
|
13
|
-
* Reads a value from public storage, returning zero if none.
|
|
14
|
-
* @param contract - Owner of the storage.
|
|
15
|
-
* @param slot - Slot to read in the contract storage.
|
|
16
|
-
* @returns The current value in the storage slot.
|
|
17
|
-
*/
|
|
18
|
-
storageRead(contract: AztecAddress, slot: Fr): Promise<Fr>;
|
|
19
|
-
/**
|
|
20
|
-
* Records a write to public storage.
|
|
21
|
-
* @param contract - Owner of the storage.
|
|
22
|
-
* @param slot - Slot to read in the contract storage.
|
|
23
|
-
* @param newValue - The new value to store.
|
|
24
|
-
*/
|
|
25
|
-
storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<void>;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Database interface for providing access to public contract data.
|
|
29
|
-
*/
|
|
30
|
-
export interface PublicContractsDB {
|
|
31
|
-
/**
|
|
32
|
-
* Returns a publicly deployed contract instance.
|
|
33
|
-
* @param address - Address of the contract.
|
|
34
|
-
* @returns The contract instance or undefined if not found.
|
|
35
|
-
*/
|
|
36
|
-
getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
37
|
-
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
38
|
-
}
|
|
39
|
-
/** Database interface for providing access to commitment tree, l1 to l2 message tree, and nullifier tree. */
|
|
40
|
-
export interface CommitmentsDB {
|
|
41
|
-
/**
|
|
42
|
-
* Fetches a message from the db, given its key.
|
|
43
|
-
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
44
|
-
* @param messageHash - Hash of the message.
|
|
45
|
-
* @param secret - Secret used to compute a nullifier.
|
|
46
|
-
* @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
|
|
47
|
-
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
48
|
-
*/
|
|
49
|
-
getL1ToL2MembershipWitness(contractAddress: AztecAddress, messageHash: Fr, secret: Fr): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
|
|
50
|
-
/**
|
|
51
|
-
* @param leafIndex the leaf to look up
|
|
52
|
-
* @returns The l1 to l2 leaf value or undefined if not found.
|
|
53
|
-
*/
|
|
54
|
-
getL1ToL2LeafValue(leafIndex: bigint): Promise<Fr | undefined>;
|
|
55
|
-
/**
|
|
56
|
-
* Gets the index of a commitment in the note hash tree.
|
|
57
|
-
* @param commitment - The commitment.
|
|
58
|
-
* @returns - The index of the commitment. Undefined if it does not exist in the tree.
|
|
59
|
-
*/
|
|
60
|
-
getCommitmentIndex(commitment: Fr): Promise<bigint | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Gets commitment in the note hash tree given a leaf index.
|
|
63
|
-
* @param leafIndex - the leaf to look up.
|
|
64
|
-
* @returns - The commitment at that index. Undefined if leaf index is not found.
|
|
65
|
-
*/
|
|
66
|
-
getCommitmentValue(leafIndex: bigint): Promise<Fr | undefined>;
|
|
67
|
-
/**
|
|
68
|
-
* Gets the index of a nullifier in the nullifier tree.
|
|
69
|
-
* @param nullifier - The nullifier.
|
|
70
|
-
* @returns - The index of the nullifier. Undefined if it does not exist in the tree.
|
|
71
|
-
*/
|
|
72
|
-
getNullifierIndex(nullifier: Fr): Promise<bigint | undefined>;
|
|
73
|
-
/**
|
|
74
|
-
* Returns a nullifier membership witness for the given nullifier or undefined if not found.
|
|
75
|
-
* REFACTOR: Same as getL1ToL2MembershipWitness, can be combined with aztec-node method that does almost the same thing.
|
|
76
|
-
* @param nullifier - Nullifier we're looking for.
|
|
77
|
-
*/
|
|
78
|
-
getNullifierMembershipWitnessAtLatestBlock(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=db_interfaces.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db_interfaces.d.ts","sourceRoot":"","sources":["../../src/common/db_interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC;IAE3D;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7E;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAE7F,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9G;AAED,6GAA6G;AAC7G,MAAM,WAAW,aAAa;IAC5B;;;;;;;OAOG;IACH,0BAA0B,CACxB,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,GACT,OAAO,CAAC,uBAAuB,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC;IAErE;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAE/D;;;;OAIG;IACH,kBAAkB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhE;;;;OAIG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAE/D;;;;OAIG;IACH,iBAAiB,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAE9D;;;;OAIG;IACH,0CAA0C,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAAC;CAC5G"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import type { WorldStateDB } from '../public/public_db_sources.js';
|
|
4
|
-
export declare function getPublicFunctionDebugName(db: WorldStateDB, contractAddress: AztecAddress, calldata: Fr[]): Promise<string>;
|
|
5
|
-
//# sourceMappingURL=debug_fn_name.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug_fn_name.d.ts","sourceRoot":"","sources":["../../src/common/debug_fn_name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAEnE,wBAAsB,0BAA0B,CAC9C,EAAE,EAAE,YAAY,EAChB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,EAAE,EAAE,GACb,OAAO,CAAC,MAAM,CAAC,CAOjB"}
|
package/dest/common/errors.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { BrilligFunctionId, FunctionAbi, FunctionDebugMetadata, OpcodeLocation } from '@aztec/stdlib/abi';
|
|
3
|
-
import { type FailingFunction, type NoirCallStack, SimulationError, type SourceCodeLocation } from '@aztec/stdlib/errors';
|
|
4
|
-
import type { RawAssertionPayload } from '@noir-lang/acvm_js';
|
|
5
|
-
/**
|
|
6
|
-
* An error that occurred during the execution of a function.
|
|
7
|
-
* @param message - the error message
|
|
8
|
-
* @param failingFunction - the Aztec function that failed
|
|
9
|
-
* @param noirCallStack - the internal call stack of the function that failed (within the failing Aztec function)
|
|
10
|
-
* @param options - additional error options (an optional "cause" entry allows for a recursive error stack where
|
|
11
|
-
* an error's cause may be an ExecutionError itself)
|
|
12
|
-
*/
|
|
13
|
-
export declare class ExecutionError extends Error {
|
|
14
|
-
/**
|
|
15
|
-
* The function that failed.
|
|
16
|
-
*/
|
|
17
|
-
failingFunction: FailingFunction;
|
|
18
|
-
/**
|
|
19
|
-
* The noir call stack of the function that failed.
|
|
20
|
-
*/
|
|
21
|
-
noirCallStack?: NoirCallStack | undefined;
|
|
22
|
-
constructor(message: string,
|
|
23
|
-
/**
|
|
24
|
-
* The function that failed.
|
|
25
|
-
*/
|
|
26
|
-
failingFunction: FailingFunction,
|
|
27
|
-
/**
|
|
28
|
-
* The noir call stack of the function that failed.
|
|
29
|
-
*/
|
|
30
|
-
noirCallStack?: NoirCallStack | undefined, options?: ErrorOptions);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Traverses the cause chain of an error.
|
|
34
|
-
* @param error - The error to start from.
|
|
35
|
-
* @param callback - A callback on every error, including the first one.
|
|
36
|
-
*/
|
|
37
|
-
export declare function traverseCauseChain(error: Error, callback: (error: Error) => void): void;
|
|
38
|
-
/**
|
|
39
|
-
* Creates a simulation error from an error chain generated during the execution of a function.
|
|
40
|
-
* @param error - The error thrown during execution.
|
|
41
|
-
* @returns - A simulation error.
|
|
42
|
-
*/
|
|
43
|
-
export declare function createSimulationError(error: Error, revertData?: Fr[]): SimulationError;
|
|
44
|
-
/**
|
|
45
|
-
* Extracts the source code locations for an array of opcode locations
|
|
46
|
-
* @param opcodeLocations - The opcode locations that caused the error.
|
|
47
|
-
* @param debug - The debug metadata of the function.
|
|
48
|
-
* @returns The source code locations.
|
|
49
|
-
*/
|
|
50
|
-
export declare function resolveOpcodeLocations(opcodeLocations: OpcodeLocation[], debug: FunctionDebugMetadata, brilligFunctionId?: BrilligFunctionId): SourceCodeLocation[];
|
|
51
|
-
export declare function resolveAssertionMessage(errorPayload: RawAssertionPayload, abi: FunctionAbi): string | undefined;
|
|
52
|
-
export declare function resolveAssertionMessageFromRevertData(revertData: Fr[], abi: FunctionAbi): string | undefined;
|
|
53
|
-
export declare function resolveAssertionMessageFromError(err: Error, abi: FunctionAbi): string;
|
|
54
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/common/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/G,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,eAAe,EACf,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9D;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,KAAK;IAGrC;;OAEG;IACI,eAAe,EAAE,eAAe;IACvC;;OAEG;IACI,aAAa,CAAC;gBARrB,OAAO,EAAE,MAAM;IACf;;OAEG;IACI,eAAe,EAAE,eAAe;IACvC;;OAEG;IACI,aAAa,CAAC,2BAAe,EACpC,OAAO,CAAC,EAAE,YAAY;CAIzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,QAUhF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,GAAG,eAAe,CAgBtF;AAuDD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,cAAc,EAAE,EACjC,KAAK,EAAE,qBAAqB,EAC5B,iBAAiB,CAAC,EAAE,iBAAiB,GACpC,kBAAkB,EAAE,CAItB;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,mBAAmB,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAW/G;AAED,wBAAgB,qCAAqC,CAAC,UAAU,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAc5G;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAMrF"}
|
package/dest/common/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { SiblingPath } from '@aztec/foundation/trees';
|
|
3
|
-
export declare class MessageLoadOracleInputs<N extends number> {
|
|
4
|
-
/** The index of the message commitment in the merkle tree. */
|
|
5
|
-
index: bigint;
|
|
6
|
-
/** The path in the merkle tree to the message. */
|
|
7
|
-
siblingPath: SiblingPath<N>;
|
|
8
|
-
constructor(
|
|
9
|
-
/** The index of the message commitment in the merkle tree. */
|
|
10
|
-
index: bigint,
|
|
11
|
-
/** The path in the merkle tree to the message. */
|
|
12
|
-
siblingPath: SiblingPath<N>);
|
|
13
|
-
toFields(): Fr[];
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=message_load_oracle_inputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message_load_oracle_inputs.d.ts","sourceRoot":"","sources":["../../src/common/message_load_oracle_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,qBAAa,uBAAuB,CAAC,CAAC,SAAS,MAAM;IAEjD,8DAA8D;IACvD,KAAK,EAAE,MAAM;IACpB,kDAAkD;IAC3C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;;IAHlC,8DAA8D;IACvD,KAAK,EAAE,MAAM;IACpB,kDAAkD;IAC3C,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAGpC,QAAQ,IAAI,EAAE,EAAE;CAGjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/stats/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
-
import type { CircuitName } from '@aztec/stdlib/stats';
|
|
3
|
-
export declare function emitCircuitSimulationStats(circuitName: CircuitName, duration: number, inputSize: number, outputSize: number, logger: Logger): void;
|
|
4
|
-
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/common/stats/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,qBAAqB,CAAC;AAE/E,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,QAWf"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
import type { FunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
4
|
-
import type { NoirCallStack } from '@aztec/stdlib/errors';
|
|
5
|
-
import { type ExecutionError, type ForeignCallInput, type ForeignCallOutput } from '@noir-lang/acvm_js';
|
|
6
|
-
import type { ACVMWitness } from './acvm_types.js';
|
|
7
|
-
import type { ORACLE_NAMES } from './oracle/index.js';
|
|
8
|
-
/**
|
|
9
|
-
* The callback interface for the ACIR.
|
|
10
|
-
*/
|
|
11
|
-
export type ACIRCallback = Record<ORACLE_NAMES, (...args: ForeignCallInput[]) => void | Promise<void> | ForeignCallOutput | ForeignCallOutput[] | Promise<ForeignCallOutput> | Promise<ForeignCallOutput[]>>;
|
|
12
|
-
/**
|
|
13
|
-
* The result of executing an ACIR.
|
|
14
|
-
*/
|
|
15
|
-
export interface ACIRExecutionResult {
|
|
16
|
-
/**
|
|
17
|
-
* An execution result contains two witnesses.
|
|
18
|
-
* 1. The partial witness of the execution.
|
|
19
|
-
* 2. The return witness which contains the given public return values within the full witness.
|
|
20
|
-
*/
|
|
21
|
-
partialWitness: ACVMWitness;
|
|
22
|
-
returnWitness: ACVMWitness;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* The function call that executes an ACIR.
|
|
26
|
-
*/
|
|
27
|
-
export declare function acvm(acir: Buffer, initialWitness: ACVMWitness, callback: ACIRCallback): Promise<ACIRExecutionResult>;
|
|
28
|
-
/**
|
|
29
|
-
* Extracts the call stack from an thrown by the acvm.
|
|
30
|
-
* @param error - The error to extract from.
|
|
31
|
-
* @param debug - The debug metadata of the function called.
|
|
32
|
-
* @returns The call stack, if available.
|
|
33
|
-
*/
|
|
34
|
-
export declare function extractCallStack(error: Error | ExecutionError, debug?: FunctionDebugMetadata): NoirCallStack | undefined;
|
|
35
|
-
//# sourceMappingURL=acvm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acvm.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/acvm.ts"],"names":[],"mappings":";;AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAC/B,YAAY,EACZ,CACE,GAAG,IAAI,EAAE,gBAAgB,EAAE,KAEzB,IAAI,GACJ,OAAO,CAAC,IAAI,CAAC,GACb,iBAAiB,GACjB,iBAAiB,EAAE,GACnB,OAAO,CAAC,iBAAiB,CAAC,GAC1B,OAAO,CAAC,iBAAiB,EAAE,CAAC,CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC;IAC5B,aAAa,EAAE,WAAW,CAAC;CAC5B;AAED;;GAEG;AACH,wBAAsB,IAAI,CACxB,IAAI,EAAE,MAAM,EACZ,cAAc,EAAE,WAAW,EAC3B,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAkD9B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,GAAG,cAAc,EAC7B,KAAK,CAAC,EAAE,qBAAqB,GAC5B,aAAa,GAAG,SAAS,CAc3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acvm_types.d.ts","sourceRoot":"","sources":["../../../src/private/acvm/acvm_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC"}
|