@aztec/stdlib 0.80.0 → 0.82.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/abi/abi.d.ts +5 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +2 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +11 -0
- package/dest/auth_witness/auth_witness.d.ts +21 -0
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/auth_witness.js +29 -0
- package/dest/avm/avm.d.ts +173 -405
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +34 -27
- package/dest/avm/avm_proving_request.d.ts +84 -186
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +1 -0
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +3 -0
- package/dest/block/body.d.ts +1 -0
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +3 -0
- package/dest/block/index.d.ts +1 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -1
- package/dest/block/l2_block.d.ts +2 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +3 -0
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +3 -3
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +2 -4
- package/dest/block/l2_block_source.d.ts +9 -0
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/published_l2_block.d.ts +89 -0
- package/dest/block/published_l2_block.d.ts.map +1 -0
- package/dest/block/published_l2_block.js +32 -0
- package/dest/contract/interfaces/contract_data_source.d.ts +3 -14
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +5 -0
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +8 -1
- package/dest/interfaces/archiver.d.ts +1 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +5 -6
- package/dest/interfaces/aztec-node-admin.d.ts +20 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-admin.js +16 -0
- package/dest/interfaces/aztec-node.d.ts +9 -39
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +6 -12
- package/dest/interfaces/client.d.ts +1 -0
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/private_kernel_prover.d.ts +2 -3
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-node.d.ts +1 -2
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +5 -4
- package/dest/interfaces/proving-job.d.ts +106 -208
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +21 -39
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +10 -9
- package/dest/kernel/index.d.ts +1 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +49 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -0
- package/dest/kernel/private_kernel_prover_output.js +8 -0
- package/dest/kernel/private_kernel_simulated_output.d.ts +3 -7
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/logs/contract_class_log.d.ts +1 -0
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +3 -0
- package/dest/logs/l1_payload/index.d.ts +1 -1
- package/dest/logs/l1_payload/index.d.ts.map +1 -1
- package/dest/logs/l1_payload/index.js +1 -1
- package/dest/logs/log_with_tx_data.js +2 -2
- package/dest/logs/private_log.d.ts +2 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +14 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +4 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +16 -28
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +28 -19
- package/dest/noir/index.d.ts +5 -1
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/extended_note.d.ts +10 -21
- package/dest/note/extended_note.d.ts.map +1 -1
- package/dest/note/extended_note.js +19 -28
- package/dest/note/notes_filter.d.ts +2 -2
- package/dest/note/notes_filter.d.ts.map +1 -1
- package/dest/note/notes_filter.js +1 -1
- package/dest/p2p/consensus_payload.d.ts +3 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -0
- package/dest/proofs/client_ivc_proof.d.ts +1 -2
- package/dest/proofs/client_ivc_proof.d.ts.map +1 -1
- package/dest/proofs/client_ivc_proof.js +6 -9
- package/dest/proofs/proof.d.ts +0 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +2 -7
- package/dest/rollup/block_root_rollup.d.ts +1 -1
- package/dest/rollup/tube_inputs.d.ts +7 -2
- package/dest/rollup/tube_inputs.d.ts.map +1 -1
- package/dest/rollup/tube_inputs.js +10 -4
- package/dest/tests/factories.d.ts +3 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +14 -8
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -5
- package/dest/trees/nullifier_membership_witness.d.ts +11 -7
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +10 -0
- package/dest/trees/public_data_witness.d.ts +12 -12
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +13 -0
- package/dest/tx/capsule.d.ts +2 -0
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +2 -0
- package/dest/tx/index.d.ts +2 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -0
- package/dest/tx/private_execution_result.d.ts +4 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +5 -0
- package/dest/tx/profiled_tx.d.ts +9 -0
- package/dest/tx/profiled_tx.d.ts.map +1 -0
- package/dest/tx/profiled_tx.js +27 -0
- package/dest/tx/proven_tx.d.ts +33 -0
- package/dest/tx/proven_tx.d.ts.map +1 -0
- package/dest/tx/proven_tx.js +35 -0
- package/dest/tx/simulated_tx.d.ts +8 -44
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +17 -40
- package/dest/tx/tx_effect.d.ts +1 -0
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +4 -1
- package/dest/tx/tx_receipt.d.ts +1 -30
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +3 -13
- package/package.json +6 -7
- package/src/abi/abi.ts +7 -2
- package/src/abi/contract_artifact.ts +11 -0
- package/src/auth_witness/auth_witness.ts +29 -0
- package/src/avm/avm.ts +42 -39
- package/src/avm/public_data_write.ts +4 -0
- package/src/block/body.ts +6 -0
- package/src/block/index.ts +1 -1
- package/src/block/l2_block.ts +4 -0
- package/src/block/l2_block_downloader/l2_block_stream.ts +5 -7
- package/src/block/l2_block_source.ts +11 -0
- package/src/block/published_l2_block.ts +45 -0
- package/src/contract/interfaces/contract_data_source.ts +3 -16
- package/src/database-version/version_manager.ts +11 -1
- package/src/interfaces/archiver.ts +11 -14
- package/src/interfaces/aztec-node-admin.ts +39 -0
- package/src/interfaces/aztec-node.ts +13 -72
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/private_kernel_prover.ts +2 -3
- package/src/interfaces/prover-node.ts +2 -4
- package/src/interfaces/pxe.ts +34 -56
- package/src/kernel/index.ts +1 -1
- package/src/kernel/private_kernel_prover_output.ts +44 -0
- package/src/kernel/private_kernel_simulated_output.ts +4 -13
- package/src/logs/contract_class_log.ts +8 -0
- package/src/logs/l1_payload/index.ts +1 -1
- package/src/logs/log_with_tx_data.ts +2 -2
- package/src/logs/private_log.ts +13 -3
- package/src/logs/public_log.ts +11 -1
- package/src/logs/tx_scoped_l2_log.ts +28 -25
- package/src/noir/index.ts +6 -1
- package/src/note/extended_note.ts +17 -36
- package/src/note/notes_filter.ts +3 -3
- package/src/p2p/consensus_payload.ts +9 -0
- package/src/proofs/client_ivc_proof.ts +5 -15
- package/src/proofs/proof.ts +2 -8
- package/src/rollup/tube_inputs.ts +8 -4
- package/src/tests/factories.ts +15 -14
- package/src/tests/mocks.ts +4 -9
- package/src/trees/nullifier_membership_witness.ts +12 -0
- package/src/trees/public_data_witness.ts +15 -0
- package/src/tx/capsule.ts +2 -0
- package/src/tx/index.ts +2 -0
- package/src/tx/private_execution_result.ts +7 -0
- package/src/tx/profiled_tx.ts +27 -0
- package/src/tx/proven_tx.ts +58 -0
- package/src/tx/simulated_tx.ts +11 -63
- package/src/tx/tx_effect.ts +23 -1
- package/src/tx/tx_receipt.ts +0 -36
- package/dest/block/nullifier_with_block_source.d.ts +0 -6
- package/dest/block/nullifier_with_block_source.d.ts.map +0 -1
- package/dest/block/nullifier_with_block_source.js +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.d.ts +0 -25
- package/dest/kernel/private_kernel_prover_profile_result.d.ts.map +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.js +0 -7
- package/dest/logs/l1_payload/l1_note_payload.d.ts +0 -82
- package/dest/logs/l1_payload/l1_note_payload.d.ts.map +0 -1
- package/dest/logs/l1_payload/l1_note_payload.js +0 -129
- package/src/block/nullifier_with_block_source.ts +0 -7
- package/src/kernel/private_kernel_prover_profile_result.ts +0 -7
- package/src/logs/l1_payload/l1_note_payload.ts +0 -182
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
2
2
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
|
-
import { z } from 'zod';
|
|
4
3
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
5
|
-
import { type PrivateKernelProverProfileResult } from '../kernel/private_kernel_prover_profile_result.js';
|
|
6
4
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
7
|
-
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
8
5
|
import { PrivateExecutionResult } from './private_execution_result.js';
|
|
9
6
|
import { NestedProcessReturnValues, PublicSimulationOutput } from './public_simulation_output.js';
|
|
10
7
|
import { Tx } from './tx.js';
|
|
@@ -15,52 +12,19 @@ export declare class PrivateSimulationResult {
|
|
|
15
12
|
getPrivateReturnValues(): NestedProcessReturnValues;
|
|
16
13
|
toSimulatedTx(): Tx;
|
|
17
14
|
}
|
|
18
|
-
export declare class TxSimulationResult
|
|
15
|
+
export declare class TxSimulationResult {
|
|
16
|
+
privateExecutionResult: PrivateExecutionResult;
|
|
17
|
+
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
|
19
18
|
publicOutput?: PublicSimulationOutput | undefined;
|
|
20
|
-
|
|
21
|
-
gateCounts: {
|
|
22
|
-
circuitName: string;
|
|
23
|
-
gateCount: number;
|
|
24
|
-
}[];
|
|
25
|
-
} | undefined;
|
|
26
|
-
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, publicOutput?: PublicSimulationOutput | undefined, profileResult?: {
|
|
27
|
-
gateCounts: {
|
|
28
|
-
circuitName: string;
|
|
29
|
-
gateCount: number;
|
|
30
|
-
}[];
|
|
31
|
-
} | undefined);
|
|
19
|
+
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, publicOutput?: PublicSimulationOutput | undefined);
|
|
32
20
|
get gasUsed(): GasUsed;
|
|
33
21
|
static get schema(): ZodFor<TxSimulationResult>;
|
|
34
22
|
static from(fields: Omit<FieldsOf<TxSimulationResult>, 'gasUsed'>): TxSimulationResult;
|
|
35
|
-
|
|
36
|
-
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult: PrivateSimulationResult, publicOutput?: PublicSimulationOutput, profileResult?: PrivateKernelProverProfileResult): TxSimulationResult;
|
|
23
|
+
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult: PrivateSimulationResult, publicOutput?: PublicSimulationOutput): TxSimulationResult;
|
|
37
24
|
static random(): Promise<TxSimulationResult>;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
|
42
|
-
clientIvcProof: ClientIvcProof;
|
|
43
|
-
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, clientIvcProof: ClientIvcProof);
|
|
44
|
-
toTx(): Tx;
|
|
45
|
-
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
46
|
-
privateExecutionResult: ZodFor<PrivateExecutionResult>;
|
|
47
|
-
publicInputs: z.ZodType<PrivateKernelTailCircuitPublicInputs, any, string>;
|
|
48
|
-
clientIvcProof: z.ZodType<ClientIvcProof, any, string>;
|
|
49
|
-
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
|
51
|
-
clientIvcProof: ClientIvcProof;
|
|
52
|
-
privateExecutionResult: PrivateExecutionResult;
|
|
53
|
-
}, {
|
|
54
|
-
publicInputs: string;
|
|
55
|
-
clientIvcProof: string;
|
|
56
|
-
privateExecutionResult?: any;
|
|
57
|
-
}>, TxProvingResult, {
|
|
58
|
-
publicInputs: string;
|
|
59
|
-
clientIvcProof: string;
|
|
60
|
-
privateExecutionResult?: any;
|
|
61
|
-
}>;
|
|
62
|
-
static from(fields: FieldsOf<TxProvingResult>): TxProvingResult;
|
|
63
|
-
static random(): Promise<TxProvingResult>;
|
|
25
|
+
getPrivateReturnValues(): NestedProcessReturnValues;
|
|
26
|
+
toSimulatedTx(): Tx;
|
|
27
|
+
getPublicReturnValues(): NestedProcessReturnValues[];
|
|
64
28
|
}
|
|
65
29
|
/**
|
|
66
30
|
* Recursively accummulate the return values of a call result and its nested executions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulated_tx.d.ts","sourceRoot":"","sources":["../../src/tx/simulated_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"simulated_tx.d.ts","sourceRoot":"","sources":["../../src/tx/simulated_tx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAKxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAE9G,OAAO,EAEL,sBAAsB,EAIvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAClG,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qBAAa,uBAAuB;IAEzB,sBAAsB,EAAE,sBAAsB;IAC9C,YAAY,EAAE,oCAAoC;gBADlD,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,oCAAoC;IAG3D,sBAAsB;IAItB,aAAa,IAAI,EAAE;CAcpB;AAED,qBAAa,kBAAkB;IAEpB,sBAAsB,EAAE,sBAAsB;IAC9C,YAAY,EAAE,oCAAoC;IAClD,YAAY,CAAC;gBAFb,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,oCAAoC,EAClD,YAAY,CAAC,oCAAwB;IAG9C,IAAI,OAAO,IAAI,OAAO,CASrB;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAQ9C;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC;IAIjE,MAAM,CAAC,0CAA0C,CAC/C,uBAAuB,EAAE,uBAAuB,EAChD,YAAY,CAAC,EAAE,sBAAsB;WAS1B,MAAM;IAQnB,sBAAsB;IAItB,aAAa,IAAI,EAAE;IAInB,qBAAqB;CAGtB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,sBAAsB,GAAG,yBAAyB,CAWhH"}
|
package/dest/tx/simulated_tx.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Gas } from '../gas/gas.js';
|
|
3
|
-
import { PrivateKernelProverProfileResultSchema } from '../kernel/private_kernel_prover_profile_result.js';
|
|
4
3
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
5
4
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
6
5
|
import { PrivateExecutionResult, collectEnqueuedPublicFunctionCalls, collectPublicTeardownFunctionCall, collectSortedContractClassLogs } from './private_execution_result.js';
|
|
@@ -24,11 +23,14 @@ export class PrivateSimulationResult {
|
|
|
24
23
|
return tx;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
export class TxSimulationResult
|
|
26
|
+
export class TxSimulationResult {
|
|
27
|
+
privateExecutionResult;
|
|
28
|
+
publicInputs;
|
|
28
29
|
publicOutput;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
constructor(privateExecutionResult, publicInputs, publicOutput){
|
|
31
|
+
this.privateExecutionResult = privateExecutionResult;
|
|
32
|
+
this.publicInputs = publicInputs;
|
|
33
|
+
this.publicOutput = publicOutput;
|
|
32
34
|
}
|
|
33
35
|
get gasUsed() {
|
|
34
36
|
return this.publicOutput?.gasUsed ?? {
|
|
@@ -42,51 +44,26 @@ export class TxSimulationResult extends PrivateSimulationResult {
|
|
|
42
44
|
return z.object({
|
|
43
45
|
privateExecutionResult: PrivateExecutionResult.schema,
|
|
44
46
|
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
45
|
-
publicOutput: PublicSimulationOutput.schema.optional()
|
|
46
|
-
profileResult: PrivateKernelProverProfileResultSchema.optional()
|
|
47
|
+
publicOutput: PublicSimulationOutput.schema.optional()
|
|
47
48
|
}).transform(TxSimulationResult.from);
|
|
48
49
|
}
|
|
49
50
|
static from(fields) {
|
|
50
|
-
return new TxSimulationResult(fields.privateExecutionResult, fields.publicInputs, fields.publicOutput
|
|
51
|
-
}
|
|
52
|
-
getPublicReturnValues() {
|
|
53
|
-
return this.publicOutput ? this.publicOutput.publicReturnValues : [];
|
|
51
|
+
return new TxSimulationResult(fields.privateExecutionResult, fields.publicInputs, fields.publicOutput);
|
|
54
52
|
}
|
|
55
|
-
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult, publicOutput
|
|
56
|
-
return new TxSimulationResult(privateSimulationResult.privateExecutionResult, privateSimulationResult.publicInputs, publicOutput
|
|
53
|
+
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult, publicOutput) {
|
|
54
|
+
return new TxSimulationResult(privateSimulationResult.privateExecutionResult, privateSimulationResult.publicInputs, publicOutput);
|
|
57
55
|
}
|
|
58
56
|
static async random() {
|
|
59
57
|
return new TxSimulationResult(await PrivateExecutionResult.random(), PrivateKernelTailCircuitPublicInputs.empty(), await PublicSimulationOutput.random());
|
|
60
58
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
privateExecutionResult;
|
|
64
|
-
publicInputs;
|
|
65
|
-
clientIvcProof;
|
|
66
|
-
constructor(privateExecutionResult, publicInputs, clientIvcProof){
|
|
67
|
-
this.privateExecutionResult = privateExecutionResult;
|
|
68
|
-
this.publicInputs = publicInputs;
|
|
69
|
-
this.clientIvcProof = clientIvcProof;
|
|
70
|
-
}
|
|
71
|
-
toTx() {
|
|
72
|
-
const contractClassLogs = collectSortedContractClassLogs(this.privateExecutionResult);
|
|
73
|
-
const enqueuedPublicFunctions = collectEnqueuedPublicFunctionCalls(this.privateExecutionResult);
|
|
74
|
-
const teardownPublicFunction = collectPublicTeardownFunctionCall(this.privateExecutionResult);
|
|
75
|
-
const tx = new Tx(this.publicInputs, this.clientIvcProof, contractClassLogs, enqueuedPublicFunctions, teardownPublicFunction);
|
|
76
|
-
return tx;
|
|
77
|
-
}
|
|
78
|
-
static get schema() {
|
|
79
|
-
return z.object({
|
|
80
|
-
privateExecutionResult: PrivateExecutionResult.schema,
|
|
81
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
82
|
-
clientIvcProof: ClientIvcProof.schema
|
|
83
|
-
}).transform(TxProvingResult.from);
|
|
59
|
+
getPrivateReturnValues() {
|
|
60
|
+
return new PrivateSimulationResult(this.privateExecutionResult, this.publicInputs).getPrivateReturnValues();
|
|
84
61
|
}
|
|
85
|
-
|
|
86
|
-
return new
|
|
62
|
+
toSimulatedTx() {
|
|
63
|
+
return new PrivateSimulationResult(this.privateExecutionResult, this.publicInputs).toSimulatedTx();
|
|
87
64
|
}
|
|
88
|
-
|
|
89
|
-
return
|
|
65
|
+
getPublicReturnValues() {
|
|
66
|
+
return this.publicOutput ? this.publicOutput.publicReturnValues : [];
|
|
90
67
|
}
|
|
91
68
|
}
|
|
92
69
|
/**
|
package/dest/tx/tx_effect.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export declare class TxEffect {
|
|
|
100
100
|
*/
|
|
101
101
|
contractClassLogs: ContractClassLog[]);
|
|
102
102
|
toBuffer(): Buffer;
|
|
103
|
+
equals(other: TxEffect): boolean;
|
|
103
104
|
/** Returns the size of this tx effect in bytes as serialized onto DA. */
|
|
104
105
|
getDASize(): number;
|
|
105
106
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":";;;AAoBA,OAAO,EAAE,KAAK,QAAQ,EAA6B,MAAM,yBAAyB,CAAC;AAInF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,WAAW,EAGZ,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,eAAO,MAAM,4BAA4B,QAA0C,CAAC;AAEpF,eAAO,MAAM,4BAA4B,QAAmC,CAAC;AAE7E,qBAAa,QAAQ;IAEjB;;OAEG;IACI,UAAU,EAAE,UAAU;IAC7B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;;OAEG;IACI,cAAc,EAAE,EAAE;IACzB;;OAEG;IACI,UAAU,EAAE,EAAE,EAAE;IACvB;;OAEG;IACI,UAAU,EAAE,EAAE,EAAE;IACvB;;;OAGG;IACI,UAAU,EAAE,EAAE,EAAE;IACvB;;OAEG;IACI,gBAAgB,EAAE,eAAe,EAAE;IAC1C;;OAEG;IACI,WAAW,EAAE,UAAU,EAAE;IAChC;;OAEG;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OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE;;;;IAQjC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE;IAuB7B;;OAEG;IACH,YAAY,IAAI,EAAE,EAAE;IAyEpB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAiGhD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAetC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAepC;IAED,CAAC,OAAO,CAAC,MAAM,CAAC;IAehB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;CAG9B"}
|
package/dest/tx/tx_effect.js
CHANGED
|
@@ -121,6 +121,9 @@ export class TxEffect {
|
|
|
121
121
|
serializeArrayOfBufferableToVector(this.contractClassLogs, 1)
|
|
122
122
|
]);
|
|
123
123
|
}
|
|
124
|
+
equals(other) {
|
|
125
|
+
return this.revertCode.equals(other.revertCode) && this.txHash.equals(other.txHash) && this.transactionFee.equals(other.transactionFee) && this.noteHashes.length === other.noteHashes.length && this.noteHashes.every((h, i)=>h.equals(other.noteHashes[i])) && this.nullifiers.length === other.nullifiers.length && this.nullifiers.every((h, i)=>h.equals(other.nullifiers[i])) && this.l2ToL1Msgs.length === other.l2ToL1Msgs.length && this.l2ToL1Msgs.every((h, i)=>h.equals(other.l2ToL1Msgs[i])) && this.publicDataWrites.length === other.publicDataWrites.length && this.publicDataWrites.every((h, i)=>h.equals(other.publicDataWrites[i])) && this.privateLogs.length === other.privateLogs.length && this.privateLogs.every((h, i)=>h.equals(other.privateLogs[i])) && this.publicLogs.length === other.publicLogs.length && this.publicLogs.every((h, i)=>h.equals(other.publicLogs[i])) && this.contractClassLogs.length === other.contractClassLogs.length && this.contractClassLogs.every((h, i)=>h.equals(other.contractClassLogs[i]));
|
|
126
|
+
}
|
|
124
127
|
/** Returns the size of this tx effect in bytes as serialized onto DA. */ getDASize() {
|
|
125
128
|
return this.toBlobFields().length * Fr.SIZE_IN_BYTES;
|
|
126
129
|
}
|
|
@@ -158,7 +161,7 @@ export class TxEffect {
|
|
|
158
161
|
return thisLayer[0];
|
|
159
162
|
}
|
|
160
163
|
static async random(numPublicCallsPerTx = 3, numPublicLogsPerCall = 1) {
|
|
161
|
-
return new TxEffect(RevertCode.random(), TxHash.random(), new Fr(Math.floor(Math.random() * 100_000)), makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.random), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.random), makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, Fr.random), makeTuple(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, ()=>new PublicDataWrite(Fr.random(), Fr.random())), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ()=>new PrivateLog(makeTuple(PRIVATE_LOG_SIZE_IN_FIELDS, Fr.random))), await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, PublicLog.random), await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random));
|
|
164
|
+
return new TxEffect(RevertCode.random(), TxHash.random(), new Fr(Math.floor(Math.random() * 100_000)), makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.random), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.random), makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, Fr.random), makeTuple(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, ()=>new PublicDataWrite(Fr.random(), Fr.random())), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ()=>new PrivateLog(makeTuple(PRIVATE_LOG_SIZE_IN_FIELDS, Fr.random))), await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, async ()=>await PublicLog.random()), await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random));
|
|
162
165
|
}
|
|
163
166
|
static empty() {
|
|
164
167
|
return new TxEffect(RevertCode.OK, TxHash.zero(), Fr.ZERO, [], [], [], [], [], [], []);
|
package/dest/tx/tx_receipt.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
|
-
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
4
2
|
import { RevertCode } from '../avm/revert_code.js';
|
|
5
3
|
import { L2BlockHash } from '../block/block_hash.js';
|
|
6
4
|
import { type ZodFor } from '../schemas/schemas.js';
|
|
@@ -35,8 +33,6 @@ export declare class TxReceipt {
|
|
|
35
33
|
blockHash?: L2BlockHash | undefined;
|
|
36
34
|
/** The block number in which the transaction was included. */
|
|
37
35
|
blockNumber?: number | undefined;
|
|
38
|
-
/** Information useful for testing/debugging, set when test flag is set to true in `waitOpts`. */
|
|
39
|
-
debugInfo?: DebugInfo | undefined;
|
|
40
36
|
constructor(
|
|
41
37
|
/** A unique identifier for a transaction. */
|
|
42
38
|
txHash: TxHash,
|
|
@@ -49,35 +45,10 @@ export declare class TxReceipt {
|
|
|
49
45
|
/** The hash of the block containing the transaction. */
|
|
50
46
|
blockHash?: L2BlockHash | undefined,
|
|
51
47
|
/** The block number in which the transaction was included. */
|
|
52
|
-
blockNumber?: number | undefined
|
|
53
|
-
/** Information useful for testing/debugging, set when test flag is set to true in `waitOpts`. */
|
|
54
|
-
debugInfo?: DebugInfo | undefined);
|
|
48
|
+
blockNumber?: number | undefined);
|
|
55
49
|
static empty(): TxReceipt;
|
|
56
50
|
static get schema(): ZodFor<TxReceipt>;
|
|
57
51
|
static from(fields: FieldsOf<TxReceipt>): TxReceipt;
|
|
58
52
|
static statusFromRevertCode(revertCode: RevertCode): TxStatus.SUCCESS | TxStatus.APP_LOGIC_REVERTED | TxStatus.TEARDOWN_REVERTED | TxStatus.BOTH_REVERTED;
|
|
59
53
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Information useful for debugging/testing purposes included in the receipt when the debug flag is set to true
|
|
62
|
-
* in `WaitOpts`.
|
|
63
|
-
*/
|
|
64
|
-
interface DebugInfo {
|
|
65
|
-
/**
|
|
66
|
-
* New note hashes created by the transaction.
|
|
67
|
-
*/
|
|
68
|
-
noteHashes: Fr[];
|
|
69
|
-
/**
|
|
70
|
-
* New nullifiers created by the transaction.
|
|
71
|
-
*/
|
|
72
|
-
nullifiers: Fr[];
|
|
73
|
-
/**
|
|
74
|
-
* New public data writes created by the transaction.
|
|
75
|
-
*/
|
|
76
|
-
publicDataWrites: PublicDataWrite[];
|
|
77
|
-
/**
|
|
78
|
-
* New L2 to L1 messages created by the transaction.
|
|
79
|
-
*/
|
|
80
|
-
l2ToL1Msgs: Fr[];
|
|
81
|
-
}
|
|
82
|
-
export {};
|
|
83
54
|
//# sourceMappingURL=tx_receipt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_receipt.d.ts","sourceRoot":"","sources":["../../src/tx/tx_receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tx_receipt.d.ts","sourceRoot":"","sources":["../../src/tx/tx_receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;GAEG;AACH,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,kBAAkB,uBAAuB;IACzC,iBAAiB,sBAAsB;IACvC,aAAa,kBAAkB;CAChC;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IAElB,6CAA6C;IACtC,MAAM,EAAE,MAAM;IACrB,gCAAgC;IACzB,MAAM,EAAE,QAAQ;IACvB,gDAAgD;IACzC,KAAK,EAAE,MAAM;IACpB,oDAAoD;IAC7C,cAAc,CAAC;IACtB,wDAAwD;IACjD,SAAS,CAAC;IACjB,8DAA8D;IACvD,WAAW,CAAC;;IAXnB,6CAA6C;IACtC,MAAM,EAAE,MAAM;IACrB,gCAAgC;IACzB,MAAM,EAAE,QAAQ;IACvB,gDAAgD;IACzC,KAAK,EAAE,MAAM;IACpB,oDAAoD;IAC7C,cAAc,CAAC,oBAAQ;IAC9B,wDAAwD;IACjD,SAAS,CAAC,yBAAa;IAC9B,8DAA8D;IACvD,WAAW,CAAC,oBAAQ;IAG7B,MAAM,CAAC,KAAK;IAIZ,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,CAWrC;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC;WAWzB,oBAAoB,CAAC,UAAU,EAAE,UAAU;CAa1D"}
|
package/dest/tx/tx_receipt.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
3
2
|
import { RevertCode } from '../avm/revert_code.js';
|
|
4
3
|
import { L2BlockHash } from '../block/block_hash.js';
|
|
5
4
|
import { schemas } from '../schemas/schemas.js';
|
|
@@ -27,15 +26,13 @@ import { TxHash } from './tx_hash.js';
|
|
|
27
26
|
transactionFee;
|
|
28
27
|
blockHash;
|
|
29
28
|
blockNumber;
|
|
30
|
-
|
|
31
|
-
constructor(/** A unique identifier for a transaction. */ txHash, /** The transaction's status. */ status, /** Description of transaction error, if any. */ error, /** The transaction fee paid for the transaction. */ transactionFee, /** The hash of the block containing the transaction. */ blockHash, /** The block number in which the transaction was included. */ blockNumber, /** Information useful for testing/debugging, set when test flag is set to true in `waitOpts`. */ debugInfo){
|
|
29
|
+
constructor(/** A unique identifier for a transaction. */ txHash, /** The transaction's status. */ status, /** Description of transaction error, if any. */ error, /** The transaction fee paid for the transaction. */ transactionFee, /** The hash of the block containing the transaction. */ blockHash, /** The block number in which the transaction was included. */ blockNumber){
|
|
32
30
|
this.txHash = txHash;
|
|
33
31
|
this.status = status;
|
|
34
32
|
this.error = error;
|
|
35
33
|
this.transactionFee = transactionFee;
|
|
36
34
|
this.blockHash = blockHash;
|
|
37
35
|
this.blockNumber = blockNumber;
|
|
38
|
-
this.debugInfo = debugInfo;
|
|
39
36
|
}
|
|
40
37
|
static empty() {
|
|
41
38
|
return new TxReceipt(TxHash.zero(), "dropped", '');
|
|
@@ -47,12 +44,11 @@ import { TxHash } from './tx_hash.js';
|
|
|
47
44
|
error: z.string(),
|
|
48
45
|
blockHash: L2BlockHash.schema.optional(),
|
|
49
46
|
blockNumber: z.number().int().nonnegative().optional(),
|
|
50
|
-
transactionFee: schemas.BigInt.optional()
|
|
51
|
-
debugInfo: DebugInfoSchema.optional()
|
|
47
|
+
transactionFee: schemas.BigInt.optional()
|
|
52
48
|
}).transform(TxReceipt.from);
|
|
53
49
|
}
|
|
54
50
|
static from(fields) {
|
|
55
|
-
return new TxReceipt(fields.txHash, fields.status, fields.error, fields.transactionFee, fields.blockHash, fields.blockNumber
|
|
51
|
+
return new TxReceipt(fields.txHash, fields.status, fields.error, fields.transactionFee, fields.blockHash, fields.blockNumber);
|
|
56
52
|
}
|
|
57
53
|
static statusFromRevertCode(revertCode) {
|
|
58
54
|
if (revertCode.equals(RevertCode.OK)) {
|
|
@@ -68,9 +64,3 @@ import { TxHash } from './tx_hash.js';
|
|
|
68
64
|
}
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
|
-
const DebugInfoSchema = z.object({
|
|
72
|
-
noteHashes: z.array(schemas.Fr),
|
|
73
|
-
nullifiers: z.array(schemas.Fr),
|
|
74
|
-
publicDataWrites: z.array(PublicDataWrite.schema),
|
|
75
|
-
l2ToL1Msgs: z.array(schemas.Fr)
|
|
76
|
-
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
"./keys": "./dest/keys/index.js",
|
|
14
14
|
"./testing": "./dest/tests/index.js",
|
|
15
15
|
"./testing/fixtures": "./dest/tests/fixtures.js",
|
|
16
|
-
"./interfaces": "./dest/interfaces/index.js",
|
|
17
16
|
"./network": "./dest/network/index.js",
|
|
18
17
|
"./utils": "./dest/utils/index.js",
|
|
19
18
|
"./types": "./dest/types/index.js",
|
|
@@ -66,11 +65,11 @@
|
|
|
66
65
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
67
66
|
},
|
|
68
67
|
"dependencies": {
|
|
69
|
-
"@aztec/bb.js": "0.
|
|
70
|
-
"@aztec/blob-lib": "0.
|
|
71
|
-
"@aztec/constants": "0.
|
|
72
|
-
"@aztec/ethereum": "0.
|
|
73
|
-
"@aztec/foundation": "0.
|
|
68
|
+
"@aztec/bb.js": "0.82.0",
|
|
69
|
+
"@aztec/blob-lib": "0.82.0",
|
|
70
|
+
"@aztec/constants": "0.82.0",
|
|
71
|
+
"@aztec/ethereum": "0.82.0",
|
|
72
|
+
"@aztec/foundation": "0.82.0",
|
|
74
73
|
"lodash.chunk": "^4.2.0",
|
|
75
74
|
"lodash.isequal": "^4.5.0",
|
|
76
75
|
"lodash.omit": "^4.5.0",
|
package/src/abi/abi.ts
CHANGED
|
@@ -231,6 +231,11 @@ export interface FunctionArtifact extends FunctionAbi {
|
|
|
231
231
|
debug?: FunctionDebugMetadata;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
+
export interface FunctionArtifactWithContractName extends FunctionArtifact {
|
|
235
|
+
/** The name of the contract. */
|
|
236
|
+
contractName: string;
|
|
237
|
+
}
|
|
238
|
+
|
|
234
239
|
export const FunctionArtifactSchema = FunctionAbiSchema.and(
|
|
235
240
|
z.object({
|
|
236
241
|
bytecode: schemas.Buffer,
|
|
@@ -395,7 +400,7 @@ export function getFunctionArtifactByName(artifact: ContractArtifact, functionNa
|
|
|
395
400
|
export async function getFunctionArtifact(
|
|
396
401
|
artifact: ContractArtifact,
|
|
397
402
|
functionNameOrSelector: string | FunctionSelector,
|
|
398
|
-
): Promise<
|
|
403
|
+
): Promise<FunctionArtifactWithContractName> {
|
|
399
404
|
let functionArtifact;
|
|
400
405
|
if (typeof functionNameOrSelector === 'string') {
|
|
401
406
|
functionArtifact = artifact.functions.find(f => f.name === functionNameOrSelector);
|
|
@@ -416,7 +421,7 @@ export async function getFunctionArtifact(
|
|
|
416
421
|
|
|
417
422
|
const debugMetadata = getFunctionDebugMetadata(artifact, functionArtifact);
|
|
418
423
|
|
|
419
|
-
return { ...functionArtifact, debug: debugMetadata };
|
|
424
|
+
return { ...functionArtifact, debug: debugMetadata, contractName: artifact.name };
|
|
420
425
|
}
|
|
421
426
|
|
|
422
427
|
/** Gets all function abis */
|
|
@@ -97,6 +97,17 @@ function isContractArtifact(input: any): input is ContractArtifact {
|
|
|
97
97
|
return false;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
if (!Array.isArray(maybeContractArtifact.nonDispatchPublicFunctions)) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
for (const fn of maybeContractArtifact.nonDispatchPublicFunctions) {
|
|
104
|
+
if (typeof fn.name !== 'string') {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
if (typeof fn.functionType !== 'string') {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
100
111
|
return true;
|
|
101
112
|
}
|
|
102
113
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { GeneratorIndex } from '@aztec/constants';
|
|
2
|
+
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
1
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
6
|
|
|
7
|
+
import type { AztecAddress } from '../aztec-address/index.js';
|
|
5
8
|
import { hexSchemaFor } from '../schemas/schemas.js';
|
|
6
9
|
import { Vector } from '../types/shared.js';
|
|
7
10
|
|
|
@@ -50,3 +53,29 @@ export class AuthWitness {
|
|
|
50
53
|
return new AuthWitness(Fr.random(), [Fr.random(), Fr.random(), Fr.random()]);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Compute the inner hash for an authentication witness.
|
|
59
|
+
* This is the "intent" of the message, before siloed with the consumer.
|
|
60
|
+
* @param args - The arguments to hash
|
|
61
|
+
* @returns The inner hash for the witness
|
|
62
|
+
*/
|
|
63
|
+
export const computeInnerAuthWitHash = (args: Fr[]) => {
|
|
64
|
+
return poseidon2HashWithSeparator(args, GeneratorIndex.AUTHWIT_INNER);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Compute the outer hash for an authentication witness.
|
|
69
|
+
* This is the value siloed with its "consumer" and what the `on_behalf_of`
|
|
70
|
+
* should be signing.
|
|
71
|
+
* The consumer is who will be consuming the message, for token approvals it
|
|
72
|
+
* is the token contract itself (because the token makes the call to check the approval).
|
|
73
|
+
* @param consumer - The address that can "consume" the authwit
|
|
74
|
+
* @param chainId - The chain id that can "consume" the authwit
|
|
75
|
+
* @param version - The version that can "consume" the authwit
|
|
76
|
+
* @param innerHash - The inner hash for the witness
|
|
77
|
+
* @returns The outer hash for the witness
|
|
78
|
+
*/
|
|
79
|
+
export const computeOuterAuthWitHash = (consumer: AztecAddress, chainId: Fr, version: Fr, innerHash: Fr) => {
|
|
80
|
+
return poseidon2HashWithSeparator([consumer.toField(), chainId, version, innerHash], GeneratorIndex.AUTHWIT_OUTER);
|
|
81
|
+
};
|
package/src/avm/avm.ts
CHANGED
|
@@ -12,25 +12,33 @@ import { AvmCircuitPublicInputs } from './avm_circuit_public_inputs.js';
|
|
|
12
12
|
import { serializeWithMessagePack } from './message_pack.js';
|
|
13
13
|
|
|
14
14
|
export class AvmEnqueuedCallHint {
|
|
15
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
public readonly msgSender: AztecAddress,
|
|
17
|
+
public readonly contractAddress: AztecAddress,
|
|
18
|
+
public readonly calldata: Fr[],
|
|
19
|
+
public isStaticCall: boolean,
|
|
20
|
+
) {}
|
|
16
21
|
|
|
17
22
|
static get schema() {
|
|
18
23
|
return z
|
|
19
24
|
.object({
|
|
25
|
+
msgSender: AztecAddress.schema,
|
|
20
26
|
contractAddress: AztecAddress.schema,
|
|
21
27
|
calldata: schemas.Fr.array(),
|
|
28
|
+
isStaticCall: z.boolean(),
|
|
22
29
|
})
|
|
23
|
-
.transform(
|
|
30
|
+
.transform(
|
|
31
|
+
({ msgSender, contractAddress, calldata, isStaticCall }) =>
|
|
32
|
+
new AvmEnqueuedCallHint(msgSender, contractAddress, calldata, isStaticCall),
|
|
33
|
+
);
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
36
|
|
|
27
37
|
export class AvmContractClassHint {
|
|
28
38
|
constructor(
|
|
29
39
|
public readonly classId: Fr,
|
|
30
|
-
public readonly exists: boolean,
|
|
31
40
|
public readonly artifactHash: Fr,
|
|
32
41
|
public readonly privateFunctionsRoot: Fr,
|
|
33
|
-
public readonly publicBytecodeCommitment: Fr,
|
|
34
42
|
public readonly packedBytecode: Buffer,
|
|
35
43
|
) {}
|
|
36
44
|
|
|
@@ -38,79 +46,70 @@ export class AvmContractClassHint {
|
|
|
38
46
|
return z
|
|
39
47
|
.object({
|
|
40
48
|
classId: schemas.Fr,
|
|
41
|
-
exists: z.boolean(),
|
|
42
49
|
artifactHash: schemas.Fr,
|
|
43
50
|
privateFunctionsRoot: schemas.Fr,
|
|
44
|
-
publicBytecodeCommitment: schemas.Fr,
|
|
45
51
|
packedBytecode: schemas.Buffer,
|
|
46
52
|
})
|
|
47
53
|
.transform(
|
|
48
|
-
({ classId,
|
|
49
|
-
new AvmContractClassHint(
|
|
50
|
-
classId,
|
|
51
|
-
exists,
|
|
52
|
-
artifactHash,
|
|
53
|
-
privateFunctionsRoot,
|
|
54
|
-
publicBytecodeCommitment,
|
|
55
|
-
packedBytecode,
|
|
56
|
-
),
|
|
54
|
+
({ classId, artifactHash, privateFunctionsRoot, packedBytecode }) =>
|
|
55
|
+
new AvmContractClassHint(classId, artifactHash, privateFunctionsRoot, packedBytecode),
|
|
57
56
|
);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
60
|
+
export class AvmBytecodeCommitmentHint {
|
|
61
|
+
constructor(public readonly classId: Fr, public readonly commitment: Fr) {}
|
|
62
|
+
|
|
63
|
+
static get schema() {
|
|
64
|
+
return z
|
|
65
|
+
.object({
|
|
66
|
+
classId: schemas.Fr,
|
|
67
|
+
commitment: schemas.Fr,
|
|
68
|
+
})
|
|
69
|
+
.transform(({ classId, commitment }) => new AvmBytecodeCommitmentHint(classId, commitment));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
61
73
|
export class AvmContractInstanceHint {
|
|
62
74
|
constructor(
|
|
63
75
|
public readonly address: AztecAddress,
|
|
64
|
-
public readonly exists: boolean,
|
|
65
76
|
public readonly salt: Fr,
|
|
66
77
|
public readonly deployer: AztecAddress,
|
|
67
78
|
public readonly currentContractClassId: Fr,
|
|
68
79
|
public readonly originalContractClassId: Fr,
|
|
69
80
|
public readonly initializationHash: Fr,
|
|
70
81
|
public readonly publicKeys: PublicKeys,
|
|
71
|
-
// public readonly updateMembershipHint: AvmPublicDataReadTreeHint = AvmPublicDataReadTreeHint.empty(),
|
|
72
|
-
public readonly updateMembershipHint: AvmPublicDataReadTreeHint,
|
|
73
|
-
public readonly updatePreimage: Fr[] = [],
|
|
74
82
|
) {}
|
|
75
83
|
|
|
76
84
|
static get schema() {
|
|
77
85
|
return z
|
|
78
86
|
.object({
|
|
79
87
|
address: AztecAddress.schema,
|
|
80
|
-
exists: z.boolean(),
|
|
81
88
|
salt: schemas.Fr,
|
|
82
89
|
deployer: AztecAddress.schema,
|
|
83
90
|
currentContractClassId: schemas.Fr,
|
|
84
91
|
originalContractClassId: schemas.Fr,
|
|
85
92
|
initializationHash: schemas.Fr,
|
|
86
93
|
publicKeys: PublicKeys.schema,
|
|
87
|
-
updateMembershipHint: AvmPublicDataReadTreeHint.schema,
|
|
88
|
-
updatePreimage: schemas.Fr.array(),
|
|
89
94
|
})
|
|
90
95
|
.transform(
|
|
91
96
|
({
|
|
92
97
|
address,
|
|
93
|
-
exists,
|
|
94
98
|
salt,
|
|
95
99
|
deployer,
|
|
96
100
|
currentContractClassId,
|
|
97
101
|
originalContractClassId,
|
|
98
102
|
initializationHash,
|
|
99
103
|
publicKeys,
|
|
100
|
-
updateMembershipHint,
|
|
101
|
-
updatePreimage,
|
|
102
104
|
}) =>
|
|
103
105
|
new AvmContractInstanceHint(
|
|
104
106
|
address,
|
|
105
|
-
exists,
|
|
106
107
|
salt,
|
|
107
108
|
deployer,
|
|
108
109
|
currentContractClassId,
|
|
109
110
|
originalContractClassId,
|
|
110
111
|
initializationHash,
|
|
111
112
|
publicKeys,
|
|
112
|
-
updateMembershipHint,
|
|
113
|
-
updatePreimage,
|
|
114
113
|
),
|
|
115
114
|
);
|
|
116
115
|
}
|
|
@@ -213,20 +212,21 @@ export class AvmPublicDataWriteTreeHint {
|
|
|
213
212
|
|
|
214
213
|
export class AvmExecutionHints {
|
|
215
214
|
constructor(
|
|
216
|
-
public readonly enqueuedCalls: AvmEnqueuedCallHint[],
|
|
217
|
-
public readonly contractInstances: AvmContractInstanceHint[],
|
|
218
|
-
public readonly contractClasses: AvmContractClassHint[],
|
|
219
|
-
public readonly
|
|
220
|
-
public readonly
|
|
221
|
-
public readonly
|
|
222
|
-
public readonly
|
|
223
|
-
public readonly
|
|
224
|
-
public readonly
|
|
225
|
-
public readonly
|
|
215
|
+
public readonly enqueuedCalls: AvmEnqueuedCallHint[] = [],
|
|
216
|
+
public readonly contractInstances: AvmContractInstanceHint[] = [],
|
|
217
|
+
public readonly contractClasses: AvmContractClassHint[] = [],
|
|
218
|
+
public readonly bytecodeCommitments: AvmBytecodeCommitmentHint[] = [],
|
|
219
|
+
public readonly publicDataReads: AvmPublicDataReadTreeHint[] = [],
|
|
220
|
+
public readonly publicDataWrites: AvmPublicDataWriteTreeHint[] = [],
|
|
221
|
+
public readonly nullifierReads: AvmNullifierReadTreeHint[] = [],
|
|
222
|
+
public readonly nullifierWrites: AvmNullifierWriteTreeHint[] = [],
|
|
223
|
+
public readonly noteHashReads: AvmAppendTreeHint[] = [],
|
|
224
|
+
public readonly noteHashWrites: AvmAppendTreeHint[] = [],
|
|
225
|
+
public readonly l1ToL2MessageReads: AvmAppendTreeHint[] = [],
|
|
226
226
|
) {}
|
|
227
227
|
|
|
228
228
|
static empty() {
|
|
229
|
-
return new AvmExecutionHints(
|
|
229
|
+
return new AvmExecutionHints();
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
static get schema() {
|
|
@@ -235,6 +235,7 @@ export class AvmExecutionHints {
|
|
|
235
235
|
enqueuedCalls: AvmEnqueuedCallHint.schema.array(),
|
|
236
236
|
contractInstances: AvmContractInstanceHint.schema.array(),
|
|
237
237
|
contractClasses: AvmContractClassHint.schema.array(),
|
|
238
|
+
bytecodeCommitments: AvmBytecodeCommitmentHint.schema.array(),
|
|
238
239
|
publicDataReads: AvmPublicDataReadTreeHint.schema.array(),
|
|
239
240
|
publicDataWrites: AvmPublicDataWriteTreeHint.schema.array(),
|
|
240
241
|
nullifierReads: AvmNullifierReadTreeHint.schema.array(),
|
|
@@ -248,6 +249,7 @@ export class AvmExecutionHints {
|
|
|
248
249
|
enqueuedCalls,
|
|
249
250
|
contractInstances,
|
|
250
251
|
contractClasses,
|
|
252
|
+
bytecodeCommitments,
|
|
251
253
|
publicDataReads,
|
|
252
254
|
publicDataWrites,
|
|
253
255
|
nullifierReads,
|
|
@@ -260,6 +262,7 @@ export class AvmExecutionHints {
|
|
|
260
262
|
enqueuedCalls,
|
|
261
263
|
contractInstances,
|
|
262
264
|
contractClasses,
|
|
265
|
+
bytecodeCommitments,
|
|
263
266
|
publicDataReads,
|
|
264
267
|
publicDataWrites,
|
|
265
268
|
nullifierReads,
|