@aztec/stdlib 1.2.1 → 2.0.0-nightly.20250813
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 +0 -67
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +1 -14
- package/dest/abi/authorization_selector.d.ts +52 -0
- package/dest/abi/authorization_selector.d.ts.map +1 -0
- package/dest/abi/authorization_selector.js +70 -0
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +0 -40
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +3 -6
- package/dest/abi/index.d.ts +1 -0
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/avm/avm.d.ts +278 -412
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +12 -12
- package/dest/avm/avm_proving_request.d.ts +160 -186
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/l2_block.d.ts +8 -0
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +9 -0
- package/dest/block/l2_block_source.d.ts +446 -2
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +29 -0
- package/dest/block/proposal/committee_attestation.d.ts +3 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.js +3 -0
- package/dest/block/published_l2_block.d.ts +2 -1
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +6 -1
- package/dest/contract/contract_instance.d.ts +3 -3
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +3 -3
- package/dest/contract/interfaces/contract_class.d.ts +2 -2
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts +9 -9
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
- package/dest/contract/interfaces/protocol_contract_addresses.js +4 -4
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.js +1 -1
- package/dest/contract/utility_function_membership_proof.d.ts +1 -1
- package/dest/contract/utility_function_membership_proof.js +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +20 -0
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -0
- package/dest/{shared_mutable/shared_mutable_values.js → delayed_public_mutable/delayed_public_mutable_values.js} +9 -9
- package/dest/{shared_mutable/shared_mutable_values_with_hash.d.ts → delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts} +6 -6
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -0
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.js +30 -0
- package/dest/delayed_public_mutable/index.d.ts +5 -0
- package/dest/delayed_public_mutable/index.d.ts.map +1 -0
- package/dest/delayed_public_mutable/index.js +4 -0
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -0
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -0
- package/dest/gas/gas.d.ts +1 -0
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +3 -0
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +1 -4
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +4 -2
- package/dest/interfaces/aztec-node-admin.d.ts +210 -8
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +8 -3
- package/dest/interfaces/configs.d.ts +27 -0
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +6 -1
- package/dest/interfaces/get_logs_response.d.ts +1 -1
- package/dest/interfaces/proving-job.d.ts +166 -192
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +3 -1
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +1 -1
- package/dest/interfaces/server.d.ts +1 -1
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +1 -1
- package/dest/interfaces/slasher.d.ts +21 -0
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +6 -1
- package/dest/interfaces/tx_provider.d.ts +24 -0
- package/dest/interfaces/tx_provider.d.ts.map +1 -0
- package/dest/kernel/claimed_length_array.d.ts +34 -0
- package/dest/kernel/claimed_length_array.d.ts.map +1 -0
- package/dest/kernel/claimed_length_array.js +58 -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 +18 -20
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +7 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +17 -32
- package/dest/kernel/hints/build_transient_data_hints.d.ts +4 -3
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -10
- package/dest/kernel/hints/index.d.ts +1 -2
- package/dest/kernel/hints/index.d.ts.map +1 -1
- package/dest/kernel/hints/index.js +1 -2
- 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/private_kernel_reset_hints.d.ts +5 -5
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.js +9 -9
- 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/{transient_data_index_hint.d.ts → transient_data_squashing_hint.d.ts} +5 -5
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -0
- package/dest/kernel/hints/{transient_data_index_hint.js → transient_data_squashing_hint.js} +5 -5
- 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/private_accumulated_data.d.ts +16 -15
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_call_data.d.ts +4 -4
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.js +2 -2
- package/dest/kernel/private_circuit_public_inputs.d.ts +26 -25
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +33 -15
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +9 -0
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +8 -4
- 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 +9 -6
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +11 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +20 -18
- 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 +9 -10
- 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 +11 -12
- package/dest/kernel/private_validation_requests.d.ts +8 -20
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +9 -21
- package/dest/kernel/utils/order_and_comparison.d.ts +0 -3
- package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.js +0 -19
- package/dest/logs/extended_public_log.d.ts +1 -1
- package/dest/logs/shared_secret_derivation.d.ts +1 -1
- package/dest/logs/shared_secret_derivation.js +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +4 -1
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +49 -54
- package/dest/messaging/l2_to_l1_message.d.ts +2 -0
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +7 -0
- package/dest/note/notes_filter.d.ts +5 -2
- package/dest/note/notes_filter.d.ts.map +1 -1
- package/dest/note/notes_filter.js +1 -1
- package/dest/p2p/attestation_utils.d.ts +10 -0
- package/dest/p2p/attestation_utils.d.ts.map +1 -0
- package/dest/p2p/attestation_utils.js +21 -0
- package/dest/p2p/block_attestation.d.ts +3 -4
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +3 -4
- package/dest/p2p/block_proposal.d.ts +8 -1
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +21 -8
- package/dest/p2p/consensus_payload.d.ts +3 -11
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +13 -22
- package/dest/p2p/index.d.ts +1 -0
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +5 -3
- package/dest/rollup/block_root_rollup.d.ts +1 -1
- package/dest/slashing/index.d.ts +51 -0
- package/dest/slashing/index.d.ts.map +1 -0
- package/dest/slashing/index.js +54 -0
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +0 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +25 -24
- package/dest/tests/mocks.d.ts +2 -0
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +31 -22
- package/dest/tx/index.d.ts +0 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.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/processed_tx.d.ts +2 -2
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +4 -4
- package/dest/tx/proven_tx.d.ts +1 -1
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +7 -3
- package/dest/tx/simulated_tx.d.ts +11 -17
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +12 -12
- package/dest/tx/tx.d.ts +25 -25
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +60 -48
- package/dest/tx/tx_effect.d.ts +2 -2
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +3 -18
- package/dest/tx/tx_execution_request.js +2 -2
- package/dest/tx/tx_hash.d.ts +7 -0
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_hash.js +19 -1
- package/dest/tx/tx_request.d.ts +5 -5
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/tx_request.js +7 -7
- package/dest/tx/validator/error_texts.d.ts +1 -0
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -0
- package/dest/tx/validator/tx_validator.d.ts +6 -4
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +3 -0
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +4 -4
- package/package.json +10 -9
- package/src/abi/abi.ts +0 -38
- package/src/abi/authorization_selector.ts +95 -0
- package/src/abi/contract_artifact.ts +0 -49
- package/src/abi/decoder.ts +3 -6
- package/src/abi/index.ts +1 -0
- package/src/avm/avm.ts +7 -9
- package/src/block/l2_block.ts +18 -0
- package/src/block/l2_block_source.ts +70 -1
- package/src/block/proposal/committee_attestation.ts +5 -1
- package/src/block/published_l2_block.ts +14 -5
- package/src/contract/contract_instance.ts +3 -3
- package/src/contract/interfaces/protocol_contract_addresses.ts +5 -10
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/contract/utility_function_membership_proof.ts +1 -1
- package/src/{shared_mutable/shared_mutable_values.ts → delayed_public_mutable/delayed_public_mutable_values.ts} +10 -10
- package/src/delayed_public_mutable/delayed_public_mutable_values_with_hash.ts +38 -0
- package/src/delayed_public_mutable/index.ts +4 -0
- package/src/gas/gas.ts +4 -0
- package/src/hash/hash.ts +1 -4
- package/src/interfaces/archiver.ts +3 -1
- package/src/interfaces/aztec-node-admin.ts +18 -11
- package/src/interfaces/configs.ts +17 -0
- package/src/interfaces/pxe.ts +4 -2
- package/src/interfaces/server.ts +1 -1
- package/src/interfaces/slasher.ts +11 -0
- package/src/interfaces/tx_provider.ts +16 -0
- package/src/kernel/claimed_length_array.ts +104 -0
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +28 -30
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +28 -59
- package/src/kernel/hints/build_transient_data_hints.ts +12 -14
- package/src/kernel/hints/index.ts +1 -2
- package/src/kernel/hints/note_hash_read_request_hints.ts +4 -16
- package/src/kernel/hints/nullifier_read_request_hints.ts +4 -16
- package/src/kernel/hints/private_kernel_reset_hints.ts +7 -7
- package/src/kernel/hints/read_request_hints.ts +22 -22
- package/src/kernel/hints/{transient_data_index_hint.ts → transient_data_squashing_hint.ts} +5 -5
- package/src/kernel/index.ts +1 -0
- package/src/kernel/private_accumulated_data.ts +23 -23
- package/src/kernel/private_call_data.ts +3 -3
- package/src/kernel/private_circuit_public_inputs.ts +92 -68
- package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -1
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +13 -4
- 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 +16 -10
- package/src/kernel/private_validation_requests.ts +19 -50
- package/src/kernel/utils/order_and_comparison.ts +0 -25
- package/src/logs/shared_secret_derivation.ts +1 -1
- package/src/messaging/l2_to_l1_membership.ts +76 -85
- package/src/messaging/l2_to_l1_message.ts +9 -0
- package/src/note/notes_filter.ts +6 -3
- package/src/p2p/attestation_utils.ts +35 -0
- package/src/p2p/block_attestation.ts +3 -4
- package/src/p2p/block_proposal.ts +23 -5
- package/src/p2p/consensus_payload.ts +10 -29
- package/src/p2p/index.ts +1 -0
- package/src/p2p/topic_type.ts +3 -1
- package/src/slashing/index.ts +74 -0
- package/src/stats/stats.ts +2 -2
- package/src/tests/factories.ts +37 -27
- package/src/tests/mocks.ts +24 -22
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +11 -9
- package/src/tx/processed_tx.ts +6 -6
- package/src/tx/proven_tx.ts +7 -8
- package/src/tx/simulated_tx.ts +13 -19
- package/src/tx/tx.ts +70 -57
- package/src/tx/tx_effect.ts +5 -20
- package/src/tx/tx_execution_request.ts +2 -2
- package/src/tx/tx_hash.ts +21 -1
- package/src/tx/tx_request.ts +7 -6
- package/src/tx/validator/error_texts.ts +1 -0
- package/src/tx/validator/tx_validator.ts +5 -0
- package/src/versioning/versioning.ts +0 -3
- package/src/vks/verification_key.ts +4 -7
- package/dest/interfaces/tx-collector.d.ts +0 -15
- package/dest/interfaces/tx-collector.d.ts.map +0 -1
- package/dest/kernel/hints/rollup_validation_requests.d.ts +0 -34
- package/dest/kernel/hints/rollup_validation_requests.d.ts.map +0 -1
- package/dest/kernel/hints/rollup_validation_requests.js +0 -55
- package/dest/kernel/hints/transient_data_index_hint.d.ts.map +0 -1
- package/dest/shared_mutable/index.d.ts +0 -5
- package/dest/shared_mutable/index.d.ts.map +0 -1
- package/dest/shared_mutable/index.js +0 -4
- package/dest/shared_mutable/scheduled_delay_change.d.ts.map +0 -1
- package/dest/shared_mutable/scheduled_value_change.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values.d.ts +0 -20
- package/dest/shared_mutable/shared_mutable_values.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values_with_hash.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values_with_hash.js +0 -30
- package/dest/tx/include_by_timestamp.d.ts +0 -54
- package/dest/tx/include_by_timestamp.d.ts.map +0 -1
- package/dest/tx/include_by_timestamp.js +0 -72
- package/src/interfaces/tx-collector.ts +0 -17
- package/src/kernel/hints/rollup_validation_requests.ts +0 -71
- package/src/shared_mutable/index.ts +0 -4
- package/src/shared_mutable/shared_mutable_values_with_hash.ts +0 -38
- package/src/tx/include_by_timestamp.ts +0 -90
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.d.ts +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.js +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.d.ts +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.js +0 -0
- /package/dest/interfaces/{tx-collector.js → tx_provider.js} +0 -0
- /package/src/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.ts +0 -0
- /package/src/{shared_mutable → delayed_public_mutable}/scheduled_value_change.ts +0 -0
|
@@ -9,8 +9,8 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
9
9
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
10
10
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
11
11
|
|
|
12
|
+
import { DelayedPublicMutableValues } from '../delayed_public_mutable/delayed_public_mutable_values.js';
|
|
12
13
|
import { PublicKeys } from '../keys/public_keys.js';
|
|
13
|
-
import { SharedMutableValues } from '../shared_mutable/shared_mutable_values.js';
|
|
14
14
|
import { ProtocolContractLeafPreimage, PublicDataTreeLeafPreimage } from '../trees/index.js';
|
|
15
15
|
import { VerificationKeyAsFields } from '../vks/verification_key.js';
|
|
16
16
|
import { PrivateCircuitPublicInputs } from './private_circuit_public_inputs.js';
|
|
@@ -162,7 +162,7 @@ export class UpdatedClassIdHints {
|
|
|
162
162
|
constructor(
|
|
163
163
|
public updatedClassIdWitness: MembershipWitness<typeof PUBLIC_DATA_TREE_HEIGHT>,
|
|
164
164
|
public updatedClassIdLeaf: PublicDataTreeLeafPreimage,
|
|
165
|
-
public updatedClassIdValues:
|
|
165
|
+
public updatedClassIdValues: DelayedPublicMutableValues,
|
|
166
166
|
) {}
|
|
167
167
|
|
|
168
168
|
static getFields(fields: FieldsOf<UpdatedClassIdHints>) {
|
|
@@ -193,7 +193,7 @@ export class UpdatedClassIdHints {
|
|
|
193
193
|
reader.readObject(PublicDataTreeLeafPreimage),
|
|
194
194
|
reader.readObject({
|
|
195
195
|
fromBuffer(reader) {
|
|
196
|
-
return
|
|
196
|
+
return DelayedPublicMutableValues.fromBuffer(reader, UPDATES_VALUE_SIZE);
|
|
197
197
|
},
|
|
198
198
|
}),
|
|
199
199
|
);
|
|
@@ -9,15 +9,13 @@ import {
|
|
|
9
9
|
MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
|
|
10
10
|
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,
|
|
11
11
|
MAX_PRIVATE_LOGS_PER_CALL,
|
|
12
|
-
PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH,
|
|
13
12
|
} from '@aztec/constants';
|
|
14
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
15
13
|
import { Fr } from '@aztec/foundation/fields';
|
|
16
14
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
17
15
|
import {
|
|
18
16
|
BufferReader,
|
|
19
17
|
FieldReader,
|
|
20
|
-
|
|
18
|
+
bigintToUInt64BE,
|
|
21
19
|
serializeToBuffer,
|
|
22
20
|
serializeToFields,
|
|
23
21
|
} from '@aztec/foundation/serialize';
|
|
@@ -30,13 +28,17 @@ import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
|
30
28
|
import { CountedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
31
29
|
import { BlockHeader } from '../tx/block_header.js';
|
|
32
30
|
import { CallContext } from '../tx/call_context.js';
|
|
33
|
-
import { IncludeByTimestamp } from '../tx/include_by_timestamp.js';
|
|
34
31
|
import { TxContext } from '../tx/tx_context.js';
|
|
32
|
+
import type { UInt64 } from '../types/shared.js';
|
|
33
|
+
import {
|
|
34
|
+
ClaimedLengthArray,
|
|
35
|
+
ClaimedLengthArrayFromBuffer,
|
|
36
|
+
ClaimedLengthArrayFromFields,
|
|
37
|
+
} from './claimed_length_array.js';
|
|
35
38
|
import { ReadRequest } from './hints/read_request.js';
|
|
36
39
|
import { NoteHash } from './note_hash.js';
|
|
37
40
|
import { Nullifier } from './nullifier.js';
|
|
38
41
|
import { CountedPublicCallRequest, PublicCallRequest } from './public_call_request.js';
|
|
39
|
-
import { isEmptyArray } from './utils/order_and_comparison.js';
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* Public inputs to a private circuit.
|
|
@@ -66,38 +68,38 @@ export class PrivateCircuitPublicInputs {
|
|
|
66
68
|
/**
|
|
67
69
|
* The highest timestamp of a block in which the transaction can still be included.
|
|
68
70
|
*/
|
|
69
|
-
public includeByTimestamp:
|
|
71
|
+
public includeByTimestamp: UInt64,
|
|
70
72
|
/**
|
|
71
73
|
* Read requests created by the corresponding function call.
|
|
72
74
|
*/
|
|
73
|
-
public noteHashReadRequests:
|
|
75
|
+
public noteHashReadRequests: ClaimedLengthArray<ReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,
|
|
74
76
|
/**
|
|
75
77
|
* Nullifier read requests created by the corresponding function call.
|
|
76
78
|
*/
|
|
77
|
-
public nullifierReadRequests:
|
|
79
|
+
public nullifierReadRequests: ClaimedLengthArray<ReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,
|
|
78
80
|
/**
|
|
79
81
|
* Key validation requests and generators created by the corresponding function call.
|
|
80
82
|
*/
|
|
81
|
-
public keyValidationRequestsAndGenerators:
|
|
83
|
+
public keyValidationRequestsAndGenerators: ClaimedLengthArray<
|
|
82
84
|
KeyValidationRequestAndGenerator,
|
|
83
85
|
typeof MAX_KEY_VALIDATION_REQUESTS_PER_CALL
|
|
84
86
|
>,
|
|
85
87
|
/**
|
|
86
88
|
* New note hashes created by the corresponding function call.
|
|
87
89
|
*/
|
|
88
|
-
public noteHashes:
|
|
90
|
+
public noteHashes: ClaimedLengthArray<NoteHash, typeof MAX_NOTE_HASHES_PER_CALL>,
|
|
89
91
|
/**
|
|
90
92
|
* New nullifiers created by the corresponding function call.
|
|
91
93
|
*/
|
|
92
|
-
public nullifiers:
|
|
94
|
+
public nullifiers: ClaimedLengthArray<Nullifier, typeof MAX_NULLIFIERS_PER_CALL>,
|
|
93
95
|
/**
|
|
94
96
|
* Private call requests made within the current kernel iteration.
|
|
95
97
|
*/
|
|
96
|
-
public privateCallRequests:
|
|
98
|
+
public privateCallRequests: ClaimedLengthArray<PrivateCallRequest, typeof MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,
|
|
97
99
|
/**
|
|
98
100
|
* Public call stack at the current kernel iteration.
|
|
99
101
|
*/
|
|
100
|
-
public publicCallRequests:
|
|
102
|
+
public publicCallRequests: ClaimedLengthArray<CountedPublicCallRequest, typeof MAX_ENQUEUED_CALLS_PER_CALL>,
|
|
101
103
|
/**
|
|
102
104
|
* Hash of the public teardown function.
|
|
103
105
|
*/
|
|
@@ -105,15 +107,15 @@ export class PrivateCircuitPublicInputs {
|
|
|
105
107
|
/**
|
|
106
108
|
* New L2 to L1 messages created by the corresponding function call.
|
|
107
109
|
*/
|
|
108
|
-
public l2ToL1Msgs:
|
|
110
|
+
public l2ToL1Msgs: ClaimedLengthArray<CountedL2ToL1Message, typeof MAX_L2_TO_L1_MSGS_PER_CALL>,
|
|
109
111
|
/**
|
|
110
112
|
* Logs emitted in this function call.
|
|
111
113
|
*/
|
|
112
|
-
public privateLogs:
|
|
114
|
+
public privateLogs: ClaimedLengthArray<PrivateLogData, typeof MAX_PRIVATE_LOGS_PER_CALL>,
|
|
113
115
|
/**
|
|
114
116
|
* Hash of the contract class logs emitted in this function call.
|
|
115
117
|
*/
|
|
116
|
-
public contractClassLogsHashes:
|
|
118
|
+
public contractClassLogsHashes: ClaimedLengthArray<CountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_CALL>,
|
|
117
119
|
/**
|
|
118
120
|
* The side effect counter at the start of this call.
|
|
119
121
|
*/
|
|
@@ -158,18 +160,20 @@ export class PrivateCircuitPublicInputs {
|
|
|
158
160
|
reader.readObject(Fr),
|
|
159
161
|
reader.readObject(Fr),
|
|
160
162
|
reader.readBoolean(),
|
|
161
|
-
reader.
|
|
162
|
-
reader.
|
|
163
|
-
reader.
|
|
164
|
-
reader.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
reader.
|
|
168
|
-
reader.
|
|
163
|
+
reader.readUInt64(),
|
|
164
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)),
|
|
165
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)),
|
|
166
|
+
reader.readObject(
|
|
167
|
+
ClaimedLengthArrayFromBuffer(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
168
|
+
),
|
|
169
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(NoteHash, MAX_NOTE_HASHES_PER_CALL)),
|
|
170
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(Nullifier, MAX_NULLIFIERS_PER_CALL)),
|
|
171
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)),
|
|
172
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)),
|
|
169
173
|
reader.readObject(PublicCallRequest),
|
|
170
|
-
reader.
|
|
171
|
-
reader.
|
|
172
|
-
reader.
|
|
174
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)),
|
|
175
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)),
|
|
176
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)),
|
|
173
177
|
reader.readObject(Fr),
|
|
174
178
|
reader.readObject(Fr),
|
|
175
179
|
reader.readObject(BlockHeader),
|
|
@@ -185,18 +189,20 @@ export class PrivateCircuitPublicInputs {
|
|
|
185
189
|
reader.readField(),
|
|
186
190
|
reader.readField(),
|
|
187
191
|
reader.readBoolean(),
|
|
188
|
-
reader.
|
|
189
|
-
reader.
|
|
190
|
-
reader.
|
|
191
|
-
reader.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
reader.
|
|
195
|
-
reader.
|
|
192
|
+
reader.readU64(),
|
|
193
|
+
reader.readObject(ClaimedLengthArrayFromFields(ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)),
|
|
194
|
+
reader.readObject(ClaimedLengthArrayFromFields(ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)),
|
|
195
|
+
reader.readObject(
|
|
196
|
+
ClaimedLengthArrayFromFields(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
197
|
+
),
|
|
198
|
+
reader.readObject(ClaimedLengthArrayFromFields(NoteHash, MAX_NOTE_HASHES_PER_CALL)),
|
|
199
|
+
reader.readObject(ClaimedLengthArrayFromFields(Nullifier, MAX_NULLIFIERS_PER_CALL)),
|
|
200
|
+
reader.readObject(ClaimedLengthArrayFromFields(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)),
|
|
201
|
+
reader.readObject(ClaimedLengthArrayFromFields(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)),
|
|
196
202
|
reader.readObject(PublicCallRequest),
|
|
197
|
-
reader.
|
|
198
|
-
reader.
|
|
199
|
-
reader.
|
|
203
|
+
reader.readObject(ClaimedLengthArrayFromFields(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)),
|
|
204
|
+
reader.readObject(ClaimedLengthArrayFromFields(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)),
|
|
205
|
+
reader.readObject(ClaimedLengthArrayFromFields(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)),
|
|
200
206
|
reader.readField(),
|
|
201
207
|
reader.readField(),
|
|
202
208
|
reader.readObject(BlockHeader),
|
|
@@ -215,18 +221,18 @@ export class PrivateCircuitPublicInputs {
|
|
|
215
221
|
Fr.ZERO,
|
|
216
222
|
Fr.ZERO,
|
|
217
223
|
false,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
0n,
|
|
225
|
+
ClaimedLengthArray.empty(ReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL),
|
|
226
|
+
ClaimedLengthArray.empty(ReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL),
|
|
227
|
+
ClaimedLengthArray.empty(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
228
|
+
ClaimedLengthArray.empty(NoteHash, MAX_NOTE_HASHES_PER_CALL),
|
|
229
|
+
ClaimedLengthArray.empty(Nullifier, MAX_NULLIFIERS_PER_CALL),
|
|
230
|
+
ClaimedLengthArray.empty(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL),
|
|
231
|
+
ClaimedLengthArray.empty(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL),
|
|
226
232
|
PublicCallRequest.empty(),
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
ClaimedLengthArray.empty(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL),
|
|
234
|
+
ClaimedLengthArray.empty(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL),
|
|
235
|
+
ClaimedLengthArray.empty(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL),
|
|
230
236
|
Fr.ZERO,
|
|
231
237
|
Fr.ZERO,
|
|
232
238
|
BlockHeader.empty(),
|
|
@@ -241,18 +247,18 @@ export class PrivateCircuitPublicInputs {
|
|
|
241
247
|
this.returnsHash.isZero() &&
|
|
242
248
|
this.minRevertibleSideEffectCounter.isZero() &&
|
|
243
249
|
!this.isFeePayer &&
|
|
244
|
-
this.includeByTimestamp
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
!this.includeByTimestamp &&
|
|
251
|
+
this.noteHashReadRequests.isEmpty() &&
|
|
252
|
+
this.nullifierReadRequests.isEmpty() &&
|
|
253
|
+
this.keyValidationRequestsAndGenerators.isEmpty() &&
|
|
254
|
+
this.noteHashes.isEmpty() &&
|
|
255
|
+
this.nullifiers.isEmpty() &&
|
|
256
|
+
this.privateCallRequests.isEmpty() &&
|
|
257
|
+
this.publicCallRequests.isEmpty() &&
|
|
252
258
|
this.publicTeardownCallRequest.isEmpty() &&
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
259
|
+
this.l2ToL1Msgs.isEmpty() &&
|
|
260
|
+
this.privateLogs.isEmpty() &&
|
|
261
|
+
this.contractClassLogsHashes.isEmpty() &&
|
|
256
262
|
this.startSideEffectCounter.isZero() &&
|
|
257
263
|
this.endSideEffectCounter.isZero() &&
|
|
258
264
|
this.historicalHeader.isEmpty() &&
|
|
@@ -296,20 +302,38 @@ export class PrivateCircuitPublicInputs {
|
|
|
296
302
|
* @returns The buffer.
|
|
297
303
|
*/
|
|
298
304
|
toBuffer(): Buffer {
|
|
299
|
-
|
|
305
|
+
// TODO(#15525): Use the line below once UInt64 can be serialized correctly.
|
|
306
|
+
// return serializeToBuffer(...PrivateCircuitPublicInputs.getFields(this));
|
|
307
|
+
return serializeToBuffer([
|
|
308
|
+
this.callContext,
|
|
309
|
+
this.argsHash,
|
|
310
|
+
this.returnsHash,
|
|
311
|
+
this.minRevertibleSideEffectCounter,
|
|
312
|
+
this.isFeePayer,
|
|
313
|
+
bigintToUInt64BE(this.includeByTimestamp),
|
|
314
|
+
this.noteHashReadRequests,
|
|
315
|
+
this.nullifierReadRequests,
|
|
316
|
+
this.keyValidationRequestsAndGenerators,
|
|
317
|
+
this.noteHashes,
|
|
318
|
+
this.nullifiers,
|
|
319
|
+
this.privateCallRequests,
|
|
320
|
+
this.publicCallRequests,
|
|
321
|
+
this.publicTeardownCallRequest,
|
|
322
|
+
this.l2ToL1Msgs,
|
|
323
|
+
this.privateLogs,
|
|
324
|
+
this.contractClassLogsHashes,
|
|
325
|
+
this.startSideEffectCounter,
|
|
326
|
+
this.endSideEffectCounter,
|
|
327
|
+
this.historicalHeader,
|
|
328
|
+
this.txContext,
|
|
329
|
+
]);
|
|
300
330
|
}
|
|
301
331
|
|
|
302
332
|
/**
|
|
303
333
|
* Serialize this as a field array.
|
|
304
334
|
*/
|
|
305
335
|
toFields(): Fr[] {
|
|
306
|
-
|
|
307
|
-
if (fields.length !== PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH) {
|
|
308
|
-
throw new Error(
|
|
309
|
-
`Invalid number of fields for PrivateCircuitPublicInputs. Expected ${PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH}, got ${fields.length}`,
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
return fields;
|
|
336
|
+
return serializeToFields(...PrivateCircuitPublicInputs.getFields(this));
|
|
313
337
|
}
|
|
314
338
|
|
|
315
339
|
public toJSON() {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
|
|
5
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
6
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
7
|
+
import type { UInt64 } from '../types/shared.js';
|
|
7
8
|
import { PrivateAccumulatedData } from './private_accumulated_data.js';
|
|
8
9
|
import { PrivateValidationRequests } from './private_validation_requests.js';
|
|
9
10
|
import { PublicCallRequest } from './public_call_request.js';
|
|
@@ -37,6 +38,10 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
37
38
|
* The address of the fee payer for the transaction
|
|
38
39
|
*/
|
|
39
40
|
public feePayer: AztecAddress,
|
|
41
|
+
/**
|
|
42
|
+
* The timestamp by which the transaction must be included in a block.
|
|
43
|
+
*/
|
|
44
|
+
public includeByTimestamp: UInt64,
|
|
40
45
|
/**
|
|
41
46
|
* Wether this is a private only tx or not
|
|
42
47
|
*/
|
|
@@ -63,6 +68,7 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
63
68
|
this.end,
|
|
64
69
|
this.publicTeardownCallRequest,
|
|
65
70
|
this.feePayer,
|
|
71
|
+
bigintToUInt64BE(this.includeByTimestamp),
|
|
66
72
|
this.isPrivateOnly,
|
|
67
73
|
this.claimedFirstNullifier,
|
|
68
74
|
);
|
|
@@ -82,6 +88,7 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
82
88
|
reader.readObject(PrivateAccumulatedData),
|
|
83
89
|
reader.readObject(PublicCallRequest),
|
|
84
90
|
reader.readObject(AztecAddress),
|
|
91
|
+
reader.readUInt64(),
|
|
85
92
|
reader.readBoolean(),
|
|
86
93
|
reader.readObject(Fr),
|
|
87
94
|
);
|
|
@@ -95,6 +102,7 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
95
102
|
PrivateAccumulatedData.empty(),
|
|
96
103
|
PublicCallRequest.empty(),
|
|
97
104
|
AztecAddress.ZERO,
|
|
105
|
+
0n,
|
|
98
106
|
false,
|
|
99
107
|
Fr.zero(),
|
|
100
108
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
1
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
2
|
|
|
3
|
+
import type { UInt64 } from '../types/shared.js';
|
|
3
4
|
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
4
5
|
import { PrivateKernelData } from './private_kernel_data.js';
|
|
5
|
-
import { countAccumulatedItems } from './utils/order_and_comparison.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Input to the private kernel circuit - tail call.
|
|
@@ -17,11 +17,15 @@ export class PrivateKernelTailCircuitPrivateInputs {
|
|
|
17
17
|
* The number of the padded side effects.
|
|
18
18
|
*/
|
|
19
19
|
public paddedSideEffectAmounts: PaddedSideEffectAmounts,
|
|
20
|
+
/**
|
|
21
|
+
* The timestamp by which the transaction must be included in a block.
|
|
22
|
+
*/
|
|
23
|
+
public includeByTimestampUpperBound: UInt64,
|
|
20
24
|
) {}
|
|
21
25
|
|
|
22
26
|
isForPublic() {
|
|
23
27
|
return (
|
|
24
|
-
|
|
28
|
+
this.previousKernel.publicInputs.end.publicCallRequests.claimedLength > 0 ||
|
|
25
29
|
!this.previousKernel.publicInputs.publicTeardownCallRequest.isEmpty()
|
|
26
30
|
);
|
|
27
31
|
}
|
|
@@ -31,7 +35,11 @@ export class PrivateKernelTailCircuitPrivateInputs {
|
|
|
31
35
|
* @returns The buffer.
|
|
32
36
|
*/
|
|
33
37
|
toBuffer() {
|
|
34
|
-
return serializeToBuffer(
|
|
38
|
+
return serializeToBuffer(
|
|
39
|
+
this.previousKernel,
|
|
40
|
+
this.paddedSideEffectAmounts,
|
|
41
|
+
bigintToUInt64BE(this.includeByTimestampUpperBound),
|
|
42
|
+
);
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
/**
|
|
@@ -44,6 +52,7 @@ export class PrivateKernelTailCircuitPrivateInputs {
|
|
|
44
52
|
return new PrivateKernelTailCircuitPrivateInputs(
|
|
45
53
|
reader.readObject(PrivateKernelData),
|
|
46
54
|
reader.readObject(PaddedSideEffectAmounts),
|
|
55
|
+
reader.readUInt64(),
|
|
47
56
|
);
|
|
48
57
|
}
|
|
49
58
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
|
|
5
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
6
|
import { Gas } from '../gas/gas.js';
|
|
7
7
|
import type { PrivateLog } from '../logs/index.js';
|
|
8
8
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
9
|
-
import {
|
|
9
|
+
import type { UInt64 } from '../types/shared.js';
|
|
10
10
|
import type { ScopedLogHash } from './log_hash.js';
|
|
11
11
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
12
12
|
import { PrivateToPublicKernelCircuitPublicInputs } from './private_to_public_kernel_circuit_public_inputs.js';
|
|
13
13
|
import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js';
|
|
14
14
|
import { PrivateToRollupKernelCircuitPublicInputs } from './private_to_rollup_kernel_circuit_public_inputs.js';
|
|
15
15
|
import { PublicCallRequest } from './public_call_request.js';
|
|
16
|
-
import { countAccumulatedItems
|
|
16
|
+
import { countAccumulatedItems } from './utils/order_and_comparison.js';
|
|
17
17
|
|
|
18
18
|
export class PartialPrivateTailPublicInputsForPublic {
|
|
19
19
|
constructor(
|
|
@@ -104,7 +104,6 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
104
104
|
* Data which is not modified by the circuits.
|
|
105
105
|
*/
|
|
106
106
|
public constants: TxConstantData,
|
|
107
|
-
public rollupValidationRequests: RollupValidationRequests,
|
|
108
107
|
/**
|
|
109
108
|
* The accumulated gas used after private execution.
|
|
110
109
|
* If the tx has a teardown call request, the teardown gas limits will also be included.
|
|
@@ -114,6 +113,10 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
114
113
|
* The address of the fee payer for the transaction.
|
|
115
114
|
*/
|
|
116
115
|
public feePayer: AztecAddress,
|
|
116
|
+
/**
|
|
117
|
+
* The timestamp by which the transaction must be included in a block.
|
|
118
|
+
*/
|
|
119
|
+
public includeByTimestamp: UInt64,
|
|
117
120
|
|
|
118
121
|
public forPublic?: PartialPrivateTailPublicInputsForPublic,
|
|
119
122
|
public forRollup?: PartialPrivateTailPublicInputsForRollup,
|
|
@@ -141,8 +144,9 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
141
144
|
(this.forPublic?.getSize() ?? 0) +
|
|
142
145
|
(this.forRollup?.getSize() ?? 0) +
|
|
143
146
|
this.constants.getSize() +
|
|
144
|
-
this.
|
|
145
|
-
this.feePayer.size
|
|
147
|
+
this.gasUsed.getSize() +
|
|
148
|
+
this.feePayer.size +
|
|
149
|
+
8 // includeByTimestamp
|
|
146
150
|
);
|
|
147
151
|
}
|
|
148
152
|
|
|
@@ -152,12 +156,12 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
152
156
|
}
|
|
153
157
|
return new PrivateToPublicKernelCircuitPublicInputs(
|
|
154
158
|
this.constants,
|
|
155
|
-
this.rollupValidationRequests,
|
|
156
159
|
this.forPublic.nonRevertibleAccumulatedData,
|
|
157
160
|
this.forPublic.revertibleAccumulatedData,
|
|
158
161
|
this.forPublic.publicTeardownCallRequest,
|
|
159
162
|
this.gasUsed,
|
|
160
163
|
this.feePayer,
|
|
164
|
+
this.includeByTimestamp,
|
|
161
165
|
);
|
|
162
166
|
}
|
|
163
167
|
|
|
@@ -173,10 +177,10 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
173
177
|
);
|
|
174
178
|
return new PrivateToRollupKernelCircuitPublicInputs(
|
|
175
179
|
constants,
|
|
176
|
-
this.rollupValidationRequests,
|
|
177
180
|
this.forRollup.end,
|
|
178
181
|
this.gasUsed,
|
|
179
182
|
this.feePayer,
|
|
183
|
+
this.includeByTimestamp,
|
|
180
184
|
);
|
|
181
185
|
}
|
|
182
186
|
|
|
@@ -217,8 +221,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
217
221
|
|
|
218
222
|
getNonEmptyNoteHashes() {
|
|
219
223
|
const noteHashes = this.forPublic
|
|
220
|
-
?
|
|
221
|
-
this.forPublic.nonRevertibleAccumulatedData.noteHashes,
|
|
224
|
+
? this.forPublic.nonRevertibleAccumulatedData.noteHashes.concat(
|
|
222
225
|
this.forPublic.revertibleAccumulatedData.noteHashes,
|
|
223
226
|
)
|
|
224
227
|
: this.forRollup!.end.noteHashes;
|
|
@@ -227,8 +230,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
227
230
|
|
|
228
231
|
getNonEmptyNullifiers() {
|
|
229
232
|
const nullifiers = this.forPublic
|
|
230
|
-
?
|
|
231
|
-
this.forPublic.nonRevertibleAccumulatedData.nullifiers,
|
|
233
|
+
? this.forPublic.nonRevertibleAccumulatedData.nullifiers.concat(
|
|
232
234
|
this.forPublic.revertibleAccumulatedData.nullifiers,
|
|
233
235
|
)
|
|
234
236
|
: this.forRollup!.end.nullifiers;
|
|
@@ -237,8 +239,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
237
239
|
|
|
238
240
|
getNonEmptyPrivateLogs() {
|
|
239
241
|
const privateLogs = this.forPublic
|
|
240
|
-
?
|
|
241
|
-
this.forPublic.nonRevertibleAccumulatedData.privateLogs,
|
|
242
|
+
? this.forPublic.nonRevertibleAccumulatedData.privateLogs.concat(
|
|
242
243
|
this.forPublic.revertibleAccumulatedData.privateLogs,
|
|
243
244
|
)
|
|
244
245
|
: this.forRollup!.end.privateLogs;
|
|
@@ -247,8 +248,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
247
248
|
|
|
248
249
|
getNonEmptyContractClassLogsHashes() {
|
|
249
250
|
const contractClassLogsHashes = this.forPublic
|
|
250
|
-
?
|
|
251
|
-
this.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes,
|
|
251
|
+
? this.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes.concat(
|
|
252
252
|
this.forPublic.revertibleAccumulatedData.contractClassLogsHashes,
|
|
253
253
|
)
|
|
254
254
|
: this.forRollup!.end.contractClassLogsHashes;
|
|
@@ -277,9 +277,9 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
277
277
|
const isForPublic = reader.readBoolean();
|
|
278
278
|
return new PrivateKernelTailCircuitPublicInputs(
|
|
279
279
|
reader.readObject(TxConstantData),
|
|
280
|
-
reader.readObject(RollupValidationRequests),
|
|
281
280
|
reader.readObject(Gas),
|
|
282
281
|
reader.readObject(AztecAddress),
|
|
282
|
+
reader.readUInt64(),
|
|
283
283
|
isForPublic ? reader.readObject(PartialPrivateTailPublicInputsForPublic) : undefined,
|
|
284
284
|
!isForPublic ? reader.readObject(PartialPrivateTailPublicInputsForRollup) : undefined,
|
|
285
285
|
);
|
|
@@ -290,9 +290,9 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
290
290
|
return serializeToBuffer(
|
|
291
291
|
isForPublic,
|
|
292
292
|
this.constants,
|
|
293
|
-
this.rollupValidationRequests,
|
|
294
293
|
this.gasUsed,
|
|
295
294
|
this.feePayer,
|
|
295
|
+
bigintToUInt64BE(this.includeByTimestamp),
|
|
296
296
|
isForPublic ? this.forPublic!.toBuffer() : this.forRollup!.toBuffer(),
|
|
297
297
|
);
|
|
298
298
|
}
|
|
@@ -300,9 +300,9 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
300
300
|
static empty() {
|
|
301
301
|
return new PrivateKernelTailCircuitPublicInputs(
|
|
302
302
|
TxConstantData.empty(),
|
|
303
|
-
RollupValidationRequests.empty(),
|
|
304
303
|
Gas.empty(),
|
|
305
304
|
AztecAddress.ZERO,
|
|
305
|
+
0n,
|
|
306
306
|
undefined,
|
|
307
307
|
PartialPrivateTailPublicInputsForRollup.empty(),
|
|
308
308
|
);
|
|
@@ -318,9 +318,9 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
318
318
|
data.nullifiers[0] = Fr.random();
|
|
319
319
|
return new PrivateKernelTailCircuitPublicInputs(
|
|
320
320
|
TxConstantData.empty(),
|
|
321
|
-
RollupValidationRequests.empty(),
|
|
322
321
|
Gas.empty(),
|
|
323
322
|
AztecAddress.ZERO,
|
|
323
|
+
0n,
|
|
324
324
|
undefined,
|
|
325
325
|
new PartialPrivateTailPublicInputsForRollup(data),
|
|
326
326
|
);
|
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { GeneratorIndex, PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
3
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
4
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
5
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
7
|
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
9
|
import { Gas } from '../gas/gas.js';
|
|
10
10
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
11
|
-
import {
|
|
11
|
+
import type { UInt64 } from '../types/index.js';
|
|
12
12
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
13
13
|
import { PublicCallRequest } from './public_call_request.js';
|
|
14
14
|
|
|
15
15
|
export class PrivateToPublicKernelCircuitPublicInputs {
|
|
16
16
|
constructor(
|
|
17
17
|
public constants: TxConstantData,
|
|
18
|
-
public rollupValidationRequests: RollupValidationRequests,
|
|
19
18
|
public nonRevertibleAccumulatedData: PrivateToPublicAccumulatedData,
|
|
20
19
|
public revertibleAccumulatedData: PrivateToPublicAccumulatedData,
|
|
21
20
|
public publicTeardownCallRequest: PublicCallRequest,
|
|
22
21
|
public gasUsed: Gas,
|
|
23
22
|
public feePayer: AztecAddress,
|
|
23
|
+
public includeByTimestamp: UInt64,
|
|
24
24
|
) {}
|
|
25
25
|
|
|
26
26
|
toBuffer() {
|
|
27
27
|
return serializeToBuffer(
|
|
28
28
|
this.constants,
|
|
29
|
-
this.rollupValidationRequests,
|
|
30
29
|
this.nonRevertibleAccumulatedData,
|
|
31
30
|
this.revertibleAccumulatedData,
|
|
32
31
|
this.publicTeardownCallRequest,
|
|
33
32
|
this.gasUsed,
|
|
34
33
|
this.feePayer,
|
|
34
|
+
bigintToUInt64BE(this.includeByTimestamp),
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
static getFields(fields: FieldsOf<PrivateToPublicKernelCircuitPublicInputs>) {
|
|
39
39
|
return [
|
|
40
40
|
fields.constants,
|
|
41
|
-
fields.rollupValidationRequests,
|
|
42
41
|
fields.nonRevertibleAccumulatedData,
|
|
43
42
|
fields.revertibleAccumulatedData,
|
|
44
43
|
fields.publicTeardownCallRequest,
|
|
45
44
|
fields.gasUsed,
|
|
46
45
|
fields.feePayer,
|
|
46
|
+
fields.includeByTimestamp,
|
|
47
47
|
] as const;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -51,24 +51,24 @@ export class PrivateToPublicKernelCircuitPublicInputs {
|
|
|
51
51
|
const reader = BufferReader.asReader(buffer);
|
|
52
52
|
return new PrivateToPublicKernelCircuitPublicInputs(
|
|
53
53
|
reader.readObject(TxConstantData),
|
|
54
|
-
reader.readObject(RollupValidationRequests),
|
|
55
54
|
reader.readObject(PrivateToPublicAccumulatedData),
|
|
56
55
|
reader.readObject(PrivateToPublicAccumulatedData),
|
|
57
56
|
reader.readObject(PublicCallRequest),
|
|
58
57
|
reader.readObject(Gas),
|
|
59
58
|
reader.readObject(AztecAddress),
|
|
59
|
+
reader.readUInt64(),
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
static empty() {
|
|
64
64
|
return new PrivateToPublicKernelCircuitPublicInputs(
|
|
65
65
|
TxConstantData.empty(),
|
|
66
|
-
RollupValidationRequests.empty(),
|
|
67
66
|
PrivateToPublicAccumulatedData.empty(),
|
|
68
67
|
PrivateToPublicAccumulatedData.empty(),
|
|
69
68
|
PublicCallRequest.empty(),
|
|
70
69
|
Gas.empty(),
|
|
71
70
|
AztecAddress.ZERO,
|
|
71
|
+
0n,
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
74
|
|