@aztec/stdlib 0.0.1-commit.1142ef1 → 0.0.1-commit.1bea0213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/abi/function_call.d.ts +9 -1
- package/dest/abi/function_call.d.ts.map +1 -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_circuit_public_inputs.d.ts +9 -9
- package/dest/avm/avm_proving_request.d.ts +299 -299
- package/dest/avm/contract_storage_read.d.ts +13 -1
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +13 -1
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +3 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +10 -1
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +10 -1
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +7 -1
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.d.ts +4 -1
- package/dest/avm/public_inner_call_request.d.ts.map +1 -1
- package/dest/avm/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/block/block_hash.d.ts +16 -9
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +23 -8
- package/dest/block/block_parameter.d.ts +4 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +2 -0
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -1
- package/dest/block/checkpointed_l2_block.d.ts +20 -137
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
- package/dest/block/checkpointed_l2_block.js +7 -45
- package/dest/block/in_block.d.ts +8 -8
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/in_block.js +4 -4
- 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 +55 -59
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -109
- package/dest/block/l2_block_source.d.ts +63 -38
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +2 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +9 -6
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -3
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +37 -34
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +3 -3
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +2 -7
- package/dest/block/validate_block_result.d.ts +1 -1
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +5 -4
- package/dest/checkpoint/checkpoint.d.ts +30 -20
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +18 -6
- 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/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/interfaces/api_limit.d.ts +2 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +1 -0
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +16 -14
- package/dest/interfaces/aztec-node-admin.d.ts +56 -26
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +61 -43
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +7 -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 +8 -8
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.d.ts +3 -3
- package/dest/interfaces/l2_logs_source.d.ts +14 -5
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- 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 +14 -14
- 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 +69 -13
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +2 -2
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +1 -1
- 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 +16 -6
- 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/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_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +17 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +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/public_call_request.d.ts +22 -1
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/utils/optional_number.d.ts +7 -1
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -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 +7 -5
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +10 -6
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +5 -5
- package/dest/messaging/inbox_leaf.d.ts +3 -1
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/l1_actor.d.ts +7 -1
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +6 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l2_actor.d.ts +7 -1
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +5 -3
- package/dest/messaging/out_hash.d.ts +41 -4
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +52 -26
- package/dest/note/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/block_proposal.d.ts +14 -6
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +25 -7
- package/dest/p2p/checkpoint_attestation.d.ts +5 -1
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts +11 -5
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +17 -5
- package/dest/p2p/consensus_payload.d.ts +4 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +0 -3
- 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/index.d.ts +2 -1
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- package/dest/p2p/message_validator.d.ts +18 -3
- package/dest/p2p/message_validator.d.ts.map +1 -1
- package/dest/p2p/message_validator.js +2 -1
- package/dest/p2p/signed_txs.d.ts +3 -1
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +6 -1
- package/dest/p2p/topic_type.js +2 -1
- package/dest/parity/parity_base_private_inputs.d.ts +3 -1
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +4 -1
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +2 -1
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +1 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +9 -4
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/recursive_proof.d.ts +10 -1
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +34 -1
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +12 -1
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +44 -3
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +2 -2
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +10 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +29 -2
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +21 -5
- 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 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +10 -6
- 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 +12 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +4 -1
- 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 +2 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +6 -15
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +15 -13
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +41 -24
- package/dest/trees/append_only_tree_snapshot.d.ts +13 -1
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.d.ts +13 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +10 -1
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +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 +5 -1
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +4 -1
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +9 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -2
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +9 -1
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/hashed_values.d.ts +7 -1
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/in_tx.d.ts +3 -3
- package/dest/tx/indexed_tx_effect.d.ts +4 -4
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +2 -2
- package/dest/tx/partial_state_reference.d.ts +4 -1
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +23 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +1 -1
- package/dest/tx/private_tx_constant_data.d.ts +16 -1
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +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/state_reference.d.ts +3 -1
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +6 -3
- package/dest/tx/tx_context.d.ts +2 -1
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +32 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +0 -7
- package/dest/tx/tx_execution_request.d.ts +30 -1
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +47 -13
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +46 -15
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/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/utils.ts +17 -0
- package/src/block/block_hash.ts +36 -10
- package/src/block/block_parameter.ts +4 -2
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +8 -58
- package/src/block/in_block.ts +5 -5
- package/src/block/index.ts +0 -2
- package/src/block/l2_block.ts +101 -149
- package/src/block/l2_block_source.ts +69 -41
- package/src/block/l2_block_stream/interfaces.ts +8 -5
- package/src/block/l2_block_stream/l2_block_stream.ts +45 -37
- package/src/block/l2_block_stream/l2_tips_store_base.ts +2 -2
- package/src/block/test/l2_tips_store_test_suite.ts +4 -9
- package/src/block/validate_block_result.ts +5 -4
- package/src/checkpoint/checkpoint.ts +33 -11
- 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 +1 -0
- package/src/interfaces/archiver.ts +16 -23
- package/src/interfaces/aztec-node.ts +76 -74
- package/src/interfaces/block-builder.ts +31 -24
- package/src/interfaces/configs.ts +1 -3
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/prover-client.ts +15 -0
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +8 -9
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +17 -6
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- package/src/logs/log_id.ts +6 -6
- package/src/messaging/l2_to_l1_membership.ts +5 -3
- package/src/messaging/out_hash.ts +60 -29
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/block_proposal.ts +27 -11
- package/src/p2p/checkpoint_proposal.ts +20 -9
- package/src/p2p/consensus_payload.ts +0 -5
- package/src/p2p/constants.ts +3 -0
- package/src/p2p/index.ts +1 -0
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signed_txs.ts +6 -1
- package/src/p2p/topic_type.ts +1 -1
- package/src/proofs/chonk_proof.ts +9 -5
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +2 -2
- package/src/rollup/checkpoint_header.ts +20 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +12 -6
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +4 -1
- package/src/tests/factories.ts +6 -26
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +56 -38
- package/src/tx/block_header.ts +11 -3
- package/src/tx/indexed_tx_effect.ts +2 -2
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/profiling.ts +46 -4
- package/src/tx/tx.ts +8 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_receipt.ts +75 -18
- 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 -11
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -55
- package/dest/block/l2_block_header.d.ts +0 -94
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -160
- package/dest/block/l2_block_new.d.ts +0 -134
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -155
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/src/block/l2_block_code_to_purge.ts +0 -80
- package/src/block/l2_block_header.ts +0 -255
- package/src/block/l2_block_new.ts +0 -211
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
|
@@ -48,8 +48,8 @@ export class BlockRollupPublicInputs {
|
|
|
48
48
|
public timestamp: UInt64,
|
|
49
49
|
/**
|
|
50
50
|
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
51
|
-
* other blocks in the same checkpoint to form
|
|
52
|
-
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
51
|
+
* other blocks in the same checkpoint to form an unbalanced tree. The root of that tree becomes the final hash
|
|
52
|
+
* stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
53
53
|
*/
|
|
54
54
|
public blockHeadersHash: Fr,
|
|
55
55
|
/**
|
|
@@ -32,6 +32,14 @@ export class CheckpointHeader {
|
|
|
32
32
|
public blobsHash: Fr,
|
|
33
33
|
/** Root of the l1 to l2 messages subtree. */
|
|
34
34
|
public inHash: Fr,
|
|
35
|
+
/**
|
|
36
|
+
* The root of the epoch out hash balanced tree. The out hash of the first checkpoint in the epoch is inserted at
|
|
37
|
+
* index 0, the second at index 1, and so on.
|
|
38
|
+
* Note: This is not necessarily the final epoch out hash. It includes only the out hashes of checkpoints up to and
|
|
39
|
+
* including the current checkpoint. Any subsequent checkpoints added to the same epoch are not reflected in this
|
|
40
|
+
* value.
|
|
41
|
+
*/
|
|
42
|
+
public epochOutHash: Fr,
|
|
35
43
|
/** Slot number of the L2 block */
|
|
36
44
|
public slotNumber: SlotNumber,
|
|
37
45
|
/** Timestamp of the L2 block. */
|
|
@@ -53,6 +61,7 @@ export class CheckpointHeader {
|
|
|
53
61
|
blockHeadersHash: schemas.Fr,
|
|
54
62
|
blobsHash: schemas.Fr,
|
|
55
63
|
inHash: schemas.Fr,
|
|
64
|
+
epochOutHash: schemas.Fr,
|
|
56
65
|
slotNumber: schemas.SlotNumber,
|
|
57
66
|
timestamp: schemas.BigInt,
|
|
58
67
|
coinbase: schemas.EthAddress,
|
|
@@ -69,6 +78,7 @@ export class CheckpointHeader {
|
|
|
69
78
|
fields.blockHeadersHash,
|
|
70
79
|
fields.blobsHash,
|
|
71
80
|
fields.inHash,
|
|
81
|
+
fields.epochOutHash,
|
|
72
82
|
fields.slotNumber,
|
|
73
83
|
fields.timestamp,
|
|
74
84
|
fields.coinbase,
|
|
@@ -90,6 +100,7 @@ export class CheckpointHeader {
|
|
|
90
100
|
reader.readObject(Fr),
|
|
91
101
|
reader.readObject(Fr),
|
|
92
102
|
reader.readObject(Fr),
|
|
103
|
+
reader.readObject(Fr),
|
|
93
104
|
SlotNumber(Fr.fromBuffer(reader).toNumber()),
|
|
94
105
|
reader.readUInt64(),
|
|
95
106
|
reader.readObject(EthAddress),
|
|
@@ -105,6 +116,7 @@ export class CheckpointHeader {
|
|
|
105
116
|
this.blockHeadersHash.equals(other.blockHeadersHash) &&
|
|
106
117
|
this.blobsHash.equals(other.blobsHash) &&
|
|
107
118
|
this.inHash.equals(other.inHash) &&
|
|
119
|
+
this.epochOutHash.equals(other.epochOutHash) &&
|
|
108
120
|
this.slotNumber === other.slotNumber &&
|
|
109
121
|
this.timestamp === other.timestamp &&
|
|
110
122
|
this.coinbase.equals(other.coinbase) &&
|
|
@@ -132,6 +144,7 @@ export class CheckpointHeader {
|
|
|
132
144
|
this.blockHeadersHash,
|
|
133
145
|
this.blobsHash,
|
|
134
146
|
this.inHash,
|
|
147
|
+
this.epochOutHash,
|
|
135
148
|
new Fr(this.slotNumber),
|
|
136
149
|
bigintToUInt64BE(this.timestamp),
|
|
137
150
|
this.coinbase,
|
|
@@ -151,6 +164,7 @@ export class CheckpointHeader {
|
|
|
151
164
|
blockHeadersHash: Fr.ZERO,
|
|
152
165
|
blobsHash: Fr.ZERO,
|
|
153
166
|
inHash: Fr.ZERO,
|
|
167
|
+
epochOutHash: Fr.ZERO,
|
|
154
168
|
slotNumber: SlotNumber.ZERO,
|
|
155
169
|
timestamp: 0n,
|
|
156
170
|
coinbase: EthAddress.ZERO,
|
|
@@ -167,6 +181,7 @@ export class CheckpointHeader {
|
|
|
167
181
|
blockHeadersHash: Fr.random(),
|
|
168
182
|
blobsHash: Fr.random(),
|
|
169
183
|
inHash: Fr.random(),
|
|
184
|
+
epochOutHash: Fr.random(),
|
|
170
185
|
slotNumber: SlotNumber(Math.floor(Math.random() * 1000) + 1),
|
|
171
186
|
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
172
187
|
coinbase: EthAddress.random(),
|
|
@@ -183,6 +198,7 @@ export class CheckpointHeader {
|
|
|
183
198
|
this.blockHeadersHash.isZero() &&
|
|
184
199
|
this.blobsHash.isZero() &&
|
|
185
200
|
this.inHash.isZero() &&
|
|
201
|
+
this.epochOutHash.isZero() &&
|
|
186
202
|
this.slotNumber === 0 &&
|
|
187
203
|
this.timestamp === 0n &&
|
|
188
204
|
this.coinbase.isZero() &&
|
|
@@ -210,6 +226,7 @@ export class CheckpointHeader {
|
|
|
210
226
|
Fr.fromString(header.blockHeadersHash),
|
|
211
227
|
Fr.fromString(header.blobsHash),
|
|
212
228
|
Fr.fromString(header.inHash),
|
|
229
|
+
Fr.fromString(header.outHash),
|
|
213
230
|
SlotNumber.fromBigInt(header.slotNumber),
|
|
214
231
|
header.timestamp,
|
|
215
232
|
new EthAddress(hexToBuffer(header.coinbase)),
|
|
@@ -233,6 +250,7 @@ export class CheckpointHeader {
|
|
|
233
250
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
234
251
|
blobsHash: this.blobsHash.toString(),
|
|
235
252
|
inHash: this.inHash.toString(),
|
|
253
|
+
outHash: this.epochOutHash.toString(),
|
|
236
254
|
slotNumber: BigInt(this.slotNumber),
|
|
237
255
|
timestamp: this.timestamp,
|
|
238
256
|
coinbase: this.coinbase.toString(),
|
|
@@ -251,6 +269,7 @@ export class CheckpointHeader {
|
|
|
251
269
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
252
270
|
blobsHash: this.blobsHash.toString(),
|
|
253
271
|
inHash: this.inHash.toString(),
|
|
272
|
+
epochOutHash: this.epochOutHash.toString(),
|
|
254
273
|
slotNumber: this.slotNumber,
|
|
255
274
|
timestamp: this.timestamp,
|
|
256
275
|
coinbase: this.coinbase.toString(),
|
|
@@ -266,6 +285,7 @@ export class CheckpointHeader {
|
|
|
266
285
|
blockHeadersHash: ${this.blockHeadersHash.toString()},
|
|
267
286
|
blobsHash: ${inspect(this.blobsHash)},
|
|
268
287
|
inHash: ${inspect(this.inHash)},
|
|
288
|
+
epochOutHash: ${inspect(this.epochOutHash)},
|
|
269
289
|
slotNumber: ${this.slotNumber},
|
|
270
290
|
timestamp: ${this.timestamp},
|
|
271
291
|
coinbase: ${this.coinbase.toString()},
|
|
@@ -28,13 +28,17 @@ export class CheckpointRollupPublicInputs {
|
|
|
28
28
|
*/
|
|
29
29
|
public newArchive: AppendOnlyTreeSnapshot,
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
31
|
+
* The out hash tree snapshot immediately before this checkpoint range.
|
|
32
32
|
*/
|
|
33
|
-
public
|
|
33
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
34
34
|
/**
|
|
35
|
-
* The
|
|
35
|
+
* The out hash tree snapshot after applying this checkpoint range.
|
|
36
36
|
*/
|
|
37
|
-
public
|
|
37
|
+
public newOutHash: AppendOnlyTreeSnapshot,
|
|
38
|
+
/**
|
|
39
|
+
* The hashes of the headers of the constituent checkpoints.
|
|
40
|
+
*/
|
|
41
|
+
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
38
42
|
/**
|
|
39
43
|
* The summed transaction fees and recipients of the constituent checkpoints.
|
|
40
44
|
*/
|
|
@@ -59,7 +63,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
59
63
|
reader.readObject(EpochConstantData),
|
|
60
64
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
61
65
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
62
|
-
reader.
|
|
66
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
63
68
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
64
69
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
|
|
65
70
|
reader.readObject(BlobAccumulator),
|
|
@@ -73,8 +78,9 @@ export class CheckpointRollupPublicInputs {
|
|
|
73
78
|
this.constants,
|
|
74
79
|
this.previousArchive,
|
|
75
80
|
this.newArchive,
|
|
81
|
+
this.previousOutHash,
|
|
82
|
+
this.newOutHash,
|
|
76
83
|
this.checkpointHeaderHashes,
|
|
77
|
-
this.outHashes,
|
|
78
84
|
this.fees,
|
|
79
85
|
this.startBlobAccumulator,
|
|
80
86
|
this.endBlobAccumulator,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
-
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
|
+
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, OUT_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -8,6 +8,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
10
|
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
11
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
12
|
import { BlockHeader } from '../tx/block_header.js';
|
|
12
13
|
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
13
14
|
|
|
@@ -21,6 +22,14 @@ export class CheckpointRootRollupHints {
|
|
|
21
22
|
* Hint for checking the hash of previous_block_header is the last leaf of the previous archive.
|
|
22
23
|
*/
|
|
23
24
|
public previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
25
|
+
/**
|
|
26
|
+
* The out hash tree snapshot immediately before this checkpoint.
|
|
27
|
+
*/
|
|
28
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
29
|
+
/**
|
|
30
|
+
* Hint for inserting the new out hash into the out hash tree.
|
|
31
|
+
*/
|
|
32
|
+
public newOutHashSiblingPath: Tuple<Fr, typeof OUT_HASH_TREE_HEIGHT>,
|
|
24
33
|
/**
|
|
25
34
|
* The current blob accumulation state across the epoch.
|
|
26
35
|
*/
|
|
@@ -54,6 +63,8 @@ export class CheckpointRootRollupHints {
|
|
|
54
63
|
return [
|
|
55
64
|
fields.previousBlockHeader,
|
|
56
65
|
fields.previousArchiveSiblingPath,
|
|
66
|
+
fields.previousOutHash,
|
|
67
|
+
fields.newOutHashSiblingPath,
|
|
57
68
|
fields.startBlobAccumulator,
|
|
58
69
|
fields.finalBlobChallenges,
|
|
59
70
|
fields.blobFields,
|
|
@@ -71,6 +82,8 @@ export class CheckpointRootRollupHints {
|
|
|
71
82
|
return new CheckpointRootRollupHints(
|
|
72
83
|
BlockHeader.fromBuffer(reader),
|
|
73
84
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
85
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
86
|
+
reader.readArray(OUT_HASH_TREE_HEIGHT, Fr),
|
|
74
87
|
reader.readObject(BlobAccumulator),
|
|
75
88
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
76
89
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
@@ -21,7 +21,10 @@ export class RootRollupPublicInputs {
|
|
|
21
21
|
public previousArchiveRoot: Fr,
|
|
22
22
|
/** Root of the archive tree after this rollup is processed */
|
|
23
23
|
public endArchiveRoot: Fr,
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Root of the balanced merkle tree consisting of the out hashes of all checkpoints in this epoch.
|
|
26
|
+
* The out hash of the first checkpoint in the epoch is inserted at index 0, the second at index 1, and so on.
|
|
27
|
+
*/
|
|
25
28
|
public outHash: Fr,
|
|
26
29
|
/** Hashes of checkpoint headers for this rollup. */
|
|
27
30
|
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
package/src/tests/factories.ts
CHANGED
|
@@ -87,7 +87,6 @@ import {
|
|
|
87
87
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
88
88
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
89
89
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
90
|
-
import { L2BlockHeader } from '../block/l2_block_header.js';
|
|
91
90
|
import type { L2Tips } from '../block/l2_block_source.js';
|
|
92
91
|
import {
|
|
93
92
|
type ContractClassPublic,
|
|
@@ -850,7 +849,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
850
849
|
makeEpochConstantData(seed),
|
|
851
850
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
852
851
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
853
|
-
|
|
852
|
+
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
853
|
+
makeAppendOnlyTreeSnapshot(seed + 0x350),
|
|
854
854
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x400),
|
|
855
855
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
856
856
|
makeBlobAccumulator(seed + 0x600),
|
|
@@ -910,40 +910,20 @@ export function makeBlockHeader(
|
|
|
910
910
|
});
|
|
911
911
|
}
|
|
912
912
|
|
|
913
|
-
export function
|
|
914
|
-
seed = 0,
|
|
915
|
-
blockNumber?: number,
|
|
916
|
-
slotNumber?: number,
|
|
917
|
-
overrides: Partial<FieldsOf<L2BlockHeader>> = {},
|
|
918
|
-
) {
|
|
919
|
-
return new L2BlockHeader(
|
|
920
|
-
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
921
|
-
overrides?.blobsHash ?? fr(seed + 0x200),
|
|
922
|
-
overrides?.inHash ?? fr(seed + 0x300),
|
|
923
|
-
overrides?.state ?? makeStateReference(seed + 0x600),
|
|
924
|
-
makeGlobalVariables((seed += 0x700), {
|
|
925
|
-
...(blockNumber !== undefined ? { blockNumber: BlockNumber(blockNumber) } : {}),
|
|
926
|
-
...(slotNumber !== undefined ? { slotNumber: SlotNumber(slotNumber) } : {}),
|
|
927
|
-
}),
|
|
928
|
-
new Fr(seed + 0x800),
|
|
929
|
-
new Fr(seed + 0x900),
|
|
930
|
-
new Fr(seed + 0xa00),
|
|
931
|
-
new Fr(seed + 0xb00),
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
export function makeCheckpointHeader(seed = 0) {
|
|
913
|
+
export function makeCheckpointHeader(seed = 0, overrides: Partial<FieldsOf<CheckpointHeader>> = {}) {
|
|
936
914
|
return CheckpointHeader.from({
|
|
937
915
|
lastArchiveRoot: fr(seed + 0x100),
|
|
938
916
|
blockHeadersHash: fr(seed + 0x150),
|
|
939
917
|
blobsHash: fr(seed + 0x200),
|
|
940
918
|
inHash: fr(seed + 0x210),
|
|
919
|
+
epochOutHash: fr(seed + 0x220),
|
|
941
920
|
slotNumber: SlotNumber(seed + 0x300),
|
|
942
921
|
timestamp: BigInt(seed + 0x400),
|
|
943
922
|
coinbase: makeEthAddress(seed + 0x500),
|
|
944
923
|
feeRecipient: makeAztecAddress(seed + 0x600),
|
|
945
924
|
gasFees: makeGasFees(seed + 0x700),
|
|
946
925
|
totalManaUsed: fr(seed + 0x800),
|
|
926
|
+
...overrides,
|
|
947
927
|
});
|
|
948
928
|
}
|
|
949
929
|
|
|
@@ -1759,7 +1739,7 @@ export function makeL2Tips(
|
|
|
1759
1739
|
? typeof checkpointNumber === 'number'
|
|
1760
1740
|
? CheckpointNumber(checkpointNumber)
|
|
1761
1741
|
: checkpointNumber
|
|
1762
|
-
: CheckpointNumber(bn);
|
|
1742
|
+
: CheckpointNumber.fromBlockNumber(bn);
|
|
1763
1743
|
const cph = checkpointHash ?? hash;
|
|
1764
1744
|
return {
|
|
1765
1745
|
proposed: { number: bn, hash },
|
package/src/tests/jest.ts
CHANGED
|
@@ -20,7 +20,7 @@ export function equalL2Blocks(a: any, b: any) {
|
|
|
20
20
|
// use a custom comparator because the blockHash property is lazily computed and one instance might not have it
|
|
21
21
|
return aAsL2Block.toBuffer().equals(bAsL2Block.toBuffer());
|
|
22
22
|
} else if (aAsL2Block || bAsL2Block) {
|
|
23
|
-
// one value is an
|
|
23
|
+
// one value is an L2Block and the other isn't. Definitely not equal.
|
|
24
24
|
return false;
|
|
25
25
|
} else {
|
|
26
26
|
// we don't know what they are, tell Jest to keep looking
|
package/src/tests/mocks.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
8
8
|
} from '@aztec/constants';
|
|
9
9
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
10
|
-
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
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';
|
|
@@ -22,8 +22,7 @@ import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
|
22
22
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
23
23
|
import { RevertCode } from '../avm/revert_code.js';
|
|
24
24
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
25
|
-
import {
|
|
26
|
-
import { L2Block } from '../block/l2_block.js';
|
|
25
|
+
import { CheckpointedL2Block, CommitteeAttestation, L2Block } from '../block/index.js';
|
|
27
26
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
28
27
|
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
29
28
|
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
@@ -76,9 +75,9 @@ import {
|
|
|
76
75
|
makeAvmCircuitInputs,
|
|
77
76
|
makeAztecAddress,
|
|
78
77
|
makeBlockHeader,
|
|
78
|
+
makeCheckpointHeader,
|
|
79
79
|
makeGas,
|
|
80
80
|
makeGlobalVariables,
|
|
81
|
-
makeL2BlockHeader,
|
|
82
81
|
makePrivateToPublicAccumulatedData,
|
|
83
82
|
makePrivateToRollupAccumulatedData,
|
|
84
83
|
makeProtocolContracts,
|
|
@@ -400,38 +399,47 @@ export async function mockCheckpointAndMessages(
|
|
|
400
399
|
{
|
|
401
400
|
startBlockNumber = BlockNumber(1),
|
|
402
401
|
numBlocks = 1,
|
|
402
|
+
blocks,
|
|
403
403
|
numTxsPerBlock = 1,
|
|
404
404
|
numL1ToL2Messages = 1,
|
|
405
405
|
makeBlockOptions = () => ({}),
|
|
406
406
|
previousArchive,
|
|
407
|
+
maxEffects,
|
|
407
408
|
...options
|
|
408
409
|
}: {
|
|
409
410
|
startBlockNumber?: BlockNumber;
|
|
410
411
|
numBlocks?: number;
|
|
411
412
|
numTxsPerBlock?: number;
|
|
412
413
|
numL1ToL2Messages?: number;
|
|
413
|
-
makeBlockOptions?: (blockNumber: BlockNumber) => Partial<Parameters<typeof
|
|
414
|
+
makeBlockOptions?: (blockNumber: BlockNumber) => Partial<Parameters<typeof L2Block.random>[1]>;
|
|
414
415
|
previousArchive?: AppendOnlyTreeSnapshot;
|
|
416
|
+
blocks?: L2Block[];
|
|
417
|
+
maxEffects?: number;
|
|
415
418
|
} & Partial<Parameters<typeof Checkpoint.random>[1]> &
|
|
416
|
-
Partial<Parameters<typeof
|
|
419
|
+
Partial<Parameters<typeof L2Block.random>[1]> = {},
|
|
417
420
|
) {
|
|
418
|
-
const slotNumber = options.slotNumber ?? SlotNumber(checkpointNumber * 10);
|
|
421
|
+
const slotNumber = options.slotNumber ?? SlotNumber(Number(checkpointNumber) * 10);
|
|
419
422
|
const blocksAndMessages = [];
|
|
420
423
|
// Track the previous block's archive to ensure consecutive blocks have consistent archive roots.
|
|
421
424
|
// The current block's header.lastArchive must equal the previous block's archive.
|
|
422
425
|
let lastArchive: AppendOnlyTreeSnapshot | undefined = previousArchive;
|
|
423
|
-
|
|
426
|
+
// Pass maxEffects via txOptions so it reaches TxEffect.random
|
|
427
|
+
const txOptions = maxEffects !== undefined ? { maxEffects } : {};
|
|
428
|
+
for (let i = 0; i < (blocks?.length ?? numBlocks); i++) {
|
|
424
429
|
const blockNumber = BlockNumber(startBlockNumber + i);
|
|
425
430
|
const { block, messages } = {
|
|
426
|
-
block:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
block:
|
|
432
|
+
blocks?.[i] ??
|
|
433
|
+
(await L2Block.random(blockNumber, {
|
|
434
|
+
checkpointNumber,
|
|
435
|
+
indexWithinCheckpoint: IndexWithinCheckpoint(i),
|
|
436
|
+
txsPerBlock: numTxsPerBlock,
|
|
437
|
+
txOptions,
|
|
438
|
+
slotNumber,
|
|
439
|
+
...options,
|
|
440
|
+
...makeBlockOptions(blockNumber),
|
|
441
|
+
...(lastArchive ? { lastArchive } : {}),
|
|
442
|
+
})),
|
|
435
443
|
messages: mockL1ToL2Messages(numL1ToL2Messages),
|
|
436
444
|
};
|
|
437
445
|
// Update lastArchive for the next block
|
|
@@ -489,7 +497,7 @@ export interface MakeConsensusPayloadOptions {
|
|
|
489
497
|
signer?: Secp256k1Signer;
|
|
490
498
|
attesterSigner?: Secp256k1Signer;
|
|
491
499
|
proposerSigner?: Secp256k1Signer;
|
|
492
|
-
header?:
|
|
500
|
+
header?: CheckpointHeader;
|
|
493
501
|
archive?: Fr;
|
|
494
502
|
txHashes?: TxHash[];
|
|
495
503
|
txs?: Tx[];
|
|
@@ -497,8 +505,8 @@ export interface MakeConsensusPayloadOptions {
|
|
|
497
505
|
|
|
498
506
|
export interface MakeBlockProposalOptions {
|
|
499
507
|
signer?: Secp256k1Signer;
|
|
500
|
-
blockHeader?:
|
|
501
|
-
indexWithinCheckpoint?:
|
|
508
|
+
blockHeader?: BlockHeader;
|
|
509
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
502
510
|
inHash?: Fr;
|
|
503
511
|
archiveRoot?: Fr;
|
|
504
512
|
txHashes?: TxHash[];
|
|
@@ -511,8 +519,8 @@ export interface MakeCheckpointProposalOptions {
|
|
|
511
519
|
archiveRoot?: Fr;
|
|
512
520
|
/** Options for the lastBlock - if undefined, no lastBlock is included */
|
|
513
521
|
lastBlock?: {
|
|
514
|
-
blockHeader?:
|
|
515
|
-
indexWithinCheckpoint?:
|
|
522
|
+
blockHeader?: BlockHeader;
|
|
523
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
516
524
|
txHashes?: TxHash[];
|
|
517
525
|
txs?: Tx[];
|
|
518
526
|
};
|
|
@@ -523,18 +531,18 @@ const makeAndSignConsensusPayload = (
|
|
|
523
531
|
domainSeparator: SignatureDomainSeparator,
|
|
524
532
|
options?: MakeConsensusPayloadOptions,
|
|
525
533
|
) => {
|
|
526
|
-
const header = options?.header ??
|
|
534
|
+
const header = options?.header ?? makeCheckpointHeader(1);
|
|
527
535
|
const { signer = Secp256k1Signer.random(), archive = Fr.random() } = options ?? {};
|
|
528
536
|
|
|
529
537
|
const payload = ConsensusPayload.fromFields({
|
|
530
|
-
header
|
|
538
|
+
header,
|
|
531
539
|
archive,
|
|
532
540
|
});
|
|
533
541
|
|
|
534
542
|
const hash = getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator);
|
|
535
543
|
const signature = signer.sign(hash);
|
|
536
544
|
|
|
537
|
-
return { blockNumber: header.
|
|
545
|
+
return { blockNumber: header.slotNumber, payload, signature };
|
|
538
546
|
};
|
|
539
547
|
|
|
540
548
|
export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
@@ -549,9 +557,8 @@ export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
|
549
557
|
};
|
|
550
558
|
|
|
551
559
|
export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<BlockProposal> => {
|
|
552
|
-
const
|
|
553
|
-
const
|
|
554
|
-
const indexWithinCheckpoint = options?.indexWithinCheckpoint ?? 0;
|
|
560
|
+
const blockHeader = options?.blockHeader ?? makeBlockHeader(1);
|
|
561
|
+
const indexWithinCheckpoint = options?.indexWithinCheckpoint ?? IndexWithinCheckpoint(0);
|
|
555
562
|
const inHash = options?.inHash ?? Fr.random();
|
|
556
563
|
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
557
564
|
const txHashes = options?.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random());
|
|
@@ -565,21 +572,21 @@ export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<B
|
|
|
565
572
|
archiveRoot,
|
|
566
573
|
txHashes,
|
|
567
574
|
txs,
|
|
568
|
-
|
|
575
|
+
(_payload, _context) => Promise.resolve(signer.signMessage(_payload)),
|
|
569
576
|
);
|
|
570
577
|
};
|
|
571
578
|
|
|
572
579
|
export const makeCheckpointProposal = (options?: MakeCheckpointProposalOptions): Promise<CheckpointProposal> => {
|
|
573
|
-
const
|
|
574
|
-
const checkpointHeader = options?.checkpointHeader ??
|
|
580
|
+
const blockHeader = options?.lastBlock?.blockHeader ?? makeBlockHeader(1);
|
|
581
|
+
const checkpointHeader = options?.checkpointHeader ?? makeCheckpointHeader(1);
|
|
575
582
|
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
576
583
|
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
577
584
|
|
|
578
585
|
// Build lastBlock info if provided
|
|
579
586
|
const lastBlockInfo = options?.lastBlock
|
|
580
587
|
? {
|
|
581
|
-
blockHeader
|
|
582
|
-
indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? 4, // Last block in a 5-block checkpoint
|
|
588
|
+
blockHeader,
|
|
589
|
+
indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? IndexWithinCheckpoint(4), // Last block in a 5-block checkpoint
|
|
583
590
|
txHashes: options.lastBlock.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random()),
|
|
584
591
|
txs: options.lastBlock.txs,
|
|
585
592
|
}
|
|
@@ -605,7 +612,7 @@ export type MakeCheckpointAttestationOptions = {
|
|
|
605
612
|
* Create a checkpoint attestation for testing
|
|
606
613
|
*/
|
|
607
614
|
export const makeCheckpointAttestation = (options: MakeCheckpointAttestationOptions = {}): CheckpointAttestation => {
|
|
608
|
-
const header = options.header ??
|
|
615
|
+
const header = options.header ?? makeCheckpointHeader(1);
|
|
609
616
|
const archive = options.archive ?? Fr.random();
|
|
610
617
|
const { signer, attesterSigner = signer, proposerSigner = signer } = options;
|
|
611
618
|
|
|
@@ -669,13 +676,20 @@ export const makeCheckpointAttestationFromCheckpoint = (
|
|
|
669
676
|
|
|
670
677
|
/**
|
|
671
678
|
* Create a checkpoint attestation from an L2Block
|
|
679
|
+
* Note: This is a compatibility function for tests. L2Block doesn't have a checkpoint header directly.
|
|
672
680
|
*/
|
|
673
681
|
export const makeCheckpointAttestationFromBlock = (
|
|
674
682
|
block: L2Block,
|
|
675
683
|
attesterSigner?: Secp256k1Signer,
|
|
676
684
|
proposerSigner?: Secp256k1Signer,
|
|
677
685
|
): CheckpointAttestation => {
|
|
678
|
-
|
|
686
|
+
// For L2Block, we create a minimal checkpoint header for testing purposes
|
|
687
|
+
const header = CheckpointHeader.empty({
|
|
688
|
+
lastArchiveRoot: block.header.lastArchive.root,
|
|
689
|
+
slotNumber: block.slot,
|
|
690
|
+
timestamp: block.timestamp,
|
|
691
|
+
blockHeadersHash: Fr.ZERO, // Would need to compute from block header hash
|
|
692
|
+
});
|
|
679
693
|
const archive = block.archive.root;
|
|
680
694
|
|
|
681
695
|
return makeCheckpointAttestation({ header, archive, attesterSigner, proposerSigner });
|
|
@@ -684,7 +698,7 @@ export const makeCheckpointAttestationFromBlock = (
|
|
|
684
698
|
export async function randomPublishedL2Block(
|
|
685
699
|
l2BlockNumber: number,
|
|
686
700
|
opts: { signers?: Secp256k1Signer[] } = {},
|
|
687
|
-
): Promise<
|
|
701
|
+
): Promise<CheckpointedL2Block> {
|
|
688
702
|
const block = await L2Block.random(BlockNumber(l2BlockNumber));
|
|
689
703
|
const l1 = L1PublishedData.fromFields({
|
|
690
704
|
blockNumber: BigInt(block.number),
|
|
@@ -693,15 +707,19 @@ export async function randomPublishedL2Block(
|
|
|
693
707
|
});
|
|
694
708
|
|
|
695
709
|
const signers = opts.signers ?? times(3, () => Secp256k1Signer.random());
|
|
710
|
+
const checkpoint = await Checkpoint.random(CheckpointNumber.fromBlockNumber(BlockNumber(l2BlockNumber)), {
|
|
711
|
+
numBlocks: 0,
|
|
712
|
+
});
|
|
713
|
+
checkpoint.blocks = [block];
|
|
696
714
|
const atts = signers.map(signer =>
|
|
697
715
|
makeCheckpointAttestation({
|
|
698
716
|
signer,
|
|
699
717
|
archive: block.archive.root,
|
|
700
|
-
header:
|
|
718
|
+
header: checkpoint.header,
|
|
701
719
|
}),
|
|
702
720
|
);
|
|
703
721
|
const attestations = atts.map(
|
|
704
722
|
(attestation, i) => new CommitteeAttestation(signers[i].address, attestation.signature),
|
|
705
723
|
);
|
|
706
|
-
return new
|
|
724
|
+
return new CheckpointedL2Block(CheckpointNumber.fromBlockNumber(BlockNumber(l2BlockNumber)), block, l1, attestations);
|
|
707
725
|
}
|
package/src/tx/block_header.ts
CHANGED
|
@@ -11,13 +11,14 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
11
11
|
import { inspect } from 'util';
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
|
|
14
|
+
import { BlockHash } from '../block/block_hash.js';
|
|
14
15
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
15
16
|
import { GlobalVariables } from './global_variables.js';
|
|
16
17
|
import { StateReference } from './state_reference.js';
|
|
17
18
|
|
|
18
19
|
/** A header of an L2 block. */
|
|
19
20
|
export class BlockHeader {
|
|
20
|
-
private _cachedHash?: Promise<
|
|
21
|
+
private _cachedHash?: Promise<BlockHash>;
|
|
21
22
|
|
|
22
23
|
constructor(
|
|
23
24
|
/** Snapshot of archive before the block is applied. */
|
|
@@ -161,13 +162,20 @@ export class BlockHeader {
|
|
|
161
162
|
return BlockHeader.fromBuffer(hexToBuffer(str));
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
hash(): Promise<
|
|
165
|
+
hash(): Promise<BlockHash> {
|
|
165
166
|
if (!this._cachedHash) {
|
|
166
|
-
this._cachedHash = poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH)
|
|
167
|
+
this._cachedHash = poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH).then(fr =>
|
|
168
|
+
BlockHash.fromField(fr),
|
|
169
|
+
);
|
|
167
170
|
}
|
|
168
171
|
return this._cachedHash;
|
|
169
172
|
}
|
|
170
173
|
|
|
174
|
+
/** Manually set the hash for this block header if already computed */
|
|
175
|
+
setHash(hashed: Fr) {
|
|
176
|
+
this._cachedHash = Promise.resolve(BlockHash.fromField(hashed));
|
|
177
|
+
}
|
|
178
|
+
|
|
171
179
|
static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
|
|
172
180
|
return BlockHeader.from({
|
|
173
181
|
lastArchive: AppendOnlyTreeSnapshot.random(),
|
|
@@ -2,7 +2,7 @@ import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { BlockHash } from '../block/block_hash.js';
|
|
6
6
|
import { type DataInBlock, dataInBlockSchemaFor, randomDataInBlock } from '../block/in_block.js';
|
|
7
7
|
import { TxEffect } from './tx_effect.js';
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ export function serializeIndexedTxEffect(effect: IndexedTxEffect): Buffer {
|
|
|
26
26
|
export function deserializeIndexedTxEffect(buffer: Buffer): IndexedTxEffect {
|
|
27
27
|
const reader = BufferReader.asReader(buffer);
|
|
28
28
|
|
|
29
|
-
const l2BlockHash = reader.readObject(
|
|
29
|
+
const l2BlockHash = reader.readObject(BlockHash);
|
|
30
30
|
const l2BlockNumber = BlockNumber(reader.readNumber());
|
|
31
31
|
const txIndexInBlock = reader.readNumber();
|
|
32
32
|
const data = reader.readObject(TxEffect);
|
|
@@ -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[],
|