@aztec/stdlib 0.0.1-commit.8c0b8ff → 0.0.1-commit.8cb2d04d8
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 +191 -26
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +4 -45
- package/dest/abi/authorization_selector.d.ts +3 -6
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +32 -6
- package/dest/abi/event_selector.d.ts +3 -6
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +3 -6
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +1 -3
- package/dest/abi/note_selector.d.ts +3 -6
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -3
- package/dest/avm/avm_accumulated_data.js +2 -2
- package/dest/avm/avm_circuit_public_inputs.js +2 -2
- package/dest/aztec-address/index.d.ts +3 -6
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +2 -4
- package/dest/block/block_data.d.ts +8 -8
- package/dest/block/block_data.d.ts.map +1 -1
- package/dest/block/block_data.js +2 -2
- package/dest/block/block_hash.d.ts +11 -10
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +10 -9
- package/dest/block/l2_block_info.d.ts +6 -5
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_info.js +6 -5
- package/dest/block/l2_block_source.d.ts +80 -3
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +18 -5
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +4 -3
- package/dest/checkpoint/checkpoint.d.ts +7 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +9 -1
- package/dest/checkpoint/checkpoint_data.d.ts +71 -5
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +10 -0
- package/dest/config/chain-config.d.ts +1 -1
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +7 -1
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/pipelining-config.d.ts +19 -0
- package/dest/config/pipelining-config.d.ts.map +1 -0
- package/dest/config/pipelining-config.js +18 -0
- package/dest/config/sequencer-config.d.ts +4 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +11 -3
- package/dest/contract/contract_address.d.ts +3 -3
- package/dest/contract/contract_address.js +3 -3
- package/dest/contract/contract_class_id.d.ts +2 -2
- package/dest/contract/contract_class_id.js +2 -2
- package/dest/contract/index.d.ts +1 -3
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -2
- package/dest/contract/interfaces/contract_class.d.ts +3 -156
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +1 -28
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +2 -4
- package/dest/epoch-helpers/index.d.ts +3 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +3 -0
- package/dest/file-store/factory.d.ts +4 -3
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +2 -2
- package/dest/file-store/http.d.ts +9 -2
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +20 -9
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/gas/fee_math.d.ts +49 -0
- package/dest/gas/fee_math.d.ts.map +1 -0
- package/dest/gas/fee_math.js +80 -0
- package/dest/gas/gas_fees.d.ts +1 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +10 -1
- package/dest/gas/index.d.ts +2 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +1 -0
- package/dest/ha-signing/config.d.ts +136 -0
- package/dest/ha-signing/config.d.ts.map +1 -0
- package/dest/ha-signing/config.js +97 -0
- package/dest/ha-signing/index.d.ts +4 -0
- package/dest/ha-signing/index.d.ts.map +1 -0
- package/dest/ha-signing/index.js +3 -0
- package/dest/ha-signing/local_config.d.ts +63 -0
- package/dest/ha-signing/local_config.d.ts.map +1 -0
- package/dest/ha-signing/local_config.js +24 -0
- package/dest/ha-signing/types.d.ts +90 -0
- package/dest/ha-signing/types.d.ts.map +1 -0
- package/dest/ha-signing/types.js +39 -0
- package/dest/hash/hash.d.ts +16 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +32 -0
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +3 -1
- package/dest/interfaces/aztec-node-admin.d.ts +16 -17
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +3 -3
- package/dest/interfaces/aztec-node.d.ts +10 -1
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +2 -0
- package/dest/interfaces/l2_logs_source.d.ts +5 -3
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +1 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +0 -3
- package/dest/interfaces/proving-job.d.ts +200 -200
- package/dest/interfaces/slasher.d.ts +1 -10
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +0 -2
- package/dest/interfaces/validator.d.ts +45 -36
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +2 -3
- package/dest/kernel/claimed_length_array.js +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/padded_side_effects.js +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +2 -2
- package/dest/kernel/private_to_public_accumulated_data.js +2 -2
- package/dest/kernel/private_to_rollup_accumulated_data.js +1 -1
- package/dest/kv-store/config.d.ts +17 -0
- package/dest/kv-store/config.d.ts.map +1 -0
- package/dest/kv-store/config.js +26 -0
- package/dest/kv-store/index.d.ts +2 -0
- package/dest/kv-store/index.d.ts.map +1 -0
- package/dest/kv-store/index.js +1 -0
- package/dest/l1-contracts/index.d.ts +2 -2
- package/dest/l1-contracts/index.d.ts.map +1 -1
- package/dest/l1-contracts/index.js +1 -1
- package/dest/logs/log_id.d.ts +1 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +1 -2
- package/dest/logs/private_log.js +1 -1
- package/dest/logs/public_log.d.ts +1 -1
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +1 -7
- package/dest/logs/siloed_tag.d.ts +5 -7
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +4 -0
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +4 -0
- package/dest/messaging/l1_to_l2_message_source.d.ts +4 -2
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +7 -9
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +5 -10
- package/dest/p2p/checkpoint_attestation.d.ts +4 -6
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +2 -7
- package/dest/p2p/checkpoint_proposal.d.ts +9 -11
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +6 -25
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +1 -1
- package/dest/proofs/chonk_proof.d.ts +46 -2
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +84 -15
- package/dest/rollup/base_rollup_hints.js +2 -2
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_headers_hash.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +8 -2
- package/dest/rollup/block_root_rollup_private_inputs.js +5 -5
- package/dest/rollup/checkpoint_rollup_public_inputs.js +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +3 -3
- package/dest/rollup/root_rollup_public_inputs.js +1 -1
- package/dest/rollup/tree_snapshot_diff_hints.js +2 -2
- package/dest/slashing/index.d.ts +2 -3
- package/dest/slashing/index.d.ts.map +1 -1
- package/dest/slashing/index.js +1 -2
- package/dest/slashing/serialization.d.ts +2 -6
- package/dest/slashing/serialization.d.ts.map +1 -1
- package/dest/slashing/serialization.js +0 -60
- package/dest/slashing/types.d.ts +4 -90
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +0 -14
- package/dest/slashing/{tally.d.ts → votes.d.ts} +1 -1
- package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
- package/dest/slashing/{tally.js → votes.js} +1 -1
- package/dest/tests/factories.d.ts +3 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +11 -34
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +12 -17
- package/dest/timetable/index.d.ts +51 -1
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +204 -14
- package/dest/trees/nullifier_leaf.d.ts +2 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +3 -0
- package/dest/tx/block_header.d.ts +2 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +1 -1
- package/dest/tx/fee_provider.d.ts +10 -0
- package/dest/tx/fee_provider.d.ts.map +1 -0
- package/dest/tx/fee_provider.js +1 -0
- package/dest/tx/global_variable_builder.d.ts +3 -4
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/index.d.ts +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/indexed_tx_effect.d.ts +1 -1
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +1 -2
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/simulated_tx.d.ts +151 -26
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +3 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/types/shared.d.ts +1 -10
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +0 -9
- package/dest/vks/verification_key.d.ts +2 -137
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +5 -126
- package/dest/vks/vk_data.js +1 -1
- package/dest/world-state/genesis_data.d.ts +11 -0
- package/dest/world-state/genesis_data.d.ts.map +1 -0
- package/dest/world-state/genesis_data.js +4 -0
- package/dest/world-state/index.d.ts +2 -1
- package/dest/world-state/index.d.ts.map +1 -1
- package/dest/world-state/index.js +1 -0
- package/package.json +11 -10
- package/src/abi/abi.ts +14 -67
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/encoder.ts +42 -6
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_selector.ts +3 -12
- package/src/abi/note_selector.ts +3 -12
- package/src/avm/avm_accumulated_data.ts +6 -6
- package/src/avm/avm_circuit_public_inputs.ts +4 -4
- package/src/aztec-address/index.ts +4 -10
- package/src/block/block_data.ts +3 -4
- package/src/block/block_hash.ts +21 -14
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +10 -2
- package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
- package/src/block/test/l2_tips_store_test_suite.ts +9 -2
- package/src/checkpoint/checkpoint.ts +11 -1
- package/src/checkpoint/checkpoint_data.ts +40 -4
- package/src/config/chain-config.ts +7 -1
- package/src/config/index.ts +1 -0
- package/src/config/pipelining-config.ts +31 -0
- package/src/config/sequencer-config.ts +17 -4
- package/src/contract/contract_address.ts +3 -3
- package/src/contract/contract_class_id.ts +2 -2
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/contract/private_function.ts +3 -1
- package/src/epoch-helpers/index.ts +5 -0
- package/src/file-store/factory.ts +13 -4
- package/src/file-store/http.ts +29 -10
- package/src/file-store/index.ts +1 -0
- package/src/gas/README.md +31 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas_fees.ts +12 -4
- package/src/gas/index.ts +1 -0
- package/src/ha-signing/config.ts +156 -0
- package/src/ha-signing/index.ts +29 -0
- package/src/ha-signing/local_config.ts +46 -0
- package/src/ha-signing/types.ts +126 -0
- package/src/hash/hash.ts +27 -0
- package/src/interfaces/archiver.ts +3 -1
- package/src/interfaces/aztec-node-admin.ts +5 -7
- package/src/interfaces/aztec-node.ts +15 -0
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +3 -2
- package/src/interfaces/prover-client.ts +2 -5
- package/src/interfaces/slasher.ts +0 -6
- package/src/interfaces/validator.ts +53 -44
- package/src/kernel/claimed_length_array.ts +2 -2
- package/src/kernel/hints/private_kernel_reset_hints.ts +2 -5
- package/src/kernel/hints/read_request_hints.ts +3 -3
- package/src/kernel/padded_side_effects.ts +3 -3
- package/src/kernel/private_to_avm_accumulated_data.ts +4 -4
- package/src/kernel/private_to_public_accumulated_data.ts +10 -10
- package/src/kernel/private_to_rollup_accumulated_data.ts +5 -5
- package/src/kv-store/config.ts +36 -0
- package/src/kv-store/index.ts +1 -0
- package/src/l1-contracts/index.ts +1 -1
- package/src/logs/log_id.ts +1 -2
- package/src/logs/private_log.ts +1 -1
- package/src/logs/public_log.ts +1 -11
- package/src/logs/siloed_tag.ts +8 -9
- package/src/logs/tag.ts +8 -8
- package/src/messaging/l1_to_l2_message_source.ts +3 -1
- package/src/p2p/block_proposal.ts +14 -10
- package/src/p2p/checkpoint_attestation.ts +5 -9
- package/src/p2p/checkpoint_proposal.ts +22 -37
- package/src/p2p/gossipable.ts +4 -4
- package/src/parity/parity_base_private_inputs.ts +1 -1
- package/src/proofs/chonk_proof.ts +90 -12
- package/src/rollup/base_rollup_hints.ts +2 -2
- package/src/rollup/block_headers_hash.ts +11 -2
- package/src/rollup/block_root_rollup_private_inputs.ts +8 -8
- package/src/rollup/checkpoint_rollup_public_inputs.ts +2 -2
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +4 -4
- package/src/rollup/root_rollup_public_inputs.ts +2 -2
- package/src/rollup/tree_snapshot_diff_hints.ts +5 -5
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +3 -35
- package/src/slashing/{tally.ts → votes.ts} +1 -1
- package/src/tests/factories.ts +5 -42
- package/src/tests/mocks.ts +14 -10
- package/src/timetable/index.ts +293 -13
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/tx/block_header.ts +2 -2
- package/src/tx/fee_provider.ts +10 -0
- package/src/tx/global_variable_builder.ts +2 -3
- package/src/tx/index.ts +1 -0
- package/src/tx/indexed_tx_effect.ts +1 -2
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/tx.ts +2 -2
- package/src/types/shared.ts +0 -10
- package/src/vks/verification_key.ts +5 -184
- package/src/vks/vk_data.ts +1 -1
- package/src/world-state/genesis_data.ts +15 -0
- package/src/world-state/index.ts +1 -0
- package/dest/abi/mocked_keys.d.ts +0 -2
- package/dest/abi/mocked_keys.d.ts.map +0 -1
- package/dest/abi/mocked_keys.js +0 -1
- package/dest/contract/private_function_membership_proof.d.ts +0 -32
- package/dest/contract/private_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/private_function_membership_proof.js +0 -124
- package/dest/contract/utility_function_membership_proof.d.ts +0 -27
- package/dest/contract/utility_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/utility_function_membership_proof.js +0 -87
- package/dest/l1-contracts/slash_factory.d.ts +0 -45
- package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
- package/dest/l1-contracts/slash_factory.js +0 -158
- package/dest/slashing/empire.d.ts +0 -31
- package/dest/slashing/empire.d.ts.map +0 -1
- package/dest/slashing/empire.js +0 -87
- package/src/abi/mocked_keys.ts +0 -2
- package/src/contract/private_function_membership_proof.ts +0 -167
- package/src/contract/utility_function_membership_proof.ts +0 -118
- package/src/l1-contracts/slash_factory.ts +0 -180
- package/src/slashing/empire.ts +0 -104
|
@@ -1,19 +1,63 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
+
/**
|
|
4
|
+
* Serialization format detection for ChonkProof is size-based:
|
|
5
|
+
* - UNCOMPRESSED (legacy): [field_count=1632: uint32] [fields...] → total ≈ 52KB (>= 40KB)
|
|
6
|
+
* - COMPRESSED: [byte_count: uint32] [compressed_bytes] → total ≈ 35KB (< 40KB)
|
|
7
|
+
*
|
|
8
|
+
* Detection: if the first uint32 equals CHONK_PROOF_LENGTH (1632), it's legacy format
|
|
9
|
+
* (field count). Otherwise, it's compressed format (byte count). The old uncompressed
|
|
10
|
+
* format is never smaller than 40KB; compressed proofs are always smaller than 40KB.
|
|
11
|
+
*/
|
|
3
12
|
export declare class ChonkProof {
|
|
4
13
|
fields: Fr[];
|
|
5
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Optional compressed proof bytes from chonk compression (point compression + u256 encoding).
|
|
16
|
+
* When set, toBuffer() will serialize in compressed format (~1.7x smaller).
|
|
17
|
+
* When reading from compressed format, this is populated and fields are decompressed on demand.
|
|
18
|
+
*/
|
|
19
|
+
compressedProof?: Buffer;
|
|
20
|
+
constructor(fields: Fr[], compressedProof?: Buffer);
|
|
6
21
|
attachPublicInputs(publicInputs: Fr[]): ChonkProofWithPublicInputs;
|
|
7
22
|
isEmpty(): boolean;
|
|
8
23
|
static empty(): ChonkProof;
|
|
9
24
|
static random(): ChonkProof;
|
|
10
25
|
static get schema(): import("zod").ZodType<ChonkProof, any, string>;
|
|
11
26
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
27
|
+
/**
|
|
28
|
+
* Deserialize a ChonkProof from a buffer.
|
|
29
|
+
* Supports both legacy (field elements) and compressed (chonk compression) formats.
|
|
30
|
+
*
|
|
31
|
+
* Size-based format detection:
|
|
32
|
+
* - First uint32 == CHONK_PROOF_LENGTH (1632): legacy format, read field elements
|
|
33
|
+
* Total proof data ≈ 52KB (always >= 40KB)
|
|
34
|
+
* - Otherwise: compressed format, first uint32 is byte count of compressed data
|
|
35
|
+
* Total proof data ≈ 35KB (always < 40KB)
|
|
36
|
+
*/
|
|
12
37
|
static fromBuffer(buffer: Buffer | BufferReader): ChonkProof;
|
|
38
|
+
/**
|
|
39
|
+
* Create a ChonkProof from compressed bytes by decompressing via the BarretenbergSync API.
|
|
40
|
+
* The compressed format uses point compression and u256 encoding (from PR #20645).
|
|
41
|
+
*
|
|
42
|
+
* @param compressed - Compressed proof bytes from chonk compression
|
|
43
|
+
* @returns ChonkProof with both fields and compressed bytes populated
|
|
44
|
+
*/
|
|
45
|
+
static fromCompressedBytes(compressed: Buffer): ChonkProof;
|
|
46
|
+
/**
|
|
47
|
+
* Serialize the proof to a buffer.
|
|
48
|
+
* If compressed bytes are available, uses the compressed format (~1.7x smaller).
|
|
49
|
+
* Otherwise falls back to legacy field element format.
|
|
50
|
+
*/
|
|
13
51
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
14
52
|
}
|
|
15
53
|
export declare class ChonkProofWithPublicInputs {
|
|
16
54
|
fieldsWithPublicInputs: Fr[];
|
|
55
|
+
/**
|
|
56
|
+
* Optional compressed proof bytes (covers the full proof WITH public inputs).
|
|
57
|
+
* Set by the prover when using chonk compression. Flows through to ChonkProof
|
|
58
|
+
* via removePublicInputs() so the Tx can serialize in compressed format.
|
|
59
|
+
*/
|
|
60
|
+
compressedProof?: Buffer;
|
|
17
61
|
constructor(fieldsWithPublicInputs: Fr[]);
|
|
18
62
|
getPublicInputs(): Fr[];
|
|
19
63
|
removePublicInputs(): ChonkProof;
|
|
@@ -25,4 +69,4 @@ export declare class ChonkProofWithPublicInputs {
|
|
|
25
69
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
26
70
|
static fromBufferArray(fields: Uint8Array[]): ChonkProofWithPublicInputs;
|
|
27
71
|
}
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hvbmtfcHJvb2YuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm9vZnMvY2hvbmtfcHJvb2YudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXBELE9BQU8sRUFBRSxZQUFZLEVBQW9DLE1BQU0sNkJBQTZCLENBQUM7QUFFN0Y7Ozs7Ozs7O0dBUUc7QUFHSCxxQkFBYSxVQUFVO0lBWVosTU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JBQTBCLENBSzNFO0lBRU0sUUFBUSw0QkFFZDtJQUdELE1BQU0sQ0FBQyxlQUFlLENBQUMsTUFBTSxFQUFFLFVBQVUsRUFBRSxHQUFHLDBCQUEwQixDQUd2RTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chonk_proof.d.ts","sourceRoot":"","sources":["../../src/proofs/chonk_proof.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chonk_proof.d.ts","sourceRoot":"","sources":["../../src/proofs/chonk_proof.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAoC,MAAM,6BAA6B,CAAC;AAE7F;;;;;;;;GAQG;AAGH,qBAAa,UAAU;IAYZ,MAAM,EAAE,EAAE,EAAE;IAXrB;;;;OAIG;IACI,eAAe,CAAC,EAAE,MAAM,CAAC;IAEhC,YAIS,MAAM,EAAE,EAAE,EAAE,EACnB,eAAe,CAAC,EAAE,MAAM,EAMzB;IAEM,kBAAkB,CAAC,YAAY,EAAE,EAAE,EAAE,8BAE3C;IAEM,OAAO,YAEb;IAED,MAAM,CAAC,KAAK,eAEX;IAED,MAAM,CAAC,MAAM,eAYZ;IAED,MAAM,KAAK,MAAM,mDAEhB;IAGD,MAAM,4BAEL;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAgB3D;IAED;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAkBzD;IAED;;;;OAIG;IACI,QAAQ,4BAOd;CACF;AAED,qBAAa,0BAA0B;IAW5B,sBAAsB,EAAE,EAAE,EAAE;IAVrC;;;;OAIG;IACI,eAAe,CAAC,EAAE,MAAM,CAAC;IAEhC,YAGS,sBAAsB,EAAE,EAAE,EAAE,EAKpC;IAEM,eAAe,SAGrB;IAEM,kBAAkB,eAIxB;IAEM,OAAO,YAEb;IAED,MAAM,CAAC,KAAK,+BAEX;IAED,MAAM,KAAK,MAAM,mEAEhB;IAGD,MAAM,4BAEL;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,0BAA0B,CAK3E;IAEM,QAAQ,4BAEd;IAGD,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,0BAA0B,CAGvE;CACF"}
|
|
@@ -1,20 +1,35 @@
|
|
|
1
|
+
import { BarretenbergSync, flattenChonkProofFields } from '@aztec/bb.js';
|
|
1
2
|
import { CHONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
3
|
import { times } from '@aztec/foundation/collection';
|
|
3
4
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
4
5
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
6
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
6
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
7
|
-
|
|
7
|
+
import { BufferReader, numToUInt32BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
8
|
+
/**
|
|
9
|
+
* Serialization format detection for ChonkProof is size-based:
|
|
10
|
+
* - UNCOMPRESSED (legacy): [field_count=1632: uint32] [fields...] → total ≈ 52KB (>= 40KB)
|
|
11
|
+
* - COMPRESSED: [byte_count: uint32] [compressed_bytes] → total ≈ 35KB (< 40KB)
|
|
12
|
+
*
|
|
13
|
+
* Detection: if the first uint32 equals CHONK_PROOF_LENGTH (1632), it's legacy format
|
|
14
|
+
* (field count). Otherwise, it's compressed format (byte count). The old uncompressed
|
|
15
|
+
* format is never smaller than 40KB; compressed proofs are always smaller than 40KB.
|
|
16
|
+
*/ // CHONK: "Client Honk" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.
|
|
8
17
|
export class ChonkProof {
|
|
9
18
|
fields;
|
|
19
|
+
/**
|
|
20
|
+
* Optional compressed proof bytes from chonk compression (point compression + u256 encoding).
|
|
21
|
+
* When set, toBuffer() will serialize in compressed format (~1.7x smaller).
|
|
22
|
+
* When reading from compressed format, this is populated and fields are decompressed on demand.
|
|
23
|
+
*/ compressedProof;
|
|
10
24
|
constructor(// The proof fields.
|
|
11
25
|
// For native verification, attach public inputs via `attachPublicInputs(publicInputs)`.
|
|
12
26
|
// Not using Tuple here due to the length being too high.
|
|
13
|
-
fields){
|
|
27
|
+
fields, compressedProof){
|
|
14
28
|
this.fields = fields;
|
|
15
29
|
if (fields.length !== CHONK_PROOF_LENGTH) {
|
|
16
30
|
throw new Error(`Invalid ChonkProof length: ${fields.length}`);
|
|
17
31
|
}
|
|
32
|
+
this.compressedProof = compressedProof;
|
|
18
33
|
}
|
|
19
34
|
attachPublicInputs(publicInputs) {
|
|
20
35
|
return new ChonkProofWithPublicInputs([
|
|
@@ -48,21 +63,77 @@ export class ChonkProof {
|
|
|
48
63
|
toJSON() {
|
|
49
64
|
return this.toBuffer();
|
|
50
65
|
}
|
|
51
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Deserialize a ChonkProof from a buffer.
|
|
68
|
+
* Supports both legacy (field elements) and compressed (chonk compression) formats.
|
|
69
|
+
*
|
|
70
|
+
* Size-based format detection:
|
|
71
|
+
* - First uint32 == CHONK_PROOF_LENGTH (1632): legacy format, read field elements
|
|
72
|
+
* Total proof data ≈ 52KB (always >= 40KB)
|
|
73
|
+
* - Otherwise: compressed format, first uint32 is byte count of compressed data
|
|
74
|
+
* Total proof data ≈ 35KB (always < 40KB)
|
|
75
|
+
*/ static fromBuffer(buffer) {
|
|
52
76
|
const reader = BufferReader.asReader(buffer);
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
77
|
+
const firstUint32 = reader.readNumber();
|
|
78
|
+
if (firstUint32 === CHONK_PROOF_LENGTH) {
|
|
79
|
+
// Legacy format: firstUint32 is the field count (1632)
|
|
80
|
+
// Widen to `number` to prevent TS from narrowing to literal 1632,
|
|
81
|
+
// which would cause Tuple<Fr, 1632> to exceed the recursion limit.
|
|
82
|
+
const fieldCount = firstUint32;
|
|
83
|
+
const proof = reader.readArray(fieldCount, Fr);
|
|
84
|
+
return new ChonkProof(proof);
|
|
56
85
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
86
|
+
// Compressed format: firstUint32 is the compressed byte count
|
|
87
|
+
const compressedBytes = reader.readBytes(firstUint32);
|
|
88
|
+
return ChonkProof.fromCompressedBytes(Buffer.from(compressedBytes));
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Create a ChonkProof from compressed bytes by decompressing via the BarretenbergSync API.
|
|
92
|
+
* The compressed format uses point compression and u256 encoding (from PR #20645).
|
|
93
|
+
*
|
|
94
|
+
* @param compressed - Compressed proof bytes from chonk compression
|
|
95
|
+
* @returns ChonkProof with both fields and compressed bytes populated
|
|
96
|
+
*/ static fromCompressedBytes(compressed) {
|
|
97
|
+
const api = BarretenbergSync.getSingleton();
|
|
98
|
+
const result = api.chonkDecompressProof({
|
|
99
|
+
compressedProof: new Uint8Array(compressed)
|
|
100
|
+
});
|
|
101
|
+
// Flatten the structured bb.js ChonkProof into flat Fr[] field elements
|
|
102
|
+
const flatFields = flattenChonkProofFields(result.proof);
|
|
103
|
+
const fields = flatFields.map((f)=>Fr.fromBuffer(Buffer.from(f)));
|
|
104
|
+
// The decompressed proof includes public inputs in hidingOinkProof.
|
|
105
|
+
// Since ChonkProof stores fields WITHOUT public inputs, strip them.
|
|
106
|
+
// The number of public inputs = total fields - CHONK_PROOF_LENGTH
|
|
107
|
+
if (fields.length > CHONK_PROOF_LENGTH) {
|
|
108
|
+
const numPubInputs = fields.length - CHONK_PROOF_LENGTH;
|
|
109
|
+
const proofFields = fields.slice(numPubInputs);
|
|
110
|
+
return new ChonkProof(proofFields, compressed);
|
|
111
|
+
}
|
|
112
|
+
return new ChonkProof(fields, compressed);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Serialize the proof to a buffer.
|
|
116
|
+
* If compressed bytes are available, uses the compressed format (~1.7x smaller).
|
|
117
|
+
* Otherwise falls back to legacy field element format.
|
|
118
|
+
*/ toBuffer() {
|
|
119
|
+
if (this.compressedProof) {
|
|
120
|
+
// Compressed format: [compressed_byte_count: uint32] [compressed_bytes]
|
|
121
|
+
return Buffer.concat([
|
|
122
|
+
numToUInt32BE(this.compressedProof.length),
|
|
123
|
+
this.compressedProof
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
// Legacy format: [field_count=1632: uint32] [fields...]
|
|
61
127
|
return serializeToBuffer(this.fields.length, this.fields);
|
|
62
128
|
}
|
|
63
129
|
}
|
|
64
130
|
export class ChonkProofWithPublicInputs {
|
|
65
131
|
fieldsWithPublicInputs;
|
|
132
|
+
/**
|
|
133
|
+
* Optional compressed proof bytes (covers the full proof WITH public inputs).
|
|
134
|
+
* Set by the prover when using chonk compression. Flows through to ChonkProof
|
|
135
|
+
* via removePublicInputs() so the Tx can serialize in compressed format.
|
|
136
|
+
*/ compressedProof;
|
|
66
137
|
constructor(// The proof fields with public inputs.
|
|
67
138
|
// For recursive verification, use without public inputs via `removePublicInputs()`.
|
|
68
139
|
fieldsWithPublicInputs){
|
|
@@ -77,7 +148,8 @@ export class ChonkProofWithPublicInputs {
|
|
|
77
148
|
}
|
|
78
149
|
removePublicInputs() {
|
|
79
150
|
const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
|
|
80
|
-
|
|
151
|
+
// Flow compressed proof bytes through so the ChonkProof can serialize efficiently
|
|
152
|
+
return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs), this.compressedProof);
|
|
81
153
|
}
|
|
82
154
|
isEmpty() {
|
|
83
155
|
return this.fieldsWithPublicInputs.every((field)=>field.isZero());
|
|
@@ -95,9 +167,6 @@ export class ChonkProofWithPublicInputs {
|
|
|
95
167
|
static fromBuffer(buffer) {
|
|
96
168
|
const reader = BufferReader.asReader(buffer);
|
|
97
169
|
const proofLength = reader.readNumber();
|
|
98
|
-
if (proofLength < CHONK_PROOF_LENGTH) {
|
|
99
|
-
throw new Error(`Invalid ChonkProofWithPublicInputs length from buffer: ${proofLength}, expected at least ${CHONK_PROOF_LENGTH}`);
|
|
100
|
-
}
|
|
101
170
|
const proof = reader.readArray(proofLength, Fr);
|
|
102
171
|
return new ChonkProofWithPublicInputs(proof);
|
|
103
172
|
}
|
|
@@ -69,7 +69,7 @@ export class PrivateBaseRollupHints {
|
|
|
69
69
|
}
|
|
70
70
|
static fromBuffer(buffer) {
|
|
71
71
|
const reader = BufferReader.asReader(buffer);
|
|
72
|
-
return new PrivateBaseRollupHints(reader.readObject(PartialStateReference), reader.readObject(SpongeBlob), reader.readObject(TreeSnapshotDiffHints), reader.readObject(PublicDataTreeLeafPreimage), reader.
|
|
72
|
+
return new PrivateBaseRollupHints(reader.readObject(PartialStateReference), reader.readObject(SpongeBlob), reader.readObject(TreeSnapshotDiffHints), reader.readObject(PublicDataTreeLeafPreimage), reader.readArray(ARCHIVE_HEIGHT, Fr), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ()=>reader.readObject(ContractClassLogFields)), reader.readObject(BlockConstantData));
|
|
73
73
|
}
|
|
74
74
|
static fromString(str) {
|
|
75
75
|
return PrivateBaseRollupHints.fromBuffer(hexToBuffer(str));
|
|
@@ -122,7 +122,7 @@ export class PublicBaseRollupHints {
|
|
|
122
122
|
}
|
|
123
123
|
static fromBuffer(buffer) {
|
|
124
124
|
const reader = BufferReader.asReader(buffer);
|
|
125
|
-
return new PublicBaseRollupHints(reader.readObject(SpongeBlob), reader.readObject(AppendOnlyTreeSnapshot), reader.
|
|
125
|
+
return new PublicBaseRollupHints(reader.readObject(SpongeBlob), reader.readObject(AppendOnlyTreeSnapshot), reader.readArray(ARCHIVE_HEIGHT, Fr), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ()=>reader.readObject(ContractClassLogFields)));
|
|
126
126
|
}
|
|
127
127
|
static fromString(str) {
|
|
128
128
|
return PublicBaseRollupHints.fromBuffer(hexToBuffer(str));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
3
3
|
export declare function computeBlockHeadersHash(blockHeaders: BlockHeader[]): Promise<Fr>;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfaGVhZGVyc19oYXNoLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcm9sbHVwL2Jsb2NrX2hlYWRlcnNfaGFzaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFekQsd0JBQXNCLHVCQUF1QixDQUFDLFlBQVksRUFBRSxXQUFXLEVBQUUsR0FBRyxPQUFPLENBQUMsRUFBRSxDQUFDLENBYXRGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_headers_hash.d.ts","sourceRoot":"","sources":["../../src/rollup/block_headers_hash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"block_headers_hash.d.ts","sourceRoot":"","sources":["../../src/rollup/block_headers_hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,wBAAsB,uBAAuB,CAAC,YAAY,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAatF"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { DomainSeparator } from '@aztec/constants';
|
|
2
|
+
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
1
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
import {
|
|
4
|
+
import { computeUnbalancedMerkleTreeRootAsync } from '@aztec/foundation/trees';
|
|
3
5
|
export async function computeBlockHeadersHash(blockHeaders) {
|
|
4
6
|
const blockHeaderHashes = await Promise.all(blockHeaders.map((header)=>header.hash()));
|
|
5
7
|
// Must match the implementation in merge_block_rollups.nr, with the **unbalanced** rollup structure
|
|
6
8
|
// (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
|
|
7
|
-
const
|
|
9
|
+
const blockHeadersHasher = async (left, right)=>(await poseidon2HashWithSeparator([
|
|
10
|
+
Buffer.from(left),
|
|
11
|
+
Buffer.from(right)
|
|
12
|
+
], DomainSeparator.BLOCK_HEADERS_HASH)).toBuffer();
|
|
13
|
+
const blockHeadersHash = await computeUnbalancedMerkleTreeRootAsync(blockHeaderHashes.map((hash)=>hash.toBuffer()), blockHeadersHasher);
|
|
8
14
|
return Fr.fromBuffer(blockHeadersHash);
|
|
9
15
|
}
|
|
@@ -51,7 +51,7 @@ export class BlockRootFirstRollupPrivateInputs {
|
|
|
51
51
|
return new BlockRootFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), [
|
|
52
52
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
53
53
|
ProofData.fromBuffer(reader, TxRollupPublicInputs)
|
|
54
|
-
], AppendOnlyTreeSnapshot.fromBuffer(reader), reader.
|
|
54
|
+
], AppendOnlyTreeSnapshot.fromBuffer(reader), reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
55
55
|
}
|
|
56
56
|
toJSON() {
|
|
57
57
|
return this.toBuffer();
|
|
@@ -100,7 +100,7 @@ export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
100
100
|
}
|
|
101
101
|
static fromBuffer(buffer) {
|
|
102
102
|
const reader = BufferReader.asReader(buffer);
|
|
103
|
-
return new BlockRootSingleTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), reader.
|
|
103
|
+
return new BlockRootSingleTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
104
104
|
}
|
|
105
105
|
toJSON() {
|
|
106
106
|
return this.toBuffer();
|
|
@@ -167,7 +167,7 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
167
167
|
}
|
|
168
168
|
static fromBuffer(buffer) {
|
|
169
169
|
const reader = BufferReader.asReader(buffer);
|
|
170
|
-
return new BlockRootEmptyTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), StateReference.fromBuffer(reader), CheckpointConstantData.fromBuffer(reader), reader.readUInt64(), reader.
|
|
170
|
+
return new BlockRootEmptyTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), StateReference.fromBuffer(reader), CheckpointConstantData.fromBuffer(reader), reader.readUInt64(), reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
171
171
|
}
|
|
172
172
|
toJSON() {
|
|
173
173
|
return this.toBuffer();
|
|
@@ -204,7 +204,7 @@ export class BlockRootRollupPrivateInputs {
|
|
|
204
204
|
return new BlockRootRollupPrivateInputs([
|
|
205
205
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
206
206
|
ProofData.fromBuffer(reader, TxRollupPublicInputs)
|
|
207
|
-
], reader.
|
|
207
|
+
], reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
208
208
|
}
|
|
209
209
|
toJSON() {
|
|
210
210
|
return this.toBuffer();
|
|
@@ -238,7 +238,7 @@ export class BlockRootSingleTxRollupPrivateInputs {
|
|
|
238
238
|
}
|
|
239
239
|
static fromBuffer(buffer) {
|
|
240
240
|
const reader = BufferReader.asReader(buffer);
|
|
241
|
-
return new BlockRootSingleTxRollupPrivateInputs(ProofData.fromBuffer(reader, TxRollupPublicInputs), reader.
|
|
241
|
+
return new BlockRootSingleTxRollupPrivateInputs(ProofData.fromBuffer(reader, TxRollupPublicInputs), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
242
242
|
}
|
|
243
243
|
toJSON() {
|
|
244
244
|
return this.toBuffer();
|
|
@@ -54,7 +54,7 @@ import { EpochConstantData } from './epoch_constant_data.js';
|
|
|
54
54
|
}
|
|
55
55
|
static fromBuffer(buffer) {
|
|
56
56
|
const reader = BufferReader.asReader(buffer);
|
|
57
|
-
return new CheckpointRollupPublicInputs(reader.readObject(EpochConstantData), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.
|
|
57
|
+
return new CheckpointRollupPublicInputs(reader.readObject(EpochConstantData), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, Fr), reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient), reader.readObject(BlobAccumulator), reader.readObject(BlobAccumulator), reader.readObject(FinalBlobBatchingChallenges));
|
|
58
58
|
}
|
|
59
59
|
toBuffer() {
|
|
60
60
|
return serializeToBuffer(this.constants, this.previousArchive, this.newArchive, this.previousOutHash, this.newOutHash, this.checkpointHeaderHashes, this.fees, this.startBlobAccumulator, this.endBlobAccumulator, this.finalBlobChallenges);
|
|
@@ -72,11 +72,11 @@ export class CheckpointRootRollupHints {
|
|
|
72
72
|
}
|
|
73
73
|
static fromBuffer(buffer) {
|
|
74
74
|
const reader = BufferReader.asReader(buffer);
|
|
75
|
-
return new CheckpointRootRollupHints(BlockHeader.fromBuffer(reader), reader.
|
|
76
|
-
// reader.
|
|
75
|
+
return new CheckpointRootRollupHints(BlockHeader.fromBuffer(reader), reader.readArray(ARCHIVE_HEIGHT, Fr), reader.readObject(AppendOnlyTreeSnapshot), reader.readArray(OUT_HASH_TREE_HEIGHT, Fr), reader.readObject(BlobAccumulator), reader.readObject(FinalBlobBatchingChallenges), // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
76
|
+
// reader.readArray(FIELDS_PER_BLOB, Fr),
|
|
77
77
|
Array.from({
|
|
78
78
|
length: FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT
|
|
79
|
-
}, ()=>Fr.fromBuffer(reader)), reader.
|
|
79
|
+
}, ()=>Fr.fromBuffer(reader)), reader.readArray(BLOBS_PER_CHECKPOINT, BLS12Point), Fr.fromBuffer(reader));
|
|
80
80
|
}
|
|
81
81
|
toString() {
|
|
82
82
|
return bufferToHex(this.toBuffer());
|
|
@@ -57,7 +57,7 @@ import { EpochConstantData } from './epoch_constant_data.js';
|
|
|
57
57
|
* @returns The deserialized `RootRollupPublicInputs` object.
|
|
58
58
|
*/ static fromBuffer(buffer) {
|
|
59
59
|
const reader = BufferReader.asReader(buffer);
|
|
60
|
-
return new RootRollupPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.
|
|
60
|
+
return new RootRollupPublicInputs(Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, Fr), reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient), EpochConstantData.fromBuffer(reader), reader.readObject(FinalBlobAccumulator));
|
|
61
61
|
}
|
|
62
62
|
toString() {
|
|
63
63
|
return bufferToHex(this.toBuffer());
|
|
@@ -65,9 +65,9 @@ import { NullifierLeafPreimage } from '../trees/index.js';
|
|
|
65
65
|
* @returns A new TreeSnapshotDiffHints instance.
|
|
66
66
|
*/ static fromBuffer(buffer) {
|
|
67
67
|
const reader = BufferReader.asReader(buffer);
|
|
68
|
-
return new TreeSnapshotDiffHints(reader.
|
|
68
|
+
return new TreeSnapshotDiffHints(reader.readArray(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr), reader.readArray(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage), reader.readArray(MAX_NULLIFIERS_PER_TX, {
|
|
69
69
|
fromBuffer: (buffer)=>MembershipWitness.fromBuffer(buffer, NULLIFIER_TREE_HEIGHT)
|
|
70
|
-
}), reader.
|
|
70
|
+
}), reader.readArray(MAX_NULLIFIERS_PER_TX, Fr), reader.readNumbers(MAX_NULLIFIERS_PER_TX), reader.readArray(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr), MembershipWitness.fromBuffer(reader, PUBLIC_DATA_TREE_HEIGHT));
|
|
71
71
|
}
|
|
72
72
|
static empty() {
|
|
73
73
|
return new TreeSnapshotDiffHints(makeTuple(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr.zero), makeTuple(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage.empty), makeTuple(MAX_NULLIFIERS_PER_TX, ()=>MembershipWitness.empty(NULLIFIER_TREE_HEIGHT)), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero), makeTuple(MAX_NULLIFIERS_PER_TX, ()=>0), makeTuple(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr.zero), MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT));
|
package/dest/slashing/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './types.js';
|
|
2
2
|
export * from './interfaces.js';
|
|
3
3
|
export * from './helpers.js';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './tally.js';
|
|
4
|
+
export * from './votes.js';
|
|
6
5
|
export * from './serialization.js';
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zbGFzaGluZy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLFlBQVksQ0FBQztBQUMzQixjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsY0FBYyxDQUFDO0FBQzdCLGNBQWMsWUFBWSxDQUFDO0FBQzNCLGNBQWMsb0JBQW9CLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slashing/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/slashing/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
|
package/dest/slashing/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { Offense
|
|
1
|
+
import type { Offense } from './types.js';
|
|
2
2
|
export declare function serializeOffense(offense: Offense): Buffer;
|
|
3
3
|
export declare function deserializeOffense(buffer: Buffer): Offense;
|
|
4
|
-
|
|
5
|
-
export declare function deserializeSlashPayload(buffer: Buffer): SlashPayload;
|
|
6
|
-
export declare function serializeSlashPayloadRound(payload: SlashPayloadRound): Buffer;
|
|
7
|
-
export declare function deserializeSlashPayloadRound(buffer: Buffer): SlashPayloadRound;
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyaWFsaXphdGlvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NsYXNoaW5nL3NlcmlhbGl6YXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxLQUFLLEVBQ1YsT0FBTyxFQUVQLFlBQVksRUFDWixpQkFBaUIsRUFHbEIsTUFBTSxZQUFZLENBQUM7QUFFcEIsd0JBQWdCLGdCQUFnQixDQUFDLE9BQU8sRUFBRSxPQUFPLEdBQUcsTUFBTSxDQU96RDtBQUVELHdCQUFnQixrQkFBa0IsQ0FBQyxNQUFNLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FRMUQ7QUFpQ0Qsd0JBQWdCLHFCQUFxQixDQUFDLE9BQU8sRUFBRSxZQUFZLEdBQUcsTUFBTSxDQU9uRTtBQUVELHdCQUFnQix1QkFBdUIsQ0FBQyxNQUFNLEVBQUUsTUFBTSxHQUFHLFlBQVksQ0FPcEU7QUFFRCx3QkFBZ0IsMEJBQTBCLENBQUMsT0FBTyxFQUFFLGlCQUFpQixHQUFHLE1BQU0sQ0FTN0U7QUFFRCx3QkFBZ0IsNEJBQTRCLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxpQkFBaUIsQ0FVOUUifQ==
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyaWFsaXphdGlvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NsYXNoaW5nL3NlcmlhbGl6YXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFlLE1BQU0sWUFBWSxDQUFDO0FBRXZELHdCQUFnQixnQkFBZ0IsQ0FBQyxPQUFPLEVBQUUsT0FBTyxHQUFHLE1BQU0sQ0FPekQ7QUFFRCx3QkFBZ0Isa0JBQWtCLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxPQUFPLENBUTFEIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../src/slashing/serialization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../src/slashing/serialization.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAEvD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAOzD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAQ1D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { times } from '@aztec/foundation/collection';
|
|
2
1
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
2
|
import { BufferReader, bigintToUInt64BE, bigintToUInt128BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
3
|
export function serializeOffense(offense) {
|
|
@@ -17,62 +16,3 @@ export function deserializeOffense(buffer) {
|
|
|
17
16
|
epochOrSlot
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
function serializeValidatorSlashOffense(offense) {
|
|
21
|
-
return serializeToBuffer(bigintToUInt64BE(offense.epochOrSlot), offense.offenseType);
|
|
22
|
-
}
|
|
23
|
-
function deserializeValidatorSlashOffense(buffer) {
|
|
24
|
-
const reader = BufferReader.asReader(buffer);
|
|
25
|
-
return {
|
|
26
|
-
epochOrSlot: reader.readUInt64(),
|
|
27
|
-
offenseType: reader.readNumber()
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function serializeValidatorSlash(slash) {
|
|
31
|
-
return serializeToBuffer(slash.validator, bigintToUInt128BE(slash.amount), slash.offenses.length, slash.offenses.map(serializeValidatorSlashOffense));
|
|
32
|
-
}
|
|
33
|
-
function deserializeValidatorSlash(buffer) {
|
|
34
|
-
const reader = BufferReader.asReader(buffer);
|
|
35
|
-
const validator = reader.readObject(EthAddress);
|
|
36
|
-
const amount = reader.readUInt128();
|
|
37
|
-
const offensesCount = reader.readNumber();
|
|
38
|
-
const offenses = times(offensesCount, ()=>deserializeValidatorSlashOffense(reader));
|
|
39
|
-
return {
|
|
40
|
-
validator,
|
|
41
|
-
amount,
|
|
42
|
-
offenses
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export function serializeSlashPayload(payload) {
|
|
46
|
-
return serializeToBuffer(payload.address, payload.slashes.length, payload.slashes.map(serializeValidatorSlash), bigintToUInt64BE(payload.timestamp));
|
|
47
|
-
}
|
|
48
|
-
export function deserializeSlashPayload(buffer) {
|
|
49
|
-
const reader = BufferReader.asReader(buffer);
|
|
50
|
-
const address = reader.readObject(EthAddress);
|
|
51
|
-
const slashesCount = reader.readNumber();
|
|
52
|
-
const slashes = times(slashesCount, ()=>deserializeValidatorSlash(reader));
|
|
53
|
-
const timestamp = reader.readUInt64();
|
|
54
|
-
return {
|
|
55
|
-
address,
|
|
56
|
-
slashes,
|
|
57
|
-
timestamp
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export function serializeSlashPayloadRound(payload) {
|
|
61
|
-
return serializeToBuffer(payload.address, payload.slashes.length, payload.slashes.map(serializeValidatorSlash), bigintToUInt64BE(payload.timestamp), Number(payload.votes), bigintToUInt64BE(payload.round));
|
|
62
|
-
}
|
|
63
|
-
export function deserializeSlashPayloadRound(buffer) {
|
|
64
|
-
const reader = BufferReader.asReader(buffer);
|
|
65
|
-
const address = reader.readObject(EthAddress);
|
|
66
|
-
const slashesCount = reader.readNumber();
|
|
67
|
-
const slashes = times(slashesCount, ()=>deserializeValidatorSlash(reader));
|
|
68
|
-
const timestamp = reader.readUInt64();
|
|
69
|
-
const votes = BigInt(reader.readNumber());
|
|
70
|
-
const round = reader.readUInt64();
|
|
71
|
-
return {
|
|
72
|
-
address,
|
|
73
|
-
slashes,
|
|
74
|
-
timestamp,
|
|
75
|
-
votes,
|
|
76
|
-
round
|
|
77
|
-
};
|
|
78
|
-
}
|
package/dest/slashing/types.d.ts
CHANGED
|
@@ -59,107 +59,21 @@ export type ValidatorSlash = {
|
|
|
59
59
|
amount: bigint;
|
|
60
60
|
offenses: ValidatorSlashOffense[];
|
|
61
61
|
};
|
|
62
|
-
/**
|
|
63
|
-
export type SlashPayload = {
|
|
64
|
-
address: EthAddress;
|
|
65
|
-
slashes: ValidatorSlash[];
|
|
66
|
-
timestamp: bigint;
|
|
67
|
-
};
|
|
68
|
-
/** Slash payload with round information from empire slash proposer */
|
|
69
|
-
export type SlashPayloadRound = SlashPayload & {
|
|
70
|
-
votes: bigint;
|
|
71
|
-
round: bigint;
|
|
72
|
-
};
|
|
73
|
-
export declare const SlashPayloadRoundSchema: z.ZodObject<{
|
|
74
|
-
address: import("../schemas/index.js").ZodFor<EthAddress>;
|
|
75
|
-
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
76
|
-
votes: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
77
|
-
round: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
78
|
-
slashes: z.ZodArray<z.ZodObject<{
|
|
79
|
-
validator: import("../schemas/index.js").ZodFor<EthAddress>;
|
|
80
|
-
amount: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
81
|
-
offenses: z.ZodArray<z.ZodObject<{
|
|
82
|
-
offenseType: z.ZodNativeEnum<typeof OffenseType>;
|
|
83
|
-
epochOrSlot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
84
|
-
}, "strip", z.ZodTypeAny, {
|
|
85
|
-
offenseType: OffenseType;
|
|
86
|
-
epochOrSlot: bigint;
|
|
87
|
-
}, {
|
|
88
|
-
offenseType: OffenseType;
|
|
89
|
-
epochOrSlot: string | number | bigint;
|
|
90
|
-
}>, "many">;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
validator: EthAddress;
|
|
93
|
-
amount: bigint;
|
|
94
|
-
offenses: {
|
|
95
|
-
offenseType: OffenseType;
|
|
96
|
-
epochOrSlot: bigint;
|
|
97
|
-
}[];
|
|
98
|
-
}, {
|
|
99
|
-
validator?: any;
|
|
100
|
-
amount: string | number | bigint;
|
|
101
|
-
offenses: {
|
|
102
|
-
offenseType: OffenseType;
|
|
103
|
-
epochOrSlot: string | number | bigint;
|
|
104
|
-
}[];
|
|
105
|
-
}>, "many">;
|
|
106
|
-
}, "strip", z.ZodTypeAny, {
|
|
107
|
-
address: EthAddress;
|
|
108
|
-
timestamp: bigint;
|
|
109
|
-
votes: bigint;
|
|
110
|
-
round: bigint;
|
|
111
|
-
slashes: {
|
|
112
|
-
validator: EthAddress;
|
|
113
|
-
amount: bigint;
|
|
114
|
-
offenses: {
|
|
115
|
-
offenseType: OffenseType;
|
|
116
|
-
epochOrSlot: bigint;
|
|
117
|
-
}[];
|
|
118
|
-
}[];
|
|
119
|
-
}, {
|
|
120
|
-
address?: any;
|
|
121
|
-
timestamp: string | number | bigint;
|
|
122
|
-
votes: string | number | bigint;
|
|
123
|
-
round: string | number | bigint;
|
|
124
|
-
slashes: {
|
|
125
|
-
validator?: any;
|
|
126
|
-
amount: string | number | bigint;
|
|
127
|
-
offenses: {
|
|
128
|
-
offenseType: OffenseType;
|
|
129
|
-
epochOrSlot: string | number | bigint;
|
|
130
|
-
}[];
|
|
131
|
-
}[];
|
|
132
|
-
}>;
|
|
133
|
-
/** Votes for a validator slash in the consensus slash proposer */
|
|
62
|
+
/** Votes for a validator slash in the slashing proposer */
|
|
134
63
|
export type ValidatorSlashVote = number;
|
|
135
64
|
export type ProposerSlashAction =
|
|
136
|
-
/**
|
|
65
|
+
/** Vote for offenses on the slashing proposer */
|
|
137
66
|
{
|
|
138
|
-
type: 'create-empire-payload';
|
|
139
|
-
data: ValidatorSlash[];
|
|
140
|
-
}
|
|
141
|
-
/** Vote for a slashing payload on an empire-based slash proposer */
|
|
142
|
-
| {
|
|
143
|
-
type: 'vote-empire-payload';
|
|
144
|
-
payload: EthAddress;
|
|
145
|
-
}
|
|
146
|
-
/** Execute a slashing payload on an empire-based slash proposer */
|
|
147
|
-
| {
|
|
148
|
-
type: 'execute-empire-payload';
|
|
149
|
-
round: bigint;
|
|
150
|
-
}
|
|
151
|
-
/** Vote for offenses on a consensus slashing proposer */
|
|
152
|
-
| {
|
|
153
67
|
type: 'vote-offenses';
|
|
154
68
|
votes: ValidatorSlashVote[];
|
|
155
69
|
committees: EthAddress[][];
|
|
156
70
|
round: bigint;
|
|
157
71
|
}
|
|
158
|
-
/** Execute a slashing round on
|
|
72
|
+
/** Execute a slashing round on the slashing proposer */
|
|
159
73
|
| {
|
|
160
74
|
type: 'execute-slash';
|
|
161
75
|
committees: EthAddress[][];
|
|
162
76
|
round: bigint;
|
|
163
77
|
};
|
|
164
78
|
export type ProposerSlashActionType = ProposerSlashAction['type'];
|
|
165
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
79
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zbG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