@aztec/stdlib 0.0.1-commit.fcb71a6 → 0.0.1-commit.fffb133c
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 +9 -2
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +15 -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 +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/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.d.ts +56 -57
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -107
- package/dest/block/l2_block_source.d.ts +296 -67
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +25 -6
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +15 -5
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +8 -3
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +106 -31
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +478 -38
- package/dest/block/validate_block_result.d.ts +24 -24
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -17
- package/dest/checkpoint/checkpoint.d.ts +30 -20
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +19 -6
- 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 +17 -15
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +4 -3
- package/dest/config/node-rpc-config.js +1 -1
- 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/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +1 -2
- 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/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.js +1 -1
- 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 +3 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +2 -0
- package/dest/interfaces/archiver.d.ts +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +20 -16
- package/dest/interfaces/aztec-node-admin.d.ts +67 -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 +70 -51
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +12 -9
- package/dest/interfaces/block-builder.d.ts +16 -14
- 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/l2_logs_source.d.ts +14 -5
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +7 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +3 -4
- package/dest/interfaces/prover-client.d.ts +10 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -1
- 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/tx_provider.d.ts +3 -3
- package/dest/interfaces/tx_provider.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 +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +16 -8
- package/dest/kernel/hints/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/constants.d.ts +3 -0
- package/dest/p2p/constants.d.ts.map +1 -0
- package/dest/p2p/constants.js +2 -0
- package/dest/p2p/gossipable.d.ts +4 -3
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +16 -5
- package/dest/p2p/index.d.ts +5 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +4 -1
- package/dest/p2p/message_validator.d.ts +18 -3
- package/dest/p2p/message_validator.d.ts.map +1 -1
- package/dest/p2p/message_validator.js +2 -1
- package/dest/p2p/signature_utils.d.ts +5 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +3 -1
- package/dest/p2p/signed_txs.d.ts +42 -0
- package/dest/p2p/signed_txs.d.ts.map +1 -0
- package/dest/p2p/signed_txs.js +75 -0
- package/dest/p2p/topic_type.d.ts +3 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +10 -3
- package/dest/parity/parity_base_private_inputs.d.ts +3 -1
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +4 -1
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +2 -1
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +1 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +9 -4
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/recursive_proof.d.ts +10 -1
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +34 -1
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +12 -1
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +47 -11
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -12
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +10 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +3 -1
- package/dest/rollup/checkpoint_header.d.ts +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.js +1 -1
- package/dest/tests/mocks.d.ts +69 -18
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +119 -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 +14 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +8 -2
- 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 +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +9 -4
- package/dest/tx/tx_context.d.ts +2 -1
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +32 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +3 -8
- package/dest/tx/tx_execution_request.d.ts +30 -1
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_execution_request.js +6 -2
- package/dest/tx/tx_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +44 -10
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +44 -13
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +2 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +2 -0
- 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 +27 -1
- 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/index.ts +0 -2
- package/src/block/l2_block.ts +101 -148
- package/src/block/l2_block_source.ts +121 -43
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +15 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +130 -39
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
- package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
- package/src/block/test/l2_tips_store_test_suite.ts +480 -36
- package/src/block/validate_block_result.ts +40 -35
- package/src/checkpoint/checkpoint.ts +34 -11
- 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/config/node-rpc-config.ts +1 -1
- package/src/contract/index.ts +0 -2
- package/src/contract/private_function.ts +1 -2
- 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 +1 -1
- package/src/interfaces/api_limit.ts +2 -0
- package/src/interfaces/archiver.ts +24 -23
- package/src/interfaces/aztec-node-admin.ts +5 -2
- package/src/interfaces/aztec-node.ts +100 -68
- package/src/interfaces/block-builder.ts +31 -24
- package/src/interfaces/configs.ts +3 -0
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/prover-client.ts +15 -0
- package/src/interfaces/proving-job.ts +2 -11
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +63 -14
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +20 -12
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- package/src/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/constants.ts +3 -0
- package/src/p2p/gossipable.ts +14 -4
- package/src/p2p/index.ts +4 -1
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signature_utils.ts +3 -1
- package/src/p2p/signed_txs.ts +88 -0
- package/src/p2p/topic_type.ts +4 -3
- package/src/proofs/chonk_proof.ts +9 -5
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +5 -11
- package/src/rollup/checkpoint_header.ts +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 +1 -1
- package/src/tests/mocks.ts +207 -87
- package/src/tx/block_header.ts +11 -3
- 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 +10 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_execution_request.ts +2 -0
- package/src/tx/tx_receipt.ts +72 -15
- package/src/tx/validator/error_texts.ts +3 -0
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block_code_to_purge.d.ts +0 -12
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -61
- package/dest/block/l2_block_header.d.ts +0 -98
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -153
- package/dest/block/l2_block_new.d.ts +0 -135
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -152
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/dest/p2p/block_attestation.d.ts +0 -80
- package/dest/p2p/block_attestation.d.ts.map +0 -1
- package/dest/tx/content_commitment.d.ts +0 -49
- package/dest/tx/content_commitment.d.ts.map +0 -1
- package/dest/tx/content_commitment.js +0 -90
- package/src/block/l2_block_code_to_purge.ts +0 -88
- package/src/block/l2_block_header.ts +0 -246
- package/src/block/l2_block_new.ts +0 -207
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/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';
|
|
@@ -7,11 +13,15 @@ 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';
|
|
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. */
|
|
@@ -19,27 +29,31 @@ export class Checkpoint {
|
|
|
19
29
|
/** Header of the checkpoint. */
|
|
20
30
|
public header: CheckpointHeader,
|
|
21
31
|
/** L2 blocks in the checkpoint. */
|
|
22
|
-
public blocks:
|
|
32
|
+
public blocks: L2Block[],
|
|
23
33
|
/** Number of the 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({
|
|
30
44
|
archive: AppendOnlyTreeSnapshot.schema,
|
|
31
45
|
header: CheckpointHeader.schema,
|
|
32
|
-
blocks: z.array(
|
|
46
|
+
blocks: z.array(L2Block.schema),
|
|
33
47
|
number: CheckpointNumberSchema,
|
|
34
48
|
})
|
|
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(
|
|
65
|
+
reader.readVector(L2Block, 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,
|
|
@@ -112,17 +135,17 @@ export class Checkpoint {
|
|
|
112
135
|
startBlockNumber?: number;
|
|
113
136
|
previousArchive?: AppendOnlyTreeSnapshot;
|
|
114
137
|
} & Partial<Parameters<typeof CheckpointHeader.random>[0]> &
|
|
115
|
-
Partial<Parameters<typeof
|
|
138
|
+
Partial<Parameters<typeof L2Block.random>[1]> = {},
|
|
116
139
|
) {
|
|
117
140
|
const header = CheckpointHeader.random(options);
|
|
118
141
|
|
|
119
142
|
// Create blocks sequentially to chain archive roots properly.
|
|
120
143
|
// Each block's header.lastArchive must equal the previous block's archive.
|
|
121
|
-
const blocks:
|
|
144
|
+
const blocks: L2Block[] = [];
|
|
122
145
|
let lastArchive = previousArchive;
|
|
123
146
|
for (let i = 0; i < numBlocks; i++) {
|
|
124
|
-
const block = await
|
|
125
|
-
indexWithinCheckpoint: i,
|
|
147
|
+
const block = await L2Block.random(BlockNumber(startBlockNumber + 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),
|
|
@@ -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
|
|
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';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FUNCTION_TREE_HEIGHT, GeneratorIndex } from '@aztec/constants';
|
|
2
|
-
import { pedersenHash } from '@aztec/foundation/crypto/pedersen';
|
|
3
2
|
import { poseidon2Hash, poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
4
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { type MerkleTree, MerkleTreeCalculator } from '@aztec/foundation/trees';
|
|
@@ -38,7 +37,7 @@ export async function computePrivateFunctionLeaf(fn: PrivateFunction): Promise<B
|
|
|
38
37
|
async function getPrivateFunctionTreeCalculator(): Promise<MerkleTreeCalculator> {
|
|
39
38
|
if (!privateFunctionTreeCalculator) {
|
|
40
39
|
const functionTreeZeroLeaf = (
|
|
41
|
-
await
|
|
40
|
+
await poseidon2Hash(new Array(PRIVATE_FUNCTION_SIZE).fill(0))
|
|
42
41
|
).toBuffer() as Buffer<ArrayBuffer>;
|
|
43
42
|
privateFunctionTreeCalculator = await MerkleTreeCalculator.create(
|
|
44
43
|
FUNCTION_TREE_HEIGHT,
|
|
@@ -68,23 +68,22 @@ export class DelayedPublicMutableValues {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
static async readFromTree(delayedPublicMutableSlot: Fr, readStorage: (storageSlot: Fr) => Promise<Fr>) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return DelayedPublicMutableValues.fromFields(fields);
|
|
71
|
+
const fieldPromises = Array.from({ length: DELAYED_PUBLIC_MUTABLE_VALUES_LEN }).map((_, i) =>
|
|
72
|
+
readStorage(delayedPublicMutableSlot.add(new Fr(i))),
|
|
73
|
+
);
|
|
74
|
+
return DelayedPublicMutableValues.fromFields(await Promise.all(fieldPromises));
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
isEmpty(): boolean {
|
|
79
78
|
return this.svc.isEmpty() && this.sdc.isEmpty();
|
|
80
79
|
}
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
const
|
|
81
|
+
writeToTree(delayedPublicMutableSlot: Fr, storageWrite: (storageSlot: Fr, value: Fr) => Promise<void>) {
|
|
82
|
+
const fieldPromises = this.toFields().map((field, i) =>
|
|
83
|
+
storageWrite(delayedPublicMutableSlot.add(new Fr(i)), field),
|
|
84
|
+
);
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
await storageWrite(delayedPublicMutableSlot.add(new Fr(i)), fields[i]);
|
|
87
|
-
}
|
|
86
|
+
return Promise.all(fieldPromises);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
async hash(): Promise<Fr> {
|
|
@@ -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;
|
|
@@ -69,7 +69,7 @@ export function getSlotRangeForEpoch(
|
|
|
69
69
|
epochNumber: EpochNumber,
|
|
70
70
|
constants: Pick<L1RollupConstants, 'epochDuration'>,
|
|
71
71
|
): [SlotNumber, SlotNumber] {
|
|
72
|
-
const startSlot = SlotNumber(epochNumber * constants.epochDuration);
|
|
72
|
+
const startSlot = SlotNumber(Number(epochNumber) * constants.epochDuration);
|
|
73
73
|
return [startSlot, SlotNumber(startSlot + constants.epochDuration - 1)];
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -4,11 +4,10 @@ import type { ApiSchemaFor } from '@aztec/foundation/schemas';
|
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
|
-
import { CheckpointedL2Block
|
|
7
|
+
import { CheckpointedL2Block } from '../block/checkpointed_l2_block.js';
|
|
8
8
|
import { L2Block } from '../block/l2_block.js';
|
|
9
|
-
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,45 +82,47 @@ 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),
|
|
85
|
+
getCheckpointedL2BlockNumber: z.function().args().returns(BlockNumberSchema),
|
|
86
|
+
getFinalizedL2BlockNumber: z.function().args().returns(BlockNumberSchema),
|
|
86
87
|
getBlock: z.function().args(BlockNumberSchema).returns(L2Block.schema.optional()),
|
|
87
88
|
getBlockHeader: z
|
|
88
89
|
.function()
|
|
89
90
|
.args(z.union([BlockNumberSchema, z.literal('latest')]))
|
|
90
91
|
.returns(BlockHeader.schema.optional()),
|
|
91
92
|
getCheckpointedBlock: z.function().args(BlockNumberSchema).returns(CheckpointedL2Block.schema.optional()),
|
|
92
|
-
|
|
93
|
+
getCheckpointedBlocks: z
|
|
93
94
|
.function()
|
|
94
|
-
.args(BlockNumberSchema, schemas.Integer
|
|
95
|
-
.returns(z.array(
|
|
96
|
-
|
|
95
|
+
.args(BlockNumberSchema, schemas.Integer)
|
|
96
|
+
.returns(z.array(CheckpointedL2Block.schema)),
|
|
97
|
+
getBlocks: z.function().args(BlockNumberSchema, schemas.Integer).returns(z.array(L2Block.schema)),
|
|
98
|
+
getCheckpoints: z
|
|
97
99
|
.function()
|
|
98
100
|
.args(CheckpointNumberSchema, schemas.Integer)
|
|
99
101
|
.returns(z.array(PublishedCheckpoint.schema)),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
103
|
-
.returns(z.array(PublishedL2Block.schema)),
|
|
104
|
-
getPublishedBlockByHash: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
|
|
105
|
-
getPublishedBlockByArchive: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
|
|
102
|
+
getCheckpointedBlockByHash: z.function().args(schemas.Fr).returns(CheckpointedL2Block.schema.optional()),
|
|
103
|
+
getCheckpointedBlockByArchive: z.function().args(schemas.Fr).returns(CheckpointedL2Block.schema.optional()),
|
|
106
104
|
getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
107
105
|
getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
108
|
-
|
|
106
|
+
getL2Block: z.function().args(BlockNumberSchema).returns(L2Block.schema.optional()),
|
|
107
|
+
getL2BlockByHash: z.function().args(schemas.Fr).returns(L2Block.schema.optional()),
|
|
108
|
+
getL2BlockByArchive: z.function().args(schemas.Fr).returns(L2Block.schema.optional()),
|
|
109
109
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
110
110
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
111
111
|
getL2SlotNumber: z.function().args().returns(schemas.SlotNumber.optional()),
|
|
112
112
|
getL2EpochNumber: z.function().args().returns(EpochNumberSchema.optional()),
|
|
113
113
|
getCheckpointsForEpoch: z.function().args(EpochNumberSchema).returns(z.array(Checkpoint.schema)),
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
getCheckpointedBlocksForEpoch: z.function().args(EpochNumberSchema).returns(z.array(CheckpointedL2Block.schema)),
|
|
115
|
+
getBlocksForSlot: z.function().args(schemas.SlotNumber).returns(z.array(L2Block.schema)),
|
|
116
|
+
getCheckpointedBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
|
|
116
117
|
isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
|
|
117
118
|
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
118
119
|
getPrivateLogsByTags: z
|
|
119
120
|
.function()
|
|
120
|
-
.args(z.array(SiloedTag.schema))
|
|
121
|
+
.args(z.array(SiloedTag.schema), optional(z.number().gte(0)))
|
|
121
122
|
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
122
123
|
getPublicLogsByTagsFromContract: z
|
|
123
124
|
.function()
|
|
124
|
-
.args(schemas.AztecAddress, z.array(Tag.schema))
|
|
125
|
+
.args(schemas.AztecAddress, z.array(Tag.schema), optional(z.number().gte(0)))
|
|
125
126
|
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
126
127
|
getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
|
|
127
128
|
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
@@ -144,5 +145,5 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
144
145
|
getL1Timestamp: z.function().args().returns(schemas.BigInt.optional()),
|
|
145
146
|
syncImmediate: z.function().args().returns(z.void()),
|
|
146
147
|
isPendingChainInvalid: z.function().args().returns(z.boolean()),
|
|
147
|
-
getPendingChainValidationStatus: z.function().args().returns(
|
|
148
|
+
getPendingChainValidationStatus: z.function().args().returns(ValidateCheckpointResultSchema),
|
|
148
149
|
};
|
|
@@ -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() }));
|