@aztec/stdlib 0.87.2 → 0.87.3-nightly.20250529
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 +3 -0
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +38 -0
- package/dest/avm/avm.d.ts +696 -12
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +16 -8
- package/dest/avm/avm_accumulated_data.d.ts +77 -0
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +67 -0
- package/dest/avm/avm_circuit_public_inputs.d.ts +73 -3
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +19 -9
- package/dest/avm/avm_proving_request.d.ts +366 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -2
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +3 -2
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +10 -5
- package/dest/block/l2_block_source.d.ts +9 -4
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/proposal/committee_attestation.d.ts +34 -0
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -0
- package/dest/block/proposal/committee_attestation.js +59 -0
- package/dest/block/proposal/index.d.ts +2 -0
- package/dest/block/proposal/index.d.ts.map +1 -0
- package/dest/block/proposal/index.js +1 -0
- package/dest/block/published_l2_block.d.ts +99 -69
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +38 -12
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/interfaces/archiver.js +2 -2
- package/dest/interfaces/aztec-node.js +2 -2
- package/dest/interfaces/p2p.d.ts +5 -2
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +1 -2
- package/dest/interfaces/prover-agent.d.ts +31 -6
- package/dest/interfaces/prover-agent.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.js +15 -6
- package/dest/interfaces/proving-job.d.ts +370 -4
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts +3 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +1 -1
- package/dest/kernel/hints/key_validation_hint.d.ts +2 -6
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_hint.js +5 -7
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +7 -7
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.js +8 -4
- package/dest/kernel/hints/read_request_hints.d.ts +8 -8
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +1 -0
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -0
- package/dest/kernel/padded_side_effects.d.ts +26 -0
- package/dest/kernel/padded_side_effects.d.ts.map +1 -0
- package/dest/kernel/padded_side_effects.js +51 -0
- package/dest/kernel/private_kernel_data.d.ts +6 -25
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +8 -19
- package/dest/kernel/private_kernel_prover_output.d.ts +3 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +7 -4
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.js +10 -6
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +10 -10
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_dimensions.js +29 -29
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +8 -3
- package/dest/kernel/public_call_request.d.ts +54 -0
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +58 -0
- package/dest/logs/contract_class_log.d.ts +0 -4
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +0 -33
- package/dest/logs/log_with_tx_data.d.ts +3 -3
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +9 -13
- package/dest/logs/pending_tagged_log.d.ts +1 -1
- package/dest/logs/pending_tagged_log.js +1 -1
- package/dest/logs/private_log.d.ts +1 -0
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +3 -0
- package/dest/logs/public_log.d.ts +1 -0
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +3 -0
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +1 -0
- package/dest/rollup/avm_proof_data.d.ts +7 -5
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +12 -4
- package/dest/rollup/base_rollup_hints.d.ts +4 -4
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +8 -8
- package/dest/rollup/previous_rollup_block_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.js +8 -13
- package/dest/rollup/previous_rollup_data.d.ts +6 -15
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.js +8 -13
- package/dest/rollup/private_tube_data.d.ts +3 -3
- package/dest/rollup/private_tube_data.d.ts.map +1 -1
- package/dest/rollup/private_tube_data.js +3 -3
- package/dest/rollup/public_tube_data.d.ts +3 -3
- package/dest/rollup/public_tube_data.d.ts.map +1 -1
- package/dest/rollup/public_tube_data.js +3 -3
- package/dest/rollup/root_rollup.d.ts +9 -10
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +9 -20
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +25 -19
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -3
- package/dest/tx/private_execution_result.d.ts +6 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +2 -5
- package/dest/tx/profiling.d.ts +41 -0
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +4 -1
- package/dest/tx/proven_tx.d.ts +40 -18
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +2 -2
- package/dest/tx/tx.d.ts +10 -25
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +25 -50
- package/dest/tx/tx_effect.d.ts +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -2
- package/dest/validators/types.d.ts +4 -0
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/index.d.ts.map +1 -1
- package/dest/vks/index.js +1 -1
- package/dest/vks/{vk_witness_data.d.ts → vk_data.d.ts} +8 -8
- package/dest/vks/vk_data.d.ts.map +1 -0
- package/dest/vks/{vk_witness_data.js → vk_data.js} +10 -10
- package/package.json +7 -7
- package/src/abi/abi.ts +37 -0
- package/src/avm/avm.ts +14 -0
- package/src/avm/avm_accumulated_data.ts +93 -0
- package/src/avm/avm_circuit_public_inputs.ts +22 -2
- package/src/block/body.ts +7 -2
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +8 -3
- package/src/block/l2_block_source.ts +9 -3
- package/src/block/proposal/committee_attestation.ts +70 -0
- package/src/block/proposal/index.ts +1 -0
- package/src/block/published_l2_block.ts +38 -24
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/interfaces/archiver.ts +2 -2
- package/src/interfaces/aztec-node.ts +2 -2
- package/src/interfaces/p2p.ts +8 -3
- package/src/interfaces/prover-agent.ts +9 -10
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +3 -3
- package/src/kernel/hints/key_validation_hint.ts +4 -6
- package/src/kernel/hints/private_kernel_reset_hints.ts +34 -43
- package/src/kernel/hints/read_request_hints.ts +27 -15
- package/src/kernel/index.ts +1 -0
- package/src/kernel/padded_side_effects.ts +73 -0
- package/src/kernel/private_kernel_data.ts +7 -29
- package/src/kernel/private_kernel_prover_output.ts +1 -0
- package/src/kernel/private_kernel_reset_circuit_private_inputs.ts +16 -13
- package/src/kernel/private_kernel_reset_dimensions.ts +27 -27
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +10 -2
- package/src/kernel/public_call_request.ts +66 -0
- package/src/logs/contract_class_log.ts +0 -36
- package/src/logs/log_with_tx_data.ts +7 -11
- package/src/logs/pending_tagged_log.ts +1 -1
- package/src/logs/private_log.ts +4 -0
- package/src/logs/public_log.ts +4 -0
- package/src/logs/tx_scoped_l2_log.ts +1 -0
- package/src/rollup/avm_proof_data.ts +14 -7
- package/src/rollup/base_rollup_hints.ts +4 -4
- package/src/rollup/previous_rollup_block_data.ts +6 -12
- package/src/rollup/previous_rollup_data.ts +6 -12
- package/src/rollup/private_tube_data.ts +4 -4
- package/src/rollup/public_tube_data.ts +4 -4
- package/src/rollup/root_rollup.ts +6 -19
- package/src/tests/factories.ts +36 -32
- package/src/tests/mocks.ts +6 -3
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/processed_tx.ts +4 -5
- package/src/tx/profiling.ts +6 -1
- package/src/tx/proven_tx.ts +2 -2
- package/src/tx/tx.ts +28 -54
- package/src/tx/tx_effect.ts +23 -5
- package/src/validators/types.ts +2 -0
- package/src/vks/index.ts +1 -1
- package/src/vks/{vk_witness_data.ts → vk_data.ts} +6 -6
- package/dest/vks/vk_witness_data.d.ts.map +0 -1
package/dest/tx/tx.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
6
6
|
import type { GasSettings } from '../gas/gas_settings.js';
|
|
7
7
|
import type { GetPublicLogsResponse } from '../interfaces/get_logs_response.js';
|
|
8
8
|
import type { L2LogsSource } from '../interfaces/l2_logs_source.js';
|
|
9
|
-
import type { ScopedLogHash } from '../kernel/log_hash.js';
|
|
10
9
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
11
10
|
import { ContractClassLog, ContractClassLogFields } from '../logs/contract_class_log.js';
|
|
12
11
|
import { Gossipable } from '../p2p/gossipable.js';
|
|
@@ -31,9 +30,11 @@ export declare class Tx extends Gossipable {
|
|
|
31
30
|
*/
|
|
32
31
|
readonly clientIvcProof: ClientIvcProof;
|
|
33
32
|
/**
|
|
34
|
-
* Contract class
|
|
33
|
+
* Contract class log fields emitted from the tx.
|
|
34
|
+
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
35
|
+
* It's checked in data_validator.ts
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
|
+
contractClassLogFields: ContractClassLogFields[];
|
|
37
38
|
/**
|
|
38
39
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
39
40
|
*/
|
|
@@ -52,9 +53,11 @@ export declare class Tx extends Gossipable {
|
|
|
52
53
|
*/
|
|
53
54
|
clientIvcProof: ClientIvcProof,
|
|
54
55
|
/**
|
|
55
|
-
* Contract class
|
|
56
|
+
* Contract class log fields emitted from the tx.
|
|
57
|
+
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
58
|
+
* It's checked in data_validator.ts
|
|
56
59
|
*/
|
|
57
|
-
|
|
60
|
+
contractClassLogFields: ContractClassLogFields[],
|
|
58
61
|
/**
|
|
59
62
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
60
63
|
*/
|
|
@@ -87,19 +90,13 @@ export declare class Tx extends Gossipable {
|
|
|
87
90
|
* @returns The requested logs.
|
|
88
91
|
*/
|
|
89
92
|
getPublicLogs(logsSource: L2LogsSource): Promise<GetPublicLogsResponse>;
|
|
93
|
+
getContractClassLogs(): ContractClassLog[];
|
|
90
94
|
/**
|
|
91
95
|
* Gets either revertible or non revertible contract class logs emitted by this tx.
|
|
92
96
|
* @param revertible - true for revertible only logs, false for non reverible only logs.
|
|
93
97
|
* @returns The requested logs.
|
|
94
98
|
*/
|
|
95
|
-
getSplitContractClassLogs(revertible: boolean
|
|
96
|
-
/**
|
|
97
|
-
* Filters contract class logs emitted by this tx.
|
|
98
|
-
* @param logHashes - logs to keep represented by their hashes.
|
|
99
|
-
* @param silo - whether to silo the logs before returning them.
|
|
100
|
-
* @returns The requested logs.
|
|
101
|
-
*/
|
|
102
|
-
filterContractClassLogs(logHashes: ScopedLogHash[], silo?: boolean): Promise<ContractClassLog[]>;
|
|
99
|
+
getSplitContractClassLogs(revertible: boolean): ContractClassLog[];
|
|
103
100
|
/**
|
|
104
101
|
* Computes (if necessary) & return transaction hash.
|
|
105
102
|
* @returns The hash of the public inputs of the private kernel tail circuit.
|
|
@@ -145,18 +142,6 @@ export declare class Tx extends Gossipable {
|
|
|
145
142
|
* @returns A random tx.
|
|
146
143
|
*/
|
|
147
144
|
static random(randomProof?: boolean): Tx;
|
|
148
|
-
/**
|
|
149
|
-
* Filters out logs from functions that are not present in the provided kernel output.
|
|
150
|
-
*
|
|
151
|
-
* The purpose of this is to remove logs that got dropped due to a revert,
|
|
152
|
-
* in which case, we only have the kernel's hashes to go on, as opposed to
|
|
153
|
-
* this grouping by function maintained in this class.
|
|
154
|
-
*
|
|
155
|
-
* The logic therefore is to drop all FunctionLogs if any constituent hash
|
|
156
|
-
* does not appear in the provided hashes: it is impossible for part of a
|
|
157
|
-
* function to revert.
|
|
158
|
-
*/
|
|
159
|
-
filterRevertedLogs(): Promise<void>;
|
|
160
145
|
}
|
|
161
146
|
/** Utility type for an entity that has a hash property for a txhash */
|
|
162
147
|
type HasHash = {
|
package/dest/tx/tx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../src/tx/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAyD,MAAM,6BAA6B,CAAC;AAClH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,OAAO,
|
|
1
|
+
{"version":3,"file":"tx.d.ts","sourceRoot":"","sources":["../../src/tx/tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAyD,MAAM,6BAA6B,CAA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EAAE,EAAE,EAAE,GAAG,EAAE;IAaxB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,WAAW,UAAQ;CAgBlC;AAED,uEAAuE;AACvE,KAAK,OAAO,GAAG;IAAqB,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dest/tx/tx.js
CHANGED
|
@@ -16,7 +16,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
16
16
|
*/ export class Tx extends Gossipable {
|
|
17
17
|
data;
|
|
18
18
|
clientIvcProof;
|
|
19
|
-
|
|
19
|
+
contractClassLogFields;
|
|
20
20
|
publicFunctionCalldata;
|
|
21
21
|
static p2pTopic = TopicType.tx;
|
|
22
22
|
// For memoization
|
|
@@ -28,11 +28,13 @@ import { TxHash } from './tx_hash.js';
|
|
|
28
28
|
* Proof from the private kernel circuit.
|
|
29
29
|
* TODO(#7368): This client IVC object currently contains various VKs that will eventually be more like static data.
|
|
30
30
|
*/ clientIvcProof, /**
|
|
31
|
-
* Contract class
|
|
32
|
-
|
|
31
|
+
* Contract class log fields emitted from the tx.
|
|
32
|
+
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
33
|
+
* It's checked in data_validator.ts
|
|
34
|
+
*/ contractClassLogFields, /**
|
|
33
35
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
34
36
|
*/ publicFunctionCalldata){
|
|
35
|
-
super(), this.data = data, this.clientIvcProof = clientIvcProof, this.
|
|
37
|
+
super(), this.data = data, this.clientIvcProof = clientIvcProof, this.contractClassLogFields = contractClassLogFields, this.publicFunctionCalldata = publicFunctionCalldata;
|
|
36
38
|
}
|
|
37
39
|
// Gossipable method
|
|
38
40
|
async generateP2PMessageIdentifier() {
|
|
@@ -86,7 +88,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
86
88
|
return serializeToBuffer([
|
|
87
89
|
this.data,
|
|
88
90
|
this.clientIvcProof,
|
|
89
|
-
serializeArrayOfBufferableToVector(this.
|
|
91
|
+
serializeArrayOfBufferableToVector(this.contractClassLogFields, 1),
|
|
90
92
|
serializeArrayOfBufferableToVector(this.publicFunctionCalldata, 1)
|
|
91
93
|
]);
|
|
92
94
|
}
|
|
@@ -94,12 +96,12 @@ import { TxHash } from './tx_hash.js';
|
|
|
94
96
|
return z.object({
|
|
95
97
|
data: PrivateKernelTailCircuitPublicInputs.schema,
|
|
96
98
|
clientIvcProof: ClientIvcProof.schema,
|
|
97
|
-
|
|
99
|
+
contractClassLogFields: z.array(ContractClassLogFields.schema),
|
|
98
100
|
publicFunctionCalldata: z.array(HashedValues.schema)
|
|
99
101
|
}).transform(Tx.from);
|
|
100
102
|
}
|
|
101
103
|
static from(fields) {
|
|
102
|
-
return new Tx(fields.data, fields.clientIvcProof, fields.
|
|
104
|
+
return new Tx(fields.data, fields.clientIvcProof, fields.contractClassLogFields, fields.publicFunctionCalldata);
|
|
103
105
|
}
|
|
104
106
|
/**
|
|
105
107
|
* Gets public logs emitted by this tx.
|
|
@@ -110,38 +112,25 @@ import { TxHash } from './tx_hash.js';
|
|
|
110
112
|
txHash: await this.getTxHash()
|
|
111
113
|
});
|
|
112
114
|
}
|
|
115
|
+
getContractClassLogs() {
|
|
116
|
+
const logHashes = this.data.getNonEmptyContractClassLogsHashes();
|
|
117
|
+
return logHashes.map((logHash, i)=>ContractClassLog.from({
|
|
118
|
+
contractAddress: logHash.contractAddress,
|
|
119
|
+
fields: this.contractClassLogFields[i],
|
|
120
|
+
emittedLength: logHash.logHash.length
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
113
123
|
/**
|
|
114
124
|
* Gets either revertible or non revertible contract class logs emitted by this tx.
|
|
115
125
|
* @param revertible - true for revertible only logs, false for non reverible only logs.
|
|
116
126
|
* @returns The requested logs.
|
|
117
|
-
*/
|
|
118
|
-
// Should only be called on txs with public calls
|
|
127
|
+
*/ getSplitContractClassLogs(revertible) {
|
|
119
128
|
if (!this.data.forPublic) {
|
|
120
|
-
|
|
129
|
+
throw new Error('`getSplitContractClassLogs` should only be called on txs with public calls');
|
|
121
130
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Filters contract class logs emitted by this tx.
|
|
127
|
-
* @param logHashes - logs to keep represented by their hashes.
|
|
128
|
-
* @param silo - whether to silo the logs before returning them.
|
|
129
|
-
* @returns The requested logs.
|
|
130
|
-
*/ async filterContractClassLogs(logHashes, silo = false) {
|
|
131
|
-
const contractClassLogs = [];
|
|
132
|
-
for (const fields of this.contractClassLogs){
|
|
133
|
-
const hashedLog = await fields.hash();
|
|
134
|
-
const logHash = logHashes.find((hash)=>hash.value.equals(hashedLog));
|
|
135
|
-
if (logHash) {
|
|
136
|
-
const log = ContractClassLog.from({
|
|
137
|
-
contractAddress: logHash.contractAddress,
|
|
138
|
-
fields,
|
|
139
|
-
emittedLength: logHash.logHash.length
|
|
140
|
-
});
|
|
141
|
-
contractClassLogs.push(silo ? await log.silo() : log);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return contractClassLogs;
|
|
131
|
+
const contractClassLogs = this.getContractClassLogs();
|
|
132
|
+
const numNonRevertible = this.data.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes.filter((h)=>!h.isEmpty()).length;
|
|
133
|
+
return revertible ? contractClassLogs.slice(numNonRevertible) : contractClassLogs.slice(0, numNonRevertible);
|
|
145
134
|
}
|
|
146
135
|
/**
|
|
147
136
|
* Computes (if necessary) & return transaction hash.
|
|
@@ -184,7 +173,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
184
173
|
};
|
|
185
174
|
}
|
|
186
175
|
getSize() {
|
|
187
|
-
return this.data.getSize() + this.clientIvcProof.clientIvcProofBuffer.length + arraySerializedSizeOfNonEmpty(this.
|
|
176
|
+
return this.data.getSize() + this.clientIvcProof.clientIvcProofBuffer.length + arraySerializedSizeOfNonEmpty(this.contractClassLogFields) + this.publicFunctionCalldata.reduce((accum, cd)=>accum + cd.getSize(), 0);
|
|
188
177
|
}
|
|
189
178
|
/**
|
|
190
179
|
* Estimates the tx size based on its private effects. Note that the actual size of the tx
|
|
@@ -213,9 +202,9 @@ import { TxHash } from './tx_hash.js';
|
|
|
213
202
|
*/ static clone(tx) {
|
|
214
203
|
const publicInputs = PrivateKernelTailCircuitPublicInputs.fromBuffer(tx.data.toBuffer());
|
|
215
204
|
const clientIvcProof = ClientIvcProof.fromBuffer(tx.clientIvcProof.toBuffer());
|
|
216
|
-
const
|
|
205
|
+
const contractClassLogFields = tx.contractClassLogFields.map((p)=>p.clone());
|
|
217
206
|
const publicFunctionCalldata = tx.publicFunctionCalldata.map((cd)=>HashedValues.fromBuffer(cd.toBuffer()));
|
|
218
|
-
const clonedTx = new Tx(publicInputs, clientIvcProof,
|
|
207
|
+
const clonedTx = new Tx(publicInputs, clientIvcProof, contractClassLogFields, publicFunctionCalldata);
|
|
219
208
|
if (tx.txHash) {
|
|
220
209
|
clonedTx.setTxHash(TxHash.fromBuffer(tx.txHash.toBuffer()));
|
|
221
210
|
}
|
|
@@ -232,20 +221,6 @@ import { TxHash } from './tx_hash.js';
|
|
|
232
221
|
HashedValues.random()
|
|
233
222
|
]);
|
|
234
223
|
}
|
|
235
|
-
/**
|
|
236
|
-
* Filters out logs from functions that are not present in the provided kernel output.
|
|
237
|
-
*
|
|
238
|
-
* The purpose of this is to remove logs that got dropped due to a revert,
|
|
239
|
-
* in which case, we only have the kernel's hashes to go on, as opposed to
|
|
240
|
-
* this grouping by function maintained in this class.
|
|
241
|
-
*
|
|
242
|
-
* The logic therefore is to drop all FunctionLogs if any constituent hash
|
|
243
|
-
* does not appear in the provided hashes: it is impossible for part of a
|
|
244
|
-
* function to revert.
|
|
245
|
-
*/ // TODO: don't modify the tx object directly. The preimages should match the log hashes. When did the log hashes change?
|
|
246
|
-
async filterRevertedLogs() {
|
|
247
|
-
this.contractClassLogs = (await this.getSplitContractClassLogs(false)).map((log)=>log.fields);
|
|
248
|
-
}
|
|
249
224
|
#combinePublicCallRequestWithCallData(request) {
|
|
250
225
|
const calldataMap = this.getCalldataMap();
|
|
251
226
|
// Assume empty calldata if nothing is given for the hash.
|
package/dest/tx/tx_effect.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ export declare class TxEffect {
|
|
|
112
112
|
* @dev Follows new_sha in variable_merkle_tree.nr
|
|
113
113
|
*/
|
|
114
114
|
txOutHash(): Buffer<ArrayBufferLike>;
|
|
115
|
-
static random(numPublicCallsPerTx?: number, numPublicLogsPerCall?: number): Promise<TxEffect>;
|
|
115
|
+
static random(numPublicCallsPerTx?: number, numPublicLogsPerCall?: number, maxEffects?: number | undefined): Promise<TxEffect>;
|
|
116
116
|
static empty(): TxEffect;
|
|
117
117
|
isEmpty(): boolean;
|
|
118
118
|
/** Returns a hex representation of the TxEffect object. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":"AAiBA,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,eA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,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAetC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAepC;IAED,CAAC,OAAO,CAAC,MAAM,CAAC;IAsBhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;CAG9B"}
|
package/dest/tx/tx_effect.js
CHANGED
|
@@ -160,8 +160,8 @@ export class TxEffect {
|
|
|
160
160
|
}
|
|
161
161
|
return thisLayer[0];
|
|
162
162
|
}
|
|
163
|
-
static async random(numPublicCallsPerTx = 3, numPublicLogsPerCall = 1) {
|
|
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, PublicDataWrite.random), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ()=>PrivateLog.random()), await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, async ()=>await PublicLog.random()), await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random));
|
|
163
|
+
static async random(numPublicCallsPerTx = 3, numPublicLogsPerCall = 1, maxEffects = undefined) {
|
|
164
|
+
return new TxEffect(RevertCode.random(), TxHash.random(), new Fr(Math.floor(Math.random() * 100_000)), makeTuple(maxEffects === undefined ? MAX_NOTE_HASHES_PER_TX : Math.min(maxEffects, MAX_NOTE_HASHES_PER_TX), Fr.random), makeTuple(maxEffects === undefined ? MAX_NULLIFIERS_PER_TX : Math.min(maxEffects, MAX_NULLIFIERS_PER_TX), Fr.random), makeTuple(maxEffects === undefined ? MAX_L2_TO_L1_MSGS_PER_TX : Math.min(maxEffects, MAX_L2_TO_L1_MSGS_PER_TX), Fr.random), makeTuple(maxEffects === undefined ? MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX : Math.min(maxEffects, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX), PublicDataWrite.random), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ()=>PrivateLog.random()), await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, async ()=>await PublicLog.random()), await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random));
|
|
165
165
|
}
|
|
166
166
|
static empty() {
|
|
167
167
|
return new TxEffect(RevertCode.OK, TxHash.zero(), Fr.ZERO, [], [], [], [], [], [], []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,EAAE,CAAC;AAEvF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,eAAe,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE;QACf,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,CAA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CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,kBAAkB,EAAE;QAClB,aAAa,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,OAAO,EAAE,sBAAsB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC"}
|
package/dest/vks/index.d.ts
CHANGED
package/dest/vks/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vks/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vks/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC"}
|
package/dest/vks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './verification_key.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './vk_data.js';
|
|
@@ -3,28 +3,28 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
4
4
|
import type { UInt32 } from '../types/shared.js';
|
|
5
5
|
import { VerificationKeyData } from './verification_key.js';
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class VkData {
|
|
7
7
|
vk: VerificationKeyData;
|
|
8
8
|
/**
|
|
9
9
|
* Index of the vk in the vk tree.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
leafIndex: UInt32;
|
|
12
12
|
/**
|
|
13
13
|
* Sibling path of the vk in the vk tree.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
siblingPath: Tuple<Fr, typeof VK_TREE_HEIGHT>;
|
|
16
16
|
constructor(vk: VerificationKeyData,
|
|
17
17
|
/**
|
|
18
18
|
* Index of the vk in the vk tree.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
leafIndex: UInt32,
|
|
21
21
|
/**
|
|
22
22
|
* Sibling path of the vk in the vk tree.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
static empty():
|
|
26
|
-
static fromBuffer(buffer: Buffer | BufferReader):
|
|
24
|
+
siblingPath: Tuple<Fr, typeof VK_TREE_HEIGHT>);
|
|
25
|
+
static empty(): VkData;
|
|
26
|
+
static fromBuffer(buffer: Buffer | BufferReader): VkData;
|
|
27
27
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
28
28
|
toString(): `0x${string}`;
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=vk_data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vk_data.d.ts","sourceRoot":"","sources":["../../src/vks/vk_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,MAAM;IAER,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,SAAS,EAAE,MAAM;IACxB;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;gBAR7C,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,SAAS,EAAE,MAAM;IACxB;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;IAGtD,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAS/C,QAAQ;IAIR,QAAQ;CAGT"}
|
|
@@ -4,28 +4,28 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
4
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
import { bufferToHex } from '@aztec/foundation/string';
|
|
6
6
|
import { VerificationKeyData } from './verification_key.js';
|
|
7
|
-
export class
|
|
7
|
+
export class VkData {
|
|
8
8
|
vk;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
leafIndex;
|
|
10
|
+
siblingPath;
|
|
11
11
|
constructor(vk, /**
|
|
12
12
|
* Index of the vk in the vk tree.
|
|
13
|
-
*/
|
|
13
|
+
*/ leafIndex, /**
|
|
14
14
|
* Sibling path of the vk in the vk tree.
|
|
15
|
-
*/
|
|
15
|
+
*/ siblingPath){
|
|
16
16
|
this.vk = vk;
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
17
|
+
this.leafIndex = leafIndex;
|
|
18
|
+
this.siblingPath = siblingPath;
|
|
19
19
|
}
|
|
20
20
|
static empty() {
|
|
21
|
-
return new
|
|
21
|
+
return new VkData(VerificationKeyData.empty(), 0, makeTuple(VK_TREE_HEIGHT, Fr.zero));
|
|
22
22
|
}
|
|
23
23
|
static fromBuffer(buffer) {
|
|
24
24
|
const reader = BufferReader.asReader(buffer);
|
|
25
|
-
return new
|
|
25
|
+
return new VkData(reader.readObject(VerificationKeyData), reader.readNumber(), reader.readArray(VK_TREE_HEIGHT, Fr));
|
|
26
26
|
}
|
|
27
27
|
toBuffer() {
|
|
28
|
-
return serializeToBuffer(this.vk, this.
|
|
28
|
+
return serializeToBuffer(this.vk, this.leafIndex, this.siblingPath);
|
|
29
29
|
}
|
|
30
30
|
toString() {
|
|
31
31
|
return bufferToHex(this.toBuffer());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.3-nightly.20250529",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/bb.js": "0.87.
|
|
71
|
-
"@aztec/blob-lib": "0.87.
|
|
72
|
-
"@aztec/constants": "0.87.
|
|
73
|
-
"@aztec/ethereum": "0.87.
|
|
74
|
-
"@aztec/foundation": "0.87.
|
|
75
|
-
"@aztec/noir-noirc_abi": "0.87.
|
|
70
|
+
"@aztec/bb.js": "0.87.3-nightly.20250529",
|
|
71
|
+
"@aztec/blob-lib": "0.87.3-nightly.20250529",
|
|
72
|
+
"@aztec/constants": "0.87.3-nightly.20250529",
|
|
73
|
+
"@aztec/ethereum": "0.87.3-nightly.20250529",
|
|
74
|
+
"@aztec/foundation": "0.87.3-nightly.20250529",
|
|
75
|
+
"@aztec/noir-noirc_abi": "0.87.3-nightly.20250529",
|
|
76
76
|
"@google-cloud/storage": "^7.15.0",
|
|
77
77
|
"axios": "^1.9.0",
|
|
78
78
|
"json-stringify-deterministic": "1.0.12",
|
package/src/abi/abi.ts
CHANGED
|
@@ -533,3 +533,40 @@ export function getInitializer(
|
|
|
533
533
|
return initializerNameOrArtifact;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
+
|
|
537
|
+
export function emptyFunctionAbi(): FunctionAbi {
|
|
538
|
+
return {
|
|
539
|
+
name: '',
|
|
540
|
+
functionType: FunctionType.PRIVATE,
|
|
541
|
+
isInternal: false,
|
|
542
|
+
isStatic: false,
|
|
543
|
+
parameters: [],
|
|
544
|
+
returnTypes: [],
|
|
545
|
+
errorTypes: {},
|
|
546
|
+
isInitializer: false,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export function emptyFunctionArtifact(): FunctionArtifact {
|
|
551
|
+
const abi = emptyFunctionAbi();
|
|
552
|
+
return {
|
|
553
|
+
...abi,
|
|
554
|
+
bytecode: Buffer.from([]),
|
|
555
|
+
debugSymbols: '',
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export function emptyContractArtifact(): ContractArtifact {
|
|
560
|
+
return {
|
|
561
|
+
name: '',
|
|
562
|
+
functions: [emptyFunctionArtifact()],
|
|
563
|
+
nonDispatchPublicFunctions: [emptyFunctionAbi()],
|
|
564
|
+
outputs: {
|
|
565
|
+
structs: {},
|
|
566
|
+
globals: {},
|
|
567
|
+
},
|
|
568
|
+
storageLayout: {},
|
|
569
|
+
fileMap: {},
|
|
570
|
+
notes: {},
|
|
571
|
+
};
|
|
572
|
+
}
|
package/src/avm/avm.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { schemas } from '@aztec/foundation/schemas';
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
|
+
import { Gas } from '../gas/gas.js';
|
|
9
|
+
import { GasSettings } from '../gas/gas_settings.js';
|
|
8
10
|
import { PublicKeys } from '../keys/public_keys.js';
|
|
9
11
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
10
12
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
@@ -406,6 +408,7 @@ export class AvmTxHint {
|
|
|
406
408
|
constructor(
|
|
407
409
|
public readonly hash: string,
|
|
408
410
|
public readonly globalVariables: GlobalVariables,
|
|
411
|
+
public readonly gasSettings: GasSettings,
|
|
409
412
|
public readonly nonRevertibleAccumulatedData: {
|
|
410
413
|
noteHashes: Fr[];
|
|
411
414
|
nullifiers: Fr[];
|
|
@@ -421,6 +424,7 @@ export class AvmTxHint {
|
|
|
421
424
|
// We need this to be null and not undefined because that's what
|
|
422
425
|
// MessagePack expects for an std::optional.
|
|
423
426
|
public readonly teardownEnqueuedCall: AvmEnqueuedCallHint | null,
|
|
427
|
+
public readonly gasUsedByPrivate: Gas,
|
|
424
428
|
) {}
|
|
425
429
|
|
|
426
430
|
static async fromTx(tx: Tx): Promise<AvmTxHint> {
|
|
@@ -434,6 +438,7 @@ export class AvmTxHint {
|
|
|
434
438
|
return new AvmTxHint(
|
|
435
439
|
txHash.hash.toString(),
|
|
436
440
|
tx.data.constants.historicalHeader.globalVariables,
|
|
441
|
+
tx.data.constants.txContext.gasSettings,
|
|
437
442
|
{
|
|
438
443
|
noteHashes: tx.data.forPublic!.nonRevertibleAccumulatedData.noteHashes.filter(x => !x.isZero()),
|
|
439
444
|
nullifiers: tx.data.forPublic!.nonRevertibleAccumulatedData.nullifiers.filter(x => !x.isZero()),
|
|
@@ -468,6 +473,7 @@ export class AvmTxHint {
|
|
|
468
473
|
teardownCallRequest.request.isStaticCall,
|
|
469
474
|
)
|
|
470
475
|
: null,
|
|
476
|
+
tx.data.gasUsed,
|
|
471
477
|
);
|
|
472
478
|
}
|
|
473
479
|
|
|
@@ -475,11 +481,13 @@ export class AvmTxHint {
|
|
|
475
481
|
return new AvmTxHint(
|
|
476
482
|
'',
|
|
477
483
|
GlobalVariables.empty(),
|
|
484
|
+
GasSettings.empty(),
|
|
478
485
|
{ noteHashes: [], nullifiers: [] },
|
|
479
486
|
{ noteHashes: [], nullifiers: [] },
|
|
480
487
|
[],
|
|
481
488
|
[],
|
|
482
489
|
null,
|
|
490
|
+
Gas.empty(),
|
|
483
491
|
);
|
|
484
492
|
}
|
|
485
493
|
|
|
@@ -488,6 +496,7 @@ export class AvmTxHint {
|
|
|
488
496
|
.object({
|
|
489
497
|
hash: z.string(),
|
|
490
498
|
globalVariables: GlobalVariables.schema,
|
|
499
|
+
gasSettings: GasSettings.schema,
|
|
491
500
|
nonRevertibleAccumulatedData: z.object({
|
|
492
501
|
noteHashes: schemas.Fr.array(),
|
|
493
502
|
nullifiers: schemas.Fr.array(),
|
|
@@ -499,25 +508,30 @@ export class AvmTxHint {
|
|
|
499
508
|
setupEnqueuedCalls: AvmEnqueuedCallHint.schema.array(),
|
|
500
509
|
appLogicEnqueuedCalls: AvmEnqueuedCallHint.schema.array(),
|
|
501
510
|
teardownEnqueuedCall: AvmEnqueuedCallHint.schema.nullable(),
|
|
511
|
+
gasUsedByPrivate: Gas.schema,
|
|
502
512
|
})
|
|
503
513
|
.transform(
|
|
504
514
|
({
|
|
505
515
|
hash,
|
|
506
516
|
globalVariables,
|
|
517
|
+
gasSettings,
|
|
507
518
|
nonRevertibleAccumulatedData,
|
|
508
519
|
revertibleAccumulatedData,
|
|
509
520
|
setupEnqueuedCalls,
|
|
510
521
|
appLogicEnqueuedCalls,
|
|
511
522
|
teardownEnqueuedCall,
|
|
523
|
+
gasUsedByPrivate,
|
|
512
524
|
}) =>
|
|
513
525
|
new AvmTxHint(
|
|
514
526
|
hash,
|
|
515
527
|
globalVariables,
|
|
528
|
+
gasSettings,
|
|
516
529
|
nonRevertibleAccumulatedData,
|
|
517
530
|
revertibleAccumulatedData,
|
|
518
531
|
setupEnqueuedCalls,
|
|
519
532
|
appLogicEnqueuedCalls,
|
|
520
533
|
teardownEnqueuedCall,
|
|
534
|
+
gasUsedByPrivate,
|
|
521
535
|
),
|
|
522
536
|
);
|
|
523
537
|
}
|
|
@@ -185,3 +185,96 @@ export class AvmAccumulatedData {
|
|
|
185
185
|
}`;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Represents the lengths of arrays in AVM accumulated data
|
|
191
|
+
*/
|
|
192
|
+
export class AvmAccumulatedDataArrayLengths {
|
|
193
|
+
constructor(
|
|
194
|
+
/**
|
|
195
|
+
* Number of note hashes
|
|
196
|
+
*/
|
|
197
|
+
public noteHashes: number,
|
|
198
|
+
/**
|
|
199
|
+
* Number of nullifiers
|
|
200
|
+
*/
|
|
201
|
+
public nullifiers: number,
|
|
202
|
+
/**
|
|
203
|
+
* Number of L2 to L1 messages
|
|
204
|
+
*/
|
|
205
|
+
public l2ToL1Msgs: number,
|
|
206
|
+
/**
|
|
207
|
+
* Number of public logs
|
|
208
|
+
*/
|
|
209
|
+
public publicLogs: number,
|
|
210
|
+
/**
|
|
211
|
+
* Number of public data writes
|
|
212
|
+
*/
|
|
213
|
+
public publicDataWrites: number,
|
|
214
|
+
) {}
|
|
215
|
+
|
|
216
|
+
static get schema() {
|
|
217
|
+
return z
|
|
218
|
+
.object({
|
|
219
|
+
noteHashes: z.number(),
|
|
220
|
+
nullifiers: z.number(),
|
|
221
|
+
l2ToL1Msgs: z.number(),
|
|
222
|
+
publicLogs: z.number(),
|
|
223
|
+
publicDataWrites: z.number(),
|
|
224
|
+
})
|
|
225
|
+
.transform(
|
|
226
|
+
({ noteHashes, nullifiers, l2ToL1Msgs, publicLogs, publicDataWrites }) =>
|
|
227
|
+
new AvmAccumulatedDataArrayLengths(noteHashes, nullifiers, l2ToL1Msgs, publicLogs, publicDataWrites),
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
232
|
+
const reader = BufferReader.asReader(buffer);
|
|
233
|
+
return new AvmAccumulatedDataArrayLengths(
|
|
234
|
+
reader.readNumber(),
|
|
235
|
+
reader.readNumber(),
|
|
236
|
+
reader.readNumber(),
|
|
237
|
+
reader.readNumber(),
|
|
238
|
+
reader.readNumber(),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
toBuffer() {
|
|
243
|
+
return serializeToBuffer(this.noteHashes, this.nullifiers, this.l2ToL1Msgs, this.publicLogs, this.publicDataWrites);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
static fromFields(fields: Fr[] | FieldReader) {
|
|
247
|
+
const reader = FieldReader.asReader(fields);
|
|
248
|
+
return new AvmAccumulatedDataArrayLengths(
|
|
249
|
+
Number(reader.readField()),
|
|
250
|
+
Number(reader.readField()),
|
|
251
|
+
Number(reader.readField()),
|
|
252
|
+
Number(reader.readField()),
|
|
253
|
+
Number(reader.readField()),
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
toFields(): Fr[] {
|
|
258
|
+
return [
|
|
259
|
+
new Fr(this.noteHashes),
|
|
260
|
+
new Fr(this.nullifiers),
|
|
261
|
+
new Fr(this.l2ToL1Msgs),
|
|
262
|
+
new Fr(this.publicLogs),
|
|
263
|
+
new Fr(this.publicDataWrites),
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
static empty() {
|
|
268
|
+
return new AvmAccumulatedDataArrayLengths(0, 0, 0, 0, 0);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
[inspect.custom]() {
|
|
272
|
+
return `AvmAccumulatedDataArrayLengths {
|
|
273
|
+
noteHashes: ${this.noteHashes},
|
|
274
|
+
nullifiers: ${this.nullifiers},
|
|
275
|
+
l2ToL1Msgs: ${this.l2ToL1Msgs},
|
|
276
|
+
publicLogs: ${this.publicLogs},
|
|
277
|
+
publicDataWrites: ${this.publicDataWrites},
|
|
278
|
+
}`;
|
|
279
|
+
}
|
|
280
|
+
}
|