@aztec/stdlib 0.0.1-commit.993d52e → 0.0.1-commit.9badcec54
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 +138 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +10 -2
- package/dest/abi/authorization_selector.d.ts +3 -6
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +14 -4
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +25 -4
- package/dest/abi/decoder.d.ts +6 -45
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +17 -67
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +60 -7
- package/dest/abi/event_metadata_definition.d.ts +3 -1
- package/dest/abi/event_metadata_definition.d.ts.map +1 -1
- package/dest/abi/event_metadata_definition.js +1 -1
- 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 +2 -4
- package/dest/abi/function_signature_decoder.d.ts +43 -0
- package/dest/abi/function_signature_decoder.d.ts.map +1 -0
- package/dest/abi/function_signature_decoder.js +66 -0
- package/dest/abi/index.d.ts +2 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- 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/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/abi/utils.d.ts +14 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +15 -0
- package/dest/avm/revert_code.d.ts +8 -18
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +15 -30
- 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.d.ts +9 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +12 -2
- 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 +95 -10
- 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/interfaces.d.ts +6 -3
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- 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 +8 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +18 -5
- 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/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/validate.d.ts +36 -0
- package/dest/checkpoint/validate.d.ts.map +1 -0
- package/dest/checkpoint/validate.js +120 -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 +3 -3
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +10 -4
- 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 +11 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +16 -2
- 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 +13 -1
- package/dest/gas/gas_settings.d.ts +40 -3
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +50 -6
- 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 +34 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +61 -0
- package/dest/interfaces/allowed_element.d.ts +26 -20
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +8 -8
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +6 -3
- package/dest/interfaces/aztec-node-admin.d.ts +76 -46
- 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-debug.d.ts +21 -0
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-debug.js +18 -0
- package/dest/interfaces/aztec-node.d.ts +21 -6
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +7 -2
- package/dest/interfaces/block-builder.d.ts +38 -11
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +13 -6
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/configs.d.ts +52 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +4 -2
- 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 +12 -21
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +6 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -4
- 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 +111 -63
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +8 -6
- package/dest/interfaces/world_state.d.ts +5 -4
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +13 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +13 -10
- package/dest/kernel/hints/build_transient_data_hints.d.ts +5 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -3
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +2 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +4 -0
- 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/extended_directional_app_tagging_secret.d.ts +4 -4
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/extended_directional_app_tagging_secret.js +12 -5
- package/dest/logs/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +1 -0
- package/dest/logs/log_filter.d.ts +4 -1
- package/dest/logs/log_filter.d.ts.map +1 -1
- package/dest/logs/log_filter.js +2 -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/message_context.d.ts +4 -7
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +23 -9
- package/dest/logs/pending_tagged_log.d.ts +2 -3
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +2 -2
- package/dest/logs/public_log.d.ts +4 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +2 -1
- package/dest/logs/shared_secret_derivation.d.ts +11 -10
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +15 -9
- package/dest/logs/siloed_tag.d.ts +8 -7
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +11 -3
- 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/logs/tagging_index_range.d.ts +40 -0
- package/dest/logs/tagging_index_range.d.ts.map +1 -0
- package/dest/logs/tagging_index_range.js +8 -0
- package/dest/logs/tx_scoped_l2_log.d.ts +3 -1
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +7 -0
- package/dest/messaging/l1_to_l2_message.d.ts +3 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +11 -13
- 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/messaging/l2_to_l1_membership.d.ts +32 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +69 -26
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/note_dao.d.ts +1 -1
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +1 -4
- 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 -16
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +6 -35
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/peer_error.d.ts +3 -1
- package/dest/p2p/peer_error.d.ts.map +1 -1
- package/dest/p2p/peer_error.js +5 -0
- 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 +85 -10
- 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/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} +7 -2
- package/dest/slashing/votes.d.ts.map +1 -0
- package/dest/slashing/{tally.js → votes.js} +30 -2
- package/dest/tests/factories.d.ts +3 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +12 -35
- package/dest/tests/mocks.d.ts +4 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +27 -27
- 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 +4 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +5 -1
- package/dest/tx/capsule.d.ts +6 -2
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +9 -3
- 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/private_execution_result.d.ts +6 -6
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +6 -6
- package/dest/tx/profiling.d.ts +14 -2
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +13 -3
- package/dest/tx/simulated_tx.d.ts +116 -5
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +7 -4
- package/dest/tx/tx.d.ts +8 -7
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -6
- package/dest/tx/tx_receipt.d.ts +14 -5
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +14 -18
- package/dest/tx/validator/error_texts.d.ts +9 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +10 -0
- 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/update-checker/package_version.d.ts +2 -2
- package/dest/update-checker/package_version.d.ts.map +1 -1
- package/dest/update-checker/package_version.js +16 -3
- package/dest/validators/errors.d.ts +6 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +7 -0
- package/dest/versioning/versioning.d.ts +4 -2
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +4 -1
- 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/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 +25 -2
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/buffer.ts +25 -4
- package/src/abi/decoder.ts +36 -79
- package/src/abi/encoder.ts +83 -7
- package/src/abi/event_metadata_definition.ts +2 -0
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_selector.ts +4 -13
- package/src/abi/function_signature_decoder.ts +77 -0
- package/src/abi/index.ts +1 -0
- package/src/abi/note_selector.ts +3 -12
- package/src/abi/selector.ts +1 -1
- package/src/abi/utils.ts +25 -0
- package/src/avm/revert_code.ts +25 -39
- 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.ts +13 -1
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +26 -9
- package/src/block/l2_block_stream/interfaces.ts +6 -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 +23 -4
- package/src/checkpoint/checkpoint_data.ts +40 -4
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/validate.ts +230 -0
- 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 +15 -5
- 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 +27 -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 +154 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas_fees.ts +15 -1
- package/src/gas/gas_settings.ts +65 -12
- 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 +61 -0
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +6 -3
- package/src/interfaces/aztec-node-admin.ts +5 -7
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/aztec-node.ts +39 -5
- package/src/interfaces/block-builder.ts +60 -14
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/configs.ts +19 -8
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +11 -20
- package/src/interfaces/prover-client.ts +10 -5
- package/src/interfaces/slasher.ts +0 -6
- package/src/interfaces/validator.ts +62 -38
- package/src/interfaces/world_state.ts +4 -3
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +14 -18
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +15 -18
- package/src/kernel/hints/build_transient_data_hints.ts +17 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +9 -0
- 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/extended_directional_app_tagging_secret.ts +19 -8
- package/src/logs/index.ts +1 -0
- package/src/logs/log_filter.ts +5 -0
- package/src/logs/log_id.ts +1 -2
- package/src/logs/message_context.ts +17 -7
- package/src/logs/pending_tagged_log.ts +1 -3
- package/src/logs/public_log.ts +4 -2
- package/src/logs/shared_secret_derivation.ts +21 -10
- package/src/logs/siloed_tag.ts +15 -11
- package/src/logs/tag.ts +8 -8
- package/src/logs/tagging_index_range.ts +24 -0
- package/src/logs/tx_scoped_l2_log.ts +16 -0
- package/src/messaging/l1_to_l2_message.ts +12 -9
- package/src/messaging/l1_to_l2_message_source.ts +3 -1
- package/src/messaging/l2_to_l1_membership.ts +98 -33
- package/src/noir/index.ts +2 -2
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/block_proposal.ts +14 -10
- package/src/p2p/checkpoint_attestation.ts +5 -9
- package/src/p2p/checkpoint_proposal.ts +20 -49
- package/src/p2p/gossipable.ts +4 -4
- package/src/p2p/peer_error.ts +7 -0
- package/src/proofs/chonk_proof.ts +91 -5
- package/src/rollup/block_headers_hash.ts +11 -2
- 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} +34 -1
- package/src/tests/factories.ts +6 -43
- package/src/tests/mocks.ts +33 -18
- package/src/timetable/index.ts +293 -13
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/tx/block_header.ts +8 -2
- package/src/tx/capsule.ts +10 -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/private_execution_result.ts +5 -5
- package/src/tx/profiling.ts +11 -2
- package/src/tx/simulated_tx.ts +14 -3
- package/src/tx/tx.ts +22 -13
- package/src/tx/tx_receipt.ts +18 -16
- package/src/tx/validator/error_texts.ts +12 -0
- package/src/types/shared.ts +0 -10
- package/src/update-checker/package_version.ts +19 -6
- package/src/validators/errors.ts +9 -0
- package/src/versioning/versioning.ts +4 -1
- package/src/vks/verification_key.ts +5 -184
- 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/dest/slashing/tally.d.ts.map +0 -1
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint_proposal.d.ts","sourceRoot":"","sources":["../../src/p2p/checkpoint_proposal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"checkpoint_proposal.d.ts","sourceRoot":"","sources":["../../src/p2p/checkpoint_proposal.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
1
|
+
import { CheckpointProposalHash, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
3
2
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
3
|
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
5
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
7
6
|
import { BufferReader, serializeSignedBigInt, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
8
|
-
import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
9
7
|
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
8
|
+
import { DutyType } from '../ha-signing/index.js';
|
|
10
9
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
11
10
|
import { BlockHeader } from '../tx/block_header.js';
|
|
12
11
|
import { TxHash } from '../tx/index.js';
|
|
@@ -15,12 +14,6 @@ import { Gossipable } from './gossipable.js';
|
|
|
15
14
|
import { SignatureDomainSeparator, getHashedSignaturePayload, getHashedSignaturePayloadEthSignedMessage } from './signature_utils.js';
|
|
16
15
|
import { SignedTxs } from './signed_txs.js';
|
|
17
16
|
import { TopicType } from './topic_type.js';
|
|
18
|
-
// REFACTOR(palla): Use a branded type instead of a subclass of Buffer32
|
|
19
|
-
export class CheckpointProposalHash extends Buffer32 {
|
|
20
|
-
constructor(hash){
|
|
21
|
-
super(hash);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
17
|
/**
|
|
25
18
|
* A checkpoint proposal is created by the leader of the chain for the last block in a checkpoint.
|
|
26
19
|
* It includes the aggregated checkpoint header that validators will attest to, plus optionally
|
|
@@ -37,23 +30,11 @@ export class CheckpointProposalHash extends Buffer32 {
|
|
|
37
30
|
super(), this.checkpointHeader = checkpointHeader, this.archive = archive, this.feeAssetPriceModifier = feeAssetPriceModifier, this.signature = signature, this.lastBlock = lastBlock;
|
|
38
31
|
}
|
|
39
32
|
generateP2PMessageIdentifier() {
|
|
40
|
-
return Promise.resolve(
|
|
33
|
+
return Promise.resolve(CheckpointProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
41
34
|
}
|
|
42
35
|
get slotNumber() {
|
|
43
36
|
return this.checkpointHeader.slotNumber;
|
|
44
37
|
}
|
|
45
|
-
get blockNumber() {
|
|
46
|
-
if (!this.lastBlock) {
|
|
47
|
-
throw new Error('Cannot get blockNumber without lastBlock');
|
|
48
|
-
}
|
|
49
|
-
return this.lastBlock.blockHeader.getBlockNumber();
|
|
50
|
-
}
|
|
51
|
-
/** Convenience getter for txHashes from lastBlock */ get txHashes() {
|
|
52
|
-
return this.lastBlock?.txHashes ?? [];
|
|
53
|
-
}
|
|
54
|
-
/** Convenience getter for txs from lastBlock */ get txs() {
|
|
55
|
-
return this.lastBlock?.signedTxs?.txs;
|
|
56
|
-
}
|
|
57
38
|
/**
|
|
58
39
|
* Extract a BlockProposal from the last block info.
|
|
59
40
|
* Uses inHash from checkpointHeader.contentCommitment.inHash
|
|
@@ -95,27 +76,17 @@ export class CheckpointProposalHash extends Buffer32 {
|
|
|
95
76
|
serializeSignedBigInt(this.feeAssetPriceModifier)
|
|
96
77
|
]);
|
|
97
78
|
}
|
|
98
|
-
static async createProposalFromSigner(checkpointHeader, archiveRoot, feeAssetPriceModifier,
|
|
79
|
+
static async createProposalFromSigner(checkpointHeader, archiveRoot, checkpointNumber, feeAssetPriceModifier, lastBlockProposal, payloadSigner) {
|
|
99
80
|
// Sign the checkpoint payload with CHECKPOINT_PROPOSAL duty type
|
|
100
81
|
const tempProposal = new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, Signature.empty());
|
|
101
82
|
const checkpointHash = getHashedSignaturePayload(tempProposal, SignatureDomainSeparator.checkpointProposal);
|
|
102
83
|
const checkpointContext = {
|
|
103
84
|
slot: checkpointHeader.slotNumber,
|
|
104
|
-
|
|
85
|
+
checkpointNumber,
|
|
105
86
|
dutyType: DutyType.CHECKPOINT_PROPOSAL
|
|
106
87
|
};
|
|
107
88
|
const checkpointSignature = await payloadSigner(checkpointHash, checkpointContext);
|
|
108
|
-
|
|
109
|
-
return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature);
|
|
110
|
-
}
|
|
111
|
-
const lastBlockProposal = await BlockProposal.createProposalFromSigner(lastBlockInfo.blockHeader, lastBlockInfo.indexWithinCheckpoint, checkpointHeader.inHash, archiveRoot, lastBlockInfo.txHashes, lastBlockInfo.txs, payloadSigner);
|
|
112
|
-
return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature, {
|
|
113
|
-
blockHeader: lastBlockInfo.blockHeader,
|
|
114
|
-
indexWithinCheckpoint: lastBlockInfo.indexWithinCheckpoint,
|
|
115
|
-
txHashes: lastBlockInfo.txHashes,
|
|
116
|
-
signature: lastBlockProposal.signature,
|
|
117
|
-
signedTxs: lastBlockProposal.signedTxs
|
|
118
|
-
});
|
|
89
|
+
return new CheckpointProposal(checkpointHeader, archiveRoot, feeAssetPriceModifier, checkpointSignature, lastBlockProposal);
|
|
119
90
|
}
|
|
120
91
|
/**
|
|
121
92
|
* Lazily evaluate the sender of the proposal; result is cached.
|
package/dest/p2p/gossipable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseBuffer32 } from '@aztec/foundation/buffer';
|
|
2
2
|
import type { TopicType } from './topic_type.js';
|
|
3
3
|
export declare class P2PMessage {
|
|
4
4
|
readonly payload: Buffer;
|
|
@@ -22,8 +22,8 @@ export declare abstract class Gossipable {
|
|
|
22
22
|
* A digest of the message information **used for logging only**.
|
|
23
23
|
* The identifier used for deduplication is `getMsgIdFn` as defined in `encoding.ts` which is a hash over topic and data.
|
|
24
24
|
*/
|
|
25
|
-
p2pMessageLoggingIdentifier(): Promise<
|
|
26
|
-
abstract generateP2PMessageIdentifier(): Promise<
|
|
25
|
+
p2pMessageLoggingIdentifier(): Promise<BaseBuffer32>;
|
|
26
|
+
abstract generateP2PMessageIdentifier(): Promise<BaseBuffer32>;
|
|
27
27
|
abstract toBuffer(): Buffer;
|
|
28
28
|
toMessage(): Buffer;
|
|
29
29
|
/**
|
|
@@ -32,4 +32,4 @@ export declare abstract class Gossipable {
|
|
|
32
32
|
*/
|
|
33
33
|
abstract getSize(): number;
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ29zc2lwYWJsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3AycC9nb3NzaXBhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUd4RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUVqRCxxQkFBYSxVQUFVO2FBRUgsT0FBTyxFQUFFLE1BQU07YUFDZixTQUFTLENBQUM7YUFDVixZQUFZLENBQUM7SUFIL0IsWUFDa0IsT0FBTyxFQUFFLE1BQU0sRUFDZixTQUFTLENBQUMsa0JBQU0sRUFDaEIsWUFBWSxDQUFDLG9CQUFRLEVBQ25DO0lBRUosTUFBTSxDQUFDLGNBQWMsQ0FBQyxPQUFPLEVBQUUsVUFBVSxFQUFFLGtCQUFrQixVQUFRLEVBQUUsWUFBWSxDQUFDLEVBQUUsTUFBTSxHQUFHLFVBQVUsQ0FLeEc7SUFFRCxNQUFNLENBQUMsZUFBZSxDQUFDLFdBQVcsRUFBRSxNQUFNLEVBQUUsa0JBQWtCLFVBQVEsR0FBRyxVQUFVLENBVWxGO0lBRUQsYUFBYSxJQUFJLE1BQU0sQ0FRdEI7Q0FDRjtBQUVEOzs7O0dBSUc7QUFDSCw4QkFBc0IsVUFBVTtJQUM5QixPQUFPLENBQUMsUUFBUSxDQUEyQjtJQUMzQywyRUFBMkU7SUFDM0UsTUFBTSxDQUFDLFFBQVEsRUFBRSxTQUFTLENBQUM7SUFFM0I7OztPQUdHO0lBQ0csMkJBQTJCLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxDQU16RDtJQUVELFFBQVEsQ0FBQyw0QkFBNEIsSUFBSSxPQUFPLENBQUMsWUFBWSxDQUFDLENBQUM7SUFFL0QsUUFBUSxDQUFDLFFBQVEsSUFBSSxNQUFNLENBQUM7SUFFNUIsU0FBUyxJQUFJLE1BQU0sQ0FFbEI7SUFFRDs7O09BR0c7SUFDSCxRQUFRLENBQUMsT0FBTyxJQUFJLE1BQU0sQ0FBQztDQUM1QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gossipable.d.ts","sourceRoot":"","sources":["../../src/p2p/gossipable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"gossipable.d.ts","sourceRoot":"","sources":["../../src/p2p/gossipable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,qBAAa,UAAU;aAEH,OAAO,EAAE,MAAM;aACf,SAAS,CAAC;aACV,YAAY,CAAC;IAH/B,YACkB,OAAO,EAAE,MAAM,EACf,SAAS,CAAC,kBAAM,EAChB,YAAY,CAAC,oBAAQ,EACnC;IAEJ,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,kBAAkB,UAAQ,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,UAAU,CAKxG;IAED,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,kBAAkB,UAAQ,GAAG,UAAU,CAUlF;IAED,aAAa,IAAI,MAAM,CAQtB;CACF;AAED;;;;GAIG;AACH,8BAAsB,UAAU;IAC9B,OAAO,CAAC,QAAQ,CAA2B;IAC3C,2EAA2E;IAC3E,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;IAE3B;;;OAGG;IACG,2BAA2B,IAAI,OAAO,CAAC,YAAY,CAAC,CAMzD;IAED,QAAQ,CAAC,4BAA4B,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/D,QAAQ,CAAC,QAAQ,IAAI,MAAM,CAAC;IAE5B,SAAS,IAAI,MAAM,CAElB;IAED;;;OAGG;IACH,QAAQ,CAAC,OAAO,IAAI,MAAM,CAAC;CAC5B"}
|
package/dest/p2p/peer_error.d.ts
CHANGED
|
@@ -15,4 +15,6 @@ export declare enum PeerErrorSeverity {
|
|
|
15
15
|
*/
|
|
16
16
|
HighToleranceError = "HighToleranceError"
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/** Severities ordered from mildest to harshest. */
|
|
19
|
+
export declare const PeerErrorSeverityByHarshness: readonly [PeerErrorSeverity.HighToleranceError, PeerErrorSeverity.MidToleranceError, PeerErrorSeverity.LowToleranceError];
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVlcl9lcnJvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3AycC9wZWVyX2Vycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9CQUFZLGlCQUFpQjtJQUMzQjs7O09BR0c7SUFDSCxpQkFBaUIsc0JBQXNCO0lBQ3ZDOzs7T0FHRztJQUNILGlCQUFpQixzQkFBc0I7SUFDdkM7OztPQUdHO0lBQ0gsa0JBQWtCLHVCQUF1QjtDQUMxQztBQUVELG1EQUFtRDtBQUNuRCxlQUFPLE1BQU0sNEJBQTRCLDJIQUkvQixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer_error.d.ts","sourceRoot":"","sources":["../../src/p2p/peer_error.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,kBAAkB,uBAAuB;CAC1C"}
|
|
1
|
+
{"version":3,"file":"peer_error.d.ts","sourceRoot":"","sources":["../../src/p2p/peer_error.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,iBAAiB,sBAAsB;IACvC;;;OAGG;IACH,kBAAkB,uBAAuB;CAC1C;AAED,mDAAmD;AACnD,eAAO,MAAM,4BAA4B,2HAI/B,CAAC"}
|
package/dest/p2p/peer_error.js
CHANGED
|
@@ -13,3 +13,8 @@ export var PeerErrorSeverity = /*#__PURE__*/ function(PeerErrorSeverity) {
|
|
|
13
13
|
*/ PeerErrorSeverity["HighToleranceError"] = "HighToleranceError";
|
|
14
14
|
return PeerErrorSeverity;
|
|
15
15
|
}({});
|
|
16
|
+
/** Severities ordered from mildest to harshest. */ export const PeerErrorSeverityByHarshness = [
|
|
17
|
+
"HighToleranceError",
|
|
18
|
+
"MidToleranceError",
|
|
19
|
+
"LowToleranceError"
|
|
20
|
+
];
|
|
@@ -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,18 +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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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);
|
|
85
|
+
}
|
|
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...]
|
|
58
127
|
return serializeToBuffer(this.fields.length, this.fields);
|
|
59
128
|
}
|
|
60
129
|
}
|
|
61
130
|
export class ChonkProofWithPublicInputs {
|
|
62
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;
|
|
63
137
|
constructor(// The proof fields with public inputs.
|
|
64
138
|
// For recursive verification, use without public inputs via `removePublicInputs()`.
|
|
65
139
|
fieldsWithPublicInputs){
|
|
@@ -74,7 +148,8 @@ export class ChonkProofWithPublicInputs {
|
|
|
74
148
|
}
|
|
75
149
|
removePublicInputs() {
|
|
76
150
|
const numPublicInputs = this.fieldsWithPublicInputs.length - CHONK_PROOF_LENGTH;
|
|
77
|
-
|
|
151
|
+
// Flow compressed proof bytes through so the ChonkProof can serialize efficiently
|
|
152
|
+
return new ChonkProof(this.fieldsWithPublicInputs.slice(numPublicInputs), this.compressedProof);
|
|
78
153
|
}
|
|
79
154
|
isEmpty() {
|
|
80
155
|
return this.fieldsWithPublicInputs.every((field)=>field.isZero());
|
|
@@ -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
|
}
|
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
|
-
}
|