@aztec/simulator 0.41.0 → 0.43.0
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/acvm/acvm.d.ts +2 -2
- package/dest/acvm/acvm.d.ts.map +1 -1
- package/dest/acvm/acvm.js +3 -3
- package/dest/acvm/oracle/oracle.d.ts +7 -4
- package/dest/acvm/oracle/oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/oracle.js +32 -12
- package/dest/acvm/oracle/typed_oracle.d.ts +6 -3
- package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/typed_oracle.js +15 -6
- package/dest/acvm/serialize.js +2 -2
- package/dest/avm/avm_gas.d.ts +1 -5
- package/dest/avm/avm_gas.d.ts.map +1 -1
- package/dest/avm/avm_gas.js +69 -73
- package/dest/avm/avm_memory_types.d.ts.map +1 -1
- package/dest/avm/avm_memory_types.js +2 -4
- package/dest/avm/avm_simulator.d.ts +5 -0
- package/dest/avm/avm_simulator.d.ts.map +1 -1
- package/dest/avm/avm_simulator.js +8 -1
- package/dest/avm/fixtures/index.d.ts +6 -0
- package/dest/avm/fixtures/index.d.ts.map +1 -1
- package/dest/avm/fixtures/index.js +18 -1
- package/dest/avm/index.d.ts +2 -0
- package/dest/avm/index.d.ts.map +1 -0
- package/dest/avm/index.js +2 -0
- package/dest/avm/journal/host_storage.d.ts +1 -1
- package/dest/avm/journal/host_storage.d.ts.map +1 -1
- package/dest/avm/journal/journal.d.ts +5 -3
- package/dest/avm/journal/journal.d.ts.map +1 -1
- package/dest/avm/journal/journal.js +23 -14
- package/dest/avm/journal/trace.d.ts +3 -1
- package/dest/avm/journal/trace.d.ts.map +1 -1
- package/dest/avm/journal/trace.js +8 -1
- package/dest/avm/journal/trace_types.d.ts +5 -0
- package/dest/avm/journal/trace_types.d.ts.map +1 -1
- package/dest/avm/journal/trace_types.js +1 -5
- package/dest/avm/opcodes/accrued_substate.d.ts +2 -2
- package/dest/avm/opcodes/accrued_substate.d.ts.map +1 -1
- package/dest/avm/opcodes/accrued_substate.js +36 -21
- package/dest/avm/opcodes/arithmetic.d.ts +1 -7
- package/dest/avm/opcodes/arithmetic.d.ts.map +1 -1
- package/dest/avm/opcodes/arithmetic.js +12 -20
- package/dest/avm/opcodes/bitwise.d.ts.map +1 -1
- package/dest/avm/opcodes/bitwise.js +11 -8
- package/dest/avm/opcodes/comparators.d.ts.map +1 -1
- package/dest/avm/opcodes/comparators.js +7 -5
- package/dest/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/avm/opcodes/contract.js +20 -24
- package/dest/avm/opcodes/control_flow.d.ts.map +1 -1
- package/dest/avm/opcodes/control_flow.js +4 -2
- package/dest/avm/opcodes/conversion.js +2 -2
- package/dest/avm/opcodes/ec_add.d.ts +19 -0
- package/dest/avm/opcodes/ec_add.d.ts.map +1 -0
- package/dest/avm/opcodes/ec_add.js +78 -0
- package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/avm/opcodes/external_calls.js +11 -5
- package/dest/avm/opcodes/hashing.d.ts.map +1 -1
- package/dest/avm/opcodes/hashing.js +10 -2
- package/dest/avm/opcodes/instruction.d.ts +1 -1
- package/dest/avm/opcodes/instruction.d.ts.map +1 -1
- package/dest/avm/opcodes/instruction.js +6 -4
- package/dest/avm/opcodes/instruction_impl.d.ts.map +1 -1
- package/dest/avm/opcodes/instruction_impl.js +4 -2
- package/dest/avm/opcodes/memory.d.ts +1 -5
- package/dest/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/avm/opcodes/memory.js +14 -18
- package/dest/avm/opcodes/multi_scalar_mul.d.ts +16 -0
- package/dest/avm/opcodes/multi_scalar_mul.d.ts.map +1 -0
- package/dest/avm/opcodes/multi_scalar_mul.js +95 -0
- package/dest/avm/opcodes/storage.d.ts +1 -6
- package/dest/avm/opcodes/storage.d.ts.map +1 -1
- package/dest/avm/opcodes/storage.js +11 -14
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/bytecode_serialization.js +6 -2
- package/dest/avm/serialization/instruction_serialization.d.ts +3 -1
- package/dest/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/instruction_serialization.js +4 -2
- package/dest/client/client_execution_context.d.ts +24 -20
- package/dest/client/client_execution_context.d.ts.map +1 -1
- package/dest/client/client_execution_context.js +52 -55
- package/dest/client/db_oracle.d.ts +7 -1
- package/dest/client/db_oracle.d.ts.map +1 -1
- package/dest/client/execution_note_cache.d.ts +0 -17
- package/dest/client/execution_note_cache.d.ts.map +1 -1
- package/dest/client/execution_note_cache.js +1 -24
- package/dest/client/execution_result.d.ts +8 -4
- package/dest/client/execution_result.d.ts.map +1 -1
- package/dest/client/execution_result.js +16 -6
- package/dest/client/private_execution.d.ts +2 -3
- package/dest/client/private_execution.d.ts.map +1 -1
- package/dest/client/private_execution.js +20 -9
- package/dest/client/simulator.d.ts +2 -17
- package/dest/client/simulator.d.ts.map +1 -1
- package/dest/client/simulator.js +24 -33
- package/dest/client/unconstrained_execution.d.ts +2 -3
- package/dest/client/unconstrained_execution.d.ts.map +1 -1
- package/dest/client/unconstrained_execution.js +5 -7
- package/dest/client/view_data_oracle.d.ts +2 -0
- package/dest/client/view_data_oracle.d.ts.map +1 -1
- package/dest/client/view_data_oracle.js +7 -1
- package/dest/index.d.ts +3 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +4 -2
- package/dest/mocks/fixtures.d.ts +14 -10
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +22 -16
- package/dest/{simulator → providers}/acvm_native.d.ts.map +1 -1
- package/dest/{simulator → providers}/acvm_native.js +13 -14
- package/dest/providers/acvm_wasm.d.ts.map +1 -0
- package/dest/providers/acvm_wasm.js +15 -0
- package/dest/providers/index.d.ts.map +1 -0
- package/dest/{simulator → providers}/index.js +1 -1
- package/dest/{simulator → providers}/simulation_provider.d.ts.map +1 -1
- package/dest/{simulator → providers}/simulation_provider.js +1 -1
- package/dest/public/abstract_phase_manager.d.ts +53 -53
- package/dest/public/abstract_phase_manager.d.ts.map +1 -1
- package/dest/public/abstract_phase_manager.js +146 -153
- package/dest/public/app_logic_phase_manager.d.ts +8 -9
- package/dest/public/app_logic_phase_manager.d.ts.map +1 -1
- package/dest/public/app_logic_phase_manager.js +15 -15
- package/dest/public/{db.d.ts → db_interfaces.d.ts} +4 -3
- package/dest/public/db_interfaces.d.ts.map +1 -0
- package/dest/public/db_interfaces.js +2 -0
- package/dest/public/execution.d.ts +16 -23
- package/dest/public/execution.d.ts.map +1 -1
- package/dest/public/execution.js +1 -51
- package/dest/public/executor.d.ts +4 -31
- package/dest/public/executor.d.ts.map +1 -1
- package/dest/public/executor.js +40 -283
- package/dest/public/fee_payment.d.ts +11 -0
- package/dest/public/fee_payment.d.ts.map +1 -0
- package/dest/public/fee_payment.js +24 -0
- package/dest/public/hints_builder.d.ts +2 -1
- package/dest/public/hints_builder.d.ts.map +1 -1
- package/dest/public/hints_builder.js +6 -2
- package/dest/public/index.d.ts +8 -6
- package/dest/public/index.d.ts.map +1 -1
- package/dest/public/index.js +9 -7
- package/dest/public/phase_manager_factory.d.ts +4 -4
- package/dest/public/phase_manager_factory.d.ts.map +1 -1
- package/dest/public/phase_manager_factory.js +5 -5
- package/dest/public/{public_executor.d.ts → public_db_sources.d.ts} +6 -3
- package/dest/public/public_db_sources.d.ts.map +1 -0
- package/dest/public/public_db_sources.js +244 -0
- package/dest/public/public_kernel.js +14 -14
- package/dest/public/public_processor.d.ts +6 -4
- package/dest/public/public_processor.d.ts.map +1 -1
- package/dest/public/public_processor.js +48 -30
- package/dest/public/setup_phase_manager.d.ts +8 -10
- package/dest/public/setup_phase_manager.d.ts.map +1 -1
- package/dest/public/setup_phase_manager.js +12 -21
- package/dest/public/tail_phase_manager.d.ts +7 -13
- package/dest/public/tail_phase_manager.d.ts.map +1 -1
- package/dest/public/tail_phase_manager.js +17 -37
- package/dest/public/teardown_phase_manager.d.ts +8 -10
- package/dest/public/teardown_phase_manager.d.ts.map +1 -1
- package/dest/public/teardown_phase_manager.js +16 -22
- package/dest/public/transitional_adaptors.d.ts +2 -2
- package/dest/public/transitional_adaptors.d.ts.map +1 -1
- package/dest/public/transitional_adaptors.js +14 -6
- package/package.json +12 -9
- package/src/acvm/acvm.ts +0 -3
- package/src/acvm/oracle/oracle.ts +68 -16
- package/src/acvm/oracle/typed_oracle.ts +31 -6
- package/src/acvm/serialize.ts +1 -1
- package/src/avm/avm_gas.ts +68 -73
- package/src/avm/avm_memory_types.ts +1 -3
- package/src/avm/avm_simulator.ts +9 -0
- package/src/avm/fixtures/index.ts +24 -0
- package/src/avm/index.ts +1 -0
- package/src/avm/journal/host_storage.ts +1 -1
- package/src/avm/journal/journal.ts +32 -22
- package/src/avm/journal/trace.ts +9 -0
- package/src/avm/journal/trace_types.ts +4 -0
- package/src/avm/opcodes/accrued_substate.ts +53 -20
- package/src/avm/opcodes/arithmetic.ts +18 -22
- package/src/avm/opcodes/bitwise.ts +13 -8
- package/src/avm/opcodes/comparators.ts +9 -4
- package/src/avm/opcodes/contract.ts +22 -26
- package/src/avm/opcodes/control_flow.ts +3 -1
- package/src/avm/opcodes/conversion.ts +1 -1
- package/src/avm/opcodes/ec_add.ts +92 -0
- package/src/avm/opcodes/external_calls.ts +11 -3
- package/src/avm/opcodes/hashing.ts +11 -1
- package/src/avm/opcodes/instruction.ts +5 -3
- package/src/avm/opcodes/instruction_impl.ts +4 -1
- package/src/avm/opcodes/memory.ts +19 -19
- package/src/avm/opcodes/multi_scalar_mul.ts +114 -0
- package/src/avm/opcodes/storage.ts +10 -17
- package/src/avm/serialization/bytecode_serialization.ts +5 -1
- package/src/avm/serialization/instruction_serialization.ts +2 -0
- package/src/client/client_execution_context.ts +76 -60
- package/src/client/db_oracle.ts +8 -1
- package/src/client/execution_note_cache.ts +0 -28
- package/src/client/execution_result.ts +21 -7
- package/src/client/private_execution.ts +36 -21
- package/src/client/simulator.ts +25 -35
- package/src/client/unconstrained_execution.ts +9 -12
- package/src/client/view_data_oracle.ts +8 -0
- package/src/index.ts +3 -1
- package/src/mocks/fixtures.ts +30 -32
- package/src/{simulator → providers}/acvm_native.ts +21 -19
- package/src/{simulator → providers}/acvm_wasm.ts +2 -16
- package/src/public/abstract_phase_manager.ts +209 -258
- package/src/public/app_logic_phase_manager.ts +24 -40
- package/src/public/{db.ts → db_interfaces.ts} +4 -2
- package/src/public/execution.ts +15 -77
- package/src/public/executor.ts +61 -399
- package/src/public/fee_payment.ts +26 -0
- package/src/public/hints_builder.ts +6 -0
- package/src/public/index.ts +8 -12
- package/src/public/phase_manager_factory.ts +7 -7
- package/src/public/{public_executor.ts → public_db_sources.ts} +65 -9
- package/src/public/public_kernel.ts +24 -24
- package/src/public/public_processor.ts +81 -40
- package/src/public/setup_phase_manager.ts +21 -46
- package/src/public/tail_phase_manager.ts +19 -67
- package/src/public/teardown_phase_manager.ts +23 -42
- package/src/public/transitional_adaptors.ts +41 -5
- package/dest/public/db.d.ts.map +0 -1
- package/dest/public/db.js +0 -2
- package/dest/public/public_execution_context.d.ts +0 -121
- package/dest/public/public_execution_context.d.ts.map +0 -1
- package/dest/public/public_execution_context.js +0 -214
- package/dest/public/public_executor.d.ts.map +0 -1
- package/dest/public/public_executor.js +0 -197
- package/dest/public/state_actions.d.ts +0 -39
- package/dest/public/state_actions.d.ts.map +0 -1
- package/dest/public/state_actions.js +0 -80
- package/dest/public/utils.d.ts +0 -8
- package/dest/public/utils.d.ts.map +0 -1
- package/dest/public/utils.js +0 -31
- package/dest/simulator/acvm_wasm.d.ts.map +0 -1
- package/dest/simulator/acvm_wasm.js +0 -22
- package/dest/simulator/index.d.ts.map +0 -1
- package/src/public/public_execution_context.ts +0 -289
- package/src/public/state_actions.ts +0 -102
- package/src/public/utils.ts +0 -33
- /package/dest/{simulator → providers}/acvm_native.d.ts +0 -0
- /package/dest/{simulator → providers}/acvm_wasm.d.ts +0 -0
- /package/dest/{simulator → providers}/index.d.ts +0 -0
- /package/dest/{simulator → providers}/simulation_provider.d.ts +0 -0
- /package/src/{simulator → providers}/index.ts +0 -0
- /package/src/{simulator → providers}/simulation_provider.ts +0 -0
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { PublicKernelType } from '@aztec/circuit-types';
|
|
2
|
-
import { AbstractPhaseManager,
|
|
2
|
+
import { AbstractPhaseManager, makeAvmProvingRequest } from './abstract_phase_manager.js';
|
|
3
3
|
/**
|
|
4
4
|
* The phase manager responsible for performing the fee preparation phase.
|
|
5
5
|
*/
|
|
6
6
|
export class AppLogicPhaseManager extends AbstractPhaseManager {
|
|
7
|
-
constructor(db, publicExecutor, publicKernel, globalVariables, historicalHeader, publicContractsDB, publicStateDB, phase =
|
|
7
|
+
constructor(db, publicExecutor, publicKernel, globalVariables, historicalHeader, publicContractsDB, publicStateDB, phase = PublicKernelType.APP_LOGIC) {
|
|
8
8
|
super(db, publicExecutor, publicKernel, globalVariables, historicalHeader, phase);
|
|
9
9
|
this.publicContractsDB = publicContractsDB;
|
|
10
10
|
this.publicStateDB = publicStateDB;
|
|
11
11
|
}
|
|
12
|
-
async handle(tx, previousPublicKernelOutput
|
|
12
|
+
async handle(tx, previousPublicKernelOutput) {
|
|
13
|
+
this.log.verbose(`Processing tx ${tx.getTxHash()}`);
|
|
13
14
|
// add new contracts to the contracts db so that their functions may be found and called
|
|
14
15
|
// TODO(#4073): This is catching only private deployments, when we add public ones, we'll
|
|
15
16
|
// have to capture contracts emitted in that phase as well.
|
|
16
17
|
// TODO(@spalladino): Should we allow emitting contracts in the fee preparation phase?
|
|
17
|
-
|
|
18
|
+
// TODO(#6464): Should we allow emitting contracts in the private setup phase?
|
|
19
|
+
// if so, this should only add contracts that were deployed during private app logic.
|
|
18
20
|
await this.publicContractsDB.addNewContracts(tx);
|
|
19
|
-
const
|
|
21
|
+
const { publicProvingInformation, kernelOutput, newUnencryptedLogs, revertReason, returnValues, gasUsed } = await this.processEnqueuedPublicCalls(tx, previousPublicKernelOutput).catch(
|
|
20
22
|
// if we throw for any reason other than simulation, we need to rollback and drop the TX
|
|
21
23
|
async (err) => {
|
|
22
24
|
await this.publicStateDB.rollbackToCommit();
|
|
23
25
|
throw err;
|
|
24
26
|
});
|
|
25
27
|
if (revertReason) {
|
|
28
|
+
// TODO(#6464): Should we allow emitting contracts in the private setup phase?
|
|
29
|
+
// if so, this is removing contracts deployed in private setup
|
|
26
30
|
await this.publicContractsDB.removeNewContracts(tx);
|
|
27
31
|
await this.publicStateDB.rollbackToCheckpoint();
|
|
28
32
|
}
|
|
29
33
|
else {
|
|
30
|
-
tx.unencryptedLogs.addFunctionLogs(
|
|
31
|
-
|
|
34
|
+
tx.unencryptedLogs.addFunctionLogs(newUnencryptedLogs);
|
|
35
|
+
// TODO(#6470): we should be adding contracts deployed in those logs to the publicContractsDB
|
|
32
36
|
}
|
|
33
37
|
// Return a list of app logic proving requests
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
type: PublicKernelType.APP_LOGIC,
|
|
37
|
-
inputs: input,
|
|
38
|
-
};
|
|
39
|
-
return request;
|
|
38
|
+
const publicProvingRequests = publicProvingInformation.map(info => {
|
|
39
|
+
return makeAvmProvingRequest(info, PublicKernelType.APP_LOGIC);
|
|
40
40
|
});
|
|
41
|
-
return {
|
|
41
|
+
return { publicProvingRequests, publicKernelOutput: kernelOutput, revertReason, returnValues, gasUsed };
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwX2xvZ2ljX3BoYXNlX21hbmFnZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGljL2FwcF9sb2dpY19waGFzZV9tYW5hZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBc0MsT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QyxLQUFLO1FBQ3pFLHdGQUF3RjtRQUN4RixLQUFLLEVBQUMsR0FBRyxFQUFDLEVBQUU7WUFDVixNQUFNLElBQUksQ0FBQyxhQUFhLENBQUMsZ0JBQWdCLEVBQUUsQ0FBQztZQUM1QyxNQUFNLEdBQUcsQ0FBQztRQUNaLENBQUMsQ0FDRixDQUFDO1FBRUosSUFBSSxZQUFZLEVBQUUsQ0FBQztZQUNqQiw4RUFBOEU7WUFDOUUsOERBQThEO1lBQzlELE1BQU0sSUFBSSxDQUFDLGlCQUFpQixDQUFDLGtCQUFrQixDQUFDLEVBQUUsQ0FBQyxDQUFDO1lBQ3BELE1BQU0sSUFBSSxDQUFDLGFBQWEsQ0FBQyxvQkFBb0IsRUFBRSxDQUFDO1FBQ2xELENBQUM7YUFBTSxDQUFDO1lBQ04sRUFBRSxDQUFDLGVBQWUsQ0FBQyxlQUFlLENBQUMsa0JBQWtCLENBQUMsQ0FBQztZQUN2RCw2RkFBNkY7UUFDL0YsQ0FBQztRQUVELDhDQUE4QztRQUM5QyxNQUFNLHFCQUFxQixHQUEyQix3QkFBd0IsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDeEYsT0FBTyxxQkFBcUIsQ0FBQyxJQUFJLEVBQUUsZ0JBQWdCLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDakUsQ0FBQyxDQUFDLENBQUM7UUFDSCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsa0JBQWtCLEVBQUUsWUFBWSxFQUFFLFlBQVksRUFBRSxZQUFZLEVBQUUsT0FBTyxFQUFFLENBQUM7SUFDMUcsQ0FBQztDQUNGIn0=
|
|
@@ -21,9 +21,9 @@ export interface PublicStateDB {
|
|
|
21
21
|
* @param contract - Owner of the storage.
|
|
22
22
|
* @param slot - Slot to read in the contract storage.
|
|
23
23
|
* @param newValue - The new value to store.
|
|
24
|
-
* @returns
|
|
24
|
+
* @returns The slot of the written leaf in the public data tree.
|
|
25
25
|
*/
|
|
26
|
-
storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<
|
|
26
|
+
storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<bigint>;
|
|
27
27
|
/**
|
|
28
28
|
* Mark the uncommitted changes in this TX as a checkpoint.
|
|
29
29
|
*/
|
|
@@ -59,6 +59,7 @@ export interface PublicContractsDB {
|
|
|
59
59
|
* @returns The contract instance or undefined if not found.
|
|
60
60
|
*/
|
|
61
61
|
getContractInstance(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
62
|
+
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
62
63
|
}
|
|
63
64
|
/** Database interface for providing access to commitment tree, l1 to l2 message tree, and nullifier tree. */
|
|
64
65
|
export interface CommitmentsDB {
|
|
@@ -95,4 +96,4 @@ export interface CommitmentsDB {
|
|
|
95
96
|
*/
|
|
96
97
|
getNullifierMembershipWitnessAtLatestBlock(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
97
98
|
}
|
|
98
|
-
//# sourceMappingURL=
|
|
99
|
+
//# sourceMappingURL=db_interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db_interfaces.d.ts","sourceRoot":"","sources":["../../src/public/db_interfaces.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE;;GAEG;AACH,MAAM,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;;OAIG;IACH,kBAAkB,CAAC,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEhE;;;;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 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
1
2
|
import { type SimulationError, type UnencryptedFunctionL2Logs } from '@aztec/circuit-types';
|
|
2
|
-
import { type ContractStorageRead, type ContractStorageUpdateRequest, type Fr, type L2ToL1Message, type LogHash, type NoteHash, type Nullifier, type PublicCallRequest,
|
|
3
|
+
import { type AvmExecutionHints, type ContractStorageRead, type ContractStorageUpdateRequest, type Fr, type L2ToL1Message, type LogHash, type NoteHash, type Nullifier, type PublicCallRequest, type ReadRequest } from '@aztec/circuits.js';
|
|
3
4
|
import { type Gas } from '../avm/avm_gas.js';
|
|
4
5
|
/**
|
|
5
6
|
* The public function execution result.
|
|
@@ -19,10 +20,14 @@ export interface PublicExecutionResult {
|
|
|
19
20
|
endSideEffectCounter: Fr;
|
|
20
21
|
/** The new nullifiers to be inserted into the nullifier tree. */
|
|
21
22
|
newNullifiers: Nullifier[];
|
|
23
|
+
/** The note hash read requests emitted in this call. */
|
|
24
|
+
noteHashReadRequests: ReadRequest[];
|
|
22
25
|
/** The nullifier read requests emitted in this call. */
|
|
23
26
|
nullifierReadRequests: ReadRequest[];
|
|
24
27
|
/** The nullifier non existent read requests emitted in this call. */
|
|
25
28
|
nullifierNonExistentReadRequests: ReadRequest[];
|
|
29
|
+
/** L1 to L2 message read requests emitted in this call. */
|
|
30
|
+
l1ToL2MsgReadRequests: ReadRequest[];
|
|
26
31
|
/** The contract storage reads performed by the function. */
|
|
27
32
|
contractStorageReads: ContractStorageRead[];
|
|
28
33
|
/** The contract storage update requests performed by the function. */
|
|
@@ -44,45 +49,33 @@ export interface PublicExecutionResult {
|
|
|
44
49
|
* Useful for maintaining correct ordering in ts.
|
|
45
50
|
*/
|
|
46
51
|
allUnencryptedLogs: UnencryptedFunctionL2Logs;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the execution reverted.
|
|
49
|
-
*/
|
|
52
|
+
/** Whether the execution reverted. */
|
|
50
53
|
reverted: boolean;
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
*/
|
|
54
|
-
revertReason: SimulationError | undefined;
|
|
54
|
+
/** The revert reason if the execution reverted. */
|
|
55
|
+
revertReason?: SimulationError;
|
|
55
56
|
/** How much gas was available for this public execution. */
|
|
56
57
|
startGasLeft: Gas;
|
|
57
58
|
/** How much gas was left after this public execution. */
|
|
58
59
|
endGasLeft: Gas;
|
|
59
60
|
/** Transaction fee set for this tx. */
|
|
60
61
|
transactionFee: Fr;
|
|
62
|
+
/** Bytecode used for this execution. */
|
|
63
|
+
bytecode?: Buffer;
|
|
64
|
+
/** Calldata used for this execution. */
|
|
65
|
+
calldata: Fr[];
|
|
66
|
+
/** Hints for proving AVM execution. */
|
|
67
|
+
avmHints: AvmExecutionHints;
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
63
70
|
* The execution of a public function.
|
|
64
71
|
*/
|
|
65
|
-
export type PublicExecution = Pick<PublicCallRequest, 'contractAddress' | '
|
|
72
|
+
export type PublicExecution = Pick<PublicCallRequest, 'contractAddress' | 'functionSelector' | 'callContext' | 'args'>;
|
|
66
73
|
/**
|
|
67
74
|
* Returns if the input is a public execution result and not just a public execution.
|
|
68
75
|
* @param input - Public execution or public execution result.
|
|
69
76
|
* @returns Whether the input is a public execution result and not just a public execution.
|
|
70
77
|
*/
|
|
71
78
|
export declare function isPublicExecutionResult(input: PublicExecution | PublicExecutionResult): input is PublicExecutionResult;
|
|
72
|
-
/**
|
|
73
|
-
* Collect all public storage reads across all nested executions
|
|
74
|
-
* and convert them to PublicDataReads (to match kernel output).
|
|
75
|
-
* @param execResult - The topmost execution result.
|
|
76
|
-
* @returns All public data reads (in execution order).
|
|
77
|
-
*/
|
|
78
|
-
export declare function collectPublicDataReads(execResult: PublicExecutionResult): PublicDataRead[];
|
|
79
|
-
/**
|
|
80
|
-
* Collect all public storage update requests across all nested executions
|
|
81
|
-
* and convert them to PublicDataUpdateRequests (to match kernel output).
|
|
82
|
-
* @param execResult - The topmost execution result.
|
|
83
|
-
* @returns All public data reads (in execution order).
|
|
84
|
-
*/
|
|
85
|
-
export declare function collectPublicDataUpdateRequests(execResult: PublicExecutionResult): PublicDataUpdateRequest[];
|
|
86
79
|
/**
|
|
87
80
|
* Checks whether the child execution result is valid for a static call (no state modifications).
|
|
88
81
|
* @param executionResult - The execution result of a public function
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/public/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,EAAE,EACP,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/public/execution.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,EAAE,EACP,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EACjB,MAA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AAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wCAAwC;IACxC,QAAQ,EAAE,EAAE,EAAE,CAAC;IACf,uCAAuC;IACvC,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,kBAAkB,GAAG,aAAa,GAAG,MAAM,CAAC,CAAC;AAEvH;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,GAAG,qBAAqB,GAC7C,KAAK,IAAI,qBAAqB,CAEhC;AAED;;;GAGG;AAEH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,QAAQ,EAAE,EACzB,aAAa,EAAE,SAAS,EAAE,EAC1B,6BAA6B,EAAE,4BAA4B,EAAE,EAC7D,iBAAiB,EAAE,aAAa,EAAE,EAClC,eAAe,EAAE,yBAAyB,QAW3C"}
|
package/dest/public/execution.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { PublicDataRead, PublicDataUpdateRequest, } from '@aztec/circuits.js';
|
|
2
|
-
import { computePublicDataTreeLeafSlot, computePublicDataTreeValue } from '@aztec/circuits.js/hash';
|
|
3
1
|
/**
|
|
4
2
|
* Returns if the input is a public execution result and not just a public execution.
|
|
5
3
|
* @param input - Public execution or public execution result.
|
|
@@ -8,54 +6,6 @@ import { computePublicDataTreeLeafSlot, computePublicDataTreeValue } from '@azte
|
|
|
8
6
|
export function isPublicExecutionResult(input) {
|
|
9
7
|
return 'execution' in input && input.execution !== undefined;
|
|
10
8
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Collect all public storage reads across all nested executions
|
|
13
|
-
* and convert them to PublicDataReads (to match kernel output).
|
|
14
|
-
* @param execResult - The topmost execution result.
|
|
15
|
-
* @returns All public data reads (in execution order).
|
|
16
|
-
*/
|
|
17
|
-
export function collectPublicDataReads(execResult) {
|
|
18
|
-
// HACK(#1622): part of temporary hack - may be able to remove this function after public state ordering is fixed
|
|
19
|
-
const thisExecPublicDataReads = execResult.contractStorageReads.map(read => contractStorageReadToPublicDataRead(read));
|
|
20
|
-
const unsorted = [
|
|
21
|
-
...thisExecPublicDataReads,
|
|
22
|
-
...[...execResult.nestedExecutions].flatMap(result => collectPublicDataReads(result)),
|
|
23
|
-
];
|
|
24
|
-
return unsorted.sort((a, b) => a.sideEffectCounter - b.sideEffectCounter);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Collect all public storage update requests across all nested executions
|
|
28
|
-
* and convert them to PublicDataUpdateRequests (to match kernel output).
|
|
29
|
-
* @param execResult - The topmost execution result.
|
|
30
|
-
* @returns All public data reads (in execution order).
|
|
31
|
-
*/
|
|
32
|
-
export function collectPublicDataUpdateRequests(execResult) {
|
|
33
|
-
// HACK(#1622): part of temporary hack - may be able to remove this function after public state ordering is fixed
|
|
34
|
-
const thisExecPublicDataUpdateRequests = execResult.contractStorageUpdateRequests.map(update => contractStorageUpdateRequestToPublicDataUpdateRequest(update));
|
|
35
|
-
const unsorted = [
|
|
36
|
-
...thisExecPublicDataUpdateRequests,
|
|
37
|
-
...[...execResult.nestedExecutions].flatMap(result => collectPublicDataUpdateRequests(result)),
|
|
38
|
-
];
|
|
39
|
-
return unsorted.sort((a, b) => a.sideEffectCounter - b.sideEffectCounter);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Convert a Contract Storage Read to a Public Data Read.
|
|
43
|
-
* @param read - the contract storage read to convert
|
|
44
|
-
* @param contractAddress - the contract address of the read
|
|
45
|
-
* @returns The public data read.
|
|
46
|
-
*/
|
|
47
|
-
function contractStorageReadToPublicDataRead(read) {
|
|
48
|
-
return new PublicDataRead(computePublicDataTreeLeafSlot(read.contractAddress, read.storageSlot), computePublicDataTreeValue(read.currentValue), read.sideEffectCounter);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Convert a Contract Storage Update Request to a Public Data Update Request.
|
|
52
|
-
* @param update - the contract storage update request to convert
|
|
53
|
-
* @param contractAddress - the contract address of the data update request.
|
|
54
|
-
* @returns The public data update request.
|
|
55
|
-
*/
|
|
56
|
-
function contractStorageUpdateRequestToPublicDataUpdateRequest(update) {
|
|
57
|
-
return new PublicDataUpdateRequest(computePublicDataTreeLeafSlot(update.contractAddress, update.storageSlot), computePublicDataTreeValue(update.newValue), update.sideEffectCounter);
|
|
58
|
-
}
|
|
59
9
|
/**
|
|
60
10
|
* Checks whether the child execution result is valid for a static call (no state modifications).
|
|
61
11
|
* @param executionResult - The execution result of a public function
|
|
@@ -69,4 +19,4 @@ export function checkValidStaticCall(newNoteHashes, newNullifiers, contractStora
|
|
|
69
19
|
throw new Error('Static call cannot update the state, emit L2->L1 messages or generate logs');
|
|
70
20
|
}
|
|
71
21
|
}
|
|
72
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlY3V0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1YmxpYy9leGVjdXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0ZBOzs7O0dBSUc7QUFDSCxNQUFNLFVBQVUsdUJBQXVCLENBQ3JDLEtBQThDO0lBRTlDLE9BQU8sV0FBVyxJQUFJLEtBQUssSUFBSSxLQUFLLENBQUMsU0FBUyxLQUFLLFNBQVMsQ0FBQztBQUMvRCxDQUFDO0FBRUQ7OztHQUdHO0FBRUgsTUFBTSxVQUFVLG9CQUFvQixDQUNsQyxhQUF5QixFQUN6QixhQUEwQixFQUMxQiw2QkFBNkQsRUFDN0QsaUJBQWtDLEVBQ2xDLGVBQTBDO0lBRTFDLElBQ0UsNkJBQTZCLENBQUMsTUFBTSxHQUFHLENBQUM7UUFDeEMsYUFBYSxDQUFDLE1BQU0sR0FBRyxDQUFDO1FBQ3hCLGFBQWEsQ0FBQyxNQUFNLEdBQUcsQ0FBQztRQUN4QixpQkFBaUIsQ0FBQyxNQUFNLEdBQUcsQ0FBQztRQUM1QixlQUFlLENBQUMsSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLEVBQy9CLENBQUM7UUFDRCxNQUFNLElBQUksS0FBSyxDQUFDLDRFQUE0RSxDQUFDLENBQUM7SUFDaEcsQ0FBQztBQUNILENBQUMifQ==
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { type CommitmentsDB, type PublicContractsDB, type PublicStateDB } from './db.js';
|
|
1
|
+
import { Fr, type Gas, type GlobalVariables, type Header, type Nullifier, type TxContext } from '@aztec/circuits.js';
|
|
2
|
+
import { type CommitmentsDB, type PublicContractsDB, type PublicStateDB } from './db_interfaces.js';
|
|
4
3
|
import { type PublicExecution, type PublicExecutionResult } from './execution.js';
|
|
5
|
-
import { PublicExecutionContext } from './public_execution_context.js';
|
|
6
|
-
/**
|
|
7
|
-
* Execute a public function and return the execution result.
|
|
8
|
-
*/
|
|
9
|
-
export declare function executePublicFunction(context: PublicExecutionContext, nested: boolean): Promise<PublicExecutionResult>;
|
|
10
4
|
/**
|
|
11
5
|
* Handles execution of public functions.
|
|
12
6
|
*/
|
|
@@ -16,34 +10,13 @@ export declare class PublicExecutor {
|
|
|
16
10
|
private readonly commitmentsDb;
|
|
17
11
|
private readonly header;
|
|
18
12
|
constructor(stateDb: PublicStateDB, contractsDb: PublicContractsDB, commitmentsDb: CommitmentsDB, header: Header);
|
|
19
|
-
|
|
13
|
+
static readonly log: import("@aztec/foundation/log").Logger;
|
|
20
14
|
/**
|
|
21
15
|
* Executes a public execution request.
|
|
22
16
|
* @param execution - The execution to run.
|
|
23
17
|
* @param globalVariables - The global variables to use.
|
|
24
18
|
* @returns The result of the run plus all nested runs.
|
|
25
19
|
*/
|
|
26
|
-
simulate(execution: PublicExecution, globalVariables: GlobalVariables, availableGas: Gas, txContext: TxContext, pendingNullifiers: Nullifier[], transactionFee?: Fr,
|
|
27
|
-
/**
|
|
28
|
-
* These functions are currently housed in the temporary executor as it relies on access to
|
|
29
|
-
* oracles like the contractsDB and this is the least intrusive way to achieve this.
|
|
30
|
-
* When we remove this executor(tracking issue #4792) and have an interface that is compatible with the kernel circuits,
|
|
31
|
-
* this will be moved to sequencer-client/prover.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Generates a proof for an associated avm execution. This is currently only used for testing purposes,
|
|
35
|
-
* as proof generation is not fully complete in the AVM yet.
|
|
36
|
-
* @param execution - The execution to run.
|
|
37
|
-
* @returns An AVM proof and the verification key.
|
|
38
|
-
*/
|
|
39
|
-
getAvmProof(avmExecution: PublicExecution): Promise<Buffer[]>;
|
|
40
|
-
/**
|
|
41
|
-
* Verifies an AVM proof. This function is currently only used for testing purposes, as verification
|
|
42
|
-
* is not fully complete in the AVM yet.
|
|
43
|
-
* @param vk - The verification key to use.
|
|
44
|
-
* @param proof - The proof to verify.
|
|
45
|
-
* @returns True if the proof is valid, false otherwise.
|
|
46
|
-
*/
|
|
47
|
-
verifyAvmProof(vk: Buffer, proof: Buffer): Promise<boolean>;
|
|
20
|
+
simulate(execution: PublicExecution, globalVariables: GlobalVariables, availableGas: Gas, txContext: TxContext, pendingNullifiers: Nullifier[], transactionFee?: Fr, startSideEffectCounter?: number): Promise<PublicExecutionResult>;
|
|
48
21
|
}
|
|
49
22
|
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/public/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/public/executor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,KAAK,GAAG,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASrH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAAwB,MAAM,gBAAgB,CAAC;AAGxG;;GAEG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAHN,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,iBAAiB,EAC9B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM;IAGjC,MAAM,CAAC,QAAQ,CAAC,GAAG,yCAAwD;IAE3E;;;;;OAKG;IACU,QAAQ,CACnB,SAAS,EAAE,eAAe,EAC1B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,GAAG,EACjB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,SAAS,EAAE,EAC9B,cAAc,GAAE,EAAY,EAC5B,sBAAsB,GAAE,MAAU,GACjC,OAAO,CAAC,qBAAqB,CAAC;CAyElC"}
|