@aztec/stdlib 1.0.0-nightly.20250708 → 1.0.0-staging.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/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +6 -3
- package/dest/abi/index.d.ts +0 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +0 -1
- package/dest/block/l2_block.d.ts +0 -7
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +0 -8
- package/dest/block/l2_block_stream/l2_block_stream.js +1 -1
- package/dest/block/proposal/committee_attestation.d.ts +3 -3
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.js +2 -41
- package/dest/contract/contract_instance_update.d.ts +1 -2
- package/dest/contract/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/contract_instance_update.js +6 -6
- package/dest/contract/interfaces/contract_data_source.d.ts +2 -5
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.d.ts +8 -9
- package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.js +1 -1
- package/dest/gas/gas.d.ts +0 -1
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +0 -3
- package/dest/hash/hash.d.ts +1 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +3 -7
- package/dest/interfaces/archiver.js +1 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +1 -3
- package/dest/interfaces/aztec-node.d.ts +1 -1
- package/dest/interfaces/client.d.ts +0 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +0 -1
- package/dest/interfaces/configs.d.ts +0 -10
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +1 -3
- package/dest/interfaces/proving-job.d.ts +17 -38
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +0 -13
- package/dest/interfaces/pxe.d.ts +0 -2
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/server.d.ts +1 -3
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +1 -3
- package/dest/interfaces/server_circuit_prover.d.ts +0 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/tx-collector.d.ts +15 -0
- package/dest/interfaces/tx-collector.d.ts.map +1 -0
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -6
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +20 -18
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +10 -7
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +32 -17
- package/dest/kernel/hints/build_transient_data_hints.d.ts +1 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +8 -7
- package/dest/kernel/hints/index.d.ts +1 -0
- package/dest/kernel/hints/index.d.ts.map +1 -1
- package/dest/kernel/hints/index.js +1 -0
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.js +4 -4
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.js +4 -4
- package/dest/kernel/hints/read_request_hints.d.ts +17 -17
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.js +28 -28
- package/dest/kernel/hints/rollup_validation_requests.d.ts +38 -0
- package/dest/kernel/hints/rollup_validation_requests.d.ts.map +1 -0
- package/dest/kernel/hints/rollup_validation_requests.js +57 -0
- package/dest/kernel/index.d.ts +0 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +0 -1
- package/dest/kernel/private_accumulated_data.d.ts +15 -16
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts +27 -28
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +20 -38
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +0 -9
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -8
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +6 -9
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -11
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +18 -20
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +10 -9
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +11 -11
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +12 -11
- package/dest/kernel/private_validation_requests.d.ts +20 -8
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +21 -9
- package/dest/kernel/utils/order_and_comparison.d.ts +3 -0
- package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.js +19 -0
- package/dest/messaging/l2_to_l1_message.d.ts +0 -2
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +0 -7
- package/dest/p2p/block_proposal.d.ts +1 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +8 -21
- package/dest/p2p/consensus_payload.d.ts +11 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +22 -13
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +3 -5
- package/dest/proofs/proving_request_type.d.ts +7 -8
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +7 -8
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts +9 -0
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.js +8 -3
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +3 -2
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +1 -1
- package/dest/rollup/empty_block_root_rollup_inputs.js +6 -3
- package/dest/rollup/index.d.ts +0 -1
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +0 -1
- package/dest/shared_mutable/scheduled_delay_change.d.ts +5 -5
- package/dest/shared_mutable/scheduled_delay_change.d.ts.map +1 -1
- package/dest/shared_mutable/scheduled_delay_change.js +5 -5
- package/dest/shared_mutable/scheduled_value_change.d.ts +3 -4
- package/dest/shared_mutable/scheduled_value_change.d.ts.map +1 -1
- package/dest/shared_mutable/scheduled_value_change.js +7 -7
- package/dest/shared_mutable/shared_mutable_values.js +7 -7
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +2 -0
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +25 -23
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +12 -14
- package/dest/tx/index.d.ts +1 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/max_block_number.d.ts +54 -0
- package/dest/tx/max_block_number.d.ts.map +1 -0
- package/dest/tx/max_block_number.js +64 -0
- package/dest/tx/offchain_effect.d.ts.map +1 -1
- package/dest/tx/offchain_effect.js +0 -1
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +11 -11
- package/dest/tx/simulated_tx.js +1 -1
- package/dest/tx/tx.d.ts +2 -7
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +0 -8
- package/dest/tx/validator/error_texts.d.ts +1 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/dest/types/shared.d.ts +8 -0
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +8 -0
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/verification_key.d.ts +0 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +0 -5
- package/package.json +7 -7
- package/src/abi/decoder.ts +6 -3
- package/src/abi/index.ts +0 -1
- package/src/block/l2_block.ts +0 -16
- package/src/block/l2_block_stream/l2_block_stream.ts +1 -1
- package/src/block/proposal/committee_attestation.ts +3 -49
- package/src/contract/contract_instance_update.ts +6 -7
- package/src/contract/interfaces/contract_data_source.ts +2 -5
- package/src/contract/interfaces/contract_instance_update.ts +3 -4
- package/src/gas/gas.ts +0 -4
- package/src/hash/hash.ts +3 -7
- package/src/interfaces/archiver.ts +1 -1
- package/src/interfaces/aztec-node-admin.ts +1 -8
- package/src/interfaces/aztec-node.ts +1 -1
- package/src/interfaces/client.ts +0 -1
- package/src/interfaces/configs.ts +0 -6
- package/src/interfaces/proving-job.ts +0 -21
- package/src/interfaces/pxe.ts +0 -2
- package/src/interfaces/server.ts +1 -3
- package/src/interfaces/server_circuit_prover.ts +0 -9
- package/src/interfaces/tx-collector.ts +17 -0
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +30 -28
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +59 -28
- package/src/kernel/hints/build_transient_data_hints.ts +11 -9
- package/src/kernel/hints/index.ts +1 -0
- package/src/kernel/hints/note_hash_read_request_hints.ts +16 -4
- package/src/kernel/hints/nullifier_read_request_hints.ts +16 -4
- package/src/kernel/hints/read_request_hints.ts +22 -22
- package/src/kernel/hints/rollup_validation_requests.ts +73 -0
- package/src/kernel/index.ts +0 -1
- package/src/kernel/private_accumulated_data.ts +23 -23
- package/src/kernel/private_circuit_public_inputs.ts +70 -94
- package/src/kernel/private_kernel_circuit_public_inputs.ts +1 -9
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +4 -13
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +20 -20
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +7 -7
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +10 -16
- package/src/kernel/private_validation_requests.ts +50 -19
- package/src/kernel/utils/order_and_comparison.ts +25 -0
- package/src/messaging/l2_to_l1_message.ts +0 -9
- package/src/p2p/block_proposal.ts +5 -23
- package/src/p2p/consensus_payload.ts +29 -10
- package/src/p2p/topic_type.ts +1 -3
- package/src/proofs/proving_request_type.ts +0 -1
- package/src/rollup/base_or_merge_rollup_public_inputs.ts +8 -0
- package/src/rollup/empty_block_root_rollup_inputs.ts +7 -2
- package/src/rollup/index.ts +0 -1
- package/src/shared_mutable/scheduled_delay_change.ts +6 -6
- package/src/shared_mutable/scheduled_value_change.ts +5 -7
- package/src/shared_mutable/shared_mutable_values.ts +9 -9
- package/src/stats/stats.ts +0 -1
- package/src/tests/factories.ts +29 -34
- package/src/tests/mocks.ts +9 -7
- package/src/tx/index.ts +1 -0
- package/src/tx/max_block_number.ts +81 -0
- package/src/tx/offchain_effect.ts +0 -1
- package/src/tx/private_execution_result.ts +9 -11
- package/src/tx/simulated_tx.ts +2 -2
- package/src/tx/tx.ts +1 -14
- package/src/tx/validator/error_texts.ts +1 -1
- package/src/types/shared.ts +9 -0
- package/src/versioning/versioning.ts +3 -0
- package/src/vks/verification_key.ts +0 -6
- package/dest/abi/authorization_selector.d.ts +0 -52
- package/dest/abi/authorization_selector.d.ts.map +0 -1
- package/dest/abi/authorization_selector.js +0 -70
- package/dest/interfaces/tx_provider.d.ts +0 -24
- package/dest/interfaces/tx_provider.d.ts.map +0 -1
- package/dest/kernel/claimed_length_array.d.ts +0 -34
- package/dest/kernel/claimed_length_array.d.ts.map +0 -1
- package/dest/kernel/claimed_length_array.js +0 -58
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
- package/src/abi/authorization_selector.ts +0 -95
- package/src/interfaces/tx_provider.ts +0 -16
- package/src/kernel/claimed_length_array.ts +0 -104
- package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
- /package/dest/interfaces/{tx_provider.js → tx-collector.js} +0 -0
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import { BufferReader,
|
|
1
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
2
|
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
3
3
|
import { PrivateKernelData } from './private_kernel_data.js';
|
|
4
|
+
import { countAccumulatedItems } from './utils/order_and_comparison.js';
|
|
4
5
|
/**
|
|
5
6
|
* Input to the private kernel circuit - tail call.
|
|
6
7
|
*/ export class PrivateKernelTailCircuitPrivateInputs {
|
|
7
8
|
previousKernel;
|
|
8
9
|
paddedSideEffectAmounts;
|
|
9
|
-
includeByTimestampUpperBound;
|
|
10
10
|
constructor(/**
|
|
11
11
|
* The previous kernel data
|
|
12
12
|
*/ previousKernel, /**
|
|
13
13
|
* The number of the padded side effects.
|
|
14
|
-
*/ paddedSideEffectAmounts
|
|
15
|
-
* The timestamp by which the transaction must be included in a block.
|
|
16
|
-
*/ includeByTimestampUpperBound){
|
|
14
|
+
*/ paddedSideEffectAmounts){
|
|
17
15
|
this.previousKernel = previousKernel;
|
|
18
16
|
this.paddedSideEffectAmounts = paddedSideEffectAmounts;
|
|
19
|
-
this.includeByTimestampUpperBound = includeByTimestampUpperBound;
|
|
20
17
|
}
|
|
21
18
|
isForPublic() {
|
|
22
|
-
return this.previousKernel.publicInputs.end.publicCallRequests
|
|
19
|
+
return countAccumulatedItems(this.previousKernel.publicInputs.end.publicCallRequests) > 0 || !this.previousKernel.publicInputs.publicTeardownCallRequest.isEmpty();
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
22
|
* Serialize this as a buffer.
|
|
26
23
|
* @returns The buffer.
|
|
27
24
|
*/ toBuffer() {
|
|
28
|
-
return serializeToBuffer(this.previousKernel, this.paddedSideEffectAmounts
|
|
25
|
+
return serializeToBuffer(this.previousKernel, this.paddedSideEffectAmounts);
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
28
|
* Deserializes from a buffer or reader.
|
|
@@ -33,6 +30,6 @@ import { PrivateKernelData } from './private_kernel_data.js';
|
|
|
33
30
|
* @returns The deserialized instance.
|
|
34
31
|
*/ static fromBuffer(buffer) {
|
|
35
32
|
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new PrivateKernelTailCircuitPrivateInputs(reader.readObject(PrivateKernelData), reader.readObject(PaddedSideEffectAmounts)
|
|
33
|
+
return new PrivateKernelTailCircuitPrivateInputs(reader.readObject(PrivateKernelData), reader.readObject(PaddedSideEffectAmounts));
|
|
37
34
|
}
|
|
38
35
|
}
|
|
@@ -4,7 +4,7 @@ import { AztecAddress } from '../aztec-address/index.js';
|
|
|
4
4
|
import { Gas } from '../gas/gas.js';
|
|
5
5
|
import type { PrivateLog } from '../logs/index.js';
|
|
6
6
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
7
|
-
import
|
|
7
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
8
8
|
import type { ScopedLogHash } from './log_hash.js';
|
|
9
9
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
10
10
|
import { PrivateToPublicKernelCircuitPublicInputs } from './private_to_public_kernel_circuit_public_inputs.js';
|
|
@@ -58,6 +58,7 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
58
58
|
* Data which is not modified by the circuits.
|
|
59
59
|
*/
|
|
60
60
|
constants: TxConstantData;
|
|
61
|
+
rollupValidationRequests: RollupValidationRequests;
|
|
61
62
|
/**
|
|
62
63
|
* The accumulated gas used after private execution.
|
|
63
64
|
* If the tx has a teardown call request, the teardown gas limits will also be included.
|
|
@@ -67,17 +68,13 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
67
68
|
* The address of the fee payer for the transaction.
|
|
68
69
|
*/
|
|
69
70
|
feePayer: AztecAddress;
|
|
70
|
-
/**
|
|
71
|
-
* The timestamp by which the transaction must be included in a block.
|
|
72
|
-
*/
|
|
73
|
-
includeByTimestamp: UInt64;
|
|
74
71
|
forPublic?: PartialPrivateTailPublicInputsForPublic | undefined;
|
|
75
72
|
forRollup?: PartialPrivateTailPublicInputsForRollup | undefined;
|
|
76
73
|
constructor(
|
|
77
74
|
/**
|
|
78
75
|
* Data which is not modified by the circuits.
|
|
79
76
|
*/
|
|
80
|
-
constants: TxConstantData,
|
|
77
|
+
constants: TxConstantData, rollupValidationRequests: RollupValidationRequests,
|
|
81
78
|
/**
|
|
82
79
|
* The accumulated gas used after private execution.
|
|
83
80
|
* If the tx has a teardown call request, the teardown gas limits will also be included.
|
|
@@ -86,11 +83,7 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
86
83
|
/**
|
|
87
84
|
* The address of the fee payer for the transaction.
|
|
88
85
|
*/
|
|
89
|
-
feePayer: AztecAddress,
|
|
90
|
-
/**
|
|
91
|
-
* The timestamp by which the transaction must be included in a block.
|
|
92
|
-
*/
|
|
93
|
-
includeByTimestamp: UInt64, forPublic?: PartialPrivateTailPublicInputsForPublic | undefined, forRollup?: PartialPrivateTailPublicInputsForRollup | undefined);
|
|
86
|
+
feePayer: AztecAddress, forPublic?: PartialPrivateTailPublicInputsForPublic | undefined, forRollup?: PartialPrivateTailPublicInputsForRollup | undefined);
|
|
94
87
|
static get schema(): import("zod").ZodType<PrivateKernelTailCircuitPublicInputs, any, string>;
|
|
95
88
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
96
89
|
getSize(): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_tail_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"private_kernel_tail_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,wCAAwC,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,wCAAwC,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,qBAAa,uCAAuC;IAEhD;;OAEG;IACI,4BAA4B,EAAE,8BAA8B;IACnE;;OAEG;IACI,yBAAyB,EAAE,8BAA8B;IAChE;;OAEG;IACI,yBAAyB,EAAE,iBAAiB;;IAXnD;;OAEG;IACI,4BAA4B,EAAE,8BAA8B;IACnE;;OAEG;IACI,yBAAyB,EAAE,8BAA8B;IAChE;;OAEG;IACI,yBAAyB,EAAE,iBAAiB;IAGrD,OAAO;IAQP,IAAI,UAAU,YAEb;IAED,IAAI,aAAa,YAEhB;IAED,IAAI,aAAa,YAEhB;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,uCAAuC;IASzF,QAAQ;IAQR,MAAM,CAAC,KAAK;CAOb;AAED,qBAAa,uCAAuC;IAC/B,GAAG,EAAE,8BAA8B;gBAAnC,GAAG,EAAE,8BAA8B;IAEtD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,uCAAuC;IAKzF,OAAO;IAIP,QAAQ;IAIR,MAAM,CAAC,KAAK;CAGb;AAED,qBAAa,oCAAoC;IAE7C;;OAEG;IACI,SAAS,EAAE,cAAc;IACzB,wBAAwB,EAAE,wBAAwB;IACzD;;;OAGG;IACI,OAAO,EAAE,GAAG;IACnB;;OAEG;IACI,QAAQ,EAAE,YAAY;IAEtB,SAAS,CAAC,EAAE,uCAAuC;IACnD,SAAS,CAAC,EAAE,uCAAuC;;IAhB1D;;OAEG;IACI,SAAS,EAAE,cAAc,EACzB,wBAAwB,EAAE,wBAAwB;IACzD;;;OAGG;IACI,OAAO,EAAE,GAAG;IACnB;;OAEG;IACI,QAAQ,EAAE,YAAY,EAEtB,SAAS,CAAC,EAAE,uCAAuC,YAAA,EACnD,SAAS,CAAC,EAAE,uCAAuC,YAAA;IAY5D,MAAM,KAAK,MAAM,6EAEhB;IAED,MAAM;IAIN,OAAO;IAUP,0CAA0C;IAe1C,0CAA0C;IAmB1C,0BAA0B;IAQ1B,uCAAuC;IAIvC,oCAAoC;IAIpC,4BAA4B;IAI5B,kCAAkC;IAMlC,+BAA+B;IAI/B,4BAA4B;IAK5B,qBAAqB;IAUrB,qBAAqB;IAUrB,sBAAsB;IAUtB,kCAAkC;IAUlC,iCAAiC;IASjC,2BAA2B;IAQ3B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,oCAAoC;IAatF,QAAQ;IAYR,MAAM,CAAC,KAAK;IAWZ;;;;OAIG;IACH,MAAM,CAAC,kBAAkB;CAY1B"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader,
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
import { Gas } from '../gas/gas.js';
|
|
6
6
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
7
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
7
8
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
8
9
|
import { PrivateToPublicKernelCircuitPublicInputs } from './private_to_public_kernel_circuit_public_inputs.js';
|
|
9
10
|
import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js';
|
|
10
11
|
import { PrivateToRollupKernelCircuitPublicInputs } from './private_to_rollup_kernel_circuit_public_inputs.js';
|
|
11
12
|
import { PublicCallRequest } from './public_call_request.js';
|
|
12
|
-
import { countAccumulatedItems } from './utils/order_and_comparison.js';
|
|
13
|
+
import { countAccumulatedItems, mergeAccumulatedData } from './utils/order_and_comparison.js';
|
|
13
14
|
export class PartialPrivateTailPublicInputsForPublic {
|
|
14
15
|
nonRevertibleAccumulatedData;
|
|
15
16
|
revertibleAccumulatedData;
|
|
@@ -69,25 +70,23 @@ export class PartialPrivateTailPublicInputsForRollup {
|
|
|
69
70
|
}
|
|
70
71
|
export class PrivateKernelTailCircuitPublicInputs {
|
|
71
72
|
constants;
|
|
73
|
+
rollupValidationRequests;
|
|
72
74
|
gasUsed;
|
|
73
75
|
feePayer;
|
|
74
|
-
includeByTimestamp;
|
|
75
76
|
forPublic;
|
|
76
77
|
forRollup;
|
|
77
78
|
constructor(/**
|
|
78
79
|
* Data which is not modified by the circuits.
|
|
79
|
-
*/ constants, /**
|
|
80
|
+
*/ constants, rollupValidationRequests, /**
|
|
80
81
|
* The accumulated gas used after private execution.
|
|
81
82
|
* If the tx has a teardown call request, the teardown gas limits will also be included.
|
|
82
83
|
*/ gasUsed, /**
|
|
83
84
|
* The address of the fee payer for the transaction.
|
|
84
|
-
*/ feePayer,
|
|
85
|
-
* The timestamp by which the transaction must be included in a block.
|
|
86
|
-
*/ includeByTimestamp, forPublic, forRollup){
|
|
85
|
+
*/ feePayer, forPublic, forRollup){
|
|
87
86
|
this.constants = constants;
|
|
87
|
+
this.rollupValidationRequests = rollupValidationRequests;
|
|
88
88
|
this.gasUsed = gasUsed;
|
|
89
89
|
this.feePayer = feePayer;
|
|
90
|
-
this.includeByTimestamp = includeByTimestamp;
|
|
91
90
|
this.forPublic = forPublic;
|
|
92
91
|
this.forRollup = forRollup;
|
|
93
92
|
if (!forPublic && !forRollup) {
|
|
@@ -104,21 +103,20 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
104
103
|
return this.toBuffer();
|
|
105
104
|
}
|
|
106
105
|
getSize() {
|
|
107
|
-
return (this.forPublic?.getSize() ?? 0) + (this.forRollup?.getSize() ?? 0) + this.constants.getSize() + this.
|
|
108
|
-
;
|
|
106
|
+
return (this.forPublic?.getSize() ?? 0) + (this.forRollup?.getSize() ?? 0) + this.constants.getSize() + this.rollupValidationRequests.getSize() + this.feePayer.size;
|
|
109
107
|
}
|
|
110
108
|
toPrivateToPublicKernelCircuitPublicInputs() {
|
|
111
109
|
if (!this.forPublic) {
|
|
112
110
|
throw new Error('Private tail public inputs is not for public circuit.');
|
|
113
111
|
}
|
|
114
|
-
return new PrivateToPublicKernelCircuitPublicInputs(this.constants, this.forPublic.nonRevertibleAccumulatedData, this.forPublic.revertibleAccumulatedData, this.forPublic.publicTeardownCallRequest, this.gasUsed, this.feePayer
|
|
112
|
+
return new PrivateToPublicKernelCircuitPublicInputs(this.constants, this.rollupValidationRequests, this.forPublic.nonRevertibleAccumulatedData, this.forPublic.revertibleAccumulatedData, this.forPublic.publicTeardownCallRequest, this.gasUsed, this.feePayer);
|
|
115
113
|
}
|
|
116
114
|
toPrivateToRollupKernelCircuitPublicInputs() {
|
|
117
115
|
if (!this.forRollup) {
|
|
118
116
|
throw new Error('Private tail public inputs is not for rollup circuit.');
|
|
119
117
|
}
|
|
120
118
|
const constants = new TxConstantData(this.constants.historicalHeader, this.constants.txContext, this.constants.vkTreeRoot, this.constants.protocolContractTreeRoot);
|
|
121
|
-
return new PrivateToRollupKernelCircuitPublicInputs(constants, this.forRollup.end, this.gasUsed, this.feePayer
|
|
119
|
+
return new PrivateToRollupKernelCircuitPublicInputs(constants, this.rollupValidationRequests, this.forRollup.end, this.gasUsed, this.feePayer);
|
|
122
120
|
}
|
|
123
121
|
numberOfPublicCallRequests() {
|
|
124
122
|
return this.numberOfNonRevertiblePublicCallRequests() + this.numberOfRevertiblePublicCallRequests() + (this.hasTeardownPublicCallRequest() ? 1 : 0);
|
|
@@ -143,19 +141,19 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
143
141
|
return !publicTeardownCallRequest?.isEmpty() ? publicTeardownCallRequest : undefined;
|
|
144
142
|
}
|
|
145
143
|
getNonEmptyNoteHashes() {
|
|
146
|
-
const noteHashes = this.forPublic ? this.forPublic.nonRevertibleAccumulatedData.noteHashes
|
|
144
|
+
const noteHashes = this.forPublic ? mergeAccumulatedData(this.forPublic.nonRevertibleAccumulatedData.noteHashes, this.forPublic.revertibleAccumulatedData.noteHashes) : this.forRollup.end.noteHashes;
|
|
147
145
|
return noteHashes.filter((n)=>!n.isZero());
|
|
148
146
|
}
|
|
149
147
|
getNonEmptyNullifiers() {
|
|
150
|
-
const nullifiers = this.forPublic ? this.forPublic.nonRevertibleAccumulatedData.nullifiers
|
|
148
|
+
const nullifiers = this.forPublic ? mergeAccumulatedData(this.forPublic.nonRevertibleAccumulatedData.nullifiers, this.forPublic.revertibleAccumulatedData.nullifiers) : this.forRollup.end.nullifiers;
|
|
151
149
|
return nullifiers.filter((n)=>!n.isZero());
|
|
152
150
|
}
|
|
153
151
|
getNonEmptyPrivateLogs() {
|
|
154
|
-
const privateLogs = this.forPublic ? this.forPublic.nonRevertibleAccumulatedData.privateLogs
|
|
152
|
+
const privateLogs = this.forPublic ? mergeAccumulatedData(this.forPublic.nonRevertibleAccumulatedData.privateLogs, this.forPublic.revertibleAccumulatedData.privateLogs) : this.forRollup.end.privateLogs;
|
|
155
153
|
return privateLogs.filter((n)=>!n.isEmpty());
|
|
156
154
|
}
|
|
157
155
|
getNonEmptyContractClassLogsHashes() {
|
|
158
|
-
const contractClassLogsHashes = this.forPublic ? this.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes
|
|
156
|
+
const contractClassLogsHashes = this.forPublic ? mergeAccumulatedData(this.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes, this.forPublic.revertibleAccumulatedData.contractClassLogsHashes) : this.forRollup.end.contractClassLogsHashes;
|
|
159
157
|
return contractClassLogsHashes.filter((h)=>!h.isEmpty());
|
|
160
158
|
}
|
|
161
159
|
getEmittedContractClassLogsLength() {
|
|
@@ -169,14 +167,14 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
169
167
|
static fromBuffer(buffer) {
|
|
170
168
|
const reader = BufferReader.asReader(buffer);
|
|
171
169
|
const isForPublic = reader.readBoolean();
|
|
172
|
-
return new PrivateKernelTailCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(
|
|
170
|
+
return new PrivateKernelTailCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(RollupValidationRequests), reader.readObject(Gas), reader.readObject(AztecAddress), isForPublic ? reader.readObject(PartialPrivateTailPublicInputsForPublic) : undefined, !isForPublic ? reader.readObject(PartialPrivateTailPublicInputsForRollup) : undefined);
|
|
173
171
|
}
|
|
174
172
|
toBuffer() {
|
|
175
173
|
const isForPublic = !!this.forPublic;
|
|
176
|
-
return serializeToBuffer(isForPublic, this.constants, this.
|
|
174
|
+
return serializeToBuffer(isForPublic, this.constants, this.rollupValidationRequests, this.gasUsed, this.feePayer, isForPublic ? this.forPublic.toBuffer() : this.forRollup.toBuffer());
|
|
177
175
|
}
|
|
178
176
|
static empty() {
|
|
179
|
-
return new PrivateKernelTailCircuitPublicInputs(TxConstantData.empty(), Gas.empty(), AztecAddress.ZERO,
|
|
177
|
+
return new PrivateKernelTailCircuitPublicInputs(TxConstantData.empty(), RollupValidationRequests.empty(), Gas.empty(), AztecAddress.ZERO, undefined, PartialPrivateTailPublicInputsForRollup.empty());
|
|
180
178
|
}
|
|
181
179
|
/**
|
|
182
180
|
* Creates an empty instance except for a nullifier in the combined accumulated data.
|
|
@@ -185,6 +183,6 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
185
183
|
*/ static emptyWithNullifier() {
|
|
186
184
|
const data = PrivateToRollupAccumulatedData.empty();
|
|
187
185
|
data.nullifiers[0] = Fr.random();
|
|
188
|
-
return new PrivateKernelTailCircuitPublicInputs(TxConstantData.empty(), Gas.empty(), AztecAddress.ZERO,
|
|
186
|
+
return new PrivateKernelTailCircuitPublicInputs(TxConstantData.empty(), RollupValidationRequests.empty(), Gas.empty(), AztecAddress.ZERO, undefined, new PartialPrivateTailPublicInputsForRollup(data));
|
|
189
187
|
}
|
|
190
188
|
}
|
|
@@ -4,20 +4,20 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
4
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
import { Gas } from '../gas/gas.js';
|
|
6
6
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
7
|
-
import
|
|
7
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
8
8
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
9
9
|
import { PublicCallRequest } from './public_call_request.js';
|
|
10
10
|
export declare class PrivateToPublicKernelCircuitPublicInputs {
|
|
11
11
|
constants: TxConstantData;
|
|
12
|
+
rollupValidationRequests: RollupValidationRequests;
|
|
12
13
|
nonRevertibleAccumulatedData: PrivateToPublicAccumulatedData;
|
|
13
14
|
revertibleAccumulatedData: PrivateToPublicAccumulatedData;
|
|
14
15
|
publicTeardownCallRequest: PublicCallRequest;
|
|
15
16
|
gasUsed: Gas;
|
|
16
17
|
feePayer: AztecAddress;
|
|
17
|
-
|
|
18
|
-
constructor(constants: TxConstantData, nonRevertibleAccumulatedData: PrivateToPublicAccumulatedData, revertibleAccumulatedData: PrivateToPublicAccumulatedData, publicTeardownCallRequest: PublicCallRequest, gasUsed: Gas, feePayer: AztecAddress, includeByTimestamp: UInt64);
|
|
18
|
+
constructor(constants: TxConstantData, rollupValidationRequests: RollupValidationRequests, nonRevertibleAccumulatedData: PrivateToPublicAccumulatedData, revertibleAccumulatedData: PrivateToPublicAccumulatedData, publicTeardownCallRequest: PublicCallRequest, gasUsed: Gas, feePayer: AztecAddress);
|
|
19
19
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
20
|
-
static getFields(fields: FieldsOf<PrivateToPublicKernelCircuitPublicInputs>): readonly [TxConstantData, PrivateToPublicAccumulatedData, PrivateToPublicAccumulatedData, PublicCallRequest, Gas, AztecAddress
|
|
20
|
+
static getFields(fields: FieldsOf<PrivateToPublicKernelCircuitPublicInputs>): readonly [TxConstantData, RollupValidationRequests, PrivateToPublicAccumulatedData, PrivateToPublicAccumulatedData, PublicCallRequest, Gas, AztecAddress];
|
|
21
21
|
static fromBuffer(buffer: Buffer | BufferReader): PrivateToPublicKernelCircuitPublicInputs;
|
|
22
22
|
static empty(): PrivateToPublicKernelCircuitPublicInputs;
|
|
23
23
|
static fromString(str: string): PrivateToPublicKernelCircuitPublicInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_to_public_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_to_public_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"private_to_public_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_to_public_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAwC,MAAM,6BAA6B,CAAC;AAEjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,qBAAa,wCAAwC;IAE1C,SAAS,EAAE,cAAc;IACzB,wBAAwB,EAAE,wBAAwB;IAClD,4BAA4B,EAAE,8BAA8B;IAC5D,yBAAyB,EAAE,8BAA8B;IACzD,yBAAyB,EAAE,iBAAiB;IAC5C,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,YAAY;gBANtB,SAAS,EAAE,cAAc,EACzB,wBAAwB,EAAE,wBAAwB,EAClD,4BAA4B,EAAE,8BAA8B,EAC5D,yBAAyB,EAAE,8BAA8B,EACzD,yBAAyB,EAAE,iBAAiB,EAC5C,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,YAAY;IAG/B,QAAQ;IAYR,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,wCAAwC,CAAC;IAY3E,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAa/C,MAAM,CAAC,KAAK;IAYZ,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;IAIR,QAAQ,IAAI,EAAE,EAAE;IAUhB,IAAI;CAGL"}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
import { GeneratorIndex, PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
3
|
-
import { BufferReader,
|
|
3
|
+
import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
4
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
6
|
import { Gas } from '../gas/gas.js';
|
|
7
7
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
8
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
8
9
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
9
10
|
import { PublicCallRequest } from './public_call_request.js';
|
|
10
11
|
export class PrivateToPublicKernelCircuitPublicInputs {
|
|
11
12
|
constants;
|
|
13
|
+
rollupValidationRequests;
|
|
12
14
|
nonRevertibleAccumulatedData;
|
|
13
15
|
revertibleAccumulatedData;
|
|
14
16
|
publicTeardownCallRequest;
|
|
15
17
|
gasUsed;
|
|
16
18
|
feePayer;
|
|
17
|
-
|
|
18
|
-
constructor(constants, nonRevertibleAccumulatedData, revertibleAccumulatedData, publicTeardownCallRequest, gasUsed, feePayer, includeByTimestamp){
|
|
19
|
+
constructor(constants, rollupValidationRequests, nonRevertibleAccumulatedData, revertibleAccumulatedData, publicTeardownCallRequest, gasUsed, feePayer){
|
|
19
20
|
this.constants = constants;
|
|
21
|
+
this.rollupValidationRequests = rollupValidationRequests;
|
|
20
22
|
this.nonRevertibleAccumulatedData = nonRevertibleAccumulatedData;
|
|
21
23
|
this.revertibleAccumulatedData = revertibleAccumulatedData;
|
|
22
24
|
this.publicTeardownCallRequest = publicTeardownCallRequest;
|
|
23
25
|
this.gasUsed = gasUsed;
|
|
24
26
|
this.feePayer = feePayer;
|
|
25
|
-
this.includeByTimestamp = includeByTimestamp;
|
|
26
27
|
}
|
|
27
28
|
toBuffer() {
|
|
28
|
-
return serializeToBuffer(this.constants, this.nonRevertibleAccumulatedData, this.revertibleAccumulatedData, this.publicTeardownCallRequest, this.gasUsed, this.feePayer
|
|
29
|
+
return serializeToBuffer(this.constants, this.rollupValidationRequests, this.nonRevertibleAccumulatedData, this.revertibleAccumulatedData, this.publicTeardownCallRequest, this.gasUsed, this.feePayer);
|
|
29
30
|
}
|
|
30
31
|
static getFields(fields) {
|
|
31
32
|
return [
|
|
32
33
|
fields.constants,
|
|
34
|
+
fields.rollupValidationRequests,
|
|
33
35
|
fields.nonRevertibleAccumulatedData,
|
|
34
36
|
fields.revertibleAccumulatedData,
|
|
35
37
|
fields.publicTeardownCallRequest,
|
|
36
38
|
fields.gasUsed,
|
|
37
|
-
fields.feePayer
|
|
38
|
-
fields.includeByTimestamp
|
|
39
|
+
fields.feePayer
|
|
39
40
|
];
|
|
40
41
|
}
|
|
41
42
|
static fromBuffer(buffer) {
|
|
42
43
|
const reader = BufferReader.asReader(buffer);
|
|
43
|
-
return new PrivateToPublicKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(
|
|
44
|
+
return new PrivateToPublicKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(RollupValidationRequests), reader.readObject(PrivateToPublicAccumulatedData), reader.readObject(PrivateToPublicAccumulatedData), reader.readObject(PublicCallRequest), reader.readObject(Gas), reader.readObject(AztecAddress));
|
|
44
45
|
}
|
|
45
46
|
static empty() {
|
|
46
|
-
return new PrivateToPublicKernelCircuitPublicInputs(TxConstantData.empty(), PrivateToPublicAccumulatedData.empty(), PrivateToPublicAccumulatedData.empty(), PublicCallRequest.empty(), Gas.empty(), AztecAddress.ZERO
|
|
47
|
+
return new PrivateToPublicKernelCircuitPublicInputs(TxConstantData.empty(), RollupValidationRequests.empty(), PrivateToPublicAccumulatedData.empty(), PrivateToPublicAccumulatedData.empty(), PublicCallRequest.empty(), Gas.empty(), AztecAddress.ZERO);
|
|
47
48
|
}
|
|
48
49
|
static fromString(str) {
|
|
49
50
|
return PrivateToPublicKernelCircuitPublicInputs.fromBuffer(hexToBuffer(str));
|
|
@@ -4,7 +4,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
4
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
import { Gas } from '../gas/gas.js';
|
|
6
6
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
7
|
-
import
|
|
7
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
8
8
|
import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js';
|
|
9
9
|
/**
|
|
10
10
|
* Outputs from the public kernel circuits.
|
|
@@ -15,6 +15,10 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
15
15
|
* Data which is not modified by the circuits.
|
|
16
16
|
*/
|
|
17
17
|
constants: TxConstantData;
|
|
18
|
+
/**
|
|
19
|
+
* Validation requests accumulated from private and public execution to be completed by the rollup.
|
|
20
|
+
*/
|
|
21
|
+
rollupValidationRequests: RollupValidationRequests;
|
|
18
22
|
/**
|
|
19
23
|
* Data accumulated from both public and private circuits.
|
|
20
24
|
*/
|
|
@@ -27,15 +31,15 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
27
31
|
* The address of the fee payer for the transaction.
|
|
28
32
|
*/
|
|
29
33
|
feePayer: AztecAddress;
|
|
30
|
-
/**
|
|
31
|
-
* The timestamp by which the transaction must be included in a block.
|
|
32
|
-
*/
|
|
33
|
-
includeByTimestamp: UInt64;
|
|
34
34
|
constructor(
|
|
35
35
|
/**
|
|
36
36
|
* Data which is not modified by the circuits.
|
|
37
37
|
*/
|
|
38
38
|
constants: TxConstantData,
|
|
39
|
+
/**
|
|
40
|
+
* Validation requests accumulated from private and public execution to be completed by the rollup.
|
|
41
|
+
*/
|
|
42
|
+
rollupValidationRequests: RollupValidationRequests,
|
|
39
43
|
/**
|
|
40
44
|
* Data accumulated from both public and private circuits.
|
|
41
45
|
*/
|
|
@@ -47,11 +51,7 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
47
51
|
/**
|
|
48
52
|
* The address of the fee payer for the transaction.
|
|
49
53
|
*/
|
|
50
|
-
feePayer: AztecAddress
|
|
51
|
-
/**
|
|
52
|
-
* The timestamp by which the transaction must be included in a block.
|
|
53
|
-
*/
|
|
54
|
-
includeByTimestamp: UInt64);
|
|
54
|
+
feePayer: AztecAddress);
|
|
55
55
|
getNonEmptyNullifiers(): Fr[];
|
|
56
56
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
57
57
|
/**
|
|
@@ -65,7 +65,7 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
65
65
|
static fromString(str: string): PrivateToRollupKernelCircuitPublicInputs;
|
|
66
66
|
/** Returns a hex representation for JSON serialization. */
|
|
67
67
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
68
|
-
static getFields(fields: FieldsOf<PrivateToRollupKernelCircuitPublicInputs>): readonly [TxConstantData, PrivateToRollupAccumulatedData, Gas, AztecAddress
|
|
68
|
+
static getFields(fields: FieldsOf<PrivateToRollupKernelCircuitPublicInputs>): readonly [TxConstantData, RollupValidationRequests, PrivateToRollupAccumulatedData, Gas, AztecAddress];
|
|
69
69
|
/** Creates an instance from a hex string. */
|
|
70
70
|
static get schema(): import("zod").ZodType<PrivateToRollupKernelCircuitPublicInputs, any, string>;
|
|
71
71
|
toFields(): Fr[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_to_rollup_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"private_to_rollup_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAwC,MAAM,6BAA6B,CAAC;AAEjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AAEzF;;;GAGG;AACH,qBAAa,wCAAwC;IAEjD;;OAEG;IACI,SAAS,EAAE,cAAc;IAChC;;OAEG;IACI,wBAAwB,EAAE,wBAAwB;IACzD;;OAEG;IACI,GAAG,EAAE,8BAA8B;IAC1C;;OAEG;IACI,OAAO,EAAE,GAAG;IACnB;;OAEG;IACI,QAAQ,EAAE,YAAY;;IAnB7B;;OAEG;IACI,SAAS,EAAE,cAAc;IAChC;;OAEG;IACI,wBAAwB,EAAE,wBAAwB;IACzD;;OAEG;IACI,GAAG,EAAE,8BAA8B;IAC1C;;OAEG;IACI,OAAO,EAAE,GAAG;IACnB;;OAEG;IACI,QAAQ,EAAE,YAAY;IAG/B,qBAAqB;IAIrB,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,wCAAwC;IAW1F,MAAM,CAAC,KAAK;IAUZ,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,2DAA2D;IAC3D,MAAM;IAIN,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,wCAAwC,CAAC;IAI3E,6CAA6C;IAC7C,MAAM,KAAK,MAAM,iFAEhB;IAED,QAAQ,IAAI,EAAE,EAAE;IAUhB,IAAI;CAGL"}
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { GeneratorIndex, PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
|
-
import { BufferReader,
|
|
4
|
+
import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
5
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
6
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
7
|
import { Gas } from '../gas/gas.js';
|
|
8
8
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
9
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
9
10
|
import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js';
|
|
10
11
|
/**
|
|
11
12
|
* Outputs from the public kernel circuits.
|
|
12
13
|
* All Public kernels use this shape for outputs.
|
|
13
14
|
*/ export class PrivateToRollupKernelCircuitPublicInputs {
|
|
14
15
|
constants;
|
|
16
|
+
rollupValidationRequests;
|
|
15
17
|
end;
|
|
16
18
|
gasUsed;
|
|
17
19
|
feePayer;
|
|
18
|
-
includeByTimestamp;
|
|
19
20
|
constructor(/**
|
|
20
21
|
* Data which is not modified by the circuits.
|
|
21
22
|
*/ constants, /**
|
|
23
|
+
* Validation requests accumulated from private and public execution to be completed by the rollup.
|
|
24
|
+
*/ rollupValidationRequests, /**
|
|
22
25
|
* Data accumulated from both public and private circuits.
|
|
23
26
|
*/ end, /**
|
|
24
27
|
* Gas used during this transaction
|
|
25
28
|
*/ gasUsed, /**
|
|
26
29
|
* The address of the fee payer for the transaction.
|
|
27
|
-
*/ feePayer
|
|
28
|
-
* The timestamp by which the transaction must be included in a block.
|
|
29
|
-
*/ includeByTimestamp){
|
|
30
|
+
*/ feePayer){
|
|
30
31
|
this.constants = constants;
|
|
32
|
+
this.rollupValidationRequests = rollupValidationRequests;
|
|
31
33
|
this.end = end;
|
|
32
34
|
this.gasUsed = gasUsed;
|
|
33
35
|
this.feePayer = feePayer;
|
|
34
|
-
this.includeByTimestamp = includeByTimestamp;
|
|
35
36
|
}
|
|
36
37
|
getNonEmptyNullifiers() {
|
|
37
38
|
return this.end.nullifiers.filter((n)=>!n.isZero());
|
|
38
39
|
}
|
|
39
40
|
toBuffer() {
|
|
40
|
-
return serializeToBuffer(this.constants, this.
|
|
41
|
+
return serializeToBuffer(this.constants, this.rollupValidationRequests, this.end, this.gasUsed, this.feePayer);
|
|
41
42
|
}
|
|
42
43
|
/**
|
|
43
44
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
@@ -45,10 +46,10 @@ import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_
|
|
|
45
46
|
* @returns A new instance of PrivateToRollupKernelCircuitPublicInputs.
|
|
46
47
|
*/ static fromBuffer(buffer) {
|
|
47
48
|
const reader = BufferReader.asReader(buffer);
|
|
48
|
-
return new PrivateToRollupKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(
|
|
49
|
+
return new PrivateToRollupKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(RollupValidationRequests), reader.readObject(PrivateToRollupAccumulatedData), reader.readObject(Gas), reader.readObject(AztecAddress));
|
|
49
50
|
}
|
|
50
51
|
static empty() {
|
|
51
|
-
return new PrivateToRollupKernelCircuitPublicInputs(TxConstantData.empty(), PrivateToRollupAccumulatedData.empty(), Gas.empty(), AztecAddress.ZERO
|
|
52
|
+
return new PrivateToRollupKernelCircuitPublicInputs(TxConstantData.empty(), RollupValidationRequests.empty(), PrivateToRollupAccumulatedData.empty(), Gas.empty(), AztecAddress.ZERO);
|
|
52
53
|
}
|
|
53
54
|
toString() {
|
|
54
55
|
return bufferToHex(this.toBuffer());
|
|
@@ -62,10 +63,10 @@ import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_
|
|
|
62
63
|
static getFields(fields) {
|
|
63
64
|
return [
|
|
64
65
|
fields.constants,
|
|
66
|
+
fields.rollupValidationRequests,
|
|
65
67
|
fields.end,
|
|
66
68
|
fields.gasUsed,
|
|
67
|
-
fields.feePayer
|
|
68
|
-
fields.includeByTimestamp
|
|
69
|
+
fields.feePayer
|
|
69
70
|
];
|
|
70
71
|
}
|
|
71
72
|
/** Creates an instance from a hex string. */ static get schema() {
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
import { MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import {
|
|
2
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
|
|
3
4
|
import { inspect } from 'util';
|
|
4
5
|
import { ScopedKeyValidationRequestAndGenerator } from '../kernel/hints/scoped_key_validation_request_and_generator.js';
|
|
5
|
-
import { ClaimedLengthArray } from './claimed_length_array.js';
|
|
6
6
|
import { ScopedReadRequest } from './hints/read_request.js';
|
|
7
|
+
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
7
8
|
import { OptionalNumber } from './utils/optional_number.js';
|
|
8
9
|
/**
|
|
9
10
|
* Validation requests accumulated during the execution of the transaction.
|
|
10
11
|
*/
|
|
11
12
|
export declare class PrivateValidationRequests {
|
|
13
|
+
/**
|
|
14
|
+
* Validation requests that cannot be fulfilled in the current context (private or public), and must be instead be
|
|
15
|
+
* forwarded to the rollup for it to take care of them.
|
|
16
|
+
*/
|
|
17
|
+
forRollup: RollupValidationRequests;
|
|
12
18
|
/**
|
|
13
19
|
* All the read requests made in this transaction.
|
|
14
20
|
*/
|
|
15
|
-
noteHashReadRequests:
|
|
21
|
+
noteHashReadRequests: Tuple<ScopedReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX>;
|
|
16
22
|
/**
|
|
17
23
|
* All the nullifier read requests made in this transaction.
|
|
18
24
|
*/
|
|
19
|
-
nullifierReadRequests:
|
|
25
|
+
nullifierReadRequests: Tuple<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>;
|
|
20
26
|
/**
|
|
21
27
|
* All the key validation requests made in this transaction.
|
|
22
28
|
*/
|
|
23
|
-
scopedKeyValidationRequestsAndGenerators:
|
|
29
|
+
scopedKeyValidationRequestsAndGenerators: Tuple<ScopedKeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>;
|
|
24
30
|
/**
|
|
25
31
|
* The counter to split the data for squashing.
|
|
26
32
|
* A revertible nullifier and a non-revertible note hash will not be squashed.
|
|
@@ -28,18 +34,23 @@ export declare class PrivateValidationRequests {
|
|
|
28
34
|
*/
|
|
29
35
|
splitCounter: OptionalNumber;
|
|
30
36
|
constructor(
|
|
37
|
+
/**
|
|
38
|
+
* Validation requests that cannot be fulfilled in the current context (private or public), and must be instead be
|
|
39
|
+
* forwarded to the rollup for it to take care of them.
|
|
40
|
+
*/
|
|
41
|
+
forRollup: RollupValidationRequests,
|
|
31
42
|
/**
|
|
32
43
|
* All the read requests made in this transaction.
|
|
33
44
|
*/
|
|
34
|
-
noteHashReadRequests:
|
|
45
|
+
noteHashReadRequests: Tuple<ScopedReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX>,
|
|
35
46
|
/**
|
|
36
47
|
* All the nullifier read requests made in this transaction.
|
|
37
48
|
*/
|
|
38
|
-
nullifierReadRequests:
|
|
49
|
+
nullifierReadRequests: Tuple<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>,
|
|
39
50
|
/**
|
|
40
51
|
* All the key validation requests made in this transaction.
|
|
41
52
|
*/
|
|
42
|
-
scopedKeyValidationRequestsAndGenerators:
|
|
53
|
+
scopedKeyValidationRequestsAndGenerators: Tuple<ScopedKeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>,
|
|
43
54
|
/**
|
|
44
55
|
* The counter to split the data for squashing.
|
|
45
56
|
* A revertible nullifier and a non-revertible note hash will not be squashed.
|
|
@@ -49,6 +60,7 @@ export declare class PrivateValidationRequests {
|
|
|
49
60
|
getSize(): number;
|
|
50
61
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
51
62
|
toString(): `0x${string}`;
|
|
63
|
+
static fromFields(fields: Fr[] | FieldReader): PrivateValidationRequests;
|
|
52
64
|
/**
|
|
53
65
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
54
66
|
* @param buffer - Buffer or reader to read from.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_validation_requests.d.ts","sourceRoot":"","sources":["../../src/kernel/private_validation_requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"private_validation_requests.d.ts","sourceRoot":"","sources":["../../src/kernel/private_validation_requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC,EACnC,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAGvG,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,sCAAsC,EAAE,MAAM,gEAAgE,CAAC;AACxH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;GAEG;AACH,qBAAa,yBAAyB;IAElC;;;OAGG;IACI,SAAS,EAAE,wBAAwB;IAC1C;;OAEG;IACI,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAChG;;OAEG;IACI,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IACjG;;OAEG;IACI,wCAAwC,EAAE,KAAK,CACpD,sCAAsC,EACtC,OAAO,kCAAkC,CAC1C;IACD;;;;OAIG;IACI,YAAY,EAAE,cAAc;;IAzBnC;;;OAGG;IACI,SAAS,EAAE,wBAAwB;IAC1C;;OAEG;IACI,oBAAoB,EAAE,KAAK,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAChG;;OAEG;IACI,qBAAqB,EAAE,KAAK,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IACjG;;OAEG;IACI,wCAAwC,EAAE,KAAK,CACpD,sCAAsC,EACtC,OAAO,kCAAkC,CAC1C;IACD;;;;OAIG;IACI,YAAY,EAAE,cAAc;IAGrC,OAAO;IAUP,QAAQ;IAUR,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAW5C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAW/C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;IAUZ,CAAC,OAAO,CAAC,MAAM,CAAC;CAkBjB"}
|