@aztec/stdlib 0.0.1-commit.fcb71a6 → 0.0.1-commit.ff7989d6c
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/contract_artifact.d.ts +2 -2
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +1 -1
- package/dest/abi/function_call.d.ts +47 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +20 -3
- package/dest/abi/selector.js +3 -1
- package/dest/abi/utils.d.ts +7 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +7 -0
- package/dest/auth_witness/auth_witness.d.ts +2 -1
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/auth_witness.js +3 -3
- package/dest/avm/avm.d.ts +62 -62
- package/dest/avm/avm_accumulated_data.d.ts +30 -3
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +5 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +9 -9
- package/dest/avm/avm_circuit_public_inputs.js +3 -1
- package/dest/avm/avm_proving_request.d.ts +299 -299
- package/dest/avm/contract_storage_read.d.ts +13 -1
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +13 -1
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +3 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +10 -1
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +10 -1
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.js +3 -1
- package/dest/avm/public_data_write.d.ts +7 -1
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.d.ts +4 -1
- package/dest/avm/public_inner_call_request.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.js +3 -1
- package/dest/avm/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +3 -1
- package/dest/aztec-address/index.js +4 -2
- package/dest/block/attestation_info.d.ts +5 -5
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -4
- package/dest/block/block_data.d.ts +52 -0
- package/dest/block/block_data.d.ts.map +1 -0
- package/dest/block/block_data.js +12 -0
- package/dest/block/block_hash.d.ts +18 -14
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +22 -20
- package/dest/block/block_parameter.d.ts +4 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +2 -0
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -2
- package/dest/block/checkpointed_l2_block.d.ts +20 -137
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
- package/dest/block/checkpointed_l2_block.js +7 -45
- package/dest/block/in_block.d.ts +9 -9
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/in_block.js +5 -5
- package/dest/block/index.d.ts +2 -3
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -2
- package/dest/block/l2_block.d.ts +57 -57
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -108
- package/dest/block/l2_block_source.d.ts +317 -68
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +25 -6
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +15 -5
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +8 -3
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +106 -31
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
- 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 +478 -38
- package/dest/block/validate_block_result.d.ts +24 -24
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -17
- package/dest/checkpoint/checkpoint.d.ts +43 -19
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +38 -14
- package/dest/checkpoint/checkpoint_data.d.ts +120 -0
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_data.js +26 -0
- package/dest/checkpoint/checkpoint_info.d.ts +32 -3
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_info.js +34 -1
- 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 +33 -16
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +5 -5
- 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/node-rpc-config.js +1 -1
- package/dest/config/sequencer-config.d.ts +10 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +18 -0
- package/dest/contract/complete_address.d.ts +4 -1
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_address.js +4 -4
- 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 +2 -2
- package/dest/contract/contract_class_id.d.ts.map +1 -1
- package/dest/contract/contract_class_id.js +6 -5
- package/dest/contract/contract_deployment_data.d.ts +5 -5
- 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_instance.d.ts +16 -16
- 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 +3 -4
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.js +1 -1
- package/dest/database-version/database_version.d.ts +58 -0
- package/dest/database-version/database_version.d.ts.map +1 -0
- package/dest/database-version/database_version.js +69 -0
- package/dest/database-version/version_manager.d.ts +3 -49
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +1 -64
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +2 -2
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.js +7 -10
- package/dest/deserialization/index.d.ts +11 -0
- package/dest/deserialization/index.d.ts.map +1 -0
- package/dest/deserialization/index.js +10 -0
- package/dest/epoch-helpers/index.d.ts +7 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +9 -3
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.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/gas.js +3 -1
- package/dest/gas/gas_fees.js +3 -1
- package/dest/ha-signing/config.d.ts +101 -0
- package/dest/ha-signing/config.d.ts.map +1 -0
- package/dest/ha-signing/config.js +92 -0
- package/dest/ha-signing/index.d.ts +3 -0
- package/dest/ha-signing/index.d.ts.map +1 -0
- package/dest/ha-signing/index.js +2 -0
- package/dest/ha-signing/types.d.ts +85 -0
- package/dest/ha-signing/types.d.ts.map +1 -0
- package/dest/ha-signing/types.js +32 -0
- package/dest/hash/hash.d.ts +2 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +16 -10
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/hash/map_slot.d.ts.map +1 -1
- package/dest/hash/map_slot.js +4 -3
- package/dest/interfaces/api_limit.d.ts +3 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +2 -0
- package/dest/interfaces/archiver.d.ts +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +27 -17
- package/dest/interfaces/aztec-node-admin.d.ts +111 -32
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +14 -6
- package/dest/interfaces/aztec-node.d.ts +75 -77
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +15 -16
- package/dest/interfaces/block-builder.d.ts +22 -14
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +7 -0
- package/dest/interfaces/configs.d.ts +28 -8
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +5 -1
- package/dest/interfaces/get_logs_response.d.ts +16 -9
- package/dest/interfaces/get_logs_response.d.ts.map +1 -1
- package/dest/interfaces/l2_logs_source.d.ts +14 -5
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +7 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +3 -4
- package/dest/interfaces/prover-broker.d.ts +16 -1
- package/dest/interfaces/prover-broker.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.js +4 -1
- package/dest/interfaces/prover-client.d.ts +15 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +12 -1
- package/dest/interfaces/proving-job.d.ts +52 -52
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +1 -7
- package/dest/interfaces/server_circuit_prover.d.ts +4 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +9 -1
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +2 -0
- package/dest/interfaces/tx_provider.d.ts +3 -3
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +155 -19
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +8 -3
- package/dest/kernel/claimed_length_array.js +3 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -5
- 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 +19 -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 +16 -8
- package/dest/kernel/hints/index.d.ts +2 -2
- package/dest/kernel/hints/index.js +2 -2
- package/dest/kernel/hints/key_validation_hint.d.ts +2 -1
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +2 -1
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- 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/private_kernel_reset_hints.d.ts +13 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +7 -1
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +7 -1
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- 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/hints/transient_data_squashing_hint.js +3 -1
- package/dest/kernel/log_hash.js +3 -1
- package/dest/kernel/private_accumulated_data.d.ts +23 -1
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +25 -1
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_request.d.ts +16 -1
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +81 -8
- 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 +33 -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_data.d.ts +7 -1
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +22 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts +7 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +4 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +12 -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 +25 -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 +7 -7
- package/dest/kernel/private_log_data.js +5 -2
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
- package/dest/kernel/private_to_public_accumulated_data.js +3 -1
- 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_accumulated_data.d.ts +17 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +3 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +18 -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 +13 -4
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +12 -10
- package/dest/kernel/public_call_request.d.ts +22 -1
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +5 -2
- package/dest/kernel/utils/optional_number.d.ts +7 -1
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/derivation.d.ts +3 -3
- package/dest/keys/derivation.js +15 -15
- package/dest/keys/key_types.d.ts +3 -3
- package/dest/keys/key_types.d.ts.map +1 -1
- package/dest/keys/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +2 -2
- package/dest/keys/utils.d.ts +1 -1
- package/dest/keys/utils.d.ts.map +1 -1
- package/dest/keys/utils.js +8 -4
- package/dest/l1-contracts/slash_factory.d.ts +1 -1
- package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
- package/dest/l1-contracts/slash_factory.js +1 -0
- package/dest/logs/contract_class_log.js +3 -1
- package/dest/logs/extended_contract_class_log.d.ts +3 -1
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +17 -9
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +21 -14
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +20 -17
- package/dest/logs/private_log.d.ts +2 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +3 -1
- package/dest/logs/public_log.js +3 -1
- package/dest/logs/siloed_tag.d.ts +1 -1
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +2 -5
- package/dest/messaging/in_hash.d.ts +4 -2
- package/dest/messaging/in_hash.d.ts.map +1 -1
- package/dest/messaging/in_hash.js +3 -1
- package/dest/messaging/inbox_leaf.d.ts +3 -1
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/l1_actor.d.ts +7 -1
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +6 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l2_actor.d.ts +7 -1
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +88 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +160 -42
- package/dest/messaging/out_hash.d.ts +41 -3
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +54 -19
- 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 +36 -5
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +15 -12
- package/dest/p2p/attestation_utils.d.ts +3 -3
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +1 -1
- package/dest/p2p/block_proposal.d.ts +102 -23
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +138 -39
- package/dest/p2p/checkpoint_attestation.d.ts +82 -0
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -0
- package/dest/p2p/{block_attestation.js → checkpoint_attestation.js} +22 -19
- package/dest/p2p/checkpoint_proposal.d.ts +179 -0
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
- package/dest/p2p/checkpoint_proposal.js +243 -0
- package/dest/p2p/consensus_payload.d.ts +20 -11
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +24 -19
- package/dest/p2p/constants.d.ts +5 -0
- package/dest/p2p/constants.d.ts.map +1 -0
- package/dest/p2p/constants.js +3 -0
- package/dest/p2p/gossipable.d.ts +4 -3
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +16 -5
- package/dest/p2p/index.d.ts +5 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +4 -1
- package/dest/p2p/message_validator.d.ts +18 -3
- package/dest/p2p/message_validator.d.ts.map +1 -1
- package/dest/p2p/message_validator.js +2 -1
- package/dest/p2p/signature_utils.d.ts +5 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +3 -1
- package/dest/p2p/signed_txs.d.ts +42 -0
- package/dest/p2p/signed_txs.d.ts.map +1 -0
- package/dest/p2p/signed_txs.js +75 -0
- package/dest/p2p/topic_type.d.ts +3 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +10 -3
- package/dest/parity/parity_base_private_inputs.d.ts +3 -1
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +4 -1
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +2 -1
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +1 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +9 -4
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/recursive_proof.d.ts +10 -1
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +34 -1
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +12 -1
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +47 -11
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -12
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +10 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +3 -1
- package/dest/rollup/checkpoint_header.d.ts +43 -13
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +50 -20
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +46 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +11 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +44 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +13 -2
- package/dest/rollup/epoch_constant_data.d.ts +16 -1
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +6 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +21 -6
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +10 -4
- package/dest/rollup/tree_snapshot_diff_hints.d.ts +24 -1
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +29 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +1 -1
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +2 -0
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +6 -0
- package/dest/slashing/tally.d.ts +2 -1
- package/dest/slashing/tally.d.ts.map +1 -1
- package/dest/slashing/tally.js +6 -2
- package/dest/slashing/types.d.ts +7 -3
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +13 -1
- package/dest/stats/stats.d.ts +1 -3
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +16 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +71 -36
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +77 -19
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +133 -62
- package/dest/timetable/index.d.ts +37 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +39 -0
- package/dest/trees/append_only_tree_snapshot.d.ts +13 -1
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +3 -1
- package/dest/trees/nullifier_leaf.d.ts +13 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +10 -1
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +17 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +7 -6
- package/dest/trees/public_data_witness.d.ts +11 -1
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +14 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +9 -3
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/call_context.js +3 -1
- package/dest/tx/capsule.d.ts +4 -1
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +9 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -2
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +2 -2
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +12 -4
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +3 -1
- package/dest/tx/hashed_values.d.ts +7 -1
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/in_tx.d.ts +4 -4
- package/dest/tx/index.d.ts +1 -2
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/indexed_tx_effect.d.ts +5 -5
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +3 -2
- package/dest/tx/partial_state_reference.d.ts +4 -1
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +23 -6
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +4 -21
- package/dest/tx/private_tx_constant_data.d.ts +16 -1
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +152 -29
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +47 -10
- package/dest/tx/protocol_contracts.d.ts +2 -2
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/public_call_request_with_calldata.d.ts +7 -1
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +3 -1
- 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/state_reference.d.ts +3 -1
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -1
- package/dest/tx/tree_snapshots.js +3 -1
- package/dest/tx/tx.d.ts +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +9 -4
- package/dest/tx/tx_context.d.ts +2 -1
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +32 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +3 -8
- package/dest/tx/tx_execution_request.d.ts +30 -1
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_execution_request.js +6 -2
- package/dest/tx/tx_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +47 -13
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +46 -15
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.d.ts.map +1 -1
- 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 +3 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +3 -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 +4 -1
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/validators/schemas.d.ts +38 -38
- 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/vks/verification_key.d.ts +22 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_data.d.ts +7 -1
- package/dest/vks/vk_data.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +3 -4
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +9 -9
- package/package.json +27 -13
- package/src/abi/contract_artifact.ts +10 -10
- package/src/abi/function_call.ts +25 -3
- package/src/abi/utils.ts +17 -0
- package/src/auth_witness/auth_witness.ts +3 -3
- package/src/block/attestation_info.ts +9 -6
- package/src/block/block_data.ts +26 -0
- package/src/block/block_hash.ts +26 -25
- package/src/block/block_parameter.ts +4 -2
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +8 -58
- package/src/block/in_block.ts +6 -6
- package/src/block/index.ts +1 -2
- package/src/block/l2_block.ts +102 -149
- package/src/block/l2_block_source.ts +145 -44
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +15 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +130 -39
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
- package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
- package/src/block/test/l2_tips_store_test_suite.ts +480 -36
- package/src/block/validate_block_result.ts +40 -35
- package/src/checkpoint/checkpoint.ts +62 -21
- package/src/checkpoint/checkpoint_data.ts +51 -0
- package/src/checkpoint/checkpoint_info.ts +45 -2
- package/src/checkpoint/index.ts +2 -0
- package/src/checkpoint/published_checkpoint.ts +7 -4
- package/src/config/index.ts +1 -0
- package/src/config/node-rpc-config.ts +1 -1
- package/src/config/sequencer-config.ts +29 -0
- package/src/contract/contract_address.ts +4 -4
- package/src/contract/contract_class.ts +3 -3
- package/src/contract/contract_class_id.ts +6 -5
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/node-info.ts +3 -0
- package/src/contract/private_function.ts +3 -4
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/database-version/database_version.ts +87 -0
- package/src/database-version/version_manager.ts +1 -77
- package/src/delayed_public_mutable/delayed_public_mutable_values.ts +9 -10
- package/src/deserialization/index.ts +21 -0
- package/src/epoch-helpers/index.ts +13 -1
- package/src/file-store/local.ts +15 -5
- package/src/file-store/s3.ts +12 -3
- package/src/ha-signing/config.ts +149 -0
- package/src/ha-signing/index.ts +18 -0
- package/src/ha-signing/types.ts +112 -0
- package/src/hash/hash.ts +14 -10
- package/src/hash/map_slot.ts +3 -2
- package/src/interfaces/api_limit.ts +2 -0
- package/src/interfaces/archiver.ts +31 -24
- package/src/interfaces/aztec-node-admin.ts +31 -4
- package/src/interfaces/aztec-node.ts +110 -129
- package/src/interfaces/block-builder.ts +41 -23
- package/src/interfaces/configs.ts +15 -1
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/merkle_tree_operations.ts +1 -1
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/prover-broker.ts +22 -0
- package/src/interfaces/prover-client.ts +22 -0
- package/src/interfaces/proving-job.ts +2 -11
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/interfaces/slasher.ts +4 -0
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +73 -15
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +20 -12
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- 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 +5 -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 +15 -15
- package/src/keys/key_types.ts +6 -2
- package/src/keys/public_keys.ts +2 -2
- package/src/keys/utils.ts +8 -4
- package/src/l1-contracts/slash_factory.ts +1 -0
- package/src/logs/log_id.ts +22 -18
- package/src/logs/siloed_tag.ts +2 -2
- package/src/messaging/in_hash.ts +3 -1
- package/src/messaging/l2_to_l1_membership.ts +178 -52
- package/src/messaging/out_hash.ts +62 -21
- package/src/note/index.ts +0 -1
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +3 -3
- package/src/p2p/block_proposal.ts +211 -46
- package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +36 -25
- package/src/p2p/checkpoint_proposal.ts +387 -0
- package/src/p2p/consensus_payload.ts +29 -18
- package/src/p2p/constants.ts +6 -0
- package/src/p2p/gossipable.ts +14 -4
- package/src/p2p/index.ts +4 -1
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signature_utils.ts +3 -1
- package/src/p2p/signed_txs.ts +88 -0
- package/src/p2p/topic_type.ts +4 -3
- package/src/proofs/chonk_proof.ts +9 -5
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +5 -11
- package/src/rollup/checkpoint_header.ts +64 -21
- package/src/rollup/checkpoint_rollup_public_inputs.ts +17 -5
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +16 -7
- package/src/slashing/empire.ts +3 -1
- package/src/slashing/helpers.ts +8 -0
- package/src/slashing/tally.ts +8 -2
- package/src/slashing/types.ts +14 -0
- package/src/stats/stats.ts +0 -2
- package/src/tests/factories.ts +70 -54
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +228 -95
- package/src/timetable/index.ts +66 -0
- package/src/trees/public_data_leaf.ts +11 -5
- package/src/tx/block_header.ts +12 -4
- package/src/tx/global_variable_builder.ts +1 -1
- package/src/tx/global_variables.ts +3 -3
- package/src/tx/index.ts +0 -1
- package/src/tx/indexed_tx_effect.ts +3 -2
- package/src/tx/private_execution_result.ts +1 -16
- package/src/tx/profiling.ts +51 -9
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/public_simulation_output.ts +4 -0
- package/src/tx/tx.ts +10 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_execution_request.ts +2 -0
- package/src/tx/tx_receipt.ts +75 -18
- package/src/tx/tx_request.ts +2 -2
- package/src/tx/validator/empty_validator.ts +1 -1
- package/src/tx/validator/error_texts.ts +4 -1
- package/src/tx/validator/tx_validator.ts +1 -1
- package/src/validators/schemas.ts +8 -1
- package/src/validators/types.ts +5 -4
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block_code_to_purge.d.ts +0 -12
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -61
- package/dest/block/l2_block_header.d.ts +0 -98
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -153
- package/dest/block/l2_block_new.d.ts +0 -135
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -152
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/dest/database-version/index.d.ts +0 -2
- package/dest/database-version/index.d.ts.map +0 -1
- package/dest/database-version/index.js +0 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +0 -25
- package/dest/kernel/hints/key_validation_request_and_generator.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/p2p/block_attestation.d.ts +0 -80
- package/dest/p2p/block_attestation.d.ts.map +0 -1
- package/dest/tx/content_commitment.d.ts +0 -49
- package/dest/tx/content_commitment.d.ts.map +0 -1
- package/dest/tx/content_commitment.js +0 -90
- package/src/block/l2_block_code_to_purge.ts +0 -88
- package/src/block/l2_block_header.ts +0 -246
- package/src/block/l2_block_new.ts +0 -207
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/database-version/index.ts +0 -1
- package/src/note/notes_filter.ts +0 -38
- package/src/tx/content_commitment.ts +0 -113
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
3
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
|
+
|
|
7
|
+
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
8
|
+
import { Tx } from '../tx/tx.js';
|
|
9
|
+
import {
|
|
10
|
+
SignatureDomainSeparator,
|
|
11
|
+
getHashedSignaturePayload,
|
|
12
|
+
getHashedSignaturePayloadEthSignedMessage,
|
|
13
|
+
} from './signature_utils.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A signed collection of transactions.
|
|
17
|
+
* The signature is over the transaction objects themselves, providing
|
|
18
|
+
* data availability guarantees beyond just the transaction hashes.
|
|
19
|
+
*/
|
|
20
|
+
export class SignedTxs {
|
|
21
|
+
private sender: EthAddress | undefined;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
/** The transactions */
|
|
25
|
+
public readonly txs: Tx[],
|
|
26
|
+
/** The proposer's signature over the transactions */
|
|
27
|
+
public readonly signature: Signature,
|
|
28
|
+
) {}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get the payload to sign for this signed txs.
|
|
32
|
+
*/
|
|
33
|
+
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
|
|
34
|
+
return serializeToBuffer([domainSeparator, this.txs.length, this.txs]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Lazily evaluate the sender of the signed txs; result is cached
|
|
39
|
+
* @returns The sender address, or undefined if signature recovery fails
|
|
40
|
+
*/
|
|
41
|
+
getSender(): EthAddress | undefined {
|
|
42
|
+
if (!this.sender) {
|
|
43
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.signedTxs);
|
|
44
|
+
this.sender = tryRecoverAddress(hashed, this.signature);
|
|
45
|
+
}
|
|
46
|
+
return this.sender;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create SignedTxs from a signer function
|
|
51
|
+
*/
|
|
52
|
+
static async createFromSigner(
|
|
53
|
+
txs: Tx[],
|
|
54
|
+
payloadSigner: (payload: Buffer32) => Promise<Signature>,
|
|
55
|
+
): Promise<SignedTxs> {
|
|
56
|
+
const tempSignedTxs = new SignedTxs(txs, Signature.empty());
|
|
57
|
+
const hashed = getHashedSignaturePayload(tempSignedTxs, SignatureDomainSeparator.signedTxs);
|
|
58
|
+
const signature = await payloadSigner(hashed);
|
|
59
|
+
return new SignedTxs(txs, signature);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
toBuffer(): Buffer {
|
|
63
|
+
return serializeToBuffer([this.txs.length, this.txs, this.signature]);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static fromBuffer(buf: Buffer | BufferReader): SignedTxs {
|
|
67
|
+
const reader = BufferReader.asReader(buf);
|
|
68
|
+
const txCount = reader.readNumber();
|
|
69
|
+
if (txCount > MAX_TXS_PER_BLOCK) {
|
|
70
|
+
throw new Error(`txs count ${txCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
|
|
71
|
+
}
|
|
72
|
+
const txs = reader.readArray(txCount, Tx);
|
|
73
|
+
const signature = reader.readObject(Signature);
|
|
74
|
+
return new SignedTxs(txs, signature);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getSize(): number {
|
|
78
|
+
return 4 /* txs.length */ + this.txs.reduce((acc, tx) => acc + tx.getSize(), 0) + this.signature.getSize();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static empty(): SignedTxs {
|
|
82
|
+
return new SignedTxs([], Signature.empty());
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static random(): SignedTxs {
|
|
86
|
+
return new SignedTxs([Tx.random(), Tx.random()], Signature.random());
|
|
87
|
+
}
|
|
88
|
+
}
|
package/src/p2p/topic_type.ts
CHANGED
|
@@ -23,14 +23,15 @@ export function getTopicFromString(topicStr: string): TopicType | undefined {
|
|
|
23
23
|
export enum TopicType {
|
|
24
24
|
tx = 'tx',
|
|
25
25
|
block_proposal = 'block_proposal',
|
|
26
|
-
|
|
26
|
+
checkpoint_proposal = 'checkpoint_proposal',
|
|
27
|
+
checkpoint_attestation = 'checkpoint_attestation',
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function getTopicTypeForClientType(clientType: P2PClientType) {
|
|
30
31
|
if (clientType === P2PClientType.Full) {
|
|
31
|
-
return
|
|
32
|
+
return [TopicType.tx, TopicType.block_proposal, TopicType.checkpoint_proposal, TopicType.checkpoint_attestation];
|
|
32
33
|
} else if (clientType === P2PClientType.Prover) {
|
|
33
|
-
return [TopicType.tx, TopicType.block_proposal];
|
|
34
|
+
return [TopicType.tx, TopicType.block_proposal, TopicType.checkpoint_proposal];
|
|
34
35
|
} else {
|
|
35
36
|
const _: never = clientType;
|
|
36
37
|
return [TopicType.tx];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CHONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { times } from '@aztec/foundation/collection';
|
|
2
3
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -31,12 +32,15 @@ export class ChonkProof {
|
|
|
31
32
|
|
|
32
33
|
static random() {
|
|
33
34
|
// NB: Not using Fr.random here because it slows down some tests that require a large number of txs significantly.
|
|
35
|
+
// NB2: generate one fewer random bytes to not have to deal with buffers representing numbers greater than the field modulus
|
|
36
|
+
// NB3: a chonk proof can be compressed. Simulate this by filling 1/4 of the proof with zero data
|
|
34
37
|
const reducedFrSize = Fr.SIZE_IN_BYTES - 1;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
38
|
+
const nonZeroFields = Math.floor((3 * CHONK_PROOF_LENGTH) / 4);
|
|
39
|
+
const randomFields = randomBytes(nonZeroFields * Fr.SIZE_IN_BYTES);
|
|
40
|
+
const proof = [
|
|
41
|
+
...times(nonZeroFields, i => new Fr(randomFields.subarray(i * reducedFrSize, (i + 1) * reducedFrSize))),
|
|
42
|
+
...times(CHONK_PROOF_LENGTH - nonZeroFields, () => Fr.ZERO),
|
|
43
|
+
];
|
|
40
44
|
return new ChonkProof(proof);
|
|
41
45
|
}
|
|
42
46
|
|
|
@@ -5,7 +5,7 @@ import type { BlockHeader } from '../tx/block_header.js';
|
|
|
5
5
|
|
|
6
6
|
export async function computeBlockHeadersHash(blockHeaders: BlockHeader[]): Promise<Fr> {
|
|
7
7
|
const blockHeaderHashes = await Promise.all(blockHeaders.map(header => header.hash()));
|
|
8
|
-
// Must match the implementation in merge_block_rollups.nr, with the **
|
|
8
|
+
// Must match the implementation in merge_block_rollups.nr, with the **unbalanced** rollup structure
|
|
9
9
|
// (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
|
|
10
10
|
const blockHeadersHash = await computeUnbalancedPoseidonRoot(blockHeaderHashes.map(hash => hash.toBuffer()));
|
|
11
11
|
return Fr.fromBuffer(blockHeadersHash);
|
|
@@ -43,17 +43,13 @@ export class BlockRollupPublicInputs {
|
|
|
43
43
|
*/
|
|
44
44
|
public endSpongeBlob: SpongeBlob,
|
|
45
45
|
/**
|
|
46
|
-
* Timestamp of the
|
|
46
|
+
* Timestamp of the blocks in this block range.
|
|
47
47
|
*/
|
|
48
|
-
public
|
|
49
|
-
/**
|
|
50
|
-
* Timestamp of the last block in this block range.
|
|
51
|
-
*/
|
|
52
|
-
public endTimestamp: UInt64,
|
|
48
|
+
public timestamp: UInt64,
|
|
53
49
|
/**
|
|
54
50
|
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
55
|
-
* other blocks in the same checkpoint to form
|
|
56
|
-
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
51
|
+
* other blocks in the same checkpoint to form an unbalanced tree. The root of that tree becomes the final hash
|
|
52
|
+
* stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
57
53
|
*/
|
|
58
54
|
public blockHeadersHash: Fr,
|
|
59
55
|
/**
|
|
@@ -85,7 +81,6 @@ export class BlockRollupPublicInputs {
|
|
|
85
81
|
reader.readObject(SpongeBlob),
|
|
86
82
|
reader.readObject(SpongeBlob),
|
|
87
83
|
reader.readUInt64(),
|
|
88
|
-
reader.readUInt64(),
|
|
89
84
|
Fr.fromBuffer(reader),
|
|
90
85
|
Fr.fromBuffer(reader),
|
|
91
86
|
Fr.fromBuffer(reader),
|
|
@@ -103,8 +98,7 @@ export class BlockRollupPublicInputs {
|
|
|
103
98
|
this.endState,
|
|
104
99
|
this.startSpongeBlob,
|
|
105
100
|
this.endSpongeBlob,
|
|
106
|
-
bigintToUInt64BE(this.
|
|
107
|
-
bigintToUInt64BE(this.endTimestamp),
|
|
101
|
+
bigintToUInt64BE(this.timestamp),
|
|
108
102
|
this.blockHeadersHash,
|
|
109
103
|
this.inHash,
|
|
110
104
|
this.outHash,
|
|
@@ -14,12 +14,13 @@ import { z } from 'zod';
|
|
|
14
14
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
15
15
|
import { GasFees } from '../gas/index.js';
|
|
16
16
|
import { schemas } from '../schemas/index.js';
|
|
17
|
-
import {
|
|
17
|
+
import type { GlobalVariables } from '../tx/global_variables.js';
|
|
18
18
|
import type { UInt64 } from '../types/shared.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Header of a checkpoint. A checkpoint is a collection of blocks submitted to L1 all within the same slot.
|
|
22
|
-
*
|
|
22
|
+
* This header is verified as-is in the rollup circuits, posted to the L1 rollup contract, stored in the archiver,
|
|
23
|
+
* and exposed via the Aztec Node API. See `CheckpointData` for a struct that includes the header plus extra metadata.
|
|
23
24
|
*/
|
|
24
25
|
export class CheckpointHeader {
|
|
25
26
|
constructor(
|
|
@@ -27,8 +28,18 @@ export class CheckpointHeader {
|
|
|
27
28
|
public lastArchiveRoot: Fr,
|
|
28
29
|
/** Hash of the headers of all blocks in this checkpoint. */
|
|
29
30
|
public blockHeadersHash: Fr,
|
|
30
|
-
/**
|
|
31
|
-
public
|
|
31
|
+
/** Hash of the blobs in the checkpoint. */
|
|
32
|
+
public blobsHash: Fr,
|
|
33
|
+
/** Root of the l1 to l2 messages subtree. */
|
|
34
|
+
public inHash: Fr,
|
|
35
|
+
/**
|
|
36
|
+
* The root of the epoch out hash balanced tree. The out hash of the first checkpoint in the epoch is inserted at
|
|
37
|
+
* index 0, the second at index 1, and so on.
|
|
38
|
+
* Note: This is not necessarily the final epoch out hash. It includes only the out hashes of checkpoints up to and
|
|
39
|
+
* including the current checkpoint. Any subsequent checkpoints added to the same epoch are not reflected in this
|
|
40
|
+
* value.
|
|
41
|
+
*/
|
|
42
|
+
public epochOutHash: Fr,
|
|
32
43
|
/** Slot number of the L2 block */
|
|
33
44
|
public slotNumber: SlotNumber,
|
|
34
45
|
/** Timestamp of the L2 block. */
|
|
@@ -48,7 +59,9 @@ export class CheckpointHeader {
|
|
|
48
59
|
.object({
|
|
49
60
|
lastArchiveRoot: schemas.Fr,
|
|
50
61
|
blockHeadersHash: schemas.Fr,
|
|
51
|
-
|
|
62
|
+
blobsHash: schemas.Fr,
|
|
63
|
+
inHash: schemas.Fr,
|
|
64
|
+
epochOutHash: schemas.Fr,
|
|
52
65
|
slotNumber: schemas.SlotNumber,
|
|
53
66
|
timestamp: schemas.BigInt,
|
|
54
67
|
coinbase: schemas.EthAddress,
|
|
@@ -63,7 +76,9 @@ export class CheckpointHeader {
|
|
|
63
76
|
return [
|
|
64
77
|
fields.lastArchiveRoot,
|
|
65
78
|
fields.blockHeadersHash,
|
|
66
|
-
fields.
|
|
79
|
+
fields.blobsHash,
|
|
80
|
+
fields.inHash,
|
|
81
|
+
fields.epochOutHash,
|
|
67
82
|
fields.slotNumber,
|
|
68
83
|
fields.timestamp,
|
|
69
84
|
fields.coinbase,
|
|
@@ -83,7 +98,9 @@ export class CheckpointHeader {
|
|
|
83
98
|
return new CheckpointHeader(
|
|
84
99
|
reader.readObject(Fr),
|
|
85
100
|
reader.readObject(Fr),
|
|
86
|
-
reader.readObject(
|
|
101
|
+
reader.readObject(Fr),
|
|
102
|
+
reader.readObject(Fr),
|
|
103
|
+
reader.readObject(Fr),
|
|
87
104
|
SlotNumber(Fr.fromBuffer(reader).toNumber()),
|
|
88
105
|
reader.readUInt64(),
|
|
89
106
|
reader.readObject(EthAddress),
|
|
@@ -97,7 +114,9 @@ export class CheckpointHeader {
|
|
|
97
114
|
return (
|
|
98
115
|
this.lastArchiveRoot.equals(other.lastArchiveRoot) &&
|
|
99
116
|
this.blockHeadersHash.equals(other.blockHeadersHash) &&
|
|
100
|
-
this.
|
|
117
|
+
this.blobsHash.equals(other.blobsHash) &&
|
|
118
|
+
this.inHash.equals(other.inHash) &&
|
|
119
|
+
this.epochOutHash.equals(other.epochOutHash) &&
|
|
101
120
|
this.slotNumber === other.slotNumber &&
|
|
102
121
|
this.timestamp === other.timestamp &&
|
|
103
122
|
this.coinbase.equals(other.coinbase) &&
|
|
@@ -107,12 +126,25 @@ export class CheckpointHeader {
|
|
|
107
126
|
);
|
|
108
127
|
}
|
|
109
128
|
|
|
129
|
+
/** Returns true if the global variables match those in the checkpoint header. */
|
|
130
|
+
matchesGlobalVariables(other: GlobalVariables) {
|
|
131
|
+
return (
|
|
132
|
+
this.coinbase.equals(other.coinbase) &&
|
|
133
|
+
this.feeRecipient.equals(other.feeRecipient) &&
|
|
134
|
+
this.gasFees.equals(other.gasFees) &&
|
|
135
|
+
this.slotNumber === other.slotNumber &&
|
|
136
|
+
this.timestamp === other.timestamp
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
110
140
|
toBuffer() {
|
|
111
141
|
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
112
142
|
return serializeToBuffer([
|
|
113
143
|
this.lastArchiveRoot,
|
|
114
144
|
this.blockHeadersHash,
|
|
115
|
-
this.
|
|
145
|
+
this.blobsHash,
|
|
146
|
+
this.inHash,
|
|
147
|
+
this.epochOutHash,
|
|
116
148
|
new Fr(this.slotNumber),
|
|
117
149
|
bigintToUInt64BE(this.timestamp),
|
|
118
150
|
this.coinbase,
|
|
@@ -130,7 +162,9 @@ export class CheckpointHeader {
|
|
|
130
162
|
return CheckpointHeader.from({
|
|
131
163
|
lastArchiveRoot: Fr.ZERO,
|
|
132
164
|
blockHeadersHash: Fr.ZERO,
|
|
133
|
-
|
|
165
|
+
blobsHash: Fr.ZERO,
|
|
166
|
+
inHash: Fr.ZERO,
|
|
167
|
+
epochOutHash: Fr.ZERO,
|
|
134
168
|
slotNumber: SlotNumber.ZERO,
|
|
135
169
|
timestamp: 0n,
|
|
136
170
|
coinbase: EthAddress.ZERO,
|
|
@@ -141,13 +175,13 @@ export class CheckpointHeader {
|
|
|
141
175
|
});
|
|
142
176
|
}
|
|
143
177
|
|
|
144
|
-
static random(
|
|
145
|
-
overrides: Partial<FieldsOf<CheckpointHeader>> & Partial<FieldsOf<ContentCommitment>> = {},
|
|
146
|
-
): CheckpointHeader {
|
|
178
|
+
static random(overrides: Partial<FieldsOf<CheckpointHeader>> = {}): CheckpointHeader {
|
|
147
179
|
return CheckpointHeader.from({
|
|
148
180
|
lastArchiveRoot: Fr.random(),
|
|
149
181
|
blockHeadersHash: Fr.random(),
|
|
150
|
-
|
|
182
|
+
blobsHash: Fr.random(),
|
|
183
|
+
inHash: Fr.random(),
|
|
184
|
+
epochOutHash: Fr.random(),
|
|
151
185
|
slotNumber: SlotNumber(Math.floor(Math.random() * 1000) + 1),
|
|
152
186
|
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
153
187
|
coinbase: EthAddress.random(),
|
|
@@ -162,7 +196,9 @@ export class CheckpointHeader {
|
|
|
162
196
|
return (
|
|
163
197
|
this.lastArchiveRoot.isZero() &&
|
|
164
198
|
this.blockHeadersHash.isZero() &&
|
|
165
|
-
this.
|
|
199
|
+
this.blobsHash.isZero() &&
|
|
200
|
+
this.inHash.isZero() &&
|
|
201
|
+
this.epochOutHash.isZero() &&
|
|
166
202
|
this.slotNumber === 0 &&
|
|
167
203
|
this.timestamp === 0n &&
|
|
168
204
|
this.coinbase.isZero() &&
|
|
@@ -188,7 +224,9 @@ export class CheckpointHeader {
|
|
|
188
224
|
return new CheckpointHeader(
|
|
189
225
|
Fr.fromString(header.lastArchiveRoot),
|
|
190
226
|
Fr.fromString(header.blockHeadersHash),
|
|
191
|
-
|
|
227
|
+
Fr.fromString(header.blobsHash),
|
|
228
|
+
Fr.fromString(header.inHash),
|
|
229
|
+
Fr.fromString(header.outHash),
|
|
192
230
|
SlotNumber.fromBigInt(header.slotNumber),
|
|
193
231
|
header.timestamp,
|
|
194
232
|
new EthAddress(hexToBuffer(header.coinbase)),
|
|
@@ -210,7 +248,9 @@ export class CheckpointHeader {
|
|
|
210
248
|
return {
|
|
211
249
|
lastArchiveRoot: this.lastArchiveRoot.toString(),
|
|
212
250
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
213
|
-
|
|
251
|
+
blobsHash: this.blobsHash.toString(),
|
|
252
|
+
inHash: this.inHash.toString(),
|
|
253
|
+
outHash: this.epochOutHash.toString(),
|
|
214
254
|
slotNumber: BigInt(this.slotNumber),
|
|
215
255
|
timestamp: this.timestamp,
|
|
216
256
|
coinbase: this.coinbase.toString(),
|
|
@@ -227,7 +267,9 @@ export class CheckpointHeader {
|
|
|
227
267
|
return {
|
|
228
268
|
lastArchive: this.lastArchiveRoot.toString(),
|
|
229
269
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
230
|
-
|
|
270
|
+
blobsHash: this.blobsHash.toString(),
|
|
271
|
+
inHash: this.inHash.toString(),
|
|
272
|
+
epochOutHash: this.epochOutHash.toString(),
|
|
231
273
|
slotNumber: this.slotNumber,
|
|
232
274
|
timestamp: this.timestamp,
|
|
233
275
|
coinbase: this.coinbase.toString(),
|
|
@@ -238,16 +280,17 @@ export class CheckpointHeader {
|
|
|
238
280
|
}
|
|
239
281
|
|
|
240
282
|
[inspect.custom]() {
|
|
241
|
-
const gasfees = `da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas}`;
|
|
242
283
|
return `Header {
|
|
243
284
|
lastArchiveRoot: ${this.lastArchiveRoot.toString()},
|
|
244
285
|
blockHeadersHash: ${this.blockHeadersHash.toString()},
|
|
245
|
-
|
|
286
|
+
blobsHash: ${inspect(this.blobsHash)},
|
|
287
|
+
inHash: ${inspect(this.inHash)},
|
|
288
|
+
epochOutHash: ${inspect(this.epochOutHash)},
|
|
246
289
|
slotNumber: ${this.slotNumber},
|
|
247
290
|
timestamp: ${this.timestamp},
|
|
248
291
|
coinbase: ${this.coinbase.toString()},
|
|
249
292
|
feeRecipient: ${this.feeRecipient.toString()},
|
|
250
|
-
gasFees:
|
|
293
|
+
gasFees: { da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas} },
|
|
251
294
|
totalManaUsed: ${this.totalManaUsed.toBigInt()},
|
|
252
295
|
}`;
|
|
253
296
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
-
import {
|
|
2
|
+
import { MAX_CHECKPOINTS_PER_EPOCH } from '@aztec/constants';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -27,14 +27,22 @@ export class CheckpointRollupPublicInputs {
|
|
|
27
27
|
* Archive tree after adding this checkpoint range.
|
|
28
28
|
*/
|
|
29
29
|
public newArchive: AppendOnlyTreeSnapshot,
|
|
30
|
+
/**
|
|
31
|
+
* The out hash tree snapshot immediately before this checkpoint range.
|
|
32
|
+
*/
|
|
33
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
34
|
+
/**
|
|
35
|
+
* The out hash tree snapshot after applying this checkpoint range.
|
|
36
|
+
*/
|
|
37
|
+
public newOutHash: AppendOnlyTreeSnapshot,
|
|
30
38
|
/**
|
|
31
39
|
* The hashes of the headers of the constituent checkpoints.
|
|
32
40
|
*/
|
|
33
|
-
public checkpointHeaderHashes: Tuple<Fr, typeof
|
|
41
|
+
public checkpointHeaderHashes: Tuple<Fr, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
34
42
|
/**
|
|
35
43
|
* The summed transaction fees and recipients of the constituent checkpoints.
|
|
36
44
|
*/
|
|
37
|
-
public fees: Tuple<FeeRecipient, typeof
|
|
45
|
+
public fees: Tuple<FeeRecipient, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
38
46
|
/**
|
|
39
47
|
* Accumulated opening proofs for all blobs before this checkpoint range.
|
|
40
48
|
*/
|
|
@@ -55,8 +63,10 @@ export class CheckpointRollupPublicInputs {
|
|
|
55
63
|
reader.readObject(EpochConstantData),
|
|
56
64
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
57
65
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
58
|
-
reader.
|
|
59
|
-
reader.
|
|
66
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
68
|
+
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, Fr),
|
|
69
|
+
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient),
|
|
60
70
|
reader.readObject(BlobAccumulator),
|
|
61
71
|
reader.readObject(BlobAccumulator),
|
|
62
72
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
@@ -68,6 +78,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
68
78
|
this.constants,
|
|
69
79
|
this.previousArchive,
|
|
70
80
|
this.newArchive,
|
|
81
|
+
this.previousOutHash,
|
|
82
|
+
this.newOutHash,
|
|
71
83
|
this.checkpointHeaderHashes,
|
|
72
84
|
this.fees,
|
|
73
85
|
this.startBlobAccumulator,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
-
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
|
+
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, OUT_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -8,6 +8,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
10
|
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
11
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
12
|
import { BlockHeader } from '../tx/block_header.js';
|
|
12
13
|
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
13
14
|
|
|
@@ -21,6 +22,14 @@ export class CheckpointRootRollupHints {
|
|
|
21
22
|
* Hint for checking the hash of previous_block_header is the last leaf of the previous archive.
|
|
22
23
|
*/
|
|
23
24
|
public previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
25
|
+
/**
|
|
26
|
+
* The out hash tree snapshot immediately before this checkpoint.
|
|
27
|
+
*/
|
|
28
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
29
|
+
/**
|
|
30
|
+
* Hint for inserting the new out hash into the out hash tree.
|
|
31
|
+
*/
|
|
32
|
+
public newOutHashSiblingPath: Tuple<Fr, typeof OUT_HASH_TREE_HEIGHT>,
|
|
24
33
|
/**
|
|
25
34
|
* The current blob accumulation state across the epoch.
|
|
26
35
|
*/
|
|
@@ -54,6 +63,8 @@ export class CheckpointRootRollupHints {
|
|
|
54
63
|
return [
|
|
55
64
|
fields.previousBlockHeader,
|
|
56
65
|
fields.previousArchiveSiblingPath,
|
|
66
|
+
fields.previousOutHash,
|
|
67
|
+
fields.newOutHashSiblingPath,
|
|
57
68
|
fields.startBlobAccumulator,
|
|
58
69
|
fields.finalBlobChallenges,
|
|
59
70
|
fields.blobFields,
|
|
@@ -71,6 +82,8 @@ export class CheckpointRootRollupHints {
|
|
|
71
82
|
return new CheckpointRootRollupHints(
|
|
72
83
|
BlockHeader.fromBuffer(reader),
|
|
73
84
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
85
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
86
|
+
reader.readArray(OUT_HASH_TREE_HEIGHT, Fr),
|
|
74
87
|
reader.readObject(BlobAccumulator),
|
|
75
88
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
76
89
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FinalBlobAccumulator } from '@aztec/blob-lib/types';
|
|
2
|
-
import {
|
|
2
|
+
import { MAX_CHECKPOINTS_PER_EPOCH } from '@aztec/constants';
|
|
3
3
|
import { makeTuple } from '@aztec/foundation/array';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -21,8 +21,14 @@ export class RootRollupPublicInputs {
|
|
|
21
21
|
public previousArchiveRoot: Fr,
|
|
22
22
|
/** Root of the archive tree after this rollup is processed */
|
|
23
23
|
public endArchiveRoot: Fr,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Root of the balanced merkle tree consisting of the out hashes of all checkpoints in this epoch.
|
|
26
|
+
* The out hash of the first checkpoint in the epoch is inserted at index 0, the second at index 1, and so on.
|
|
27
|
+
*/
|
|
28
|
+
public outHash: Fr,
|
|
29
|
+
/** Hashes of checkpoint headers for this rollup. */
|
|
30
|
+
public checkpointHeaderHashes: Tuple<Fr, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
31
|
+
public fees: Tuple<FeeRecipient, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
26
32
|
public constants: EpochConstantData,
|
|
27
33
|
public blobPublicInputs: FinalBlobAccumulator,
|
|
28
34
|
) {}
|
|
@@ -31,6 +37,7 @@ export class RootRollupPublicInputs {
|
|
|
31
37
|
return [
|
|
32
38
|
fields.previousArchiveRoot,
|
|
33
39
|
fields.endArchiveRoot,
|
|
40
|
+
fields.outHash,
|
|
34
41
|
fields.checkpointHeaderHashes,
|
|
35
42
|
fields.fees,
|
|
36
43
|
fields.constants,
|
|
@@ -60,8 +67,9 @@ export class RootRollupPublicInputs {
|
|
|
60
67
|
return new RootRollupPublicInputs(
|
|
61
68
|
Fr.fromBuffer(reader),
|
|
62
69
|
Fr.fromBuffer(reader),
|
|
63
|
-
|
|
64
|
-
reader.readArray(
|
|
70
|
+
Fr.fromBuffer(reader),
|
|
71
|
+
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, Fr),
|
|
72
|
+
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient),
|
|
65
73
|
EpochConstantData.fromBuffer(reader),
|
|
66
74
|
reader.readObject(FinalBlobAccumulator),
|
|
67
75
|
);
|
|
@@ -90,8 +98,9 @@ export class RootRollupPublicInputs {
|
|
|
90
98
|
return new RootRollupPublicInputs(
|
|
91
99
|
Fr.random(),
|
|
92
100
|
Fr.random(),
|
|
93
|
-
|
|
94
|
-
makeTuple(
|
|
101
|
+
Fr.random(),
|
|
102
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, Fr.random),
|
|
103
|
+
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient.random),
|
|
95
104
|
new EpochConstantData(Fr.random(), Fr.random(), Fr.random(), Fr.random(), Fr.random()),
|
|
96
105
|
FinalBlobAccumulator.random(),
|
|
97
106
|
);
|
package/src/slashing/empire.ts
CHANGED
|
@@ -83,7 +83,9 @@ export function getFirstEligibleRoundForOffense(
|
|
|
83
83
|
case OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS:
|
|
84
84
|
case OffenseType.PROPOSED_INCORRECT_ATTESTATIONS:
|
|
85
85
|
case OffenseType.ATTESTED_DESCENDANT_OF_INVALID:
|
|
86
|
-
case OffenseType.BROADCASTED_INVALID_BLOCK_PROPOSAL:
|
|
86
|
+
case OffenseType.BROADCASTED_INVALID_BLOCK_PROPOSAL:
|
|
87
|
+
case OffenseType.DUPLICATE_PROPOSAL:
|
|
88
|
+
case OffenseType.DUPLICATE_ATTESTATION: {
|
|
87
89
|
const slot = offense.epochOrSlot;
|
|
88
90
|
const detectedSlot = SlotNumber.fromBigInt(slot + 1n);
|
|
89
91
|
return getRoundForSlot(detectedSlot, constants).round + 1n;
|
package/src/slashing/helpers.ts
CHANGED
|
@@ -50,6 +50,8 @@ export function getPenaltyForOffense(
|
|
|
50
50
|
SlasherConfig,
|
|
51
51
|
| 'slashAttestDescendantOfInvalidPenalty'
|
|
52
52
|
| 'slashBroadcastedInvalidBlockPenalty'
|
|
53
|
+
| 'slashDuplicateProposalPenalty'
|
|
54
|
+
| 'slashDuplicateAttestationPenalty'
|
|
53
55
|
| 'slashPrunePenalty'
|
|
54
56
|
| 'slashDataWithholdingPenalty'
|
|
55
57
|
| 'slashUnknownPenalty'
|
|
@@ -71,6 +73,10 @@ export function getPenaltyForOffense(
|
|
|
71
73
|
return config.slashAttestDescendantOfInvalidPenalty;
|
|
72
74
|
case OffenseType.BROADCASTED_INVALID_BLOCK_PROPOSAL:
|
|
73
75
|
return config.slashBroadcastedInvalidBlockPenalty;
|
|
76
|
+
case OffenseType.DUPLICATE_PROPOSAL:
|
|
77
|
+
return config.slashDuplicateProposalPenalty;
|
|
78
|
+
case OffenseType.DUPLICATE_ATTESTATION:
|
|
79
|
+
return config.slashDuplicateAttestationPenalty;
|
|
74
80
|
case OffenseType.UNKNOWN:
|
|
75
81
|
return config.slashUnknownPenalty;
|
|
76
82
|
default: {
|
|
@@ -85,6 +91,8 @@ export function getTimeUnitForOffense(offense: OffenseType): 'epoch' | 'slot' {
|
|
|
85
91
|
switch (offense) {
|
|
86
92
|
case OffenseType.ATTESTED_DESCENDANT_OF_INVALID:
|
|
87
93
|
case OffenseType.BROADCASTED_INVALID_BLOCK_PROPOSAL:
|
|
94
|
+
case OffenseType.DUPLICATE_PROPOSAL:
|
|
95
|
+
case OffenseType.DUPLICATE_ATTESTATION:
|
|
88
96
|
case OffenseType.PROPOSED_INCORRECT_ATTESTATIONS:
|
|
89
97
|
case OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS:
|
|
90
98
|
return 'slot';
|
package/src/slashing/tally.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sumBigint } from '@aztec/foundation/bigint';
|
|
2
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
2
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import type { PartialBy } from '@aztec/foundation/types';
|
|
4
5
|
|
|
@@ -20,9 +21,10 @@ export function getSlashConsensusVotesFromOffenses(
|
|
|
20
21
|
settings: {
|
|
21
22
|
slashingAmounts: [bigint, bigint, bigint];
|
|
22
23
|
epochDuration: number;
|
|
24
|
+
targetCommitteeSize: number;
|
|
23
25
|
},
|
|
24
26
|
): ValidatorSlashVote[] {
|
|
25
|
-
const { slashingAmounts } = settings;
|
|
27
|
+
const { slashingAmounts, targetCommitteeSize } = settings;
|
|
26
28
|
|
|
27
29
|
if (committees.length !== epochsForCommittees.length) {
|
|
28
30
|
throw new Error('committees and epochsForCommittees must have the same length');
|
|
@@ -31,7 +33,9 @@ export function getSlashConsensusVotesFromOffenses(
|
|
|
31
33
|
const votes = committees.flatMap((committee, committeeIndex) => {
|
|
32
34
|
const committeeEpoch = epochsForCommittees[committeeIndex];
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
// Map over actual committee members, then pad to targetCommitteeSize.
|
|
37
|
+
// Padding handles cases where committees may be empty (e.g., when there aren't enough validators to fill the committee size during network startup).
|
|
38
|
+
const votes = committee.map(validator => {
|
|
35
39
|
// Find offenses for this validator in this specific epoch.
|
|
36
40
|
// If an offense has no epoch, it is considered for all epochs due to a slashAlways setting.
|
|
37
41
|
const validatorOffenses = offenses.filter(
|
|
@@ -45,6 +49,8 @@ export function getSlashConsensusVotesFromOffenses(
|
|
|
45
49
|
const slashUnits = getSlashUnitsForAmount(slashAmount, slashingAmounts);
|
|
46
50
|
return Number(slashUnits);
|
|
47
51
|
});
|
|
52
|
+
|
|
53
|
+
return padArrayEnd(votes, 0, targetCommitteeSize);
|
|
48
54
|
});
|
|
49
55
|
|
|
50
56
|
return votes;
|
package/src/slashing/types.ts
CHANGED
|
@@ -20,6 +20,10 @@ export enum OffenseType {
|
|
|
20
20
|
PROPOSED_INCORRECT_ATTESTATIONS = 6,
|
|
21
21
|
/** A committee member attested to a block that was built as a descendent of an invalid block (as in a block with invalid attestations) */
|
|
22
22
|
ATTESTED_DESCENDANT_OF_INVALID = 7,
|
|
23
|
+
/** A proposer sent duplicate proposals for the same position (slot, indexWithinCheckpoint for blocks or slot for checkpoints) */
|
|
24
|
+
DUPLICATE_PROPOSAL = 8,
|
|
25
|
+
/** A validator signed attestations for different proposals at the same slot (equivocation) */
|
|
26
|
+
DUPLICATE_ATTESTATION = 9,
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export function getOffenseTypeName(offense: OffenseType) {
|
|
@@ -40,6 +44,10 @@ export function getOffenseTypeName(offense: OffenseType) {
|
|
|
40
44
|
return 'proposed_incorrect_attestations';
|
|
41
45
|
case OffenseType.ATTESTED_DESCENDANT_OF_INVALID:
|
|
42
46
|
return 'attested_descendant_of_invalid';
|
|
47
|
+
case OffenseType.DUPLICATE_PROPOSAL:
|
|
48
|
+
return 'duplicate_proposal';
|
|
49
|
+
case OffenseType.DUPLICATE_ATTESTATION:
|
|
50
|
+
return 'duplicate_attestation';
|
|
43
51
|
default:
|
|
44
52
|
throw new Error(`Unknown offense type: ${offense}`);
|
|
45
53
|
}
|
|
@@ -56,6 +64,8 @@ export const OffenseToBigInt: Record<OffenseType, bigint> = {
|
|
|
56
64
|
[OffenseType.PROPOSED_INSUFFICIENT_ATTESTATIONS]: 5n,
|
|
57
65
|
[OffenseType.PROPOSED_INCORRECT_ATTESTATIONS]: 6n,
|
|
58
66
|
[OffenseType.ATTESTED_DESCENDANT_OF_INVALID]: 7n,
|
|
67
|
+
[OffenseType.DUPLICATE_PROPOSAL]: 8n,
|
|
68
|
+
[OffenseType.DUPLICATE_ATTESTATION]: 9n,
|
|
59
69
|
};
|
|
60
70
|
|
|
61
71
|
export function bigIntToOffense(offense: bigint): OffenseType {
|
|
@@ -76,6 +86,10 @@ export function bigIntToOffense(offense: bigint): OffenseType {
|
|
|
76
86
|
return OffenseType.PROPOSED_INCORRECT_ATTESTATIONS;
|
|
77
87
|
case 7n:
|
|
78
88
|
return OffenseType.ATTESTED_DESCENDANT_OF_INVALID;
|
|
89
|
+
case 8n:
|
|
90
|
+
return OffenseType.DUPLICATE_PROPOSAL;
|
|
91
|
+
case 9n:
|
|
92
|
+
return OffenseType.DUPLICATE_ATTESTATION;
|
|
79
93
|
default:
|
|
80
94
|
throw new Error(`Unknown offense: ${offense}`);
|
|
81
95
|
}
|