@aztec/stdlib 0.0.1-commit.5914bae → 0.0.1-commit.59a0419c6
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 +4 -4
- 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 +5 -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 +98 -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 +11 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +6 -2
- package/dest/interfaces/aztec-node-admin.d.ts +21 -20
- 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 +49 -40
- 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.d.ts +7 -3
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +7 -5
- package/dest/parity/parity_public_inputs.d.ts +7 -3
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +6 -3
- 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 +18 -45
- 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/dest/world-state/world_state_revision.d.ts +8 -1
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +7 -1
- 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 +4 -4
- 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 +17 -4
- package/src/gas/index.ts +1 -0
- package/src/ha-signing/config.ts +159 -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 +11 -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 +10 -4
- package/src/parity/parity_public_inputs.ts +9 -2
- 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 +18 -53
- 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/src/world-state/world_state_revision.ts +9 -1
- 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
|
@@ -6,12 +6,16 @@ export declare class ParityBasePrivateInputs {
|
|
|
6
6
|
readonly msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>;
|
|
7
7
|
/** Root of the VK tree */
|
|
8
8
|
readonly vkTreeRoot: Fr;
|
|
9
|
+
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
10
|
+
readonly proverId: Fr;
|
|
9
11
|
constructor(
|
|
10
12
|
/** Aggregated proof of all the parity circuit iterations. */
|
|
11
13
|
msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>,
|
|
12
14
|
/** Root of the VK tree */
|
|
13
|
-
vkTreeRoot: Fr
|
|
14
|
-
|
|
15
|
+
vkTreeRoot: Fr,
|
|
16
|
+
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
17
|
+
proverId: Fr);
|
|
18
|
+
static fromSlice(array: Fr[], index: number, vkTreeRoot: Fr, proverId: Fr): ParityBasePrivateInputs;
|
|
15
19
|
/** Serializes the inputs to a buffer. */
|
|
16
20
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
17
21
|
/** Serializes the inputs to a hex string. */
|
|
@@ -32,4 +36,4 @@ export declare class ParityBasePrivateInputs {
|
|
|
32
36
|
/** Creates an instance from a hex string. */
|
|
33
37
|
static get schema(): import("zod").ZodType<ParityBasePrivateInputs, any, string>;
|
|
34
38
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyaXR5X2Jhc2VfcHJpdmF0ZV9pbnB1dHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXJpdHkvcGFyaXR5X2Jhc2VfcHJpdmF0ZV9pbnB1dHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUF1Qyx3QkFBd0IsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pHLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUVwRCxPQUFPLEVBQUUsWUFBWSxFQUFFLEtBQUssS0FBSyxFQUFxQixNQUFNLDZCQUE2QixDQUFDO0FBRzFGLHFCQUFhLHVCQUF1QjtJQUVoQyw2REFBNkQ7YUFDN0MsSUFBSSxFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyx3QkFBd0IsQ0FBQztJQUNoRSwwQkFBMEI7YUFDVixVQUFVLEVBQUUsRUFBRTtJQUM5Qix5RUFBeUU7YUFDekQsUUFBUSxFQUFFLEVBQUU7SUFOOUI7SUFDRSw2REFBNkQ7SUFDN0MsSUFBSSxFQUFFLEtBQUssQ0FBQyxFQUFFLEVBQUUsT0FBTyx3QkFBd0IsQ0FBQztJQUNoRSwwQkFBMEI7SUFDVixVQUFVLEVBQUUsRUFBRTtJQUM5Qix5RUFBeUU7SUFDekQsUUFBUSxFQUFFLEVBQUUsRUFDMUI7SUFFSixPQUFjLFNBQVMsQ0FBQyxLQUFLLEVBQUUsRUFBRSxFQUFFLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsRUFBRSxFQUFFLFFBQVEsRUFBRSxFQUFFLEdBQUcsdUJBQXVCLENBV3pHO0lBRUQseUNBQXlDO0lBQ3pDLFFBQVEsNEJBRVA7SUFFRCw2Q0FBNkM7SUFDN0MsUUFBUSxrQkFFUDtJQUVEOzs7T0FHRztJQUNILE1BQU0sQ0FBQyxVQUFVLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxZQUFZLDJCQU85QztJQUVEOzs7O09BSUc7SUFDSCxNQUFNLENBQUMsVUFBVSxDQUFDLEdBQUcsRUFBRSxNQUFNLDJCQUU1QjtJQUVELDhEQUE4RDtJQUM5RCxNQUFNLDRCQUVMO0lBRUQsNkNBQTZDO0lBQzdDLE1BQU0sS0FBSyxNQUFNLGdFQUVoQjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parity_base_private_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_base_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,qBAAa,uBAAuB;IAEhC,6DAA6D;aAC7C,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAChE,0BAA0B;aACV,UAAU,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"parity_base_private_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_base_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,qBAAa,uBAAuB;IAEhC,6DAA6D;aAC7C,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAChE,0BAA0B;aACV,UAAU,EAAE,EAAE;IAC9B,yEAAyE;aACzD,QAAQ,EAAE,EAAE;IAN9B;IACE,6DAA6D;IAC7C,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAChE,0BAA0B;IACV,UAAU,EAAE,EAAE;IAC9B,yEAAyE;IACzD,QAAQ,EAAE,EAAE,EAC1B;IAEJ,OAAc,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,uBAAuB,CAWzG;IAED,yCAAyC;IACzC,QAAQ,4BAEP;IAED,6CAA6C;IAC7C,QAAQ,kBAEP;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,2BAO9C;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,2BAE5B;IAED,8DAA8D;IAC9D,MAAM,4BAEL;IAED,6CAA6C;IAC7C,MAAM,KAAK,MAAM,gEAEhB;CACF"}
|
|
@@ -6,11 +6,13 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
6
6
|
export class ParityBasePrivateInputs {
|
|
7
7
|
msgs;
|
|
8
8
|
vkTreeRoot;
|
|
9
|
-
|
|
9
|
+
proverId;
|
|
10
|
+
constructor(/** Aggregated proof of all the parity circuit iterations. */ msgs, /** Root of the VK tree */ vkTreeRoot, /** Prover identity committed to by the circuit, for sybil protection. */ proverId){
|
|
10
11
|
this.msgs = msgs;
|
|
11
12
|
this.vkTreeRoot = vkTreeRoot;
|
|
13
|
+
this.proverId = proverId;
|
|
12
14
|
}
|
|
13
|
-
static fromSlice(array, index, vkTreeRoot) {
|
|
15
|
+
static fromSlice(array, index, vkTreeRoot, proverId) {
|
|
14
16
|
// Can't use Tuple<Fr, typeof NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP> due to length
|
|
15
17
|
if (array.length !== NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP) {
|
|
16
18
|
throw new Error(`Msgs array length must be NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP=${NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP}`);
|
|
@@ -18,10 +20,10 @@ export class ParityBasePrivateInputs {
|
|
|
18
20
|
const start = index * NUM_MSGS_PER_BASE_PARITY;
|
|
19
21
|
const end = start + NUM_MSGS_PER_BASE_PARITY;
|
|
20
22
|
const msgs = array.slice(start, end);
|
|
21
|
-
return new ParityBasePrivateInputs(msgs, vkTreeRoot);
|
|
23
|
+
return new ParityBasePrivateInputs(msgs, vkTreeRoot, proverId);
|
|
22
24
|
}
|
|
23
25
|
/** Serializes the inputs to a buffer. */ toBuffer() {
|
|
24
|
-
return serializeToBuffer(this.msgs, this.vkTreeRoot);
|
|
26
|
+
return serializeToBuffer(this.msgs, this.vkTreeRoot, this.proverId);
|
|
25
27
|
}
|
|
26
28
|
/** Serializes the inputs to a hex string. */ toString() {
|
|
27
29
|
return bufferToHex(this.toBuffer());
|
|
@@ -31,7 +33,7 @@ export class ParityBasePrivateInputs {
|
|
|
31
33
|
* @param buffer - The buffer to deserialize from.
|
|
32
34
|
*/ static fromBuffer(buffer) {
|
|
33
35
|
const reader = BufferReader.asReader(buffer);
|
|
34
|
-
return new ParityBasePrivateInputs(reader.
|
|
36
|
+
return new ParityBasePrivateInputs(reader.readArray(NUM_MSGS_PER_BASE_PARITY, Fr), Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* Deserializes the inputs from a hex string.
|
|
@@ -8,13 +8,17 @@ export declare class ParityPublicInputs {
|
|
|
8
8
|
convertedRoot: Fr;
|
|
9
9
|
/** Root of the VK tree */
|
|
10
10
|
vkTreeRoot: Fr;
|
|
11
|
+
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
12
|
+
proverId: Fr;
|
|
11
13
|
constructor(
|
|
12
14
|
/** Root of the SHA256 tree. */
|
|
13
15
|
shaRoot: Fr,
|
|
14
16
|
/** Root of the converted tree. */
|
|
15
17
|
convertedRoot: Fr,
|
|
16
18
|
/** Root of the VK tree */
|
|
17
|
-
vkTreeRoot: Fr
|
|
19
|
+
vkTreeRoot: Fr,
|
|
20
|
+
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
21
|
+
proverId: Fr);
|
|
18
22
|
/**
|
|
19
23
|
* Serializes the inputs to a buffer.
|
|
20
24
|
* @returns The inputs serialized to a buffer.
|
|
@@ -38,7 +42,7 @@ export declare class ParityPublicInputs {
|
|
|
38
42
|
* @param fields - The instance to get the fields from.
|
|
39
43
|
* @returns The instance fields.
|
|
40
44
|
*/
|
|
41
|
-
static getFields(fields: FieldsOf<ParityPublicInputs>): readonly [Fr, Fr, Fr];
|
|
45
|
+
static getFields(fields: FieldsOf<ParityPublicInputs>): readonly [Fr, Fr, Fr, Fr];
|
|
42
46
|
/**
|
|
43
47
|
* Deserializes the inputs from a buffer.
|
|
44
48
|
* @param buffer - The buffer to deserialize from.
|
|
@@ -53,4 +57,4 @@ export declare class ParityPublicInputs {
|
|
|
53
57
|
static fromString(str: string): ParityPublicInputs;
|
|
54
58
|
static get schema(): import("zod").ZodType<ParityPublicInputs, any, string>;
|
|
55
59
|
}
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyaXR5X3B1YmxpY19pbnB1dHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXJpdHkvcGFyaXR5X3B1YmxpY19pbnB1dHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXBELE9BQU8sRUFBRSxZQUFZLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFFOUUsT0FBTyxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFeEQscUJBQWEsa0JBQWtCO0lBRTNCLCtCQUErQjtJQUN4QixPQUFPLEVBQUUsRUFBRTtJQUNsQixrQ0FBa0M7SUFDM0IsYUFBYSxFQUFFLEVBQUU7SUFDeEIsMEJBQTBCO0lBQ25CLFVBQVUsRUFBRSxFQUFFO0lBQ3JCLHlFQUF5RTtJQUNsRSxRQUFRLEVBQUUsRUFBRTtJQVJyQjtJQUNFLCtCQUErQjtJQUN4QixPQUFPLEVBQUUsRUFBRTtJQUNsQixrQ0FBa0M7SUFDM0IsYUFBYSxFQUFFLEVBQUU7SUFDeEIsMEJBQTBCO0lBQ25CLFVBQVUsRUFBRSxFQUFFO0lBQ3JCLHlFQUF5RTtJQUNsRSxRQUFRLEVBQUUsRUFBRSxFQUtwQjtJQUVEOzs7T0FHRztJQUNILFFBQVEsNEJBRVA7SUFFRDs7O09BR0c7SUFDSCxRQUFRLGtCQUVQO0lBRUQsdURBQXVEO0lBQ3ZELE1BQU0sNEJBRUw7SUFFRDs7OztPQUlHO0lBQ0gsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsUUFBUSxDQUFDLGtCQUFrQixDQUFDLEdBQUcsa0JBQWtCLENBRXBFO0lBRUQ7Ozs7T0FJRztJQUNILE1BQU0sQ0FBQyxTQUFTLENBQUMsTUFBTSxFQUFFLFFBQVEsQ0FBQyxrQkFBa0IsQ0FBQyw2QkFFcEQ7SUFFRDs7OztPQUlHO0lBQ0gsTUFBTSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsTUFBTSxHQUFHLFlBQVksc0JBUTlDO0lBRUQ7Ozs7T0FJRztJQUNILE1BQU0sQ0FBQyxVQUFVLENBQUMsR0FBRyxFQUFFLE1BQU0sc0JBRTVCO0lBRUQsTUFBTSxLQUFLLE1BQU0sMkRBRWhCO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parity_public_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,qBAAa,kBAAkB;IAE3B,+BAA+B;IACxB,OAAO,EAAE,EAAE;IAClB,kCAAkC;IAC3B,aAAa,EAAE,EAAE;IACxB,0BAA0B;IACnB,UAAU,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"parity_public_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,qBAAa,kBAAkB;IAE3B,+BAA+B;IACxB,OAAO,EAAE,EAAE;IAClB,kCAAkC;IAC3B,aAAa,EAAE,EAAE;IACxB,0BAA0B;IACnB,UAAU,EAAE,EAAE;IACrB,yEAAyE;IAClE,QAAQ,EAAE,EAAE;IARrB;IACE,+BAA+B;IACxB,OAAO,EAAE,EAAE;IAClB,kCAAkC;IAC3B,aAAa,EAAE,EAAE;IACxB,0BAA0B;IACnB,UAAU,EAAE,EAAE;IACrB,yEAAyE;IAClE,QAAQ,EAAE,EAAE,EAKpB;IAED;;;OAGG;IACH,QAAQ,4BAEP;IAED;;;OAGG;IACH,QAAQ,kBAEP;IAED,uDAAuD;IACvD,MAAM,4BAEL;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,GAAG,kBAAkB,CAEpE;IAED;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,kBAAkB,CAAC,6BAEpD;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,sBAQ9C;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,sBAE5B;IAED,MAAM,KAAK,MAAM,2DAEhB;CACF"}
|
|
@@ -6,10 +6,12 @@ export class ParityPublicInputs {
|
|
|
6
6
|
shaRoot;
|
|
7
7
|
convertedRoot;
|
|
8
8
|
vkTreeRoot;
|
|
9
|
-
|
|
9
|
+
proverId;
|
|
10
|
+
constructor(/** Root of the SHA256 tree. */ shaRoot, /** Root of the converted tree. */ convertedRoot, /** Root of the VK tree */ vkTreeRoot, /** Prover identity committed to by the circuit, for sybil protection. */ proverId){
|
|
10
11
|
this.shaRoot = shaRoot;
|
|
11
12
|
this.convertedRoot = convertedRoot;
|
|
12
13
|
this.vkTreeRoot = vkTreeRoot;
|
|
14
|
+
this.proverId = proverId;
|
|
13
15
|
if (shaRoot.toBuffer()[0] != 0) {
|
|
14
16
|
throw new Error(`shaRoot buffer must be 31 bytes. Got 32 bytes`);
|
|
15
17
|
}
|
|
@@ -44,7 +46,8 @@ export class ParityPublicInputs {
|
|
|
44
46
|
return [
|
|
45
47
|
fields.shaRoot,
|
|
46
48
|
fields.convertedRoot,
|
|
47
|
-
fields.vkTreeRoot
|
|
49
|
+
fields.vkTreeRoot,
|
|
50
|
+
fields.proverId
|
|
48
51
|
];
|
|
49
52
|
}
|
|
50
53
|
/**
|
|
@@ -53,7 +56,7 @@ export class ParityPublicInputs {
|
|
|
53
56
|
* @returns A new ParityPublicInputs instance.
|
|
54
57
|
*/ static fromBuffer(buffer) {
|
|
55
58
|
const reader = BufferReader.asReader(buffer);
|
|
56
|
-
return new ParityPublicInputs(reader.readObject(Fr), reader.readObject(Fr), Fr.fromBuffer(reader));
|
|
59
|
+
return new ParityPublicInputs(reader.readObject(Fr), reader.readObject(Fr), Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
62
|
* Deserializes the inputs from a hex string.
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hvbmtfcHJvb2YuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcm9vZnMvY2hvbmtfcHJvb2YudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXBELE9BQU8sRUFBRSxZQUFZLEVBQW9DLE1BQU0sNkJBQTZCLENBQUM7QUFFN0Y7Ozs7Ozs7O0dBUUc7QUFHSCxxQkFBYSxVQUFVO0lBWVosTUFBTSxFQUFFLEVBQUUsRUFBRTtJQVhyQjs7OztPQUlHO0lBQ0ksZUFBZSxDQUFDLEVBQUUsTUFBTSxDQUFDO0lBRWhDLFlBSVMsTUFBTSxFQUFFLEVBQUUsRUFBRSxFQUNuQixlQUFlLENBQUMsRUFBRSxNQUFNLEVBTXpCO0lBRU0sa0JBQWtCLENBQUMsWUFBWSxFQUFFLEVBQUUsRUFBRSw4QkFFM0M7SUFFTSxPQUFPLFlBRWI7SUFFRCxNQUFNLENBQUMsS0FBSyxlQUVYO0lBRUQsTUFBTSxDQUFDLE1BQU0sZUFZWjtJQUVELE1BQU0sS0FBSyxNQUFNLG1EQUVoQjtJQUdELE1BQU0sNEJBRUw7SUFFRDs7Ozs7Ozs7O09BU0c7SUFDSCxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxNQUFNLEdBQUcsWUFBWSxHQUFHLFVBQVUsQ0FnQjNEO0lBRUQ7Ozs7OztPQU1HO0lBQ0gsTUFBTSxDQUFDLG1CQUFtQixDQUFDLFVBQVUsRUFBRSxNQUFNLEdBQUcsVUFBVSxDQWtCekQ7SUFFRDs7OztPQUlHO0lBQ0ksUUFBUSw0QkFPZDtDQUNGO0FBRUQscUJBQWEsMEJBQTBCO0lBVzVCLHNCQUFzQixFQUFFLEVBQUUsRUFBRTtJQVZyQzs7OztPQUlHO0lBQ0ksZUFBZSxDQUFDLEVBQUUsTUFBTSxDQUFDO0lBRWhDLFlBR1Msc0JBQXNCLEVBQUUsRUFBRSxFQUFFLEVBS3BDO0lBRU0sZUFBZSxTQUdyQjtJQUVNLGtCQUFrQixlQUl4QjtJQUVNLE9BQU8sWUFFYjtJQUVELE1BQU0sQ0FBQyxLQUFLLCtCQUVYO0lBRUQsTUFBTSxLQUFLLE1BQU0sbUVBRWhCO0lBR0QsTUFBTSw0QkFFTDtJQUVELE1BQU0sQ0FBQyxVQUFVLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxZQUFZLEdBQUcsMEJBQTBCLENBSzNFO0lBRU0sUUFBUSw0QkFFZDtJQUdELE1BQU0sQ0FBQyxlQUFlLENBQUMsTUFBTSxFQUFFLFVBQVUsRUFBRSxHQUFHLDBCQUEwQixDQUd2RTtDQUNGIn0=
|
|
@@ -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"}
|