@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
package/src/tests/mocks.ts
CHANGED
|
@@ -6,22 +6,23 @@ import {
|
|
|
6
6
|
MAX_NULLIFIERS_PER_TX,
|
|
7
7
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
8
8
|
} from '@aztec/constants';
|
|
9
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
10
|
-
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
9
|
+
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
10
|
+
import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
|
|
11
11
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
12
12
|
import { padArrayEnd, times } from '@aztec/foundation/collection';
|
|
13
13
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
14
14
|
import { Secp256k1Signer } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
15
15
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
16
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
16
17
|
|
|
17
18
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
18
19
|
import { PublicTxEffect } from '../avm/avm.js';
|
|
20
|
+
import type { AvmAccumulatedData } from '../avm/avm_accumulated_data.js';
|
|
19
21
|
import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
20
22
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
21
23
|
import { RevertCode } from '../avm/revert_code.js';
|
|
22
24
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
23
|
-
import {
|
|
24
|
-
import { L2Block } from '../block/l2_block.js';
|
|
25
|
+
import { CheckpointedL2Block, CommitteeAttestation, L2BlockNew } from '../block/index.js';
|
|
25
26
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
26
27
|
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
27
28
|
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
@@ -45,12 +46,14 @@ import { PrivateToAvmAccumulatedData } from '../kernel/private_to_avm_accumulate
|
|
|
45
46
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
46
47
|
import { PublicCallRequestArrayLengths } from '../kernel/public_call_request.js';
|
|
47
48
|
import { computeInHashFromL1ToL2Messages } from '../messaging/in_hash.js';
|
|
48
|
-
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
49
49
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
50
|
+
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
51
|
+
import { CheckpointProposal } from '../p2p/checkpoint_proposal.js';
|
|
50
52
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
51
53
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
52
54
|
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
53
55
|
import { ProvingRequestType } from '../proofs/proving_request_type.js';
|
|
56
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
54
57
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
55
58
|
import {
|
|
56
59
|
BlockHeader,
|
|
@@ -72,9 +75,9 @@ import {
|
|
|
72
75
|
makeAvmCircuitInputs,
|
|
73
76
|
makeAztecAddress,
|
|
74
77
|
makeBlockHeader,
|
|
78
|
+
makeCheckpointHeader,
|
|
75
79
|
makeGas,
|
|
76
80
|
makeGlobalVariables,
|
|
77
|
-
makeL2BlockHeader,
|
|
78
81
|
makePrivateToPublicAccumulatedData,
|
|
79
82
|
makePrivateToRollupAccumulatedData,
|
|
80
83
|
makeProtocolContracts,
|
|
@@ -202,6 +205,7 @@ export async function mockProcessedTx({
|
|
|
202
205
|
// The default gasUsed is the tx overhead.
|
|
203
206
|
gasUsed = Gas.from({ daGas: FIXED_DA_GAS, l2Gas: FIXED_L2_GAS }),
|
|
204
207
|
privateOnly = false,
|
|
208
|
+
avmAccumulatedData,
|
|
205
209
|
...mockTxOpts
|
|
206
210
|
}: {
|
|
207
211
|
seed?: number;
|
|
@@ -213,6 +217,7 @@ export async function mockProcessedTx({
|
|
|
213
217
|
protocolContracts?: ProtocolContracts;
|
|
214
218
|
feePaymentPublicDataWrite?: PublicDataWrite;
|
|
215
219
|
privateOnly?: boolean;
|
|
220
|
+
avmAccumulatedData?: Partial<FieldsOf<AvmAccumulatedData>>;
|
|
216
221
|
} & Parameters<typeof mockTx>[1] = {}) {
|
|
217
222
|
seed *= 0x1000; // Avoid clashing with the previous mock values if seed only increases by 1.
|
|
218
223
|
anchorBlockHeader ??= db?.getInitialHeader() ?? makeBlockHeader(seed);
|
|
@@ -292,19 +297,22 @@ export async function mockProcessedTx({
|
|
|
292
297
|
avmOutput.previousRevertibleAccumulatedDataArrayLengths =
|
|
293
298
|
avmOutput.previousRevertibleAccumulatedData.getArrayLengths();
|
|
294
299
|
// Assign final data emitted from avm.
|
|
295
|
-
avmOutput.accumulatedData.noteHashes = revertibleData.noteHashes;
|
|
296
|
-
avmOutput.accumulatedData.nullifiers =
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
300
|
+
avmOutput.accumulatedData.noteHashes = avmAccumulatedData?.noteHashes ?? revertibleData.noteHashes;
|
|
301
|
+
avmOutput.accumulatedData.nullifiers =
|
|
302
|
+
avmAccumulatedData?.nullifiers ??
|
|
303
|
+
padArrayEnd(
|
|
304
|
+
nonRevertibleData.nullifiers.concat(revertibleData.nullifiers).filter(n => !n.isEmpty()),
|
|
305
|
+
Fr.ZERO,
|
|
306
|
+
MAX_NULLIFIERS_PER_TX,
|
|
307
|
+
);
|
|
308
|
+
avmOutput.accumulatedData.l2ToL1Msgs = avmAccumulatedData?.l2ToL1Msgs ?? revertibleData.l2ToL1Msgs;
|
|
309
|
+
avmOutput.accumulatedData.publicDataWrites =
|
|
310
|
+
avmAccumulatedData?.publicDataWrites ??
|
|
311
|
+
makeTuple(
|
|
312
|
+
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
313
|
+
i => (i === 0 ? feePaymentPublicDataWrite : new PublicDataWrite(new Fr(i), new Fr(i + 10))),
|
|
314
|
+
seed + 0x2000,
|
|
315
|
+
);
|
|
308
316
|
avmOutput.accumulatedDataArrayLengths = avmOutput.accumulatedData.getArrayLengths();
|
|
309
317
|
avmOutput.gasSettings = gasSettings;
|
|
310
318
|
// Note: The fee is computed from the tx's gas used, which only includes the gas used in private. But this shouldn't
|
|
@@ -353,7 +361,6 @@ const emptyPrivateCallExecutionResult = () =>
|
|
|
353
361
|
Buffer.from(''),
|
|
354
362
|
new Map(),
|
|
355
363
|
PrivateCircuitPublicInputs.empty(),
|
|
356
|
-
new Map(),
|
|
357
364
|
[],
|
|
358
365
|
new Map(),
|
|
359
366
|
[],
|
|
@@ -392,6 +399,7 @@ export async function mockCheckpointAndMessages(
|
|
|
392
399
|
{
|
|
393
400
|
startBlockNumber = BlockNumber(1),
|
|
394
401
|
numBlocks = 1,
|
|
402
|
+
blocks,
|
|
395
403
|
numTxsPerBlock = 1,
|
|
396
404
|
numL1ToL2Messages = 1,
|
|
397
405
|
makeBlockOptions = () => ({}),
|
|
@@ -404,6 +412,7 @@ export async function mockCheckpointAndMessages(
|
|
|
404
412
|
numL1ToL2Messages?: number;
|
|
405
413
|
makeBlockOptions?: (blockNumber: BlockNumber) => Partial<Parameters<typeof L2BlockNew.random>[1]>;
|
|
406
414
|
previousArchive?: AppendOnlyTreeSnapshot;
|
|
415
|
+
blocks?: L2BlockNew[];
|
|
407
416
|
} & Partial<Parameters<typeof Checkpoint.random>[1]> &
|
|
408
417
|
Partial<Parameters<typeof L2BlockNew.random>[1]> = {},
|
|
409
418
|
) {
|
|
@@ -412,18 +421,20 @@ export async function mockCheckpointAndMessages(
|
|
|
412
421
|
// Track the previous block's archive to ensure consecutive blocks have consistent archive roots.
|
|
413
422
|
// The current block's header.lastArchive must equal the previous block's archive.
|
|
414
423
|
let lastArchive: AppendOnlyTreeSnapshot | undefined = previousArchive;
|
|
415
|
-
for (let i = 0; i < numBlocks; i++) {
|
|
424
|
+
for (let i = 0; i < (blocks?.length ?? numBlocks); i++) {
|
|
416
425
|
const blockNumber = BlockNumber(startBlockNumber + i);
|
|
417
426
|
const { block, messages } = {
|
|
418
|
-
block:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
+
block:
|
|
428
|
+
blocks?.[i] ??
|
|
429
|
+
(await L2BlockNew.random(blockNumber, {
|
|
430
|
+
checkpointNumber,
|
|
431
|
+
indexWithinCheckpoint: IndexWithinCheckpoint(i),
|
|
432
|
+
txsPerBlock: numTxsPerBlock,
|
|
433
|
+
slotNumber,
|
|
434
|
+
...options,
|
|
435
|
+
...makeBlockOptions(blockNumber),
|
|
436
|
+
...(lastArchive ? { lastArchive } : {}),
|
|
437
|
+
})),
|
|
427
438
|
messages: mockL1ToL2Messages(numL1ToL2Messages),
|
|
428
439
|
};
|
|
429
440
|
// Update lastArchive for the next block
|
|
@@ -481,28 +492,52 @@ export interface MakeConsensusPayloadOptions {
|
|
|
481
492
|
signer?: Secp256k1Signer;
|
|
482
493
|
attesterSigner?: Secp256k1Signer;
|
|
483
494
|
proposerSigner?: Secp256k1Signer;
|
|
484
|
-
header?:
|
|
495
|
+
header?: CheckpointHeader;
|
|
485
496
|
archive?: Fr;
|
|
486
497
|
txHashes?: TxHash[];
|
|
487
498
|
txs?: Tx[];
|
|
488
499
|
}
|
|
489
500
|
|
|
501
|
+
export interface MakeBlockProposalOptions {
|
|
502
|
+
signer?: Secp256k1Signer;
|
|
503
|
+
blockHeader?: BlockHeader;
|
|
504
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
505
|
+
inHash?: Fr;
|
|
506
|
+
archiveRoot?: Fr;
|
|
507
|
+
txHashes?: TxHash[];
|
|
508
|
+
txs?: Tx[];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
export interface MakeCheckpointProposalOptions {
|
|
512
|
+
signer?: Secp256k1Signer;
|
|
513
|
+
checkpointHeader?: CheckpointHeader;
|
|
514
|
+
archiveRoot?: Fr;
|
|
515
|
+
/** Options for the lastBlock - if undefined, no lastBlock is included */
|
|
516
|
+
lastBlock?: {
|
|
517
|
+
blockHeader?: BlockHeader;
|
|
518
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
519
|
+
txHashes?: TxHash[];
|
|
520
|
+
txs?: Tx[];
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
490
525
|
const makeAndSignConsensusPayload = (
|
|
491
526
|
domainSeparator: SignatureDomainSeparator,
|
|
492
527
|
options?: MakeConsensusPayloadOptions,
|
|
493
528
|
) => {
|
|
494
|
-
const header = options?.header ??
|
|
529
|
+
const header = options?.header ?? makeCheckpointHeader(1);
|
|
495
530
|
const { signer = Secp256k1Signer.random(), archive = Fr.random() } = options ?? {};
|
|
496
531
|
|
|
497
532
|
const payload = ConsensusPayload.fromFields({
|
|
498
|
-
header
|
|
533
|
+
header,
|
|
499
534
|
archive,
|
|
500
535
|
});
|
|
501
536
|
|
|
502
537
|
const hash = getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator);
|
|
503
538
|
const signature = signer.sign(hash);
|
|
504
539
|
|
|
505
|
-
return { blockNumber: header.
|
|
540
|
+
return { blockNumber: header.slotNumber, payload, signature };
|
|
506
541
|
};
|
|
507
542
|
|
|
508
543
|
export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
@@ -516,80 +551,150 @@ export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
|
516
551
|
return signer.sign(hash);
|
|
517
552
|
};
|
|
518
553
|
|
|
519
|
-
export const makeBlockProposal = (options?:
|
|
520
|
-
const
|
|
554
|
+
export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<BlockProposal> => {
|
|
555
|
+
const blockHeader = options?.blockHeader ?? makeBlockHeader(1);
|
|
556
|
+
const indexWithinCheckpoint = options?.indexWithinCheckpoint ?? IndexWithinCheckpoint(0);
|
|
557
|
+
const inHash = options?.inHash ?? Fr.random();
|
|
558
|
+
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
521
559
|
const txHashes = options?.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random());
|
|
522
|
-
|
|
560
|
+
const txs = options?.txs;
|
|
561
|
+
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
562
|
+
|
|
563
|
+
return BlockProposal.createProposalFromSigner(
|
|
564
|
+
blockHeader,
|
|
565
|
+
indexWithinCheckpoint,
|
|
566
|
+
inHash,
|
|
567
|
+
archiveRoot,
|
|
568
|
+
txHashes,
|
|
569
|
+
txs,
|
|
570
|
+
(_payload, _context) => Promise.resolve(signer.signMessage(_payload)),
|
|
571
|
+
);
|
|
523
572
|
};
|
|
524
573
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
const
|
|
528
|
-
const
|
|
574
|
+
export const makeCheckpointProposal = (options?: MakeCheckpointProposalOptions): Promise<CheckpointProposal> => {
|
|
575
|
+
const blockHeader = options?.lastBlock?.blockHeader ?? makeBlockHeader(1);
|
|
576
|
+
const checkpointHeader = options?.checkpointHeader ?? makeCheckpointHeader(1);
|
|
577
|
+
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
578
|
+
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
579
|
+
|
|
580
|
+
// Build lastBlock info if provided
|
|
581
|
+
const lastBlockInfo = options?.lastBlock
|
|
582
|
+
? {
|
|
583
|
+
blockHeader,
|
|
584
|
+
indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? IndexWithinCheckpoint(4), // Last block in a 5-block checkpoint
|
|
585
|
+
txHashes: options.lastBlock.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random()),
|
|
586
|
+
txs: options.lastBlock.txs,
|
|
587
|
+
}
|
|
588
|
+
: undefined;
|
|
589
|
+
|
|
590
|
+
return CheckpointProposal.createProposalFromSigner(checkpointHeader, archiveRoot, lastBlockInfo, payload =>
|
|
591
|
+
Promise.resolve(signer.signMessage(payload)),
|
|
592
|
+
);
|
|
593
|
+
};
|
|
529
594
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
595
|
+
/**
|
|
596
|
+
* Options for creating a checkpoint attestation
|
|
597
|
+
*/
|
|
598
|
+
export type MakeCheckpointAttestationOptions = {
|
|
599
|
+
header?: CheckpointHeader;
|
|
600
|
+
archive?: Fr;
|
|
601
|
+
attesterSigner?: Secp256k1Signer;
|
|
602
|
+
proposerSigner?: Secp256k1Signer;
|
|
603
|
+
signer?: Secp256k1Signer;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Create a checkpoint attestation for testing
|
|
608
|
+
*/
|
|
609
|
+
export const makeCheckpointAttestation = (options: MakeCheckpointAttestationOptions = {}): CheckpointAttestation => {
|
|
610
|
+
const header = options.header ?? makeCheckpointHeader(1);
|
|
611
|
+
const archive = options.archive ?? Fr.random();
|
|
612
|
+
const { signer, attesterSigner = signer, proposerSigner = signer } = options;
|
|
534
613
|
|
|
535
|
-
|
|
614
|
+
const payload = new ConsensusPayload(header, archive);
|
|
615
|
+
|
|
616
|
+
// Sign as attester
|
|
617
|
+
const attestationHash = getHashedSignaturePayloadEthSignedMessage(
|
|
618
|
+
payload,
|
|
619
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
620
|
+
);
|
|
621
|
+
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
622
|
+
const attestationSignature = attestationSigner.sign(attestationHash);
|
|
623
|
+
|
|
624
|
+
// Sign as proposer - use CheckpointProposal's payload format (serializeToBuffer)
|
|
625
|
+
// This is different from ConsensusPayload's format (ABI encoding)
|
|
626
|
+
const proposalSignerToUse = proposerSigner ?? Secp256k1Signer.random();
|
|
627
|
+
const tempProposal = new CheckpointProposal(header, archive, Signature.empty());
|
|
628
|
+
const proposalHash = getHashedSignaturePayloadEthSignedMessage(
|
|
629
|
+
tempProposal,
|
|
630
|
+
SignatureDomainSeparator.checkpointProposal,
|
|
631
|
+
);
|
|
632
|
+
const proposerSignature = proposalSignerToUse.sign(proposalHash);
|
|
633
|
+
|
|
634
|
+
return new CheckpointAttestation(payload, attestationSignature, proposerSignature);
|
|
536
635
|
};
|
|
537
636
|
|
|
538
|
-
|
|
539
|
-
|
|
637
|
+
/**
|
|
638
|
+
* Create a checkpoint attestation from a checkpoint proposal
|
|
639
|
+
*/
|
|
640
|
+
export const makeCheckpointAttestationFromProposal = (
|
|
641
|
+
proposal: CheckpointProposal,
|
|
540
642
|
attesterSigner?: Secp256k1Signer,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
const header = checkpoint.header;
|
|
544
|
-
const archive = checkpoint.archive.root;
|
|
643
|
+
): CheckpointAttestation => {
|
|
644
|
+
const payload = new ConsensusPayload(proposal.checkpointHeader, proposal.archive);
|
|
545
645
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
646
|
+
// Sign as attester
|
|
647
|
+
const attestationHash = getHashedSignaturePayloadEthSignedMessage(
|
|
648
|
+
payload,
|
|
649
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
650
|
+
);
|
|
651
|
+
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
652
|
+
const attestationSignature = attestationSigner.sign(attestationHash);
|
|
550
653
|
|
|
551
|
-
|
|
654
|
+
// Use the proposal's signature as the proposer signature
|
|
655
|
+
return new CheckpointAttestation(payload, attestationSignature, proposal.signature);
|
|
552
656
|
};
|
|
553
657
|
|
|
554
|
-
|
|
555
|
-
|
|
658
|
+
/**
|
|
659
|
+
* Create a checkpoint attestation from a checkpoint
|
|
660
|
+
*/
|
|
661
|
+
export const makeCheckpointAttestationFromCheckpoint = (
|
|
662
|
+
checkpoint: Checkpoint,
|
|
556
663
|
attesterSigner?: Secp256k1Signer,
|
|
557
664
|
proposerSigner?: Secp256k1Signer,
|
|
558
|
-
):
|
|
559
|
-
const header =
|
|
560
|
-
const archive =
|
|
561
|
-
|
|
562
|
-
const payload = ConsensusPayload.fromFields({
|
|
563
|
-
header: header.toCheckpointHeader(),
|
|
564
|
-
archive,
|
|
565
|
-
});
|
|
665
|
+
): CheckpointAttestation => {
|
|
666
|
+
const header = checkpoint.header;
|
|
667
|
+
const archive = checkpoint.archive.root;
|
|
566
668
|
|
|
567
|
-
return
|
|
669
|
+
return makeCheckpointAttestation({ header, archive, attesterSigner, proposerSigner });
|
|
568
670
|
};
|
|
569
671
|
|
|
570
|
-
|
|
571
|
-
|
|
672
|
+
/**
|
|
673
|
+
* Create a checkpoint attestation from an L2BlockNew
|
|
674
|
+
* Note: This is a compatibility function for tests. L2BlockNew doesn't have a checkpoint header directly.
|
|
675
|
+
*/
|
|
676
|
+
export const makeCheckpointAttestationFromBlock = (
|
|
677
|
+
block: L2BlockNew,
|
|
572
678
|
attesterSigner?: Secp256k1Signer,
|
|
573
679
|
proposerSigner?: Secp256k1Signer,
|
|
574
|
-
):
|
|
575
|
-
//
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
const
|
|
583
|
-
const proposerSignature = proposalSignerToUse.sign(proposalHash);
|
|
680
|
+
): CheckpointAttestation => {
|
|
681
|
+
// For L2BlockNew, we create a minimal checkpoint header for testing purposes
|
|
682
|
+
const header = CheckpointHeader.empty({
|
|
683
|
+
lastArchiveRoot: block.header.lastArchive.root,
|
|
684
|
+
slotNumber: block.slot,
|
|
685
|
+
timestamp: block.timestamp,
|
|
686
|
+
blockHeadersHash: Fr.ZERO, // Would need to compute from block header hash
|
|
687
|
+
});
|
|
688
|
+
const archive = block.archive.root;
|
|
584
689
|
|
|
585
|
-
return
|
|
690
|
+
return makeCheckpointAttestation({ header, archive, attesterSigner, proposerSigner });
|
|
586
691
|
};
|
|
587
692
|
|
|
588
693
|
export async function randomPublishedL2Block(
|
|
589
694
|
l2BlockNumber: number,
|
|
590
695
|
opts: { signers?: Secp256k1Signer[] } = {},
|
|
591
|
-
): Promise<
|
|
592
|
-
const block = await
|
|
696
|
+
): Promise<CheckpointedL2Block> {
|
|
697
|
+
const block = await L2BlockNew.random(BlockNumber(l2BlockNumber));
|
|
593
698
|
const l1 = L1PublishedData.fromFields({
|
|
594
699
|
blockNumber: BigInt(block.number),
|
|
595
700
|
timestamp: block.header.globalVariables.timestamp,
|
|
@@ -597,9 +702,17 @@ export async function randomPublishedL2Block(
|
|
|
597
702
|
});
|
|
598
703
|
|
|
599
704
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
600
|
-
const
|
|
705
|
+
const checkpoint = await Checkpoint.random(CheckpointNumber(l2BlockNumber), { numBlocks: 0 });
|
|
706
|
+
checkpoint.blocks = [block];
|
|
707
|
+
const atts = signers.map(signer =>
|
|
708
|
+
makeCheckpointAttestation({
|
|
709
|
+
signer,
|
|
710
|
+
archive: block.archive.root,
|
|
711
|
+
header: checkpoint.header,
|
|
712
|
+
}),
|
|
713
|
+
);
|
|
601
714
|
const attestations = atts.map(
|
|
602
715
|
(attestation, i) => new CommitteeAttestation(signers[i].address, attestation.signature),
|
|
603
716
|
);
|
|
604
|
-
return new
|
|
717
|
+
return new CheckpointedL2Block(CheckpointNumber(l2BlockNumber), block, l1, attestations);
|
|
605
718
|
}
|
package/src/tx/block_header.ts
CHANGED
|
@@ -168,6 +168,11 @@ export class BlockHeader {
|
|
|
168
168
|
return this._cachedHash;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
+
/** Manually set the hash for this block header if already computed */
|
|
172
|
+
setHash(hashed: Fr) {
|
|
173
|
+
this._cachedHash = Promise.resolve(hashed);
|
|
174
|
+
}
|
|
175
|
+
|
|
171
176
|
static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
|
|
172
177
|
return BlockHeader.from({
|
|
173
178
|
lastArchive: AppendOnlyTreeSnapshot.random(),
|
|
@@ -10,7 +10,7 @@ import type { CheckpointGlobalVariables, GlobalVariables } from './global_variab
|
|
|
10
10
|
* Interface for building global variables for Aztec blocks.
|
|
11
11
|
*/
|
|
12
12
|
export interface GlobalVariableBuilder {
|
|
13
|
-
|
|
13
|
+
getCurrentMinFees(): Promise<GasFees>;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Builds global variables for a given block.
|
package/src/tx/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './block_header.js';
|
|
2
2
|
export * from './call_context.js';
|
|
3
3
|
export * from './global_variables.js';
|
|
4
|
-
export * from './content_commitment.js';
|
|
5
4
|
export * from './state_reference.js';
|
|
6
5
|
export * from './partial_state_reference.js';
|
|
7
6
|
export * from './function_data.js';
|
|
@@ -79,7 +79,7 @@ export class CountedContractClassLog implements IsEmpty {
|
|
|
79
79
|
export class PrivateExecutionResult {
|
|
80
80
|
constructor(
|
|
81
81
|
public entrypoint: PrivateCallExecutionResult,
|
|
82
|
-
/** The first non
|
|
82
|
+
/** The first non-revertible nullifier emitted by any private call, or the protocol nullifier if there was none. */
|
|
83
83
|
public firstNullifier: Fr,
|
|
84
84
|
/** An array of calldata for the enqueued public function calls and the teardown function call. */
|
|
85
85
|
public publicFunctionCalldata: HashedValues[],
|
|
@@ -129,8 +129,6 @@ export class PrivateCallExecutionResult {
|
|
|
129
129
|
// Needed for the verifier (kernel)
|
|
130
130
|
/** The call stack item. */
|
|
131
131
|
public publicInputs: PrivateCircuitPublicInputs,
|
|
132
|
-
/** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */
|
|
133
|
-
public noteHashLeafIndexMap: Map<bigint, bigint>,
|
|
134
132
|
/** The notes created in the executed function. */
|
|
135
133
|
public newNotes: NoteAndSlot[],
|
|
136
134
|
/** Mapping of note hash counter to the counter of its nullifier. */
|
|
@@ -159,7 +157,6 @@ export class PrivateCallExecutionResult {
|
|
|
159
157
|
vk: schemas.Buffer,
|
|
160
158
|
partialWitness: mapSchema(z.coerce.number(), z.string()),
|
|
161
159
|
publicInputs: PrivateCircuitPublicInputs.schema,
|
|
162
|
-
noteHashLeafIndexMap: mapSchema(schemas.BigInt, schemas.BigInt),
|
|
163
160
|
newNotes: z.array(NoteAndSlot.schema),
|
|
164
161
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
165
162
|
returnValues: z.array(schemas.Fr),
|
|
@@ -177,7 +174,6 @@ export class PrivateCallExecutionResult {
|
|
|
177
174
|
fields.vk,
|
|
178
175
|
fields.partialWitness,
|
|
179
176
|
fields.publicInputs,
|
|
180
|
-
fields.noteHashLeafIndexMap,
|
|
181
177
|
fields.newNotes,
|
|
182
178
|
fields.noteHashNullifierCounterMap,
|
|
183
179
|
fields.returnValues,
|
|
@@ -194,7 +190,6 @@ export class PrivateCallExecutionResult {
|
|
|
194
190
|
randomBytes(4),
|
|
195
191
|
new Map([[1, 'one']]),
|
|
196
192
|
PrivateCircuitPublicInputs.empty(),
|
|
197
|
-
new Map([[1n, 1n]]),
|
|
198
193
|
[NoteAndSlot.random()],
|
|
199
194
|
new Map([[0, 0]]),
|
|
200
195
|
[Fr.random()],
|
|
@@ -210,16 +205,6 @@ export class PrivateCallExecutionResult {
|
|
|
210
205
|
}
|
|
211
206
|
}
|
|
212
207
|
|
|
213
|
-
export function collectNoteHashLeafIndexMap(execResult: PrivateExecutionResult) {
|
|
214
|
-
const accum: Map<bigint, bigint> = new Map();
|
|
215
|
-
const collectNoteHashLeafIndexMapRecursive = (callResult: PrivateCallExecutionResult, accum: Map<bigint, bigint>) => {
|
|
216
|
-
callResult.noteHashLeafIndexMap.forEach((value, key) => accum.set(key, value));
|
|
217
|
-
callResult.nestedExecutionResults.forEach(nested => collectNoteHashLeafIndexMapRecursive(nested, accum));
|
|
218
|
-
};
|
|
219
|
-
collectNoteHashLeafIndexMapRecursive(execResult.entrypoint, accum);
|
|
220
|
-
return accum;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
208
|
export function collectNoteHashNullifierCounterMap(execResult: PrivateExecutionResult) {
|
|
224
209
|
const accum: Map<number, number> = new Map();
|
|
225
210
|
const collectNoteHashNullifierCounterMapRecursive = (
|
package/src/tx/profiling.ts
CHANGED
|
@@ -6,9 +6,35 @@ import { z } from 'zod';
|
|
|
6
6
|
import type { AztecNode } from '../interfaces/aztec-node.js';
|
|
7
7
|
import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type RoundTripStats = {
|
|
10
|
+
/** Number of round trips (times we blocked waiting for node responses) */
|
|
11
|
+
roundTrips: number;
|
|
12
|
+
/** Total wall-clock time spent waiting on node (excludes parallel overlap) */
|
|
13
|
+
totalBlockingTime: number;
|
|
14
|
+
/** Individual round trip durations */
|
|
15
|
+
roundTripDurations: number[];
|
|
16
|
+
/** Methods called in each round trip (parallel calls grouped together) */
|
|
17
|
+
roundTripMethods: string[][];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const RoundTripStatsSchema = z.object({
|
|
21
|
+
roundTrips: z.number(),
|
|
22
|
+
totalBlockingTime: z.number(),
|
|
23
|
+
roundTripDurations: z.array(z.number()),
|
|
24
|
+
roundTripMethods: z.array(z.array(z.string())),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type NodeStats = {
|
|
28
|
+
/** Per-method call stats */
|
|
29
|
+
perMethod: Partial<Record<keyof AztecNode, { times: number[] }>>;
|
|
30
|
+
/** Round trip stats tracking actual blocking waits */
|
|
31
|
+
roundTrips: RoundTripStats;
|
|
32
|
+
};
|
|
10
33
|
|
|
11
|
-
const NodeStatsSchema = z.
|
|
34
|
+
const NodeStatsSchema = z.object({
|
|
35
|
+
perMethod: z.record(z.string(), z.object({ times: z.array(z.number()) })),
|
|
36
|
+
roundTrips: RoundTripStatsSchema,
|
|
37
|
+
});
|
|
12
38
|
|
|
13
39
|
type FunctionTiming = {
|
|
14
40
|
functionName: string;
|
|
@@ -105,7 +131,15 @@ export class TxProfileResult {
|
|
|
105
131
|
},
|
|
106
132
|
],
|
|
107
133
|
{
|
|
108
|
-
nodeRPCCalls: {
|
|
134
|
+
nodeRPCCalls: {
|
|
135
|
+
perMethod: { getBlockHeader: { times: [1] } },
|
|
136
|
+
roundTrips: {
|
|
137
|
+
roundTrips: 1,
|
|
138
|
+
totalBlockingTime: 1,
|
|
139
|
+
roundTripDurations: [1],
|
|
140
|
+
roundTripMethods: [['getBlockHeader']],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
109
143
|
timings: {
|
|
110
144
|
sync: 1,
|
|
111
145
|
proving: 1,
|
|
@@ -140,7 +174,15 @@ export class UtilitySimulationResult {
|
|
|
140
174
|
|
|
141
175
|
static random(): UtilitySimulationResult {
|
|
142
176
|
return new UtilitySimulationResult([Fr.random()], {
|
|
143
|
-
nodeRPCCalls: {
|
|
177
|
+
nodeRPCCalls: {
|
|
178
|
+
perMethod: { getBlockHeader: { times: [1] } },
|
|
179
|
+
roundTrips: {
|
|
180
|
+
roundTrips: 1,
|
|
181
|
+
totalBlockingTime: 1,
|
|
182
|
+
roundTripDurations: [1],
|
|
183
|
+
roundTripMethods: [['getBlockHeader']],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
144
186
|
timings: {
|
|
145
187
|
sync: 1,
|
|
146
188
|
publicSimulation: 1,
|
package/src/tx/tx.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { TxHash } from './tx_hash.js';
|
|
|
24
24
|
/**
|
|
25
25
|
* The interface of an L2 transaction.
|
|
26
26
|
*/
|
|
27
|
+
// docs:start:tx_class
|
|
27
28
|
export class Tx extends Gossipable {
|
|
28
29
|
static override p2pTopic = TopicType.tx;
|
|
29
30
|
|
|
@@ -60,6 +61,7 @@ export class Tx extends Gossipable {
|
|
|
60
61
|
) {
|
|
61
62
|
super();
|
|
62
63
|
}
|
|
64
|
+
// docs:end:tx_class
|
|
63
65
|
|
|
64
66
|
// Gossipable method
|
|
65
67
|
override generateP2PMessageIdentifier(): Promise<Buffer32> {
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -28,7 +28,6 @@ import { RevertCode } from '../avm/revert_code.js';
|
|
|
28
28
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
29
29
|
import { PrivateLog } from '../logs/private_log.js';
|
|
30
30
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
31
|
-
import { computeTxOutHash } from '../messaging/out_hash.js';
|
|
32
31
|
import { TxHash } from './tx_hash.js';
|
|
33
32
|
|
|
34
33
|
export class TxEffect {
|
|
@@ -184,14 +183,6 @@ export class TxEffect {
|
|
|
184
183
|
);
|
|
185
184
|
}
|
|
186
185
|
|
|
187
|
-
/**
|
|
188
|
-
* Computes txOutHash of this tx effect.
|
|
189
|
-
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
190
|
-
*/
|
|
191
|
-
txOutHash(): Fr {
|
|
192
|
-
return computeTxOutHash(this.l2ToL1Msgs);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
186
|
static async random({
|
|
196
187
|
numNoteHashes,
|
|
197
188
|
numNullifiers,
|
|
@@ -20,6 +20,7 @@ import { TxRequest } from './tx_request.js';
|
|
|
20
20
|
/**
|
|
21
21
|
* Request to execute a transaction. Similar to TxRequest, but has the full args.
|
|
22
22
|
*/
|
|
23
|
+
// docs:start:tx_execution_request_class
|
|
23
24
|
export class TxExecutionRequest {
|
|
24
25
|
constructor(
|
|
25
26
|
/**
|
|
@@ -60,6 +61,7 @@ export class TxExecutionRequest {
|
|
|
60
61
|
*/
|
|
61
62
|
public salt = Fr.random(),
|
|
62
63
|
) {}
|
|
64
|
+
// docs:end:tx_execution_request_class
|
|
63
65
|
|
|
64
66
|
static get schema(): ZodFor<TxExecutionRequest> {
|
|
65
67
|
return z
|