@aztec/stdlib 1.2.0 → 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 +211 -8
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +9 -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 +4 -2
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +4 -2
- package/dest/interfaces/slasher.d.ts +86 -0
- package/dest/interfaces/slasher.d.ts.map +1 -0
- package/dest/interfaces/slasher.js +23 -0
- 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 +19 -8
- package/src/interfaces/configs.ts +17 -0
- package/src/interfaces/pxe.ts +4 -2
- package/src/interfaces/server.ts +4 -2
- package/src/interfaces/slasher.ts +49 -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
|
@@ -1,32 +1,26 @@
|
|
|
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
|
|
3
|
-
import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
|
|
2
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
3
|
import { inspect } from 'util';
|
|
5
4
|
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';
|
|
8
7
|
import { OptionalNumber } from './utils/optional_number.js';
|
|
9
8
|
/**
|
|
10
9
|
* Validation requests accumulated during the execution of the transaction.
|
|
11
10
|
*/
|
|
12
11
|
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;
|
|
18
12
|
/**
|
|
19
13
|
* All the read requests made in this transaction.
|
|
20
14
|
*/
|
|
21
|
-
noteHashReadRequests:
|
|
15
|
+
noteHashReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX>;
|
|
22
16
|
/**
|
|
23
17
|
* All the nullifier read requests made in this transaction.
|
|
24
18
|
*/
|
|
25
|
-
nullifierReadRequests:
|
|
19
|
+
nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>;
|
|
26
20
|
/**
|
|
27
21
|
* All the key validation requests made in this transaction.
|
|
28
22
|
*/
|
|
29
|
-
scopedKeyValidationRequestsAndGenerators:
|
|
23
|
+
scopedKeyValidationRequestsAndGenerators: ClaimedLengthArray<ScopedKeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>;
|
|
30
24
|
/**
|
|
31
25
|
* The counter to split the data for squashing.
|
|
32
26
|
* A revertible nullifier and a non-revertible note hash will not be squashed.
|
|
@@ -34,23 +28,18 @@ export declare class PrivateValidationRequests {
|
|
|
34
28
|
*/
|
|
35
29
|
splitCounter: OptionalNumber;
|
|
36
30
|
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,
|
|
42
31
|
/**
|
|
43
32
|
* All the read requests made in this transaction.
|
|
44
33
|
*/
|
|
45
|
-
noteHashReadRequests:
|
|
34
|
+
noteHashReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX>,
|
|
46
35
|
/**
|
|
47
36
|
* All the nullifier read requests made in this transaction.
|
|
48
37
|
*/
|
|
49
|
-
nullifierReadRequests:
|
|
38
|
+
nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>,
|
|
50
39
|
/**
|
|
51
40
|
* All the key validation requests made in this transaction.
|
|
52
41
|
*/
|
|
53
|
-
scopedKeyValidationRequestsAndGenerators:
|
|
42
|
+
scopedKeyValidationRequestsAndGenerators: ClaimedLengthArray<ScopedKeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>,
|
|
54
43
|
/**
|
|
55
44
|
* The counter to split the data for squashing.
|
|
56
45
|
* A revertible nullifier and a non-revertible note hash will not be squashed.
|
|
@@ -60,7 +49,6 @@ export declare class PrivateValidationRequests {
|
|
|
60
49
|
getSize(): number;
|
|
61
50
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
62
51
|
toString(): `0x${string}`;
|
|
63
|
-
static fromFields(fields: Fr[] | FieldReader): PrivateValidationRequests;
|
|
64
52
|
/**
|
|
65
53
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
66
54
|
* @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;AAC1B,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,sCAAsC,EAAE,MAAM,gEAAgE,CAAC;AACxH,OAAO,EAAE,kBAAkB,EAAgC,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;GAEG;AACH,qBAAa,yBAAyB;IAElC;;OAEG;IACI,oBAAoB,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAC7G;;OAEG;IACI,qBAAqB,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAC9G;;OAEG;IACI,wCAAwC,EAAE,kBAAkB,CACjE,sCAAsC,EACtC,OAAO,kCAAkC,CAC1C;IACD;;;;OAIG;IACI,YAAY,EAAE,cAAc;;IApBnC;;OAEG;IACI,oBAAoB,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAC7G;;OAEG;IACI,qBAAqB,EAAE,kBAAkB,CAAC,iBAAiB,EAAE,OAAO,kCAAkC,CAAC;IAC9G;;OAEG;IACI,wCAAwC,EAAE,kBAAkB,CACjE,sCAAsC,EACtC,OAAO,kCAAkC,CAC1C;IACD;;;;OAIG;IACI,YAAY,EAAE,cAAc;IAGrC,OAAO;IASP,QAAQ;IASR,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAY/C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;IASZ,CAAC,OAAO,CAAC,MAAM,CAAC;CAQjB"}
|
|
@@ -1,25 +1,19 @@
|
|
|
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 {
|
|
3
|
-
import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection';
|
|
4
|
-
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
4
|
import { inspect } from 'util';
|
|
7
5
|
import { ScopedKeyValidationRequestAndGenerator } from '../kernel/hints/scoped_key_validation_request_and_generator.js';
|
|
6
|
+
import { ClaimedLengthArray, ClaimedLengthArrayFromBuffer } from './claimed_length_array.js';
|
|
8
7
|
import { ScopedReadRequest } from './hints/read_request.js';
|
|
9
|
-
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
10
8
|
import { OptionalNumber } from './utils/optional_number.js';
|
|
11
9
|
/**
|
|
12
10
|
* Validation requests accumulated during the execution of the transaction.
|
|
13
11
|
*/ export class PrivateValidationRequests {
|
|
14
|
-
forRollup;
|
|
15
12
|
noteHashReadRequests;
|
|
16
13
|
nullifierReadRequests;
|
|
17
14
|
scopedKeyValidationRequestsAndGenerators;
|
|
18
15
|
splitCounter;
|
|
19
16
|
constructor(/**
|
|
20
|
-
* Validation requests that cannot be fulfilled in the current context (private or public), and must be instead be
|
|
21
|
-
* forwarded to the rollup for it to take care of them.
|
|
22
|
-
*/ forRollup, /**
|
|
23
17
|
* All the read requests made in this transaction.
|
|
24
18
|
*/ noteHashReadRequests, /**
|
|
25
19
|
* All the nullifier read requests made in this transaction.
|
|
@@ -30,32 +24,27 @@ import { OptionalNumber } from './utils/optional_number.js';
|
|
|
30
24
|
* A revertible nullifier and a non-revertible note hash will not be squashed.
|
|
31
25
|
* It should be the "final" minRevertibleSideEffectCounter of a tx.
|
|
32
26
|
*/ splitCounter){
|
|
33
|
-
this.forRollup = forRollup;
|
|
34
27
|
this.noteHashReadRequests = noteHashReadRequests;
|
|
35
28
|
this.nullifierReadRequests = nullifierReadRequests;
|
|
36
29
|
this.scopedKeyValidationRequestsAndGenerators = scopedKeyValidationRequestsAndGenerators;
|
|
37
30
|
this.splitCounter = splitCounter;
|
|
38
31
|
}
|
|
39
32
|
getSize() {
|
|
40
|
-
return this.
|
|
33
|
+
return this.noteHashReadRequests.getSize() + this.nullifierReadRequests.getSize() + this.scopedKeyValidationRequestsAndGenerators.getSize() + this.splitCounter.getSize();
|
|
41
34
|
}
|
|
42
35
|
toBuffer() {
|
|
43
|
-
return serializeToBuffer(this.
|
|
36
|
+
return serializeToBuffer(this.noteHashReadRequests, this.nullifierReadRequests, this.scopedKeyValidationRequestsAndGenerators, this.splitCounter);
|
|
44
37
|
}
|
|
45
38
|
toString() {
|
|
46
39
|
return bufferToHex(this.toBuffer());
|
|
47
40
|
}
|
|
48
|
-
static fromFields(fields) {
|
|
49
|
-
const reader = FieldReader.asReader(fields);
|
|
50
|
-
return new PrivateValidationRequests(reader.readObject(RollupValidationRequests), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_TX, ScopedReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_TX, ScopedReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_TX, ScopedKeyValidationRequestAndGenerator), reader.readObject(OptionalNumber));
|
|
51
|
-
}
|
|
52
41
|
/**
|
|
53
42
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
54
43
|
* @param buffer - Buffer or reader to read from.
|
|
55
44
|
* @returns Deserialized object.
|
|
56
45
|
*/ static fromBuffer(buffer) {
|
|
57
46
|
const reader = BufferReader.asReader(buffer);
|
|
58
|
-
return new PrivateValidationRequests(reader.readObject(
|
|
47
|
+
return new PrivateValidationRequests(reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_TX)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_TX)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedKeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_TX)), reader.readObject(OptionalNumber));
|
|
59
48
|
}
|
|
60
49
|
/**
|
|
61
50
|
* Deserializes from a string, corresponding to a write in cpp.
|
|
@@ -65,14 +54,13 @@ import { OptionalNumber } from './utils/optional_number.js';
|
|
|
65
54
|
return PrivateValidationRequests.fromBuffer(hexToBuffer(str));
|
|
66
55
|
}
|
|
67
56
|
static empty() {
|
|
68
|
-
return new PrivateValidationRequests(
|
|
57
|
+
return new PrivateValidationRequests(ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_TX), ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_TX), ClaimedLengthArray.empty(ScopedKeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_TX), OptionalNumber.empty());
|
|
69
58
|
}
|
|
70
59
|
[inspect.custom]() {
|
|
71
60
|
return `PrivateValidationRequests {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
scopedKeyValidationRequestsAndGenerators: [${this.scopedKeyValidationRequestsAndGenerators.filter((x)=>!x.isEmpty()).map((h)=>inspect(h)).join(', ')}],
|
|
61
|
+
noteHashReadRequests: ${inspect(this.noteHashReadRequests)},
|
|
62
|
+
nullifierReadRequests: ${inspect(this.nullifierReadRequests)},
|
|
63
|
+
scopedKeyValidationRequestsAndGenerators: ${inspect(this.scopedKeyValidationRequestsAndGenerators)},
|
|
76
64
|
splitCounter: ${this.splitCounter.getSize()}
|
|
77
65
|
`;
|
|
78
66
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
2
2
|
import type { IsEmpty, Ordered } from './interfaces.js';
|
|
3
3
|
export declare function countAccumulatedItems<T extends IsEmpty>(arr: T[]): number;
|
|
4
|
-
export declare function mergeAccumulatedData<T extends IsEmpty, N extends number>(arr0: Tuple<T, N>, arr1: Tuple<T, N>, length?: N): Tuple<T, N>;
|
|
5
4
|
export declare function sortByCounter<T extends Ordered & IsEmpty, N extends number>(arr: Tuple<T, N>, ascending?: boolean): Tuple<T, N>;
|
|
6
|
-
export declare function isEmptyArray<T extends IsEmpty>(arr: T[]): boolean;
|
|
7
|
-
export declare function getNonEmptyItems<T extends IsEmpty>(arr: T[]): T[];
|
|
8
5
|
//# sourceMappingURL=order_and_comparison.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"order_and_comparison.d.ts","sourceRoot":"","sources":["../../../src/kernel/utils/order_and_comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAKxD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,UAUhE;
|
|
1
|
+
{"version":3,"file":"order_and_comparison.d.ts","sourceRoot":"","sources":["../../../src/kernel/utils/order_and_comparison.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAKxD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,UAUhE;AAuBD,wBAAgB,aAAa,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,CAAC,SAAS,MAAM,EACzE,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAChB,SAAS,GAAE,OAAc,GACxB,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAEb"}
|
|
@@ -11,19 +11,6 @@ export function countAccumulatedItems(arr) {
|
|
|
11
11
|
return num;
|
|
12
12
|
}, 0);
|
|
13
13
|
}
|
|
14
|
-
// Merges two arrays of length N into an array of length N.
|
|
15
|
-
export function mergeAccumulatedData(arr0, arr1, length = arr0.length) {
|
|
16
|
-
const numNonEmptyItems0 = countAccumulatedItems(arr0);
|
|
17
|
-
const numNonEmptyItems1 = countAccumulatedItems(arr1);
|
|
18
|
-
if (numNonEmptyItems0 + numNonEmptyItems1 > length) {
|
|
19
|
-
throw new Error('Combined non-empty items exceeded the maximum allowed.');
|
|
20
|
-
}
|
|
21
|
-
const arr = [
|
|
22
|
-
...arr0
|
|
23
|
-
];
|
|
24
|
-
arr1.slice(0, numNonEmptyItems1).forEach((item, i)=>arr[i + numNonEmptyItems0] = item);
|
|
25
|
-
return arr;
|
|
26
|
-
}
|
|
27
14
|
// Sort items by a provided compare function. All empty items are padded to the right.
|
|
28
15
|
function genericSort(arr, compareFn, ascending = true) {
|
|
29
16
|
return [
|
|
@@ -44,9 +31,3 @@ function compareByCounter(a, b) {
|
|
|
44
31
|
export function sortByCounter(arr, ascending = true) {
|
|
45
32
|
return genericSort(arr, compareByCounter, ascending);
|
|
46
33
|
}
|
|
47
|
-
export function isEmptyArray(arr) {
|
|
48
|
-
return arr.every((item)=>item.isEmpty());
|
|
49
|
-
}
|
|
50
|
-
export function getNonEmptyItems(arr) {
|
|
51
|
-
return arr.filter((item)=>!item.isEmpty());
|
|
52
|
-
}
|
|
@@ -10,7 +10,7 @@ import type { PublicKey } from '../keys/public_key.js';
|
|
|
10
10
|
* @returns A derived shared secret.
|
|
11
11
|
* @throws If the publicKey is zero.
|
|
12
12
|
*
|
|
13
|
-
* TODO(#12656): This function is kept around because of the
|
|
13
|
+
* TODO(#12656): This function is kept around because of the utilityGetSharedSecret oracle. Nuke this once returning
|
|
14
14
|
* the app-siloed secret.
|
|
15
15
|
*/
|
|
16
16
|
export declare function deriveEcdhSharedSecret(secretKey: GrumpkinScalar, publicKey: PublicKey): Promise<Point>;
|
|
@@ -9,7 +9,7 @@ import { Grumpkin } from '@aztec/foundation/crypto';
|
|
|
9
9
|
* @returns A derived shared secret.
|
|
10
10
|
* @throws If the publicKey is zero.
|
|
11
11
|
*
|
|
12
|
-
* TODO(#12656): This function is kept around because of the
|
|
12
|
+
* TODO(#12656): This function is kept around because of the utilityGetSharedSecret oracle. Nuke this once returning
|
|
13
13
|
* the app-siloed secret.
|
|
14
14
|
*/ export async function deriveEcdhSharedSecret(secretKey, publicKey) {
|
|
15
15
|
if (publicKey.isZero()) {
|
|
@@ -4,8 +4,11 @@ export interface MessageRetrieval {
|
|
|
4
4
|
getL2ToL1Messages(l2BlockNumber: number): Promise<Fr[][] | undefined>;
|
|
5
5
|
}
|
|
6
6
|
export type L2ToL1MembershipWitness = {
|
|
7
|
-
|
|
7
|
+
root: Fr;
|
|
8
|
+
leafIndex: bigint;
|
|
8
9
|
siblingPath: SiblingPath<number>;
|
|
9
10
|
};
|
|
10
11
|
export declare function computeL2ToL1MembershipWitness(messageRetriever: MessageRetrieval, l2BlockNumber: number, message: Fr): Promise<L2ToL1MembershipWitness | undefined>;
|
|
12
|
+
export declare function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs: Fr[][], message: Fr): Promise<L2ToL1MembershipWitness>;
|
|
13
|
+
export declare function getL2ToL1MessageLeafId(membershipWitness: Pick<L2ToL1MembershipWitness, 'leafIndex' | 'siblingPath'>): bigint;
|
|
11
14
|
//# sourceMappingURL=l2_to_l1_membership.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_to_l1_membership.d.ts","sourceRoot":"","sources":["../../src/messaging/l2_to_l1_membership.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"l2_to_l1_membership.d.ts","sourceRoot":"","sources":["../../src/messaging/l2_to_l1_membership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EACL,WAAW,EAKZ,MAAM,yBAAyB,CAAC;AASjC,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,SAAS,CAAC,CAAC;CACvE;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,EAAE,CAAC;IACT,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,wBAAsB,8BAA8B,CAClD,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,EAAE,GACV,OAAO,CAAC,uBAAuB,GAAG,SAAS,CAAC,CAO9C;AAED,wBAAsB,mDAAmD,CACvE,iBAAiB,EAAE,EAAE,EAAE,EAAE,EACzB,OAAO,EAAE,EAAE,GACV,OAAO,CAAC,uBAAuB,CAAC,CAuDlC;AAED,wBAAgB,sBAAsB,CACpC,iBAAiB,EAAE,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,aAAa,CAAC,GAC5E,MAAM,CAER"}
|
|
@@ -1,70 +1,65 @@
|
|
|
1
|
-
import { SHA256Trunc } from '@aztec/foundation/crypto';
|
|
2
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import {
|
|
2
|
+
import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedMerkleTreeRoot, findLeafLevelAndIndex, getMaxUnbalancedTreeDepth } from '@aztec/foundation/trees';
|
|
3
|
+
async function createOutHashTree(messages) {
|
|
4
|
+
const messageSubtreeHeight = getMaxUnbalancedTreeDepth(messages.length);
|
|
5
|
+
const calculator = UnbalancedMerkleTreeCalculator.create(messageSubtreeHeight);
|
|
6
|
+
await calculator.appendLeaves(messages.map((msg)=>msg.toBuffer()));
|
|
7
|
+
return calculator;
|
|
8
|
+
}
|
|
4
9
|
export async function computeL2ToL1MembershipWitness(messageRetriever, l2BlockNumber, message) {
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
10
|
+
const messagesForAllTxs = await messageRetriever.getL2ToL1Messages(l2BlockNumber);
|
|
11
|
+
if (!messagesForAllTxs) {
|
|
7
12
|
return undefined;
|
|
8
13
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
14
|
+
return computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message);
|
|
15
|
+
}
|
|
16
|
+
export async function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(messagesForAllTxs, message) {
|
|
17
|
+
// Find index of message in subtree and index of tx in a block.
|
|
18
|
+
let messageIndexInTx = -1;
|
|
19
|
+
const txIndex = messagesForAllTxs.findIndex((messages)=>{
|
|
20
|
+
messageIndexInTx = messages.findIndex((msg)=>msg.equals(message));
|
|
21
|
+
return messageIndexInTx !== -1;
|
|
22
|
+
});
|
|
18
23
|
if (txIndex === -1) {
|
|
19
24
|
throw new Error('The L2ToL1Message you are trying to prove inclusion of does not exist');
|
|
20
25
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const calculator = await MerkleTreeCalculator.create(messageSubtreeHeight, Buffer.alloc(32, 0), (lhs, rhs)=>Promise.resolve(hasher.hash(lhs, rhs)));
|
|
29
|
-
const tree = await calculator.computeTree(txMessages.map((msg)=>msg.toBuffer()));
|
|
30
|
-
const tempPath = tree.getSiblingPath(messageIndexInTx);
|
|
31
|
-
messagePathInSubtree = new SiblingPath(tempPath.length, tempPath);
|
|
32
|
-
}
|
|
33
|
-
// If the number of txs is 1 we are dealing with a special case where the tx subtree itself is the whole block's
|
|
34
|
-
// l2 to l1 message tree.
|
|
35
|
-
const numTransactions = messagesPerTx.length;
|
|
36
|
-
if (numTransactions === 1) {
|
|
37
|
-
return {
|
|
38
|
-
l2MessageIndex: BigInt(messageIndexInTx),
|
|
39
|
-
siblingPath: messagePathInSubtree
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Calculate roots for all tx subtrees
|
|
43
|
-
const txSubtreeRoots = await Promise.all(messagesPerTx.map(async (messages, _)=>{
|
|
26
|
+
// Get the txOutHash and the sibling path of the message in the tx subtree.
|
|
27
|
+
const txMessages = messagesForAllTxs[txIndex];
|
|
28
|
+
const txOutHashTree = await createOutHashTree(txMessages);
|
|
29
|
+
const txOutHash = txOutHashTree.getRoot();
|
|
30
|
+
const messagePathInSubtree = await txOutHashTree.getSiblingPath(message);
|
|
31
|
+
// Calculate txOutHash for all txs.
|
|
32
|
+
const txSubtreeRoots = messagesForAllTxs.map((messages, i)=>{
|
|
44
33
|
// For a tx with no messages, we have to set an out hash of 0 to match what the circuit does.
|
|
45
34
|
if (messages.length === 0) {
|
|
46
35
|
return Fr.ZERO;
|
|
47
36
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
if (i === txIndex) {
|
|
38
|
+
return Fr.fromBuffer(txOutHash);
|
|
39
|
+
}
|
|
40
|
+
const root = computeUnbalancedMerkleTreeRoot(messages.map((msg)=>msg.toBuffer()));
|
|
51
41
|
return Fr.fromBuffer(root);
|
|
52
|
-
})
|
|
53
|
-
// Construct the top tree
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
42
|
+
});
|
|
43
|
+
// Construct the top tree.
|
|
44
|
+
// The leaves of this tree are the txOutHashes.
|
|
45
|
+
// The root of this tree is the out_hash calculated in the circuit.
|
|
46
|
+
const topTree = await createOutHashTree(txSubtreeRoots);
|
|
47
|
+
const root = Fr.fromBuffer(topTree.getRoot());
|
|
48
|
+
// Compute the combined sibling path by appending the tx subtree path to the top tree path.
|
|
49
|
+
const txPathInTopTree = await topTree.getSiblingPath(txOutHash);
|
|
50
|
+
const combinedPath = messagePathInSubtree.toBufferArray().concat(txPathInTopTree.toBufferArray());
|
|
51
|
+
// Compute the combined index.
|
|
52
|
+
// It is the index of the message in the balanced tree at its current height.
|
|
53
|
+
const txLeafPosition = findLeafLevelAndIndex(messagesForAllTxs.length, txIndex);
|
|
54
|
+
const messageLeafPosition = findLeafLevelAndIndex(txMessages.length, messageIndexInTx);
|
|
55
|
+
const numLeavesInLeftSubtrees = txLeafPosition.indexAtLevel * (1 << messageLeafPosition.level);
|
|
56
|
+
const combinedIndex = numLeavesInLeftSubtrees + messageLeafPosition.indexAtLevel;
|
|
66
57
|
return {
|
|
67
|
-
|
|
58
|
+
root,
|
|
59
|
+
leafIndex: BigInt(combinedIndex),
|
|
68
60
|
siblingPath: new SiblingPath(combinedPath.length, combinedPath)
|
|
69
61
|
};
|
|
70
62
|
}
|
|
63
|
+
export function getL2ToL1MessageLeafId(membershipWitness) {
|
|
64
|
+
return 2n ** BigInt(membershipWitness.siblingPath.pathSize) + membershipWitness.leafIndex;
|
|
65
|
+
}
|
|
@@ -207,5 +207,7 @@ export declare class ScopedCountedL2ToL1Message {
|
|
|
207
207
|
isEmpty(): boolean;
|
|
208
208
|
static fromBuffer(buffer: Buffer | BufferReader): ScopedCountedL2ToL1Message;
|
|
209
209
|
toBuffer(): Buffer;
|
|
210
|
+
static fromFields(fields: Fr[] | FieldReader): ScopedCountedL2ToL1Message;
|
|
211
|
+
toFields(): Fr[];
|
|
210
212
|
}
|
|
211
213
|
//# sourceMappingURL=l2_to_l1_message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_to_l1_message.d.ts","sourceRoot":"","sources":["../../src/messaging/l2_to_l1_message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,aAAa;IAEf,SAAS,EAAE,UAAU;IACrB,OAAO,EAAE,EAAE;gBADX,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,EAAE;IAGpB,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,aAAa;IAI7B;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAIrC;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;OAGG;IACH,QAAQ,IAAI,EAAE,EAAE;IAIhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,aAAa;IAK5D;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa;IAK/D;;;OAGG;IACH,OAAO,IAAI,OAAO;IAIlB,KAAK,C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.contractAddress);
|
|
167
167
|
}
|
|
168
|
+
static fromFields(fields) {
|
|
169
|
+
const reader = FieldReader.asReader(fields);
|
|
170
|
+
return new ScopedCountedL2ToL1Message(reader.readObject(CountedL2ToL1Message), reader.readObject(AztecAddress));
|
|
171
|
+
}
|
|
172
|
+
toFields() {
|
|
173
|
+
return serializeToFields(this.inner, this.contractAddress);
|
|
174
|
+
}
|
|
168
175
|
}
|
|
@@ -8,10 +8,13 @@ import { NoteStatus } from './note_status.js';
|
|
|
8
8
|
* @remarks This filter is applied as an intersection of all its params.
|
|
9
9
|
*/
|
|
10
10
|
export type NotesFilter = {
|
|
11
|
+
/**
|
|
12
|
+
* The contract address the note belongs to.
|
|
13
|
+
* @remarks Providing a contract address is required as we need that information to trigger private state sync.
|
|
14
|
+
*/
|
|
15
|
+
contractAddress: AztecAddress;
|
|
11
16
|
/** Hash of a transaction from which to fetch the notes. */
|
|
12
17
|
txHash?: TxHash;
|
|
13
|
-
/** The contract address the note belongs to. */
|
|
14
|
-
contractAddress?: AztecAddress;
|
|
15
18
|
/** The specific storage location of the note on the contract. */
|
|
16
19
|
storageSlot?: Fr;
|
|
17
20
|
/** The recipient of the note (whose public key was used to encrypt the note). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../../src/note/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB
|
|
1
|
+
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../../src/note/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,iFAAiF;IACjF,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,oDAAoD;IACpD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,eAAe,CAAC,EAAE,EAAE,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAQhD,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { schemas } from '../schemas/index.js';
|
|
|
3
3
|
import { TxHash } from '../tx/tx_hash.js';
|
|
4
4
|
import { NoteStatus } from './note_status.js';
|
|
5
5
|
export const NotesFilterSchema = z.object({
|
|
6
|
+
contractAddress: schemas.AztecAddress,
|
|
6
7
|
txHash: TxHash.schema.optional(),
|
|
7
|
-
contractAddress: schemas.AztecAddress.optional(),
|
|
8
8
|
storageSlot: schemas.Fr.optional(),
|
|
9
9
|
recipient: schemas.AztecAddress.optional(),
|
|
10
10
|
status: z.nativeEnum(NoteStatus).optional(),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { CommitteeAttestation } from '../block/index.js';
|
|
3
|
+
import type { BlockAttestation } from './block_attestation.js';
|
|
4
|
+
/**
|
|
5
|
+
* Returns attestation signatures in the order of a series of provided ethereum addresses
|
|
6
|
+
* The rollup smart contract expects attestations to appear in the order of the committee
|
|
7
|
+
* @todo: perform this logic within the memory attestation store instead?
|
|
8
|
+
*/
|
|
9
|
+
export declare function orderAttestations(attestations: BlockAttestation[], orderAddresses: EthAddress[]): CommitteeAttestation[];
|
|
10
|
+
//# sourceMappingURL=attestation_utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation_utils.d.ts","sourceRoot":"","sources":["../../src/p2p/attestation_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,gBAAgB,EAAE,EAChC,cAAc,EAAE,UAAU,EAAE,GAC3B,oBAAoB,EAAE,CAqBxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CommitteeAttestation } from '../block/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns attestation signatures in the order of a series of provided ethereum addresses
|
|
4
|
+
* The rollup smart contract expects attestations to appear in the order of the committee
|
|
5
|
+
* @todo: perform this logic within the memory attestation store instead?
|
|
6
|
+
*/ export function orderAttestations(attestations, orderAddresses) {
|
|
7
|
+
// Create a map of sender addresses to BlockAttestations
|
|
8
|
+
const attestationMap = new Map();
|
|
9
|
+
for (const attestation of attestations){
|
|
10
|
+
const sender = attestation.getSender();
|
|
11
|
+
if (sender) {
|
|
12
|
+
attestationMap.set(sender.toString(), CommitteeAttestation.fromAddressAndSignature(sender, attestation.signature));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
// Create the ordered array based on the orderAddresses, else return an empty attestation
|
|
16
|
+
const orderedAttestations = orderAddresses.map((address)=>{
|
|
17
|
+
const addressString = address.toString();
|
|
18
|
+
return attestationMap.get(addressString) || CommitteeAttestation.fromAddress(address);
|
|
19
|
+
});
|
|
20
|
+
return orderedAttestations;
|
|
21
|
+
}
|
|
@@ -37,10 +37,9 @@ export declare class BlockAttestation extends Gossipable {
|
|
|
37
37
|
generateP2PMessageIdentifier(): Promise<Buffer32>;
|
|
38
38
|
get archive(): Fr;
|
|
39
39
|
get slotNumber(): Fr;
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @returns The sender of the attestation
|
|
40
|
+
/**
|
|
41
|
+
* Lazily evaluate and cache the signer of the attestation
|
|
42
|
+
* @returns The signer of the attestation
|
|
44
43
|
*/
|
|
45
44
|
getSender(): EthAddress;
|
|
46
45
|
getPayload(): Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_attestation.d.ts","sourceRoot":"","sources":["../../src/p2p/block_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAi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E,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,QAAQ;gBACpC,IAAI,EAAE,MAAM;CAGzB;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAM5C,2CAA2C;aAC3B,WAAW,EAAE,MAAM;IAEnC,iEAAiE;aACjD,OAAO,EAAE,gBAAgB;IAEzC,0CAA0C;aAC1B,SAAS,EAAE,SAAS;IAZtC,OAAgB,QAAQ,YAA+B;IAEvD,OAAO,CAAC,MAAM,CAAyB;;IAGrC,2CAA2C;IAC3B,WAAW,EAAE,MAAM;IAEnC,iEAAiE;IACjD,OAAO,EAAE,gBAAgB;IAEzC,0CAA0C;IAC1B,SAAS,EAAE,SAAS;IAKtC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAQ5C;IAEQ,4BAA4B,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI1D,IAAI,OAAO,IAAI,EAAE,CAEhB;IAED,IAAI,UAAU,IAAI,EAAE,CAEnB;IAED;;;OAGG;IACH,SAAS,IAAI,UAAU;IAWvB,UAAU,IAAI,MAAM;IAIpB,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB;IAK/D,MAAM,CAAC,KAAK,IAAI,gBAAgB;IAIhC,OAAO,IAAI,MAAM;CAGlB"}
|
|
@@ -43,10 +43,9 @@ export class BlockAttestationHash extends Buffer32 {
|
|
|
43
43
|
get slotNumber() {
|
|
44
44
|
return this.payload.header.slotNumber;
|
|
45
45
|
}
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @returns The sender of the attestation
|
|
46
|
+
/**
|
|
47
|
+
* Lazily evaluate and cache the signer of the attestation
|
|
48
|
+
* @returns The signer of the attestation
|
|
50
49
|
*/ getSender() {
|
|
51
50
|
if (!this.sender) {
|
|
52
51
|
// Recover the sender from the attestation
|
|
@@ -3,6 +3,8 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
3
3
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
6
|
+
import type { BlockInfo } from '../block/l2_block.js';
|
|
7
|
+
import { TxHash } from '../tx/index.js';
|
|
6
8
|
import { Tx } from '../tx/tx.js';
|
|
7
9
|
import type { UInt32 } from '../types/index.js';
|
|
8
10
|
import { ConsensusPayload } from './consensus_payload.js';
|
|
@@ -27,6 +29,8 @@ export declare class BlockProposal extends Gossipable {
|
|
|
27
29
|
readonly payload: ConsensusPayload;
|
|
28
30
|
/** The signer of the BlockProposal over the header of the new block*/
|
|
29
31
|
readonly signature: Signature;
|
|
32
|
+
/** The sequence of transactions in the block */
|
|
33
|
+
readonly txHashes: TxHash[];
|
|
30
34
|
/** The transactions in the block */
|
|
31
35
|
readonly txs?: Tx[] | undefined;
|
|
32
36
|
static p2pTopic: TopicType;
|
|
@@ -38,12 +42,15 @@ export declare class BlockProposal extends Gossipable {
|
|
|
38
42
|
payload: ConsensusPayload,
|
|
39
43
|
/** The signer of the BlockProposal over the header of the new block*/
|
|
40
44
|
signature: Signature,
|
|
45
|
+
/** The sequence of transactions in the block */
|
|
46
|
+
txHashes: TxHash[],
|
|
41
47
|
/** The transactions in the block */
|
|
42
48
|
txs?: Tx[] | undefined);
|
|
43
49
|
generateP2PMessageIdentifier(): Promise<Buffer32>;
|
|
44
50
|
get archive(): Fr;
|
|
45
51
|
get slotNumber(): Fr;
|
|
46
|
-
|
|
52
|
+
toBlockInfo(): BlockInfo;
|
|
53
|
+
static createProposalFromSigner(blockNumber: UInt32, payload: ConsensusPayload, txHashes: TxHash[], txs: Tx[] | undefined, payloadSigner: (payload: Buffer32) => Promise<Signature>): Promise<BlockProposal>;
|
|
47
54
|
/**Get Sender
|
|
48
55
|
* Lazily evaluate the sender of the proposal; result is cached
|
|
49
56
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_proposal.d.ts","sourceRoot":"","sources":["../../src/p2p/block_proposal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,iBAAkB,SAAQ,QAAQ;gBACjC,IAAI,EAAE,MAAM;CAGzB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAMzC,8BAA8B;aACd,WAAW,EAAE,MAAM;IAEnC,iEAAiE;aACjD,OAAO,EAAE,gBAAgB;IAEzC,sEAAsE;aACtD,SAAS,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"block_proposal.d.ts","sourceRoot":"","sources":["../../src/p2p/block_proposal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE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