@aztec/stdlib 0.0.1-commit.c7c42ec → 0.0.1-commit.f295ac2
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 +9 -1
- package/dest/abi/function_call.d.ts.map +1 -1
- 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/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_hash.d.ts +7 -1
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +12 -0
- 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 +16 -133
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
- package/dest/block/checkpointed_l2_block.js +5 -43
- package/dest/block/in_block.d.ts +3 -3
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -3
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -2
- package/dest/block/l2_block_new.d.ts +20 -13
- package/dest/block/l2_block_new.d.ts.map +1 -1
- package/dest/block/l2_block_new.js +13 -7
- package/dest/block/l2_block_source.d.ts +276 -55
- 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 +4 -2
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +93 -30
- 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 +24 -14
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +16 -3
- 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 +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 +15 -13
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +4 -3
- package/dest/contract/complete_address.d.ts +4 -1
- package/dest/contract/complete_address.d.ts.map +1 -1
- 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/database-version/version_manager.d.ts +4 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +3 -1
- 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/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/gas/gas.js +3 -1
- package/dest/gas/gas_fees.js +3 -1
- 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 +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +16 -12
- package/dest/interfaces/aztec-node-admin.d.ts +64 -31
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -2
- package/dest/interfaces/aztec-node.d.ts +45 -49
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +15 -12
- package/dest/interfaces/block-builder.d.ts +19 -17
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +12 -7
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/get_logs_response.d.ts +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/proving-job.d.ts +184 -184
- 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/validator.d.ts +108 -18
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +5 -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 +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +14 -4
- 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_generator.d.ts +6 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +1 -1
- 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/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 +74 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +31 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- 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 +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +23 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- 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_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 +16 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +10 -1
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +3 -1
- 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/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- 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 +5 -3
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +5 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/private_log.js +3 -1
- package/dest/logs/public_log.js +3 -1
- 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/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 +93 -21
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +140 -39
- package/dest/p2p/checkpoint_attestation.d.ts +81 -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 +160 -0
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
- package/dest/p2p/checkpoint_proposal.js +229 -0
- package/dest/p2p/consensus_payload.d.ts +9 -9
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -5
- 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 +4 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +3 -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 +42 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +49 -19
- 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 +41 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +10 -2
- 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 +18 -3
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +9 -3
- 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/tests/factories.d.ts +16 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +60 -25
- package/dest/tests/jest.d.ts +4 -4
- package/dest/tests/jest.js +9 -9
- package/dest/tests/mocks.d.ts +66 -16
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +114 -54
- 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 +16 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- 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 +12 -1
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +6 -1
- 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 +9 -1
- 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 +1 -1
- 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/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 +149 -26
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +44 -7
- package/dest/tx/protocol_contracts.d.ts +1 -1
- 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/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 +23 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +3 -1
- 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 +7 -1
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.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 +8 -8
- 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 +12 -10
- package/src/abi/contract_artifact.ts +10 -10
- package/src/abi/utils.ts +17 -0
- package/src/block/attestation_info.ts +9 -6
- package/src/block/block_hash.ts +22 -0
- package/src/block/block_parameter.ts +4 -2
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +5 -55
- package/src/block/in_block.ts +2 -2
- package/src/block/index.ts +0 -2
- package/src/block/l2_block_new.ts +30 -9
- package/src/block/l2_block_source.ts +100 -30
- 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 +111 -37
- 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 +28 -5
- package/src/checkpoint/checkpoint_info.ts +45 -2
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +4 -3
- package/src/contract/index.ts +0 -2
- package/src/deserialization/index.ts +21 -0
- package/src/interfaces/api_limit.ts +1 -0
- package/src/interfaces/archiver.ts +24 -14
- package/src/interfaces/aztec-node-admin.ts +5 -2
- package/src/interfaces/aztec-node.ts +81 -69
- package/src/interfaces/block-builder.ts +33 -26
- package/src/interfaces/configs.ts +5 -0
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/proving-job.ts +2 -11
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/interfaces/validator.ts +64 -14
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +20 -12
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +22 -10
- 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/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +3 -3
- package/src/p2p/block_proposal.ts +204 -44
- package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +31 -25
- package/src/p2p/checkpoint_proposal.ts +348 -0
- package/src/p2p/consensus_payload.ts +5 -7
- package/src/p2p/gossipable.ts +14 -4
- package/src/p2p/index.ts +3 -1
- 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 +63 -20
- package/src/rollup/checkpoint_rollup_public_inputs.ts +12 -0
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +9 -0
- package/src/tests/factories.ts +56 -40
- package/src/tests/jest.ts +9 -9
- package/src/tests/mocks.ts +198 -85
- package/src/tx/block_header.ts +5 -0
- package/src/tx/global_variable_builder.ts +1 -1
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +1 -16
- package/src/tx/profiling.ts +46 -4
- package/src/tx/tx.ts +2 -0
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_execution_request.ts +2 -0
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block.d.ts +0 -143
- package/dest/block/l2_block.d.ts.map +0 -1
- package/dest/block/l2_block.js +0 -198
- 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/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/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.ts +0 -271
- package/src/block/l2_block_code_to_purge.ts +0 -88
- package/src/block/l2_block_header.ts +0 -246
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/tx/content_commitment.ts +0 -113
|
@@ -5,57 +5,62 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
5
5
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
type CheckpointInfo,
|
|
10
|
+
CheckpointInfoSchema,
|
|
11
|
+
deserializeCheckpointInfo,
|
|
12
|
+
serializeCheckpointInfo,
|
|
13
|
+
} from '../checkpoint/checkpoint_info.js';
|
|
14
|
+
import { MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
9
15
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
10
16
|
|
|
11
|
-
/** Subtype for invalid
|
|
12
|
-
export type
|
|
17
|
+
/** Subtype for invalid checkpoint validation results */
|
|
18
|
+
export type ValidateCheckpointNegativeResult =
|
|
13
19
|
| {
|
|
14
20
|
valid: false;
|
|
15
|
-
/** Identifiers from the invalid
|
|
16
|
-
|
|
17
|
-
/** Committee members at the epoch this
|
|
21
|
+
/** Identifiers from the invalid checkpoint */
|
|
22
|
+
checkpoint: CheckpointInfo;
|
|
23
|
+
/** Committee members at the epoch this checkpoint was proposed */
|
|
18
24
|
committee: EthAddress[];
|
|
19
|
-
/** Epoch in which this
|
|
25
|
+
/** Epoch in which this checkpoint was proposed */
|
|
20
26
|
epoch: EpochNumber;
|
|
21
27
|
/** Proposer selection seed for the epoch */
|
|
22
28
|
seed: bigint;
|
|
23
|
-
/** List of committee members who signed this
|
|
29
|
+
/** List of committee members who signed this checkpoint proposal */
|
|
24
30
|
attestors: EthAddress[];
|
|
25
|
-
/** Committee attestations for this
|
|
31
|
+
/** Committee attestations for this checkpoint as they were posted to L1 */
|
|
26
32
|
attestations: CommitteeAttestation[];
|
|
27
|
-
/** Reason for the
|
|
33
|
+
/** Reason for the checkpoint being invalid: not enough attestations were posted */
|
|
28
34
|
reason: 'insufficient-attestations';
|
|
29
35
|
}
|
|
30
36
|
| {
|
|
31
37
|
valid: false;
|
|
32
|
-
/** Identifiers from the invalid
|
|
33
|
-
|
|
34
|
-
/** Committee members at the epoch this
|
|
38
|
+
/** Identifiers from the invalid checkpoint */
|
|
39
|
+
checkpoint: CheckpointInfo;
|
|
40
|
+
/** Committee members at the epoch this checkpoint was proposed */
|
|
35
41
|
committee: EthAddress[];
|
|
36
|
-
/** Epoch in which this
|
|
42
|
+
/** Epoch in which this checkpoint was proposed */
|
|
37
43
|
epoch: EpochNumber;
|
|
38
44
|
/** Proposer selection seed for the epoch */
|
|
39
45
|
seed: bigint;
|
|
40
|
-
/** List of committee members who signed this
|
|
46
|
+
/** List of committee members who signed this checkpoint proposal */
|
|
41
47
|
attestors: EthAddress[];
|
|
42
|
-
/** Committee attestations for this
|
|
48
|
+
/** Committee attestations for this checkpoint as they were posted to L1 */
|
|
43
49
|
attestations: CommitteeAttestation[];
|
|
44
|
-
/** Reason for the
|
|
50
|
+
/** Reason for the checkpoint being invalid: an invalid attestation was posted */
|
|
45
51
|
reason: 'invalid-attestation';
|
|
46
52
|
/** Index in the attestations array of the invalid attestation posted */
|
|
47
53
|
invalidIndex: number;
|
|
48
54
|
};
|
|
49
55
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
export type ValidateBlockResult = { valid: true } | ValidateBlockNegativeResult;
|
|
56
|
+
/** Result type for validating checkpoint attestations */
|
|
57
|
+
export type ValidateCheckpointResult = { valid: true } | ValidateCheckpointNegativeResult;
|
|
53
58
|
|
|
54
|
-
export const
|
|
59
|
+
export const ValidateCheckpointResultSchema: ZodFor<ValidateCheckpointResult> = z.union([
|
|
55
60
|
z.object({ valid: z.literal(true) }),
|
|
56
61
|
z.object({
|
|
57
62
|
valid: z.literal(false),
|
|
58
|
-
|
|
63
|
+
checkpoint: CheckpointInfoSchema,
|
|
59
64
|
committee: z.array(schemas.EthAddress),
|
|
60
65
|
epoch: EpochNumberSchema,
|
|
61
66
|
seed: schemas.BigInt,
|
|
@@ -65,7 +70,7 @@ export const ValidateBlockResultSchema: ZodFor<ValidateBlockResult> = z.union([
|
|
|
65
70
|
}),
|
|
66
71
|
z.object({
|
|
67
72
|
valid: z.literal(false),
|
|
68
|
-
|
|
73
|
+
checkpoint: CheckpointInfoSchema,
|
|
69
74
|
committee: z.array(schemas.EthAddress),
|
|
70
75
|
epoch: EpochNumberSchema,
|
|
71
76
|
seed: schemas.BigInt,
|
|
@@ -76,17 +81,17 @@ export const ValidateBlockResultSchema: ZodFor<ValidateBlockResult> = z.union([
|
|
|
76
81
|
}),
|
|
77
82
|
]);
|
|
78
83
|
|
|
79
|
-
export function
|
|
84
|
+
export function serializeValidateCheckpointResult(result: ValidateCheckpointResult): Buffer {
|
|
80
85
|
if (result.valid) {
|
|
81
86
|
return serializeToBuffer(true);
|
|
82
87
|
}
|
|
83
88
|
|
|
84
|
-
const
|
|
89
|
+
const checkpointBuffer = serializeCheckpointInfo(result.checkpoint);
|
|
85
90
|
return serializeToBuffer(
|
|
86
91
|
result.valid,
|
|
87
92
|
result.reason,
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
checkpointBuffer.length,
|
|
94
|
+
checkpointBuffer,
|
|
90
95
|
result.committee.length,
|
|
91
96
|
result.committee,
|
|
92
97
|
result.epoch,
|
|
@@ -99,24 +104,24 @@ export function serializeValidateBlockResult(result: ValidateBlockResult): Buffe
|
|
|
99
104
|
);
|
|
100
105
|
}
|
|
101
106
|
|
|
102
|
-
export function
|
|
107
|
+
export function deserializeValidateCheckpointResult(bufferOrReader: Buffer | BufferReader): ValidateCheckpointResult {
|
|
103
108
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
104
109
|
const valid = reader.readBoolean();
|
|
105
110
|
if (valid) {
|
|
106
111
|
return { valid };
|
|
107
112
|
}
|
|
108
|
-
const reason = reader.readString() as 'insufficient-attestations' | 'invalid-attestation';
|
|
109
|
-
const
|
|
110
|
-
const committee = reader.readVector(EthAddress);
|
|
113
|
+
const reason = reader.readString(64) as 'insufficient-attestations' | 'invalid-attestation';
|
|
114
|
+
const checkpoint = deserializeCheckpointInfo(reader.readBuffer());
|
|
115
|
+
const committee = reader.readVector(EthAddress, MAX_COMMITTEE_SIZE);
|
|
111
116
|
const epoch = EpochNumber(reader.readNumber());
|
|
112
117
|
const seed = reader.readBigInt();
|
|
113
|
-
const attestors = reader.readVector(EthAddress);
|
|
114
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
118
|
+
const attestors = reader.readVector(EthAddress, MAX_COMMITTEE_SIZE);
|
|
119
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
115
120
|
const invalidIndex = reader.readNumber();
|
|
116
121
|
if (reason === 'insufficient-attestations') {
|
|
117
|
-
return { valid, reason,
|
|
122
|
+
return { valid, reason, checkpoint, committee, epoch, seed, attestors, attestations };
|
|
118
123
|
} else if (reason === 'invalid-attestation') {
|
|
119
|
-
return { valid, reason,
|
|
124
|
+
return { valid, reason, checkpoint, committee, epoch, seed, attestors, invalidIndex, attestations };
|
|
120
125
|
} else {
|
|
121
126
|
const _: never = reason;
|
|
122
127
|
throw new Error(`Unknown reason: ${reason}`);
|
|
@@ -1,5 +1,11 @@
|
|
|
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
11
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -8,10 +14,14 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
8
14
|
import { z } from 'zod';
|
|
9
15
|
|
|
10
16
|
import { L2BlockNew } from '../block/l2_block_new.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';
|
|
12
20
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
13
21
|
import type { CheckpointInfo } from './checkpoint_info.js';
|
|
14
22
|
|
|
23
|
+
type FieldsOfCheckpoint = Omit<FieldsOf<Checkpoint>, 'slot'>;
|
|
24
|
+
|
|
15
25
|
export class Checkpoint {
|
|
16
26
|
constructor(
|
|
17
27
|
/** Snapshot of archive tree after the checkpoint is added. */
|
|
@@ -24,6 +34,10 @@ export class Checkpoint {
|
|
|
24
34
|
public number: CheckpointNumber,
|
|
25
35
|
) {}
|
|
26
36
|
|
|
37
|
+
get slot(): SlotNumber {
|
|
38
|
+
return this.header.slotNumber;
|
|
39
|
+
}
|
|
40
|
+
|
|
27
41
|
static get schema() {
|
|
28
42
|
return z
|
|
29
43
|
.object({
|
|
@@ -35,11 +49,11 @@ export class Checkpoint {
|
|
|
35
49
|
.transform(({ archive, header, blocks, number }) => new Checkpoint(archive, header, blocks, number));
|
|
36
50
|
}
|
|
37
51
|
|
|
38
|
-
static from(fields:
|
|
52
|
+
static from(fields: FieldsOfCheckpoint) {
|
|
39
53
|
return new Checkpoint(...Checkpoint.getFields(fields));
|
|
40
54
|
}
|
|
41
55
|
|
|
42
|
-
static getFields(fields:
|
|
56
|
+
static getFields(fields: FieldsOfCheckpoint) {
|
|
43
57
|
return [fields.archive, fields.header, fields.blocks, fields.number] as const;
|
|
44
58
|
}
|
|
45
59
|
|
|
@@ -48,7 +62,7 @@ export class Checkpoint {
|
|
|
48
62
|
return new Checkpoint(
|
|
49
63
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
50
64
|
reader.readObject(CheckpointHeader),
|
|
51
|
-
reader.readVector(L2BlockNew),
|
|
65
|
+
reader.readVector(L2BlockNew, MAX_BLOCKS_PER_CHECKPOINT),
|
|
52
66
|
CheckpointNumber(reader.readNumber()),
|
|
53
67
|
);
|
|
54
68
|
}
|
|
@@ -66,6 +80,14 @@ export class Checkpoint {
|
|
|
66
80
|
return this.header.hash();
|
|
67
81
|
}
|
|
68
82
|
|
|
83
|
+
// Returns the out hash computed from all l2-to-l1 messages in this checkpoint.
|
|
84
|
+
// Note: This value is different from the out hash in the header, which is the **accumulated** out hash over all
|
|
85
|
+
// checkpoints up to and including this one in the epoch.
|
|
86
|
+
public getCheckpointOutHash(): Fr {
|
|
87
|
+
const msgs = this.blocks.map(block => block.body.txEffects.map(txEffect => txEffect.l2ToL1Msgs));
|
|
88
|
+
return computeCheckpointOutHash(msgs);
|
|
89
|
+
}
|
|
90
|
+
|
|
69
91
|
public getState() {
|
|
70
92
|
return this.blocks.at(-1)!.header.state;
|
|
71
93
|
}
|
|
@@ -73,6 +95,7 @@ export class Checkpoint {
|
|
|
73
95
|
public toCheckpointInfo(): CheckpointInfo {
|
|
74
96
|
return {
|
|
75
97
|
archive: this.archive.root,
|
|
98
|
+
lastArchive: this.header.lastArchiveRoot,
|
|
76
99
|
slotNumber: this.header.slotNumber,
|
|
77
100
|
checkpointNumber: this.number,
|
|
78
101
|
timestamp: this.header.timestamp,
|
|
@@ -122,7 +145,7 @@ export class Checkpoint {
|
|
|
122
145
|
let lastArchive = previousArchive;
|
|
123
146
|
for (let i = 0; i < numBlocks; i++) {
|
|
124
147
|
const block = await L2BlockNew.random(BlockNumber(startBlockNumber + i), {
|
|
125
|
-
indexWithinCheckpoint: i,
|
|
148
|
+
indexWithinCheckpoint: IndexWithinCheckpoint(i),
|
|
126
149
|
...options,
|
|
127
150
|
...(lastArchive ? { lastArchive } : {}),
|
|
128
151
|
});
|
|
@@ -1,9 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
CheckpointNumber,
|
|
3
|
+
CheckpointNumberSchema,
|
|
4
|
+
SlotNumber,
|
|
5
|
+
SlotNumberSchema,
|
|
6
|
+
} from '@aztec/foundation/branded-types';
|
|
7
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
9
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
10
|
+
|
|
11
|
+
import { z } from 'zod';
|
|
3
12
|
|
|
4
13
|
export type CheckpointInfo = {
|
|
5
14
|
archive: Fr;
|
|
15
|
+
lastArchive: Fr;
|
|
6
16
|
slotNumber: SlotNumber;
|
|
7
17
|
checkpointNumber: CheckpointNumber;
|
|
8
18
|
timestamp: bigint;
|
|
9
19
|
};
|
|
20
|
+
|
|
21
|
+
export function randomCheckpointInfo(checkpointNumber?: CheckpointNumber | number): CheckpointInfo {
|
|
22
|
+
return {
|
|
23
|
+
archive: Fr.random(),
|
|
24
|
+
lastArchive: Fr.random(),
|
|
25
|
+
slotNumber: SlotNumber(Math.floor(Math.random() * 100000) + 1),
|
|
26
|
+
checkpointNumber: CheckpointNumber(checkpointNumber ?? Math.floor(Math.random() * 100000) + 1),
|
|
27
|
+
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const CheckpointInfoSchema = z.object({
|
|
32
|
+
archive: schemas.Fr,
|
|
33
|
+
lastArchive: schemas.Fr,
|
|
34
|
+
slotNumber: SlotNumberSchema,
|
|
35
|
+
checkpointNumber: CheckpointNumberSchema,
|
|
36
|
+
timestamp: schemas.BigInt,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export function serializeCheckpointInfo(info: CheckpointInfo): Buffer {
|
|
40
|
+
return serializeToBuffer(info.archive, info.lastArchive, info.slotNumber, info.checkpointNumber, info.timestamp);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function deserializeCheckpointInfo(buffer: Buffer | BufferReader): CheckpointInfo {
|
|
44
|
+
const reader = BufferReader.asReader(buffer);
|
|
45
|
+
return {
|
|
46
|
+
archive: reader.readObject(Fr),
|
|
47
|
+
lastArchive: reader.readObject(Fr),
|
|
48
|
+
slotNumber: SlotNumber(reader.readNumber()),
|
|
49
|
+
checkpointNumber: CheckpointNumber(reader.readNumber()),
|
|
50
|
+
timestamp: reader.readBigInt(),
|
|
51
|
+
};
|
|
52
|
+
}
|
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
|
}
|
|
@@ -82,9 +83,9 @@ export class PublishedCheckpoint {
|
|
|
82
83
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
83
84
|
const checkpoint = reader.readObject(Checkpoint);
|
|
84
85
|
const l1BlockNumber = reader.readBigInt();
|
|
85
|
-
const l1BlockHash = reader.readString();
|
|
86
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
86
87
|
const l1Timestamp = reader.readBigInt();
|
|
87
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
88
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
88
89
|
return new PublishedCheckpoint(
|
|
89
90
|
checkpoint,
|
|
90
91
|
new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash),
|
package/src/contract/index.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './artifact_hash.js';
|
|
2
2
|
export * from './contract_address.js';
|
|
3
3
|
export * from './contract_class.js';
|
|
4
|
-
export * from './contract_class_metadata.js';
|
|
5
4
|
export * from './contract_class_id.js';
|
|
6
5
|
export * from './contract_deployment_data.js';
|
|
7
6
|
export * from './contract_instance.js';
|
|
8
|
-
export * from './contract_metadata.js';
|
|
9
7
|
export * from './contract_instance_update.js';
|
|
10
8
|
export * from './private_function.js';
|
|
11
9
|
export * from './private_function_membership_proof.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for deserialization bounds checking.
|
|
3
|
+
* These constants define maximum allowed sizes during deserialization
|
|
4
|
+
* to prevent DoS attacks via maliciously crafted messages.
|
|
5
|
+
*/
|
|
6
|
+
import { BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
7
|
+
|
|
8
|
+
/** Max transactions per block for deserialization validation */
|
|
9
|
+
export const MAX_TXS_PER_BLOCK = 2 ** 16;
|
|
10
|
+
|
|
11
|
+
/** Max committee size - theoretical max from bitmap design (256 bytes × 8 bits) */
|
|
12
|
+
export const MAX_COMMITTEE_SIZE = 2048;
|
|
13
|
+
|
|
14
|
+
/** Max blocks per checkpoint */
|
|
15
|
+
export const MAX_BLOCKS_PER_CHECKPOINT = 72;
|
|
16
|
+
|
|
17
|
+
/** Max tx effects per body (based on blob capacity per checkpoint) */
|
|
18
|
+
export const MAX_TX_EFFECTS_PER_BODY = BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB;
|
|
19
|
+
|
|
20
|
+
/** Max block hash string length (hex: 0x + 64 chars, with generous headroom) */
|
|
21
|
+
export const MAX_BLOCK_HASH_STRING_LENGTH = 128;
|
|
@@ -4,11 +4,10 @@ import type { ApiSchemaFor } from '@aztec/foundation/schemas';
|
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
|
-
import { CheckpointedL2Block
|
|
8
|
-
import { L2Block } from '../block/l2_block.js';
|
|
7
|
+
import { CheckpointedL2Block } from '../block/checkpointed_l2_block.js';
|
|
9
8
|
import { L2BlockNew } from '../block/l2_block_new.js';
|
|
10
9
|
import { type L2BlockSource, L2TipsSchema } from '../block/l2_block_source.js';
|
|
11
|
-
import {
|
|
10
|
+
import { ValidateCheckpointResultSchema } from '../block/validate_block_result.js';
|
|
12
11
|
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
13
12
|
import { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
14
13
|
import {
|
|
@@ -52,14 +51,14 @@ export type ArchiverSpecificConfig = {
|
|
|
52
51
|
/** The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKb. */
|
|
53
52
|
archiverStoreMapSizeKb?: number;
|
|
54
53
|
|
|
55
|
-
/** Whether to skip validating block attestations (use only for testing). */
|
|
56
|
-
skipValidateBlockAttestations?: boolean;
|
|
57
|
-
|
|
58
54
|
/** Maximum allowed drift in seconds between the Ethereum client and current time. */
|
|
59
55
|
maxAllowedEthClientDriftSeconds?: number;
|
|
60
56
|
|
|
61
57
|
/** Whether to allow starting the archiver without debug/trace method support on Ethereum hosts */
|
|
62
58
|
ethereumAllowNoDebugHosts?: boolean;
|
|
59
|
+
|
|
60
|
+
/** Skip validating checkpoint attestations (for testing purposes only) */
|
|
61
|
+
skipValidateCheckpointAttestations?: boolean;
|
|
63
62
|
};
|
|
64
63
|
|
|
65
64
|
export const ArchiverSpecificConfigSchema = z.object({
|
|
@@ -68,9 +67,9 @@ export const ArchiverSpecificConfigSchema = z.object({
|
|
|
68
67
|
viemPollingIntervalMS: schemas.Integer.optional(),
|
|
69
68
|
maxLogs: schemas.Integer.optional(),
|
|
70
69
|
archiverStoreMapSizeKb: schemas.Integer.optional(),
|
|
71
|
-
skipValidateBlockAttestations: z.boolean().optional(),
|
|
72
70
|
maxAllowedEthClientDriftSeconds: schemas.Integer.optional(),
|
|
73
71
|
ethereumAllowNoDebugHosts: z.boolean().optional(),
|
|
72
|
+
skipValidateCheckpointAttestations: z.boolean().optional(),
|
|
74
73
|
});
|
|
75
74
|
|
|
76
75
|
export type ArchiverApi = Omit<
|
|
@@ -83,16 +82,20 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
83
82
|
getRegistryAddress: z.function().args().returns(schemas.EthAddress),
|
|
84
83
|
getBlockNumber: z.function().args().returns(BlockNumberSchema),
|
|
85
84
|
getProvenBlockNumber: z.function().args().returns(BlockNumberSchema),
|
|
86
|
-
getBlock: z.function().args(BlockNumberSchema).returns(
|
|
85
|
+
getBlock: z.function().args(BlockNumberSchema).returns(L2BlockNew.schema.optional()),
|
|
87
86
|
getBlockHeader: z
|
|
88
87
|
.function()
|
|
89
88
|
.args(z.union([BlockNumberSchema, z.literal('latest')]))
|
|
90
89
|
.returns(BlockHeader.schema.optional()),
|
|
91
90
|
getCheckpointedBlock: z.function().args(BlockNumberSchema).returns(CheckpointedL2Block.schema.optional()),
|
|
91
|
+
getCheckpointedBlocks: z
|
|
92
|
+
.function()
|
|
93
|
+
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
94
|
+
.returns(z.array(CheckpointedL2Block.schema)),
|
|
92
95
|
getBlocks: z
|
|
93
96
|
.function()
|
|
94
97
|
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
95
|
-
.returns(z.array(
|
|
98
|
+
.returns(z.array(L2BlockNew.schema)),
|
|
96
99
|
getPublishedCheckpoints: z
|
|
97
100
|
.function()
|
|
98
101
|
.args(CheckpointNumberSchema, schemas.Integer)
|
|
@@ -100,18 +103,25 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
100
103
|
getPublishedBlocks: z
|
|
101
104
|
.function()
|
|
102
105
|
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
103
|
-
.returns(z.array(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
.returns(z.array(CheckpointedL2Block.schema)),
|
|
107
|
+
getL2BlocksNew: z
|
|
108
|
+
.function()
|
|
109
|
+
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
110
|
+
.returns(z.array(L2BlockNew.schema)),
|
|
111
|
+
getPublishedBlockByHash: z.function().args(schemas.Fr).returns(CheckpointedL2Block.schema.optional()),
|
|
112
|
+
getPublishedBlockByArchive: z.function().args(schemas.Fr).returns(CheckpointedL2Block.schema.optional()),
|
|
106
113
|
getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
107
114
|
getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
108
115
|
getL2BlockNew: z.function().args(BlockNumberSchema).returns(L2BlockNew.schema.optional()),
|
|
116
|
+
getL2BlockNewByHash: z.function().args(schemas.Fr).returns(L2BlockNew.schema.optional()),
|
|
117
|
+
getL2BlockNewByArchive: z.function().args(schemas.Fr).returns(L2BlockNew.schema.optional()),
|
|
109
118
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
110
119
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
111
120
|
getL2SlotNumber: z.function().args().returns(schemas.SlotNumber.optional()),
|
|
112
121
|
getL2EpochNumber: z.function().args().returns(EpochNumberSchema.optional()),
|
|
113
122
|
getCheckpointsForEpoch: z.function().args(EpochNumberSchema).returns(z.array(Checkpoint.schema)),
|
|
114
|
-
getBlocksForEpoch: z.function().args(EpochNumberSchema).returns(z.array(
|
|
123
|
+
getBlocksForEpoch: z.function().args(EpochNumberSchema).returns(z.array(L2BlockNew.schema)),
|
|
124
|
+
getBlocksForSlot: z.function().args(schemas.SlotNumber).returns(z.array(L2BlockNew.schema)),
|
|
115
125
|
getBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
|
|
116
126
|
isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
|
|
117
127
|
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
@@ -144,5 +154,5 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
144
154
|
getL1Timestamp: z.function().args().returns(schemas.BigInt.optional()),
|
|
145
155
|
syncImmediate: z.function().args().returns(z.void()),
|
|
146
156
|
isPendingChainInvalid: z.function().args().returns(z.boolean()),
|
|
147
|
-
getPendingChainValidationStatus: z.function().args().returns(
|
|
157
|
+
getPendingChainValidationStatus: z.function().args().returns(ValidateCheckpointResultSchema),
|
|
148
158
|
};
|
|
@@ -56,7 +56,10 @@ export type AztecNodeAdminConfig = ValidatorClientFullConfig &
|
|
|
56
56
|
SequencerConfig &
|
|
57
57
|
ProverConfig &
|
|
58
58
|
SlasherConfig &
|
|
59
|
-
Pick<
|
|
59
|
+
Pick<
|
|
60
|
+
ArchiverSpecificConfig,
|
|
61
|
+
'archiverPollingIntervalMS' | 'archiverBatchSize' | 'skipValidateCheckpointAttestations'
|
|
62
|
+
> & {
|
|
60
63
|
maxPendingTxCount: number;
|
|
61
64
|
};
|
|
62
65
|
|
|
@@ -66,8 +69,8 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
|
|
|
66
69
|
.merge(
|
|
67
70
|
ArchiverSpecificConfigSchema.pick({
|
|
68
71
|
archiverPollingIntervalMS: true,
|
|
69
|
-
skipValidateBlockAttestations: true,
|
|
70
72
|
archiverBatchSize: true,
|
|
73
|
+
skipValidateCheckpointAttestations: true,
|
|
71
74
|
}),
|
|
72
75
|
)
|
|
73
76
|
.merge(z.object({ maxPendingTxCount: z.number() }));
|