@aztec/stdlib 0.0.1-commit.96bb3f7 → 0.0.1-commit.96dac018d
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/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/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_circuit_public_inputs.d.ts +9 -9
- 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_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/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- 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 +2 -1
- 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 +56 -59
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -110
- package/dest/block/l2_block_source.d.ts +84 -39
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +2 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +9 -6
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -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 +37 -34
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +3 -3
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- 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 +2 -7
- package/dest/block/validate_block_result.d.ts +1 -1
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +5 -4
- package/dest/checkpoint/checkpoint.d.ts +43 -19
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +37 -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/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -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 -66
- 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/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 +2 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +1 -0
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +23 -15
- package/dest/interfaces/aztec-node-admin.d.ts +101 -28
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +12 -4
- package/dest/interfaces/aztec-node.d.ts +66 -69
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +10 -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 +24 -9
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +4 -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 +2 -2
- package/dest/interfaces/p2p.d.ts.map +1 -1
- 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 +216 -216
- 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 +118 -16
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +6 -3
- 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 +29 -16
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +4 -4
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +28 -17
- 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_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/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_to_avm_accumulated_data.d.ts +2 -2
- 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_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 +9 -9
- package/dest/kernel/public_call_request.d.ts +22 -1
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- 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/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_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/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +1 -0
- package/dest/logs/log_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/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/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 +3 -3
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +8 -6
- package/dest/messaging/out_hash.d.ts +41 -4
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +52 -26
- 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 +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 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +26 -10
- package/dest/p2p/checkpoint_attestation.d.ts +6 -1
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts +34 -9
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +46 -20
- package/dest/p2p/consensus_payload.d.ts +15 -5
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +22 -18
- 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/index.d.ts +2 -1
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- 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/signed_txs.d.ts +3 -1
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +6 -1
- package/dest/p2p/topic_type.js +2 -1
- 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 +44 -3
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +2 -2
- 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_header.d.ts +31 -4
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +23 -7
- 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 +45 -10
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +11 -7
- 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 +17 -7
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +7 -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 +2 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +18 -27
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +24 -15
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +63 -40
- 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/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 +6 -2
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -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_variables.d.ts +12 -4
- package/dest/tx/global_variables.d.ts.map +1 -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/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 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +1 -1
- 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_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/tx.d.ts +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +6 -3
- 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 +0 -7
- 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_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +62 -14
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +55 -16
- 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/function_call.ts +25 -3
- package/src/abi/utils.ts +17 -0
- package/src/auth_witness/auth_witness.ts +3 -3
- 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 -150
- package/src/block/l2_block_source.ts +93 -42
- package/src/block/l2_block_stream/interfaces.ts +8 -5
- package/src/block/l2_block_stream/l2_block_stream.ts +45 -37
- package/src/block/l2_block_stream/l2_tips_store_base.ts +2 -2
- package/src/block/test/l2_tips_store_test_suite.ts +4 -9
- package/src/block/validate_block_result.ts +5 -4
- package/src/checkpoint/checkpoint.ts +61 -21
- package/src/checkpoint/checkpoint_data.ts +51 -0
- package/src/checkpoint/index.ts +1 -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 +1 -0
- package/src/interfaces/archiver.ts +23 -24
- package/src/interfaces/aztec-node-admin.ts +26 -2
- package/src/interfaces/aztec-node.ts +86 -135
- package/src/interfaces/block-builder.ts +41 -23
- package/src/interfaces/configs.ts +13 -4
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/merkle_tree_operations.ts +1 -1
- package/src/interfaces/p2p.ts +1 -1
- package/src/interfaces/prover-broker.ts +22 -0
- package/src/interfaces/prover-client.ts +22 -0
- package/src/interfaces/slasher.ts +4 -0
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +20 -12
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +31 -24
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +32 -32
- 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 +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/debug_log_store.ts +54 -0
- package/src/logs/index.ts +1 -0
- package/src/logs/log_id.ts +22 -18
- package/src/logs/siloed_tag.ts +2 -2
- package/src/messaging/l2_to_l1_membership.ts +8 -6
- package/src/messaging/out_hash.ts +60 -29
- package/src/note/index.ts +0 -1
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +56 -0
- package/src/p2p/block_proposal.ts +36 -15
- package/src/p2p/checkpoint_attestation.ts +6 -1
- package/src/p2p/checkpoint_proposal.ts +74 -24
- package/src/p2p/consensus_payload.ts +25 -17
- package/src/p2p/constants.ts +6 -0
- package/src/p2p/index.ts +1 -0
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signed_txs.ts +6 -1
- package/src/p2p/topic_type.ts +1 -1
- 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 +2 -2
- package/src/rollup/checkpoint_header.ts +22 -2
- package/src/rollup/checkpoint_rollup_public_inputs.ts +16 -10
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +11 -8
- 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 +23 -43
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +90 -55
- 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_variables.ts +3 -3
- package/src/tx/indexed_tx_effect.ts +3 -2
- package/src/tx/private_execution_result.ts +1 -1
- 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 +8 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_receipt.ts +85 -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 -11
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -55
- package/dest/block/l2_block_header.d.ts +0 -94
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -160
- package/dest/block/l2_block_new.d.ts +0 -134
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -155
- 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/src/block/l2_block_code_to_purge.ts +0 -80
- package/src/block/l2_block_header.ts +0 -255
- package/src/block/l2_block_new.ts +0 -211
- 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
|
@@ -4,9 +4,12 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
4
4
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
5
5
|
|
|
6
6
|
import type { PublishedCheckpoint } from '../../checkpoint/published_checkpoint.js';
|
|
7
|
-
import { type L2BlockId, type
|
|
7
|
+
import { type L2BlockId, type L2BlockSource, makeL2BlockId } from '../l2_block_source.js';
|
|
8
8
|
import type { L2BlockStreamEvent, L2BlockStreamEventHandler, L2BlockStreamLocalDataProvider } from './interfaces.js';
|
|
9
9
|
|
|
10
|
+
/** Maximum number of checkpoints to prefetch at once during sync. Matches MAX_RPC_CHECKPOINTS_LEN. */
|
|
11
|
+
export const CHECKPOINT_PREFETCH_LIMIT = 50;
|
|
12
|
+
|
|
10
13
|
/** Creates a stream of events for new blocks, chain tips updates, and reorgs, out of polling an archiver or a node. */
|
|
11
14
|
export class L2BlockStream {
|
|
12
15
|
private readonly runningPromise: RunningPromise;
|
|
@@ -16,13 +19,12 @@ export class L2BlockStream {
|
|
|
16
19
|
constructor(
|
|
17
20
|
private l2BlockSource: Pick<
|
|
18
21
|
L2BlockSource,
|
|
19
|
-
'
|
|
22
|
+
'getBlocks' | 'getBlockHeader' | 'getL2Tips' | 'getCheckpoints' | 'getCheckpointedBlocks'
|
|
20
23
|
>,
|
|
21
24
|
private localData: L2BlockStreamLocalDataProvider,
|
|
22
25
|
private handler: L2BlockStreamEventHandler,
|
|
23
26
|
private readonly log = createLogger('types:block_stream'),
|
|
24
27
|
private opts: {
|
|
25
|
-
proven?: boolean;
|
|
26
28
|
pollIntervalMS?: number;
|
|
27
29
|
batchSize?: number;
|
|
28
30
|
startingBlock?: number;
|
|
@@ -30,6 +32,8 @@ export class L2BlockStream {
|
|
|
30
32
|
skipFinalized?: boolean;
|
|
31
33
|
/** When true, checkpoint events will not be emitted. Blocks are still fetched via checkpoints but only blocks-added events are emitted. */
|
|
32
34
|
ignoreCheckpoints?: boolean;
|
|
35
|
+
/** Maximum number of checkpoints to prefetch at once during sync. Defaults to CHECKPOINT_PREFETCH_LIMIT (50). */
|
|
36
|
+
checkpointPrefetchLimit?: number;
|
|
33
37
|
} = {},
|
|
34
38
|
) {
|
|
35
39
|
// Note that RunningPromise is in stopped state by default. This promise won't run until someone invokes `start`,
|
|
@@ -85,18 +89,9 @@ export class L2BlockStream {
|
|
|
85
89
|
this.log.verbose(
|
|
86
90
|
`Reorg detected. Pruning blocks from ${latestBlockNumber + 1} to ${localTips.proposed.number}.`,
|
|
87
91
|
);
|
|
88
|
-
// This check is not 100% accurate
|
|
89
|
-
// If the local tips are sufficiently behind the source tips, such that we are missing at least one checkpoint
|
|
90
|
-
// that has now been re-orged due to a proof failure then this will indicate a failure to checkpoint rather than a failure to prove
|
|
91
|
-
// TODO: (mbps/PhilWindle): Improve re-org detection accuracy when we come to do re-orgs
|
|
92
|
-
let reason: L2BlockPruneReason = 'unproven';
|
|
93
|
-
if (latestBlockNumber === localTips.checkpointed.block.number && !this.opts.ignoreCheckpoints) {
|
|
94
|
-
reason = 'uncheckpointed';
|
|
95
|
-
}
|
|
96
92
|
await this.emitEvent({
|
|
97
93
|
type: 'chain-pruned',
|
|
98
94
|
block: makeL2BlockId(latestBlockNumber, hash),
|
|
99
|
-
reason,
|
|
100
95
|
checkpoint: sourceTips.checkpointed.checkpoint,
|
|
101
96
|
});
|
|
102
97
|
}
|
|
@@ -133,7 +128,7 @@ export class L2BlockStream {
|
|
|
133
128
|
if (!this.opts.ignoreCheckpoints) {
|
|
134
129
|
let loop1Iterations = 0;
|
|
135
130
|
while (nextCheckpointToEmit <= sourceTips.checkpointed.checkpoint.number) {
|
|
136
|
-
const checkpoints = await this.l2BlockSource.
|
|
131
|
+
const checkpoints = await this.l2BlockSource.getCheckpoints(nextCheckpointToEmit, 1);
|
|
137
132
|
if (checkpoints.length === 0) {
|
|
138
133
|
break;
|
|
139
134
|
}
|
|
@@ -159,27 +154,36 @@ export class L2BlockStream {
|
|
|
159
154
|
}
|
|
160
155
|
}
|
|
161
156
|
|
|
162
|
-
// Loop 2: Fetch new checkpointed blocks. For each
|
|
157
|
+
// Loop 2: Fetch new checkpointed blocks. For each checkpoint, emit all blocks
|
|
163
158
|
// from that checkpoint that we need, then emit the checkpoint event.
|
|
164
|
-
// We
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
|
|
159
|
+
// We prefetch multiple checkpoints, then process them one by one.
|
|
160
|
+
let prefetchedCheckpoints: PublishedCheckpoint[] = [];
|
|
161
|
+
let prefetchIdx = 0;
|
|
162
|
+
let nextCheckpointNumber: CheckpointNumber | undefined;
|
|
168
163
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
164
|
+
// Find the starting checkpoint number
|
|
165
|
+
if (nextBlockNumber <= sourceTips.checkpointed.block.number) {
|
|
166
|
+
const blocks = await this.l2BlockSource.getCheckpointedBlocks(BlockNumber(nextBlockNumber), 1);
|
|
167
|
+
if (blocks.length > 0) {
|
|
168
|
+
nextCheckpointNumber = blocks[0].checkpointNumber;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
while (nextBlockNumber <= sourceTips.checkpointed.block.number && nextCheckpointNumber !== undefined) {
|
|
173
|
+
// Refill the prefetch buffer when exhausted
|
|
174
|
+
if (prefetchIdx >= prefetchedCheckpoints.length) {
|
|
175
|
+
const prefetchLimit = this.opts.checkpointPrefetchLimit ?? CHECKPOINT_PREFETCH_LIMIT;
|
|
176
|
+
prefetchedCheckpoints = await this.l2BlockSource.getCheckpoints(nextCheckpointNumber, prefetchLimit);
|
|
177
|
+
prefetchIdx = 0;
|
|
178
|
+
if (prefetchedCheckpoints.length === 0) {
|
|
177
179
|
break;
|
|
178
180
|
}
|
|
179
|
-
checkpoint = checkpoints[0];
|
|
180
181
|
}
|
|
181
182
|
|
|
183
|
+
const checkpoint = prefetchedCheckpoints[prefetchIdx]!;
|
|
184
|
+
|
|
182
185
|
// Get all blocks from this checkpoint that we need, respecting batchSize
|
|
186
|
+
const limit = Math.min(this.opts.batchSize ?? 50, sourceTips.checkpointed.block.number - nextBlockNumber + 1);
|
|
183
187
|
const blocksForCheckpoint = checkpoint.checkpoint.blocks
|
|
184
188
|
.filter(b => b.number >= nextBlockNumber)
|
|
185
189
|
.slice(0, limit);
|
|
@@ -189,23 +193,27 @@ export class L2BlockStream {
|
|
|
189
193
|
await this.emitEvent({ type: 'blocks-added', blocks: blocksForCheckpoint });
|
|
190
194
|
nextBlockNumber = blocksForCheckpoint.at(-1)!.number + 1;
|
|
191
195
|
|
|
192
|
-
// If we've reached the end of this checkpoint, emit the checkpoint event
|
|
196
|
+
// If we've reached the end of this checkpoint, emit the checkpoint event and move to next
|
|
193
197
|
const lastBlockInCheckpoint = checkpoint.checkpoint.blocks.at(-1)!;
|
|
194
|
-
if (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
if (nextBlockNumber > lastBlockInCheckpoint.number) {
|
|
199
|
+
if (!this.opts.ignoreCheckpoints) {
|
|
200
|
+
const lastBlockHash = await lastBlockInCheckpoint.hash();
|
|
201
|
+
await this.emitEvent({
|
|
202
|
+
type: 'chain-checkpointed',
|
|
203
|
+
checkpoint,
|
|
204
|
+
block: makeL2BlockId(lastBlockInCheckpoint.number, lastBlockHash.toString()),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
prefetchIdx++;
|
|
208
|
+
nextCheckpointNumber = CheckpointNumber(nextCheckpointNumber + 1);
|
|
201
209
|
}
|
|
202
210
|
}
|
|
203
211
|
|
|
204
212
|
// Loop 3: Fetch any remaining uncheckpointed (proposed) blocks.
|
|
205
213
|
while (nextBlockNumber <= sourceTips.proposed.number) {
|
|
206
214
|
const limit = Math.min(this.opts.batchSize ?? 50, sourceTips.proposed.number - nextBlockNumber + 1);
|
|
207
|
-
this.log.trace(`Requesting blocks from ${nextBlockNumber} limit ${limit}
|
|
208
|
-
const blocks = await this.l2BlockSource.
|
|
215
|
+
this.log.trace(`Requesting blocks from ${nextBlockNumber} limit ${limit}`);
|
|
216
|
+
const blocks = await this.l2BlockSource.getBlocks(BlockNumber(nextBlockNumber), BlockNumber(limit));
|
|
209
217
|
if (blocks.length === 0) {
|
|
210
218
|
break;
|
|
211
219
|
}
|
|
@@ -2,7 +2,7 @@ import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
|
|
|
2
2
|
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
|
|
4
4
|
import type { PublishedCheckpoint } from '../../checkpoint/published_checkpoint.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { L2Block } from '../l2_block.js';
|
|
6
6
|
import {
|
|
7
7
|
type CheckpointId,
|
|
8
8
|
GENESIS_CHECKPOINT_HEADER_HASH,
|
|
@@ -109,7 +109,7 @@ export abstract class L2TipsStoreBase implements L2BlockStreamEventHandler, L2Bl
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Protected helper that subclasses can override for block hash computation
|
|
112
|
-
protected computeBlockHash(block:
|
|
112
|
+
protected computeBlockHash(block: L2Block): Promise<string> {
|
|
113
113
|
return block.hash().then(hash => hash.toString());
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -5,8 +5,8 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
5
5
|
import {
|
|
6
6
|
type CheckpointId,
|
|
7
7
|
GENESIS_CHECKPOINT_HEADER_HASH,
|
|
8
|
+
L2Block,
|
|
8
9
|
type L2BlockId,
|
|
9
|
-
L2BlockNew,
|
|
10
10
|
type L2TipId,
|
|
11
11
|
} from '@aztec/stdlib/block';
|
|
12
12
|
import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
@@ -31,8 +31,8 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
31
31
|
blockToCheckpoint.clear();
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
const makeBlock = async (number: number): Promise<
|
|
35
|
-
const block = await
|
|
34
|
+
const makeBlock = async (number: number): Promise<L2Block> => {
|
|
35
|
+
const block = await L2Block.random(BlockNumber(number));
|
|
36
36
|
blockHashes.set(number, (await block.hash()).toString());
|
|
37
37
|
return block;
|
|
38
38
|
};
|
|
@@ -74,7 +74,7 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
74
74
|
checkpointed: makeTipId(checkpointed),
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
const makeCheckpoint = async (checkpointNumber: number, blocks:
|
|
77
|
+
const makeCheckpoint = async (checkpointNumber: number, blocks: L2Block[]): Promise<PublishedCheckpoint> => {
|
|
78
78
|
const checkpoint = await Checkpoint.random(CheckpointNumber(checkpointNumber), {
|
|
79
79
|
numBlocks: blocks.length,
|
|
80
80
|
startBlockNumber: blocks[0].number,
|
|
@@ -243,7 +243,6 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
243
243
|
await tipsStore.handleBlockStreamEvent({
|
|
244
244
|
type: 'chain-pruned',
|
|
245
245
|
block: makeBlockId(5),
|
|
246
|
-
reason: 'unproven',
|
|
247
246
|
checkpoint: { number: CheckpointNumber.ZERO, hash: GENESIS_CHECKPOINT_HEADER_HASH.toString() },
|
|
248
247
|
});
|
|
249
248
|
|
|
@@ -268,7 +267,6 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
268
267
|
await tipsStore.handleBlockStreamEvent({
|
|
269
268
|
type: 'chain-pruned',
|
|
270
269
|
block: makeTip(0),
|
|
271
|
-
reason: 'unproven',
|
|
272
270
|
checkpoint: { number: CheckpointNumber.ZERO, hash: GENESIS_CHECKPOINT_HEADER_HASH.toString() },
|
|
273
271
|
});
|
|
274
272
|
|
|
@@ -334,7 +332,6 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
334
332
|
await tipsStore.handleBlockStreamEvent({
|
|
335
333
|
type: 'chain-pruned',
|
|
336
334
|
block: makeBlockId(5),
|
|
337
|
-
reason: 'unproven',
|
|
338
335
|
checkpoint: { number: CheckpointNumber.ZERO, hash: GENESIS_CHECKPOINT_HEADER_HASH.toString() },
|
|
339
336
|
});
|
|
340
337
|
|
|
@@ -399,7 +396,6 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
399
396
|
await tipsStore.handleBlockStreamEvent({
|
|
400
397
|
type: 'chain-pruned',
|
|
401
398
|
block: makeBlockId(3),
|
|
402
|
-
reason: 'unproven',
|
|
403
399
|
checkpoint: { number: CheckpointNumber.ZERO, hash: GENESIS_CHECKPOINT_HEADER_HASH.toString() },
|
|
404
400
|
});
|
|
405
401
|
|
|
@@ -478,7 +474,6 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
478
474
|
await tipsStore.handleBlockStreamEvent({
|
|
479
475
|
type: 'chain-pruned',
|
|
480
476
|
block: makeBlockId(3),
|
|
481
|
-
reason: 'unproven',
|
|
482
477
|
checkpoint: { number: CheckpointNumber.ZERO, hash: GENESIS_CHECKPOINT_HEADER_HASH.toString() },
|
|
483
478
|
});
|
|
484
479
|
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
deserializeCheckpointInfo,
|
|
12
12
|
serializeCheckpointInfo,
|
|
13
13
|
} from '../checkpoint/checkpoint_info.js';
|
|
14
|
+
import { MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
14
15
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
15
16
|
|
|
16
17
|
/** Subtype for invalid checkpoint validation results */
|
|
@@ -109,13 +110,13 @@ export function deserializeValidateCheckpointResult(bufferOrReader: Buffer | Buf
|
|
|
109
110
|
if (valid) {
|
|
110
111
|
return { valid };
|
|
111
112
|
}
|
|
112
|
-
const reason = reader.readString() as 'insufficient-attestations' | 'invalid-attestation';
|
|
113
|
+
const reason = reader.readString(64) as 'insufficient-attestations' | 'invalid-attestation';
|
|
113
114
|
const checkpoint = deserializeCheckpointInfo(reader.readBuffer());
|
|
114
|
-
const committee = reader.readVector(EthAddress);
|
|
115
|
+
const committee = reader.readVector(EthAddress, MAX_COMMITTEE_SIZE);
|
|
115
116
|
const epoch = EpochNumber(reader.readNumber());
|
|
116
117
|
const seed = reader.readBigInt();
|
|
117
|
-
const attestors = reader.readVector(EthAddress);
|
|
118
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
118
|
+
const attestors = reader.readVector(EthAddress, MAX_COMMITTEE_SIZE);
|
|
119
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
119
120
|
const invalidIndex = reader.readNumber();
|
|
120
121
|
if (reason === 'insufficient-attestations') {
|
|
121
122
|
return { valid, reason, checkpoint, committee, epoch, seed, attestors, attestations };
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { encodeCheckpointBlobDataFromBlocks } from '@aztec/blob-lib/encoding';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BlockNumber,
|
|
4
|
+
CheckpointNumber,
|
|
5
|
+
CheckpointNumberSchema,
|
|
6
|
+
IndexWithinCheckpoint,
|
|
7
|
+
SlotNumber,
|
|
8
|
+
} from '@aztec/foundation/branded-types';
|
|
3
9
|
import { sum } from '@aztec/foundation/collection';
|
|
4
10
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
11
|
+
import { BufferReader, serializeSignedBigInt, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
12
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
13
|
|
|
8
14
|
import { z } from 'zod';
|
|
9
15
|
|
|
10
|
-
import {
|
|
16
|
+
import { L2Block } from '../block/l2_block.js';
|
|
17
|
+
import { MAX_BLOCKS_PER_CHECKPOINT } from '../deserialization/index.js';
|
|
18
|
+
import { computeCheckpointOutHash } from '../messaging/out_hash.js';
|
|
11
19
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
20
|
+
import { schemas } from '../schemas/schemas.js';
|
|
12
21
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
13
22
|
import type { CheckpointInfo } from './checkpoint_info.js';
|
|
14
23
|
|
|
24
|
+
type FieldsOfCheckpoint = Omit<FieldsOf<Checkpoint>, 'slot'>;
|
|
25
|
+
|
|
15
26
|
export class Checkpoint {
|
|
16
27
|
constructor(
|
|
17
28
|
/** Snapshot of archive tree after the checkpoint is added. */
|
|
@@ -19,42 +30,59 @@ export class Checkpoint {
|
|
|
19
30
|
/** Header of the checkpoint. */
|
|
20
31
|
public header: CheckpointHeader,
|
|
21
32
|
/** L2 blocks in the checkpoint. */
|
|
22
|
-
public blocks:
|
|
33
|
+
public blocks: L2Block[],
|
|
23
34
|
/** Number of the checkpoint. */
|
|
24
35
|
public number: CheckpointNumber,
|
|
36
|
+
/** Fee asset price modifier in basis points (from oracle). Defaults to 0 (no change). */
|
|
37
|
+
public feeAssetPriceModifier: bigint = 0n,
|
|
25
38
|
) {}
|
|
26
39
|
|
|
40
|
+
get slot(): SlotNumber {
|
|
41
|
+
return this.header.slotNumber;
|
|
42
|
+
}
|
|
43
|
+
|
|
27
44
|
static get schema() {
|
|
28
45
|
return z
|
|
29
46
|
.object({
|
|
30
47
|
archive: AppendOnlyTreeSnapshot.schema,
|
|
31
48
|
header: CheckpointHeader.schema,
|
|
32
|
-
blocks: z.array(
|
|
49
|
+
blocks: z.array(L2Block.schema),
|
|
33
50
|
number: CheckpointNumberSchema,
|
|
51
|
+
feeAssetPriceModifier: schemas.BigInt,
|
|
34
52
|
})
|
|
35
|
-
.transform(
|
|
53
|
+
.transform(
|
|
54
|
+
({ archive, header, blocks, number, feeAssetPriceModifier }) =>
|
|
55
|
+
new Checkpoint(archive, header, blocks, number, feeAssetPriceModifier),
|
|
56
|
+
);
|
|
36
57
|
}
|
|
37
58
|
|
|
38
|
-
static from(fields:
|
|
59
|
+
static from(fields: FieldsOfCheckpoint) {
|
|
39
60
|
return new Checkpoint(...Checkpoint.getFields(fields));
|
|
40
61
|
}
|
|
41
62
|
|
|
42
|
-
static getFields(fields:
|
|
43
|
-
return [fields.archive, fields.header, fields.blocks, fields.number] as const;
|
|
63
|
+
static getFields(fields: FieldsOfCheckpoint) {
|
|
64
|
+
return [fields.archive, fields.header, fields.blocks, fields.number, fields.feeAssetPriceModifier] as const;
|
|
44
65
|
}
|
|
45
66
|
|
|
46
67
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
47
68
|
const reader = BufferReader.asReader(buf);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
69
|
+
const archive = reader.readObject(AppendOnlyTreeSnapshot);
|
|
70
|
+
const header = reader.readObject(CheckpointHeader);
|
|
71
|
+
const blocks = reader.readVector(L2Block, MAX_BLOCKS_PER_CHECKPOINT);
|
|
72
|
+
const number = CheckpointNumber(reader.readNumber());
|
|
73
|
+
const feeAssetPriceModifier = reader.readInt256();
|
|
74
|
+
return new Checkpoint(archive, header, blocks, number, feeAssetPriceModifier);
|
|
54
75
|
}
|
|
55
76
|
|
|
56
77
|
public toBuffer() {
|
|
57
|
-
return serializeToBuffer(
|
|
78
|
+
return serializeToBuffer(
|
|
79
|
+
this.archive,
|
|
80
|
+
this.header,
|
|
81
|
+
this.blocks.length,
|
|
82
|
+
this.blocks,
|
|
83
|
+
this.number,
|
|
84
|
+
serializeSignedBigInt(this.feeAssetPriceModifier),
|
|
85
|
+
);
|
|
58
86
|
}
|
|
59
87
|
|
|
60
88
|
public toBlobFields(): Fr[] {
|
|
@@ -66,6 +94,16 @@ export class Checkpoint {
|
|
|
66
94
|
return this.header.hash();
|
|
67
95
|
}
|
|
68
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Returns the out hash computed from all l2-to-l1 messages in this checkpoint.
|
|
99
|
+
* Note: This value is different from the out hash in the header, which is the **accumulated** out hash over all
|
|
100
|
+
* checkpoints up to and including this one in the epoch.
|
|
101
|
+
*/
|
|
102
|
+
public getCheckpointOutHash(): Fr {
|
|
103
|
+
const msgs = this.blocks.map(block => block.body.txEffects.map(txEffect => txEffect.l2ToL1Msgs));
|
|
104
|
+
return computeCheckpointOutHash(msgs);
|
|
105
|
+
}
|
|
106
|
+
|
|
69
107
|
public getState() {
|
|
70
108
|
return this.blocks.at(-1)!.header.state;
|
|
71
109
|
}
|
|
@@ -107,23 +145,25 @@ export class Checkpoint {
|
|
|
107
145
|
numBlocks = 1,
|
|
108
146
|
startBlockNumber = 1,
|
|
109
147
|
previousArchive,
|
|
148
|
+
feeAssetPriceModifier = 0n,
|
|
110
149
|
...options
|
|
111
150
|
}: {
|
|
112
151
|
numBlocks?: number;
|
|
113
152
|
startBlockNumber?: number;
|
|
114
153
|
previousArchive?: AppendOnlyTreeSnapshot;
|
|
154
|
+
feeAssetPriceModifier?: bigint;
|
|
115
155
|
} & Partial<Parameters<typeof CheckpointHeader.random>[0]> &
|
|
116
|
-
Partial<Parameters<typeof
|
|
156
|
+
Partial<Parameters<typeof L2Block.random>[1]> = {},
|
|
117
157
|
) {
|
|
118
158
|
const header = CheckpointHeader.random(options);
|
|
119
159
|
|
|
120
160
|
// Create blocks sequentially to chain archive roots properly.
|
|
121
161
|
// Each block's header.lastArchive must equal the previous block's archive.
|
|
122
|
-
const blocks:
|
|
162
|
+
const blocks: L2Block[] = [];
|
|
123
163
|
let lastArchive = previousArchive;
|
|
124
164
|
for (let i = 0; i < numBlocks; i++) {
|
|
125
|
-
const block = await
|
|
126
|
-
indexWithinCheckpoint: i,
|
|
165
|
+
const block = await L2Block.random(BlockNumber(startBlockNumber + i), {
|
|
166
|
+
indexWithinCheckpoint: IndexWithinCheckpoint(i),
|
|
127
167
|
...options,
|
|
128
168
|
...(lastArchive ? { lastArchive } : {}),
|
|
129
169
|
});
|
|
@@ -131,6 +171,6 @@ export class Checkpoint {
|
|
|
131
171
|
blocks.push(block);
|
|
132
172
|
}
|
|
133
173
|
|
|
134
|
-
return new Checkpoint(AppendOnlyTreeSnapshot.random(), header, blocks, checkpointNumber);
|
|
174
|
+
return new Checkpoint(AppendOnlyTreeSnapshot.random(), header, blocks, checkpointNumber, feeAssetPriceModifier);
|
|
135
175
|
}
|
|
136
176
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockNumber,
|
|
3
|
+
BlockNumberSchema,
|
|
4
|
+
CheckpointNumber,
|
|
5
|
+
CheckpointNumberSchema,
|
|
6
|
+
} from '@aztec/foundation/branded-types';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
9
|
+
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
|
|
12
|
+
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
13
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
14
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
15
|
+
import { L1PublishedData } from './published_checkpoint.js';
|
|
16
|
+
|
|
17
|
+
/** Lightweight checkpoint metadata without full block data. */
|
|
18
|
+
export type CheckpointData = {
|
|
19
|
+
checkpointNumber: CheckpointNumber;
|
|
20
|
+
header: CheckpointHeader;
|
|
21
|
+
archive: AppendOnlyTreeSnapshot;
|
|
22
|
+
checkpointOutHash: Fr;
|
|
23
|
+
startBlock: BlockNumber;
|
|
24
|
+
blockCount: number;
|
|
25
|
+
attestations: CommitteeAttestation[];
|
|
26
|
+
l1: L1PublishedData;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const CheckpointDataSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
checkpointNumber: CheckpointNumberSchema,
|
|
32
|
+
header: CheckpointHeader.schema,
|
|
33
|
+
archive: AppendOnlyTreeSnapshot.schema,
|
|
34
|
+
checkpointOutHash: schemas.Fr,
|
|
35
|
+
startBlock: BlockNumberSchema,
|
|
36
|
+
blockCount: schemas.Integer,
|
|
37
|
+
attestations: z.array(CommitteeAttestation.schema),
|
|
38
|
+
l1: L1PublishedData.schema,
|
|
39
|
+
})
|
|
40
|
+
.transform(
|
|
41
|
+
(obj): CheckpointData => ({
|
|
42
|
+
checkpointNumber: obj.checkpointNumber,
|
|
43
|
+
header: obj.header,
|
|
44
|
+
archive: obj.archive,
|
|
45
|
+
checkpointOutHash: obj.checkpointOutHash,
|
|
46
|
+
startBlock: obj.startBlock,
|
|
47
|
+
blockCount: obj.blockCount,
|
|
48
|
+
attestations: obj.attestations,
|
|
49
|
+
l1: obj.l1,
|
|
50
|
+
}),
|
|
51
|
+
);
|
package/src/checkpoint/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
11
|
+
import { MAX_BLOCK_HASH_STRING_LENGTH, MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
11
12
|
import { Checkpoint } from './checkpoint.js';
|
|
12
13
|
|
|
13
14
|
export class L1PublishedData {
|
|
@@ -42,7 +43,7 @@ export class L1PublishedData {
|
|
|
42
43
|
static fromBuffer(bufferOrReader: Buffer | BufferReader): L1PublishedData {
|
|
43
44
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
44
45
|
const l1BlockNumber = reader.readBigInt();
|
|
45
|
-
const l1BlockHash = reader.readString();
|
|
46
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
46
47
|
const l1Timestamp = reader.readBigInt();
|
|
47
48
|
return new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash);
|
|
48
49
|
}
|
|
@@ -54,9 +55,11 @@ export class L1PublishedData {
|
|
|
54
55
|
|
|
55
56
|
export class PublishedCheckpoint {
|
|
56
57
|
constructor(
|
|
58
|
+
/** The checkpoint itself. */
|
|
57
59
|
public checkpoint: Checkpoint,
|
|
60
|
+
/** Info on when this checkpoint was published on L1. */
|
|
58
61
|
public l1: L1PublishedData,
|
|
59
|
-
|
|
62
|
+
/** The attestations for the last block in the checkpoint. */
|
|
60
63
|
public attestations: CommitteeAttestation[],
|
|
61
64
|
) {}
|
|
62
65
|
|
|
@@ -82,9 +85,9 @@ export class PublishedCheckpoint {
|
|
|
82
85
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
83
86
|
const checkpoint = reader.readObject(Checkpoint);
|
|
84
87
|
const l1BlockNumber = reader.readBigInt();
|
|
85
|
-
const l1BlockHash = reader.readString();
|
|
88
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
86
89
|
const l1Timestamp = reader.readBigInt();
|
|
87
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
90
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
88
91
|
return new PublishedCheckpoint(
|
|
89
92
|
checkpoint,
|
|
90
93
|
new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash),
|
package/src/config/index.ts
CHANGED
|
@@ -21,7 +21,7 @@ export const nodeRpcConfigMappings: ConfigMappingsType<NodeRPCConfig> = {
|
|
|
21
21
|
rpcMaxBodySize: {
|
|
22
22
|
env: 'RPC_MAX_BODY_SIZE',
|
|
23
23
|
description: 'Maximum allowed batch size for JSON RPC batch requests.',
|
|
24
|
-
defaultValue: '
|
|
24
|
+
defaultValue: '1mb',
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConfigMappingsType } from '@aztec/foundation/config';
|
|
2
|
+
|
|
3
|
+
import type { SequencerConfig } from '../interfaces/configs.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Partial sequencer config mappings for fields that need to be shared across packages.
|
|
7
|
+
* The full sequencer config mappings remain in sequencer-client, but shared fields
|
|
8
|
+
* (like blockDurationMs needed by both p2p and sequencer-client) are defined here
|
|
9
|
+
* to avoid duplication.
|
|
10
|
+
*/
|
|
11
|
+
export const sharedSequencerConfigMappings: ConfigMappingsType<
|
|
12
|
+
Pick<SequencerConfig, 'blockDurationMs' | 'expectedBlockProposalsPerSlot'>
|
|
13
|
+
> = {
|
|
14
|
+
blockDurationMs: {
|
|
15
|
+
env: 'SEQ_BLOCK_DURATION_MS',
|
|
16
|
+
description:
|
|
17
|
+
'Duration per block in milliseconds when building multiple blocks per slot. ' +
|
|
18
|
+
'If undefined (default), builds a single block per slot using the full slot duration.',
|
|
19
|
+
parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
|
|
20
|
+
},
|
|
21
|
+
expectedBlockProposalsPerSlot: {
|
|
22
|
+
env: 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT',
|
|
23
|
+
description:
|
|
24
|
+
'Expected number of block proposals per slot for P2P peer scoring. ' +
|
|
25
|
+
'0 (default) disables block proposal scoring. Set to a positive value to enable.',
|
|
26
|
+
parseEnv: (val: string) => (val ? parseInt(val, 10) : 0),
|
|
27
|
+
defaultValue: 0,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DomainSeparator } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
|
|
@@ -44,7 +44,7 @@ export async function computePartialAddress(
|
|
|
44
44
|
|
|
45
45
|
return poseidon2HashWithSeparator(
|
|
46
46
|
[instance.originalContractClassId, saltedInitializationHash],
|
|
47
|
-
|
|
47
|
+
DomainSeparator.PARTIAL_ADDRESS,
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -57,7 +57,7 @@ export function computeSaltedInitializationHash(
|
|
|
57
57
|
): Promise<Fr> {
|
|
58
58
|
return poseidon2HashWithSeparator(
|
|
59
59
|
[instance.salt, instance.initializationHash, instance.deployer],
|
|
60
|
-
|
|
60
|
+
DomainSeparator.PARTIAL_ADDRESS,
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -87,5 +87,5 @@ export async function computeInitializationHashFromEncodedArgs(
|
|
|
87
87
|
encodedArgs: Fr[],
|
|
88
88
|
): Promise<Fr> {
|
|
89
89
|
const argsHash = await computeVarArgsHash(encodedArgs);
|
|
90
|
-
return poseidon2HashWithSeparator([initFn, argsHash],
|
|
90
|
+
return poseidon2HashWithSeparator([initFn, argsHash], DomainSeparator.INITIALIZER);
|
|
91
91
|
}
|
|
@@ -8,7 +8,7 @@ import { type ContractClassIdPreimage, computeContractClassIdWithPreimage } from
|
|
|
8
8
|
import type { ContractClass, ContractClassWithId } from './interfaces/index.js';
|
|
9
9
|
|
|
10
10
|
/** Contract artifact including its artifact hash */
|
|
11
|
-
type ContractArtifactWithHash = ContractArtifact & { artifactHash: Fr };
|
|
11
|
+
export type ContractArtifactWithHash = ContractArtifact & { artifactHash: Fr };
|
|
12
12
|
|
|
13
13
|
const cmpFunctionArtifacts = <T extends { selector: FunctionSelector }>(a: T, b: T) =>
|
|
14
14
|
a.selector.toField().cmp(b.selector.toField());
|
|
@@ -35,8 +35,8 @@ export async function getContractClassFromArtifact(
|
|
|
35
35
|
|
|
36
36
|
privateArtifactFunctions.sort(cmpFunctionArtifacts);
|
|
37
37
|
|
|
38
|
-
const contractClass
|
|
39
|
-
version: 1,
|
|
38
|
+
const contractClass = {
|
|
39
|
+
version: 1 as const,
|
|
40
40
|
artifactHash,
|
|
41
41
|
packedBytecode,
|
|
42
42
|
privateFunctions: privateArtifactFunctions,
|