@aztec/stdlib 0.0.1-commit.e558bd1c → 0.0.1-commit.e5a3663dd
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 -70
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +64 -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_call.d.ts +39 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +20 -3
- 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/auth_witness/auth_witness.js +3 -3
- package/dest/avm/avm_proving_request.d.ts +166 -166
- package/dest/avm/revert_code.d.ts +9 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +16 -21
- 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/attestation_info.d.ts +3 -2
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -5
- package/dest/block/block_data.d.ts +341 -0
- package/dest/block/block_data.d.ts.map +1 -0
- package/dest/block/block_data.js +26 -0
- 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/block_parameter.d.ts +30 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +36 -2
- package/dest/block/index.d.ts +2 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- 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 +149 -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_block_stream.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +10 -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/proposal/attestations_and_signers.d.ts +13 -6
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +26 -18
- 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 +28 -7
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +41 -17
- package/dest/checkpoint/checkpoint_data.d.ts +192 -0
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_data.js +38 -0
- package/dest/checkpoint/index.d.ts +3 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +2 -0
- package/dest/checkpoint/published_checkpoint.d.ts +17 -2
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +1 -2
- 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 +2 -2
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +9 -3
- package/dest/config/index.d.ts +3 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +2 -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 +14 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +38 -0
- package/dest/contract/contract_address.d.ts +3 -3
- package/dest/contract/contract_address.js +7 -7
- package/dest/contract/contract_class.d.ts +2 -3
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class_id.d.ts +3 -3
- package/dest/contract/contract_class_id.d.ts.map +1 -1
- package/dest/contract/contract_class_id.js +7 -6
- 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/interfaces/node-info.d.ts +3 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +2 -1
- 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 +4 -6
- package/dest/epoch-helpers/index.d.ts +15 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +18 -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/file-store/local.d.ts +3 -3
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/file-store/local.js +13 -4
- package/dest/file-store/s3.d.ts +1 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/file-store/s3.js +11 -3
- 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 +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 +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 +35 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +77 -10
- package/dest/hash/map_slot.js +2 -2
- 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 +11 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +17 -3
- package/dest/interfaces/aztec-node-admin.d.ts +132 -47
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +14 -7
- 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 +59 -54
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +23 -16
- package/dest/interfaces/block-builder.d.ts +39 -12
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +13 -6
- package/dest/interfaces/block_response.d.ts +156 -0
- package/dest/interfaces/block_response.d.ts.map +1 -0
- package/dest/interfaces/block_response.js +24 -0
- package/dest/interfaces/chain_tips.d.ts +304 -0
- package/dest/interfaces/chain_tips.d.ts.map +1 -0
- package/dest/interfaces/chain_tips.js +11 -0
- package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_parameter.js +20 -0
- package/dest/interfaces/checkpoint_response.d.ts +312 -0
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_response.js +26 -0
- package/dest/interfaces/client.d.ts +7 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +6 -0
- package/dest/interfaces/configs.d.ts +87 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +12 -3
- package/dest/interfaces/l1_publish_info.d.ts +43 -0
- package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
- package/dest/interfaces/l1_publish_info.js +26 -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 +13 -22
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +3 -8
- package/dest/interfaces/p2p.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 +202 -202
- package/dest/interfaces/server.d.ts +6 -1
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +5 -0
- package/dest/interfaces/slasher.d.ts +5 -10
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -2
- package/dest/interfaces/validator.d.ts +138 -64
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +12 -5
- 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/hints/index.d.ts +2 -2
- package/dest/kernel/hints/index.js +2 -2
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts +24 -0
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts.map +1 -0
- package/dest/kernel/hints/{key_validation_request_and_generator.js → key_validation_request_and_separator.js} +12 -15
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts → scoped_key_validation_request_and_separator.d.ts} +8 -8
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts.map → scoped_key_validation_request_and_separator.d.ts.map} +1 -1
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.js → scoped_key_validation_request_and_separator.js} +6 -6
- package/dest/kernel/private_circuit_public_inputs.d.ts +9 -9
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +16 -16
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +3 -3
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -3
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +11 -7
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_validation_requests.d.ts +3 -3
- package/dest/kernel/private_validation_requests.js +9 -9
- package/dest/keys/derivation.js +8 -8
- package/dest/keys/key_types.d.ts +3 -3
- package/dest/keys/key_types.d.ts.map +1 -1
- package/dest/keys/public_keys.js +2 -2
- package/dest/keys/utils.js +5 -5
- 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/debug_log_store.d.ts +30 -0
- package/dest/logs/debug_log_store.d.ts.map +1 -0
- package/dest/logs/debug_log_store.js +30 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +35 -20
- package/dest/logs/index.d.ts +4 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +3 -1
- 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/pre_tag.d.ts +16 -11
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/private_log.d.ts +2 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- 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 +12 -9
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +16 -7
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +5 -1
- 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 +34 -8
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +72 -29
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/index.d.ts +1 -2
- package/dest/note/index.d.ts.map +1 -1
- package/dest/note/index.js +0 -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/attestation_utils.d.ts +11 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +45 -0
- package/dest/p2p/block_proposal.d.ts +23 -15
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +46 -43
- package/dest/p2p/checkpoint_attestation.d.ts +11 -8
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +17 -24
- package/dest/p2p/checkpoint_proposal.d.ts +29 -23
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +43 -65
- package/dest/p2p/client_type.d.ts +2 -5
- package/dest/p2p/client_type.d.ts.map +1 -1
- package/dest/p2p/client_type.js +0 -7
- package/dest/p2p/consensus_payload.d.ts +27 -7
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +40 -21
- package/dest/p2p/constants.d.ts +3 -1
- package/dest/p2p/constants.d.ts.map +1 -1
- package/dest/p2p/constants.js +1 -0
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -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/p2p/signature_utils.d.ts +28 -19
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +118 -21
- package/dest/p2p/signed_txs.d.ts +15 -13
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +26 -24
- package/dest/p2p/topic_type.d.ts +3 -4
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +7 -24
- 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 +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/rollup/checkpoint_header.d.ts +2 -2
- package/dest/rollup/checkpoint_header.js +2 -2
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +6 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +2 -2
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +6 -6
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +3 -3
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +3 -0
- 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 +8 -92
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +7 -15
- 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 +5 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +37 -56
- package/dest/tests/mocks.d.ts +14 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +65 -46
- package/dest/timetable/index.d.ts +87 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +243 -0
- 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/trees/public_data_leaf.d.ts +2 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +7 -6
- 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 +7 -3
- 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/global_variables.d.ts +4 -4
- package/dest/tx/global_variables.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 +17 -5
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +19 -9
- package/dest/tx/protocol_contracts.d.ts +1 -1
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/public_simulation_output.d.ts +4 -2
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +7 -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 +29 -6
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +23 -19
- package/dest/tx/tx_request.js +2 -2
- package/dest/tx/validator/empty_validator.d.ts +2 -2
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +10 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +11 -1
- package/dest/tx/validator/tx_validator.d.ts +2 -2
- package/dest/tx/validator/tx_validator.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/update-checker/index.d.ts +3 -2
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +2 -1
- package/dest/update-checker/package_version.d.ts +3 -0
- package/dest/update-checker/package_version.d.ts.map +1 -0
- package/dest/update-checker/package_version.js +24 -0
- package/dest/update-checker/version_checker.d.ts +25 -0
- package/dest/update-checker/version_checker.d.ts.map +1 -0
- package/dest/update-checker/version_checker.js +50 -0
- 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/validators/schemas.d.ts +30 -30
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +4 -3
- package/dest/validators/types.d.ts +3 -3
- package/dest/validators/types.d.ts.map +1 -1
- 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/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 +13 -11
- 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 -82
- package/src/abi/encoder.ts +85 -6
- package/src/abi/event_metadata_definition.ts +2 -0
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_call.ts +25 -3
- 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/auth_witness/auth_witness.ts +3 -3
- package/src/avm/revert_code.ts +26 -25
- package/src/aztec-address/index.ts +4 -10
- package/src/block/attestation_info.ts +11 -11
- package/src/block/block_data.ts +42 -0
- package/src/block/block_hash.ts +21 -14
- package/src/block/block_parameter.ts +35 -2
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +13 -1
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +88 -9
- package/src/block/l2_block_stream/interfaces.ts +6 -2
- package/src/block/l2_block_stream/l2_block_stream.ts +21 -0
- package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
- package/src/block/proposal/attestations_and_signers.ts +32 -17
- package/src/block/test/l2_tips_store_test_suite.ts +9 -2
- package/src/checkpoint/checkpoint.ts +54 -17
- package/src/checkpoint/checkpoint_data.ts +91 -0
- package/src/checkpoint/index.ts +2 -0
- package/src/checkpoint/published_checkpoint.ts +3 -1
- package/src/checkpoint/validate.ts +230 -0
- package/src/config/chain-config.ts +9 -4
- package/src/config/index.ts +2 -0
- package/src/config/pipelining-config.ts +31 -0
- package/src/config/sequencer-config.ts +65 -0
- package/src/contract/contract_address.ts +7 -7
- package/src/contract/contract_class.ts +3 -3
- package/src/contract/contract_class_id.ts +7 -6
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/contract/interfaces/node-info.ts +3 -0
- package/src/contract/private_function.ts +5 -3
- package/src/epoch-helpers/index.ts +30 -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/file-store/local.ts +15 -5
- package/src/file-store/s3.ts +12 -3
- package/src/gas/README.md +154 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas_fees.ts +20 -1
- package/src/gas/gas_settings.ts +65 -12
- 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 +75 -10
- package/src/hash/map_slot.ts +2 -2
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +28 -2
- package/src/interfaces/aztec-node-admin.ts +31 -8
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/aztec-node.ts +129 -85
- package/src/interfaces/block-builder.ts +61 -14
- package/src/interfaces/block_response.ts +79 -0
- package/src/interfaces/chain_tips.ts +24 -0
- package/src/interfaces/checkpoint_parameter.ts +22 -0
- package/src/interfaces/checkpoint_response.ts +84 -0
- package/src/interfaces/client.ts +6 -0
- package/src/interfaces/configs.ts +43 -8
- package/src/interfaces/l1_publish_info.ts +40 -0
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +12 -21
- package/src/interfaces/p2p.ts +2 -13
- package/src/interfaces/prover-client.ts +10 -5
- package/src/interfaces/server.ts +5 -0
- package/src/interfaces/slasher.ts +2 -6
- package/src/interfaces/validator.ts +76 -36
- 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/hints/index.ts +2 -2
- package/src/kernel/hints/{key_validation_request_and_generator.ts → key_validation_request_and_separator.ts} +12 -15
- package/src/kernel/hints/{scoped_key_validation_request_and_generator.ts → scoped_key_validation_request_and_separator.ts} +10 -10
- package/src/kernel/private_circuit_public_inputs.ts +14 -14
- package/src/kernel/private_kernel_circuit_public_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +14 -5
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_validation_requests.ts +8 -8
- package/src/keys/derivation.ts +8 -8
- package/src/keys/key_types.ts +6 -2
- package/src/keys/public_keys.ts +2 -2
- package/src/keys/utils.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/debug_log_store.ts +54 -0
- package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +41 -22
- package/src/logs/index.ts +3 -1
- 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/pre_tag.ts +5 -5
- package/src/logs/public_log.ts +4 -2
- package/src/logs/shared_secret_derivation.ts +21 -10
- package/src/logs/siloed_tag.ts +23 -14
- package/src/logs/tag.ts +9 -9
- 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 +101 -36
- package/src/noir/index.ts +2 -2
- package/src/note/index.ts +0 -1
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/attestation_utils.ts +56 -0
- package/src/p2p/block_proposal.ts +97 -39
- package/src/p2p/checkpoint_attestation.ts +26 -30
- package/src/p2p/checkpoint_proposal.ts +109 -84
- package/src/p2p/client_type.ts +0 -6
- package/src/p2p/consensus_payload.ts +59 -24
- package/src/p2p/constants.ts +3 -0
- package/src/p2p/gossipable.ts +4 -4
- package/src/p2p/index.ts +0 -1
- package/src/p2p/peer_error.ts +7 -0
- package/src/p2p/signature_utils.ts +110 -25
- package/src/p2p/signed_txs.ts +46 -28
- package/src/p2p/topic_type.ts +8 -15
- 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 +91 -5
- package/src/rollup/block_headers_hash.ts +11 -2
- package/src/rollup/checkpoint_header.ts +2 -2
- package/src/rollup/checkpoint_rollup_public_inputs.ts +5 -5
- package/src/rollup/root_rollup_public_inputs.ts +7 -7
- package/src/slashing/helpers.ts +4 -0
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +10 -35
- package/src/slashing/{tally.ts → votes.ts} +34 -1
- package/src/tests/factories.ts +42 -68
- package/src/tests/mocks.ts +103 -53
- package/src/timetable/index.ts +361 -0
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/trees/public_data_leaf.ts +11 -5
- package/src/tx/block_header.ts +10 -4
- 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/global_variables.ts +3 -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 +18 -9
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/public_simulation_output.ts +4 -0
- package/src/tx/simulated_tx.ts +14 -3
- package/src/tx/tx.ts +22 -13
- package/src/tx/tx_receipt.ts +28 -16
- package/src/tx/tx_request.ts +2 -2
- package/src/tx/validator/empty_validator.ts +1 -1
- package/src/tx/validator/error_texts.ts +13 -1
- package/src/tx/validator/tx_validator.ts +1 -1
- package/src/types/shared.ts +0 -10
- package/src/update-checker/index.ts +2 -1
- package/src/update-checker/package_version.ts +30 -0
- package/src/update-checker/version_checker.ts +65 -0
- package/src/validators/errors.ts +9 -0
- package/src/validators/schemas.ts +8 -1
- package/src/validators/types.ts +5 -4
- 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/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/kernel/hints/key_validation_request_and_generator.d.ts +0 -30
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +0 -1
- 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/logs/directional_app_tagging_secret.d.ts +0 -40
- package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
- package/dest/note/notes_filter.d.ts +0 -27
- package/dest/note/notes_filter.d.ts.map +0 -1
- package/dest/note/notes_filter.js +0 -11
- package/dest/slashing/empire.d.ts +0 -31
- package/dest/slashing/empire.d.ts.map +0 -1
- package/dest/slashing/empire.js +0 -86
- package/dest/slashing/tally.d.ts.map +0 -1
- package/dest/update-checker/update-checker.d.ts +0 -49
- package/dest/update-checker/update-checker.d.ts.map +0 -1
- package/dest/update-checker/update-checker.js +0 -130
- 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/note/notes_filter.ts +0 -38
- package/src/slashing/empire.ts +0 -103
- package/src/update-checker/update-checker.ts +0 -166
package/src/slashing/index.ts
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
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
|
|
|
5
|
-
import type {
|
|
6
|
-
Offense,
|
|
7
|
-
OffenseType,
|
|
8
|
-
SlashPayload,
|
|
9
|
-
SlashPayloadRound,
|
|
10
|
-
ValidatorSlash,
|
|
11
|
-
ValidatorSlashOffense,
|
|
12
|
-
} from './types.js';
|
|
4
|
+
import type { Offense, OffenseType } from './types.js';
|
|
13
5
|
|
|
14
6
|
export function serializeOffense(offense: Offense): Buffer {
|
|
15
7
|
return serializeToBuffer(
|
|
@@ -29,75 +21,3 @@ export function deserializeOffense(buffer: Buffer): Offense {
|
|
|
29
21
|
|
|
30
22
|
return { validator, amount, offenseType: offense, epochOrSlot };
|
|
31
23
|
}
|
|
32
|
-
|
|
33
|
-
function serializeValidatorSlashOffense(offense: ValidatorSlashOffense): Buffer {
|
|
34
|
-
return serializeToBuffer(bigintToUInt64BE(offense.epochOrSlot), offense.offenseType);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function deserializeValidatorSlashOffense(buffer: Buffer | BufferReader): ValidatorSlashOffense {
|
|
38
|
-
const reader = BufferReader.asReader(buffer);
|
|
39
|
-
return {
|
|
40
|
-
epochOrSlot: reader.readUInt64(),
|
|
41
|
-
offenseType: reader.readNumber() as OffenseType,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function serializeValidatorSlash(slash: ValidatorSlash): Buffer {
|
|
46
|
-
return serializeToBuffer(
|
|
47
|
-
slash.validator,
|
|
48
|
-
bigintToUInt128BE(slash.amount),
|
|
49
|
-
slash.offenses.length,
|
|
50
|
-
slash.offenses.map(serializeValidatorSlashOffense),
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function deserializeValidatorSlash(buffer: Buffer | BufferReader): ValidatorSlash {
|
|
55
|
-
const reader = BufferReader.asReader(buffer);
|
|
56
|
-
const validator = reader.readObject(EthAddress);
|
|
57
|
-
const amount = reader.readUInt128();
|
|
58
|
-
const offensesCount = reader.readNumber();
|
|
59
|
-
const offenses = times(offensesCount, () => deserializeValidatorSlashOffense(reader));
|
|
60
|
-
|
|
61
|
-
return { validator, amount, offenses };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function serializeSlashPayload(payload: SlashPayload): Buffer {
|
|
65
|
-
return serializeToBuffer(
|
|
66
|
-
payload.address,
|
|
67
|
-
payload.slashes.length,
|
|
68
|
-
payload.slashes.map(serializeValidatorSlash),
|
|
69
|
-
bigintToUInt64BE(payload.timestamp),
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function deserializeSlashPayload(buffer: Buffer): SlashPayload {
|
|
74
|
-
const reader = BufferReader.asReader(buffer);
|
|
75
|
-
const address = reader.readObject(EthAddress);
|
|
76
|
-
const slashesCount = reader.readNumber();
|
|
77
|
-
const slashes = times(slashesCount, () => deserializeValidatorSlash(reader));
|
|
78
|
-
const timestamp = reader.readUInt64();
|
|
79
|
-
return { address, slashes, timestamp };
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function serializeSlashPayloadRound(payload: SlashPayloadRound): Buffer {
|
|
83
|
-
return serializeToBuffer(
|
|
84
|
-
payload.address,
|
|
85
|
-
payload.slashes.length,
|
|
86
|
-
payload.slashes.map(serializeValidatorSlash),
|
|
87
|
-
bigintToUInt64BE(payload.timestamp),
|
|
88
|
-
Number(payload.votes),
|
|
89
|
-
bigintToUInt64BE(payload.round),
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export function deserializeSlashPayloadRound(buffer: Buffer): SlashPayloadRound {
|
|
94
|
-
const reader = BufferReader.asReader(buffer);
|
|
95
|
-
const address = reader.readObject(EthAddress);
|
|
96
|
-
const slashesCount = reader.readNumber();
|
|
97
|
-
const slashes = times(slashesCount, () => deserializeValidatorSlash(reader));
|
|
98
|
-
const timestamp = reader.readUInt64();
|
|
99
|
-
const votes = BigInt(reader.readNumber());
|
|
100
|
-
const round = reader.readUInt64();
|
|
101
|
-
|
|
102
|
-
return { address, slashes, timestamp, votes, round };
|
|
103
|
-
}
|
package/src/slashing/types.ts
CHANGED
|
@@ -22,6 +22,8 @@ export enum OffenseType {
|
|
|
22
22
|
ATTESTED_DESCENDANT_OF_INVALID = 7,
|
|
23
23
|
/** A proposer sent duplicate proposals for the same position (slot, indexWithinCheckpoint for blocks or slot for checkpoints) */
|
|
24
24
|
DUPLICATE_PROPOSAL = 8,
|
|
25
|
+
/** A validator signed attestations for different proposals at the same slot (equivocation) */
|
|
26
|
+
DUPLICATE_ATTESTATION = 9,
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export function getOffenseTypeName(offense: OffenseType) {
|
|
@@ -44,6 +46,8 @@ export function getOffenseTypeName(offense: OffenseType) {
|
|
|
44
46
|
return 'attested_descendant_of_invalid';
|
|
45
47
|
case OffenseType.DUPLICATE_PROPOSAL:
|
|
46
48
|
return 'duplicate_proposal';
|
|
49
|
+
case OffenseType.DUPLICATE_ATTESTATION:
|
|
50
|
+
return 'duplicate_attestation';
|
|
47
51
|
default:
|
|
48
52
|
throw new Error(`Unknown offense type: ${offense}`);
|
|
49
53
|
}
|
|
@@ -61,6 +65,7 @@ export const OffenseToBigInt: Record<OffenseType, bigint> = {
|
|
|
61
65
|
[OffenseType.PROPOSED_INCORRECT_ATTESTATIONS]: 6n,
|
|
62
66
|
[OffenseType.ATTESTED_DESCENDANT_OF_INVALID]: 7n,
|
|
63
67
|
[OffenseType.DUPLICATE_PROPOSAL]: 8n,
|
|
68
|
+
[OffenseType.DUPLICATE_ATTESTATION]: 9n,
|
|
64
69
|
};
|
|
65
70
|
|
|
66
71
|
export function bigIntToOffense(offense: bigint): OffenseType {
|
|
@@ -83,6 +88,8 @@ export function bigIntToOffense(offense: bigint): OffenseType {
|
|
|
83
88
|
return OffenseType.ATTESTED_DESCENDANT_OF_INVALID;
|
|
84
89
|
case 8n:
|
|
85
90
|
return OffenseType.DUPLICATE_PROPOSAL;
|
|
91
|
+
case 9n:
|
|
92
|
+
return OffenseType.DUPLICATE_ATTESTATION;
|
|
86
93
|
default:
|
|
87
94
|
throw new Error(`Unknown offense: ${offense}`);
|
|
88
95
|
}
|
|
@@ -119,45 +126,13 @@ export type ValidatorSlash = {
|
|
|
119
126
|
offenses: ValidatorSlashOffense[];
|
|
120
127
|
};
|
|
121
128
|
|
|
122
|
-
/**
|
|
123
|
-
export type SlashPayload = {
|
|
124
|
-
address: EthAddress;
|
|
125
|
-
slashes: ValidatorSlash[];
|
|
126
|
-
timestamp: bigint;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/** Slash payload with round information from empire slash proposer */
|
|
130
|
-
export type SlashPayloadRound = SlashPayload & { votes: bigint; round: bigint };
|
|
131
|
-
|
|
132
|
-
export const SlashPayloadRoundSchema = zodFor<SlashPayloadRound>()(
|
|
133
|
-
z.object({
|
|
134
|
-
address: schemas.EthAddress,
|
|
135
|
-
timestamp: schemas.BigInt,
|
|
136
|
-
votes: schemas.BigInt,
|
|
137
|
-
round: schemas.BigInt,
|
|
138
|
-
slashes: z.array(
|
|
139
|
-
z.object({
|
|
140
|
-
validator: schemas.EthAddress,
|
|
141
|
-
amount: schemas.BigInt,
|
|
142
|
-
offenses: z.array(z.object({ offenseType: OffenseTypeSchema, epochOrSlot: schemas.BigInt })),
|
|
143
|
-
}),
|
|
144
|
-
),
|
|
145
|
-
}),
|
|
146
|
-
);
|
|
147
|
-
|
|
148
|
-
/** Votes for a validator slash in the consensus slash proposer */
|
|
129
|
+
/** Votes for a validator slash in the slashing proposer */
|
|
149
130
|
export type ValidatorSlashVote = number;
|
|
150
131
|
|
|
151
132
|
export type ProposerSlashAction =
|
|
152
|
-
/**
|
|
153
|
-
| { type: 'create-empire-payload'; data: ValidatorSlash[] }
|
|
154
|
-
/** Vote for a slashing payload on an empire-based slash proposer */
|
|
155
|
-
| { type: 'vote-empire-payload'; payload: EthAddress }
|
|
156
|
-
/** Execute a slashing payload on an empire-based slash proposer */
|
|
157
|
-
| { type: 'execute-empire-payload'; round: bigint }
|
|
158
|
-
/** Vote for offenses on a consensus slashing proposer */
|
|
133
|
+
/** Vote for offenses on the slashing proposer */
|
|
159
134
|
| { type: 'vote-offenses'; votes: ValidatorSlashVote[]; committees: EthAddress[][]; round: bigint }
|
|
160
|
-
/** Execute a slashing round on
|
|
135
|
+
/** Execute a slashing round on the slashing proposer */
|
|
161
136
|
| { type: 'execute-slash'; committees: EthAddress[][]; round: bigint };
|
|
162
137
|
|
|
163
138
|
export type ProposerSlashActionType = ProposerSlashAction['type'];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { sumBigint } from '@aztec/foundation/bigint';
|
|
2
2
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
4
5
|
import type { PartialBy } from '@aztec/foundation/types';
|
|
5
6
|
|
|
6
7
|
import { getEpochForOffense } from './helpers.js';
|
|
@@ -12,6 +13,9 @@ import type { Offense, ValidatorSlashVote } from './types.js';
|
|
|
12
13
|
* @param committees - Array of committees (each containing array of validator addresses)
|
|
13
14
|
* @param epochsForCommittees - Array of epochs corresponding to each committee
|
|
14
15
|
* @param settings - Settings including slashingAmounts and optional validator override lists
|
|
16
|
+
* @param settings.maxSlashedValidators - If set, limits the total number of [validator, epoch] pairs
|
|
17
|
+
* with non-zero votes. The lowest-vote pairs are zeroed out to stay within the limit.
|
|
18
|
+
* @param logger - Logger, logs which validators were dropped.
|
|
15
19
|
* @returns Array of ValidatorSlashVote, where each vote is how many slash units the validator in that position should be slashed
|
|
16
20
|
*/
|
|
17
21
|
export function getSlashConsensusVotesFromOffenses(
|
|
@@ -22,9 +26,11 @@ export function getSlashConsensusVotesFromOffenses(
|
|
|
22
26
|
slashingAmounts: [bigint, bigint, bigint];
|
|
23
27
|
epochDuration: number;
|
|
24
28
|
targetCommitteeSize: number;
|
|
29
|
+
maxSlashedValidators?: number;
|
|
25
30
|
},
|
|
31
|
+
logger: Logger = createLogger('slasher:votes'),
|
|
26
32
|
): ValidatorSlashVote[] {
|
|
27
|
-
const { slashingAmounts, targetCommitteeSize } = settings;
|
|
33
|
+
const { slashingAmounts, targetCommitteeSize, maxSlashedValidators } = settings;
|
|
28
34
|
|
|
29
35
|
if (committees.length !== epochsForCommittees.length) {
|
|
30
36
|
throw new Error('committees and epochsForCommittees must have the same length');
|
|
@@ -53,6 +59,33 @@ export function getSlashConsensusVotesFromOffenses(
|
|
|
53
59
|
return padArrayEnd(votes, 0, targetCommitteeSize);
|
|
54
60
|
});
|
|
55
61
|
|
|
62
|
+
// if a cap is set, zero out the lowest-vote [validator, epoch] pairs so that the most severe slashes stay.
|
|
63
|
+
if (maxSlashedValidators === undefined) {
|
|
64
|
+
return votes;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const nonZeroByDescendingVote = [...votes.entries()].filter(([, vote]) => vote > 0).sort(([, a], [, b]) => b - a);
|
|
68
|
+
|
|
69
|
+
const toTruncate = nonZeroByDescendingVote.slice(maxSlashedValidators);
|
|
70
|
+
for (const [idx] of toTruncate) {
|
|
71
|
+
votes[idx] = 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (toTruncate.length > 0) {
|
|
75
|
+
const truncated = toTruncate.map(([idx]) => {
|
|
76
|
+
const committeeIndex = Math.floor(idx / targetCommitteeSize);
|
|
77
|
+
const positionInCommittee = idx % targetCommitteeSize;
|
|
78
|
+
return {
|
|
79
|
+
validator: committees[committeeIndex][positionInCommittee].toString(),
|
|
80
|
+
epoch: epochsForCommittees[committeeIndex],
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
logger.warn(
|
|
84
|
+
`Truncated ${toTruncate.length} validator-epoch pairs to stay within limit of ${maxSlashedValidators}`,
|
|
85
|
+
{ truncated },
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
56
89
|
return votes;
|
|
57
90
|
}
|
|
58
91
|
|
package/src/tests/factories.ts
CHANGED
|
@@ -7,11 +7,10 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
ARCHIVE_HEIGHT,
|
|
9
9
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
10
|
-
AZTEC_MAX_EPOCH_DURATION,
|
|
11
10
|
CHONK_PROOF_LENGTH,
|
|
12
11
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
13
|
-
GeneratorIndex,
|
|
14
12
|
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
13
|
+
MAX_CHECKPOINTS_PER_EPOCH,
|
|
15
14
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
16
15
|
MAX_ENQUEUED_CALLS_PER_CALL,
|
|
17
16
|
MAX_ENQUEUED_CALLS_PER_TX,
|
|
@@ -46,7 +45,6 @@ import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
|
46
45
|
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
47
46
|
import { compact } from '@aztec/foundation/collection';
|
|
48
47
|
import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
|
|
49
|
-
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
50
48
|
import { SchnorrSignature } from '@aztec/foundation/crypto/schnorr';
|
|
51
49
|
import { sha256 } from '@aztec/foundation/crypto/sha256';
|
|
52
50
|
import { Fq, Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -92,17 +90,16 @@ import {
|
|
|
92
90
|
type ContractClassPublic,
|
|
93
91
|
ContractDeploymentData,
|
|
94
92
|
type ContractInstanceWithAddress,
|
|
95
|
-
type ExecutablePrivateFunctionWithMembershipProof,
|
|
96
93
|
type PrivateFunction,
|
|
97
94
|
SerializableContractInstance,
|
|
98
|
-
type UtilityFunctionWithMembershipProof,
|
|
99
95
|
computeContractClassId,
|
|
96
|
+
computePartialAddress,
|
|
100
97
|
computePublicBytecodeCommitment,
|
|
101
98
|
} from '../contract/index.js';
|
|
102
99
|
import { Gas, GasFees, GasSettings } from '../gas/index.js';
|
|
103
100
|
import { computeCalldataHash } from '../hash/hash.js';
|
|
104
101
|
import { KeyValidationRequest } from '../kernel/hints/key_validation_request.js';
|
|
105
|
-
import {
|
|
102
|
+
import { KeyValidationRequestAndSeparator } from '../kernel/hints/key_validation_request_and_separator.js';
|
|
106
103
|
import { ReadRequest, ScopedReadRequest } from '../kernel/hints/read_request.js';
|
|
107
104
|
import {
|
|
108
105
|
ClaimedLengthArray,
|
|
@@ -128,6 +125,7 @@ import {
|
|
|
128
125
|
PublicCallRequestArrayLengths,
|
|
129
126
|
} from '../kernel/public_call_request.js';
|
|
130
127
|
import { PublicKeys, computeAddress } from '../keys/index.js';
|
|
128
|
+
import { ExtendedDirectionalAppTaggingSecret } from '../logs/extended_directional_app_tagging_secret.js';
|
|
131
129
|
import { ContractClassLog, ContractClassLogFields } from '../logs/index.js';
|
|
132
130
|
import { PrivateLog } from '../logs/private_log.js';
|
|
133
131
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
@@ -177,7 +175,7 @@ import { TxHash } from '../tx/tx_hash.js';
|
|
|
177
175
|
import { TxRequest } from '../tx/tx_request.js';
|
|
178
176
|
import { Vector } from '../types/index.js';
|
|
179
177
|
import { VkData } from '../vks/index.js';
|
|
180
|
-
import {
|
|
178
|
+
import { VerificationKeyAsFields, VerificationKeyData } from '../vks/verification_key.js';
|
|
181
179
|
|
|
182
180
|
/**
|
|
183
181
|
* Creates an arbitrary side effect object with the given seed.
|
|
@@ -233,7 +231,7 @@ export function makeTxContext(seed: number = 1): TxContext {
|
|
|
233
231
|
* Creates a default instance of gas settings. No seed value is used to ensure we allocate a sensible amount of gas for testing.
|
|
234
232
|
*/
|
|
235
233
|
export function makeGasSettings() {
|
|
236
|
-
return GasSettings.
|
|
234
|
+
return GasSettings.fallback({ maxFeesPerGas: new GasFees(10, 10) });
|
|
237
235
|
}
|
|
238
236
|
|
|
239
237
|
/**
|
|
@@ -259,12 +257,12 @@ function makeKeyValidationRequests(seed: number): KeyValidationRequest {
|
|
|
259
257
|
}
|
|
260
258
|
|
|
261
259
|
/**
|
|
262
|
-
* Creates arbitrary
|
|
263
|
-
* @param seed - The seed to use for generating the
|
|
264
|
-
* @returns A
|
|
260
|
+
* Creates arbitrary KeyValidationRequestAndSeparator from the given seed.
|
|
261
|
+
* @param seed - The seed to use for generating the KeyValidationRequestAndSeparator.
|
|
262
|
+
* @returns A KeyValidationRequestAndSeparator.
|
|
265
263
|
*/
|
|
266
|
-
function
|
|
267
|
-
return new
|
|
264
|
+
function makeKeyValidationRequestAndSeparators(seed: number): KeyValidationRequestAndSeparator {
|
|
265
|
+
return new KeyValidationRequestAndSeparator(makeKeyValidationRequests(seed), fr(seed + 4));
|
|
268
266
|
}
|
|
269
267
|
|
|
270
268
|
export function makePublicDataWrite(seed = 1) {
|
|
@@ -574,14 +572,6 @@ export function makeVerificationKeyAsFields(size: number): VerificationKeyAsFiel
|
|
|
574
572
|
return VerificationKeyAsFields.makeFake(size);
|
|
575
573
|
}
|
|
576
574
|
|
|
577
|
-
/**
|
|
578
|
-
* Creates arbitrary/mocked verification key.
|
|
579
|
-
* @returns A verification key object
|
|
580
|
-
*/
|
|
581
|
-
export function makeVerificationKey(): VerificationKey {
|
|
582
|
-
return VerificationKey.makeFake();
|
|
583
|
-
}
|
|
584
|
-
|
|
585
575
|
/**
|
|
586
576
|
* Creates an arbitrary point in a curve.
|
|
587
577
|
* @param seed - Seed to generate the point values.
|
|
@@ -656,7 +646,7 @@ function makeClaimedLengthArray<T extends Serializable, N extends number>(
|
|
|
656
646
|
*/
|
|
657
647
|
export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicInputs {
|
|
658
648
|
return PrivateCircuitPublicInputs.from({
|
|
659
|
-
|
|
649
|
+
expirationTimestamp: BigInt(seed + 0x31415),
|
|
660
650
|
callContext: makeCallContext(seed, { isStaticCall: true }),
|
|
661
651
|
argsHash: fr(seed + 0x100),
|
|
662
652
|
returnsHash: fr(seed + 0x200),
|
|
@@ -671,9 +661,9 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
671
661
|
makeScopedReadRequest,
|
|
672
662
|
seed + 0x310,
|
|
673
663
|
),
|
|
674
|
-
|
|
664
|
+
keyValidationRequestsAndSeparators: makeClaimedLengthArray(
|
|
675
665
|
MAX_KEY_VALIDATION_REQUESTS_PER_CALL,
|
|
676
|
-
|
|
666
|
+
makeKeyValidationRequestAndSeparators,
|
|
677
667
|
seed + 0x320,
|
|
678
668
|
),
|
|
679
669
|
noteHashes: makeClaimedLengthArray(MAX_NOTE_HASHES_PER_CALL, makeNoteHash, seed + 0x400),
|
|
@@ -851,8 +841,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
851
841
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
852
842
|
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
853
843
|
makeAppendOnlyTreeSnapshot(seed + 0x350),
|
|
854
|
-
makeTuple(
|
|
855
|
-
makeTuple(
|
|
844
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => fr(seed), 0x400),
|
|
845
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => makeFeeRecipient(seed), 0x500),
|
|
856
846
|
makeBlobAccumulator(seed + 0x600),
|
|
857
847
|
makeBlobAccumulator(seed + 0x700),
|
|
858
848
|
makeFinalBlobBatchingChallenges(seed + 0x800),
|
|
@@ -864,11 +854,16 @@ export function makeParityPublicInputs(seed = 0): ParityPublicInputs {
|
|
|
864
854
|
new Fr(BigInt(seed + 0x200)),
|
|
865
855
|
new Fr(BigInt(seed + 0x300)),
|
|
866
856
|
new Fr(BigInt(seed + 0x400)),
|
|
857
|
+
new Fr(BigInt(seed + 0x500)),
|
|
867
858
|
);
|
|
868
859
|
}
|
|
869
860
|
|
|
870
861
|
export function makeParityBasePrivateInputs(seed = 0): ParityBasePrivateInputs {
|
|
871
|
-
return new ParityBasePrivateInputs(
|
|
862
|
+
return new ParityBasePrivateInputs(
|
|
863
|
+
makeTuple(NUM_MSGS_PER_BASE_PARITY, fr, seed + 0x3000),
|
|
864
|
+
new Fr(seed + 0x4000),
|
|
865
|
+
new Fr(seed + 0x5000),
|
|
866
|
+
);
|
|
872
867
|
}
|
|
873
868
|
|
|
874
869
|
export function makeParityRootPrivateInputs(seed = 0) {
|
|
@@ -888,8 +883,8 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
888
883
|
fr(seed + 0x100),
|
|
889
884
|
fr(seed + 0x200),
|
|
890
885
|
fr(seed + 0x300),
|
|
891
|
-
makeTuple(
|
|
892
|
-
makeTuple(
|
|
886
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => fr(seed), 0x400),
|
|
887
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => makeFeeRecipient(seed), 0x500),
|
|
893
888
|
makeEpochConstantData(seed + 0x600),
|
|
894
889
|
makeFinalBlobAccumulator(seed + 0x700),
|
|
895
890
|
);
|
|
@@ -1182,35 +1177,6 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
|
|
|
1182
1177
|
});
|
|
1183
1178
|
}
|
|
1184
1179
|
|
|
1185
|
-
export function makeExecutablePrivateFunctionWithMembershipProof(
|
|
1186
|
-
seed = 0,
|
|
1187
|
-
): ExecutablePrivateFunctionWithMembershipProof {
|
|
1188
|
-
return {
|
|
1189
|
-
selector: makeSelector(seed),
|
|
1190
|
-
bytecode: makeBytes(100, seed + 1),
|
|
1191
|
-
artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
|
|
1192
|
-
artifactTreeLeafIndex: seed + 2,
|
|
1193
|
-
privateFunctionTreeSiblingPath: makeTuple(3, fr, seed + 3),
|
|
1194
|
-
privateFunctionTreeLeafIndex: seed + 3,
|
|
1195
|
-
artifactMetadataHash: fr(seed + 4),
|
|
1196
|
-
functionMetadataHash: fr(seed + 5),
|
|
1197
|
-
utilityFunctionsTreeRoot: fr(seed + 6),
|
|
1198
|
-
vkHash: fr(seed + 7),
|
|
1199
|
-
};
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
export function makeUtilityFunctionWithMembershipProof(seed = 0): UtilityFunctionWithMembershipProof {
|
|
1203
|
-
return {
|
|
1204
|
-
selector: makeSelector(seed),
|
|
1205
|
-
bytecode: makeBytes(100, seed + 1),
|
|
1206
|
-
artifactTreeSiblingPath: makeTuple(3, fr, seed + 2),
|
|
1207
|
-
artifactTreeLeafIndex: seed + 2,
|
|
1208
|
-
artifactMetadataHash: fr(seed + 4),
|
|
1209
|
-
functionMetadataHash: fr(seed + 5),
|
|
1210
|
-
privateFunctionsArtifactTreeRoot: fr(seed + 6),
|
|
1211
|
-
};
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
1180
|
export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer): Promise<ContractClassPublic> {
|
|
1215
1181
|
const artifactHash = fr(seed + 1);
|
|
1216
1182
|
const privateFunctionsRoot = fr(seed + 3);
|
|
@@ -1222,8 +1188,6 @@ export async function makeContractClassPublic(seed = 0, publicBytecode?: Buffer)
|
|
|
1222
1188
|
artifactHash,
|
|
1223
1189
|
packedBytecode,
|
|
1224
1190
|
privateFunctionsRoot,
|
|
1225
|
-
privateFunctions: [],
|
|
1226
|
-
utilityFunctions: [],
|
|
1227
1191
|
version: 1,
|
|
1228
1192
|
};
|
|
1229
1193
|
}
|
|
@@ -1285,14 +1249,12 @@ export async function makeContractInstanceFromClassId(
|
|
|
1285
1249
|
const deployer = overrides?.deployer ?? new AztecAddress(new Fr(seed + 2));
|
|
1286
1250
|
const publicKeys = overrides?.publicKeys ?? (await makePublicKeys(seed + 3));
|
|
1287
1251
|
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
GeneratorIndex.PARTIAL_ADDRESS,
|
|
1295
|
-
);
|
|
1252
|
+
const partialAddress = await computePartialAddress({
|
|
1253
|
+
originalContractClassId: classId,
|
|
1254
|
+
salt,
|
|
1255
|
+
initializationHash,
|
|
1256
|
+
deployer,
|
|
1257
|
+
});
|
|
1296
1258
|
const address = await computeAddress(publicKeys, partialAddress);
|
|
1297
1259
|
return new SerializableContractInstance({
|
|
1298
1260
|
version: 1,
|
|
@@ -1747,6 +1709,10 @@ export function makeL2Tips(
|
|
|
1747
1709
|
block: { number: bn, hash },
|
|
1748
1710
|
checkpoint: { number: cpn, hash: cph },
|
|
1749
1711
|
},
|
|
1712
|
+
proposedCheckpoint: {
|
|
1713
|
+
block: { number: bn, hash },
|
|
1714
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1715
|
+
},
|
|
1750
1716
|
proven: {
|
|
1751
1717
|
block: { number: bn, hash },
|
|
1752
1718
|
checkpoint: { number: cpn, hash: cph },
|
|
@@ -1757,3 +1723,11 @@ export function makeL2Tips(
|
|
|
1757
1723
|
},
|
|
1758
1724
|
};
|
|
1759
1725
|
}
|
|
1726
|
+
|
|
1727
|
+
export async function randomExtendedDirectionalAppTaggingSecret(): Promise<ExtendedDirectionalAppTaggingSecret> {
|
|
1728
|
+
const resolvedApp = await AztecAddress.random();
|
|
1729
|
+
// Using the fromString method like this is messy as it leaks the underlying serialization format but I don't want to
|
|
1730
|
+
// expose the type's constructor just for tests since in prod the secret is always constructed via compute. Also this
|
|
1731
|
+
// method is tested in extended_directional_app_tagging_secret.test.ts hence all should be fine.
|
|
1732
|
+
return ExtendedDirectionalAppTaggingSecret.fromString(`${Fr.random().toString()}:${resolvedApp.toString()}`);
|
|
1733
|
+
}
|