@aztec/stdlib 3.0.0-nightly.20251126 → 3.0.0-nightly.20251128
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/abi.d.ts +83 -83
- package/dest/abi/authorization_selector.d.ts +1 -1
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/decoder.d.ts +1 -1
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/event_metadata_definition.d.ts +1 -1
- package/dest/abi/event_selector.d.ts +1 -1
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_call.d.ts +1 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +1 -1
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/index.d.ts +1 -1
- package/dest/abi/mocked_keys.d.ts +1 -1
- package/dest/abi/note_selector.d.ts +1 -1
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/selector.d.ts +1 -1
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/utils.d.ts +1 -1
- package/dest/auth_witness/auth_witness.d.ts +1 -2
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/index.d.ts +1 -1
- package/dest/avm/avm.d.ts +2413 -2419
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.d.ts +16 -43
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +171 -171
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +1654 -1654
- package/dest/avm/contract_storage_read.d.ts +1 -13
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +1 -13
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/index.d.ts +1 -1
- package/dest/avm/message_pack.d.ts +1 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +1 -3
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +1 -10
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +1 -10
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +4 -10
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.d.ts +1 -4
- 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/aztec-address/index.d.ts +1 -1
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/block/attestation_info.d.ts +3 -1
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -1
- package/dest/block/block_hash.d.ts +1 -1
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/body.d.ts +5 -2
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -2
- package/dest/block/in_block.d.ts +3 -11
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -1
- package/dest/block/l2_block.d.ts +8 -6
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +22 -1
- package/dest/block/l2_block_code_to_purge.d.ts +1 -1
- package/dest/block/l2_block_header.d.ts +1 -9
- package/dest/block/l2_block_header.d.ts.map +1 -1
- package/dest/block/l2_block_info.d.ts +9 -9
- package/dest/block/l2_block_new.d.ts +17 -6
- package/dest/block/l2_block_new.d.ts.map +1 -1
- package/dest/block/l2_block_new.js +22 -0
- package/dest/block/l2_block_number.d.ts +1 -1
- package/dest/block/l2_block_source.d.ts +8 -7
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.d.ts +1 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -6
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.d.ts +1 -1
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.d.ts +1 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/index.d.ts +1 -1
- package/dest/block/published_l2_block.d.ts +15 -28
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +12 -27
- package/dest/block/test/index.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/validate_block_result.d.ts +6 -178
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +4 -3
- package/dest/checkpoint/checkpoint.d.ts +20 -7
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +33 -8
- 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 +212 -0
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -0
- package/dest/checkpoint/published_checkpoint.js +71 -0
- package/dest/config/chain-config.d.ts +1 -1
- package/dest/config/index.d.ts +1 -1
- package/dest/config/node-rpc-config.d.ts +1 -1
- package/dest/contract/artifact_hash.d.ts +2 -2
- package/dest/contract/artifact_hash.d.ts.map +1 -1
- package/dest/contract/complete_address.d.ts +1 -4
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_address.d.ts +1 -1
- package/dest/contract/contract_class.d.ts +1 -1
- package/dest/contract/contract_class_id.d.ts +1 -1
- package/dest/contract/contract_class_metadata.d.ts +1 -1
- package/dest/contract/contract_deployment_data.d.ts +17 -17
- package/dest/contract/contract_deployment_data.d.ts.map +1 -1
- package/dest/contract/contract_function_dao.d.ts +1 -1
- package/dest/contract/contract_instance.d.ts +1 -1
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance_update.d.ts +1 -1
- package/dest/contract/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/contract_metadata.d.ts +1 -1
- package/dest/contract/deployment_info.d.ts +1 -1
- package/dest/contract/index.d.ts +1 -1
- package/dest/contract/interfaces/contract_class.d.ts +29 -29
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_data_source.d.ts +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +11 -11
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.d.ts +3 -3
- package/dest/contract/interfaces/index.d.ts +1 -1
- package/dest/contract/interfaces/node-info.d.ts +1 -1
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts +1 -1
- package/dest/contract/partial_address.d.ts +1 -1
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/utility_function_membership_proof.d.ts +1 -1
- package/dest/database-version/index.d.ts +1 -1
- package/dest/database-version/version_manager.d.ts +6 -8
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -1
- package/dest/delayed_public_mutable/index.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -1
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -1
- package/dest/epoch-helpers/index.d.ts +9 -8
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +4 -3
- package/dest/errors/index.d.ts +1 -1
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/errors/simulation_error.d.ts +1 -1
- package/dest/errors/simulation_error.d.ts.map +1 -1
- package/dest/fees/index.d.ts +1 -1
- package/dest/fees/transaction_fee.d.ts +1 -1
- package/dest/file-store/factory.d.ts +1 -1
- package/dest/file-store/gcs.d.ts +1 -1
- package/dest/file-store/gcs.d.ts.map +1 -1
- package/dest/file-store/http.d.ts +1 -1
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/index.d.ts +1 -1
- package/dest/file-store/interface.d.ts +1 -1
- package/dest/file-store/local.d.ts +1 -1
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/file-store/s3.d.ts +1 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/gas/gas.d.ts +1 -1
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas_fees.d.ts +1 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_settings.d.ts +1 -1
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_used.d.ts +1 -1
- package/dest/gas/index.d.ts +1 -1
- package/dest/hash/hash.d.ts +2 -2
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/index.d.ts +1 -1
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/interfaces/allowed_element.d.ts +5 -5
- package/dest/interfaces/api_limit.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +5 -4
- package/dest/interfaces/aztec-node-admin.d.ts +88 -88
- package/dest/interfaces/aztec-node.d.ts +1 -1
- package/dest/interfaces/block-builder.d.ts +1 -1
- package/dest/interfaces/client.d.ts +1 -1
- package/dest/interfaces/configs.d.ts +21 -21
- package/dest/interfaces/epoch-prover.d.ts +4 -3
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.d.ts +1 -1
- package/dest/interfaces/l2_logs_source.d.ts +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +1 -1
- package/dest/interfaces/p2p-bootstrap.d.ts +1 -1
- package/dest/interfaces/p2p.d.ts +1 -1
- package/dest/interfaces/private_kernel_prover.d.ts +1 -1
- package/dest/interfaces/processed-tx-handler.d.ts +1 -1
- package/dest/interfaces/prover-agent.d.ts +1 -1
- package/dest/interfaces/prover-broker.d.ts +1 -1
- package/dest/interfaces/prover-client.d.ts +5 -5
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-coordination.d.ts +1 -1
- package/dest/interfaces/prover-node.d.ts +1 -1
- package/dest/interfaces/proving-job-source.d.ts +1 -1
- package/dest/interfaces/proving-job.d.ts +1265 -1272
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +3 -2
- package/dest/interfaces/public_state_source.d.ts +1 -1
- package/dest/interfaces/server.d.ts +1 -1
- package/dest/interfaces/server_circuit_prover.d.ts +2 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/service.d.ts +1 -1
- package/dest/interfaces/slasher.d.ts +3 -3
- package/dest/interfaces/tx_provider.d.ts +1 -1
- package/dest/interfaces/validator.d.ts +21 -21
- package/dest/interfaces/world_state.d.ts +1 -1
- package/dest/kernel/claimed_length_array.d.ts +1 -1
- package/dest/kernel/claimed_length_array.d.ts.map +1 -1
- package/dest/kernel/hiding_kernel_private_inputs.d.ts +1 -1
- package/dest/kernel/hiding_kernel_private_inputs.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/build_transient_data_hints.d.ts +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +1 -1
- package/dest/kernel/hints/index.d.ts +1 -1
- package/dest/kernel/hints/key_validation_hint.d.ts +1 -2
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +1 -2
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +1 -6
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +1 -13
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +1 -7
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +1 -7
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts +1 -1
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/scoped_value_cache.d.ts +1 -1
- package/dest/kernel/hints/scoped_value_cache.d.ts.map +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts +1 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/note_hash.d.ts +1 -1
- package/dest/kernel/note_hash.d.ts.map +1 -1
- package/dest/kernel/nullifier.d.ts +1 -1
- package/dest/kernel/nullifier.d.ts.map +1 -1
- package/dest/kernel/padded_side_effects.d.ts +1 -1
- package/dest/kernel/padded_side_effects.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.d.ts +1 -23
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +1 -25
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_request.d.ts +1 -16
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +1 -74
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.d.ts +1 -1
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +1 -31
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.d.ts +1 -7
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -22
- 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 +1 -7
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +8 -8
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +1 -4
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +1 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_simulated_output.d.ts +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- 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 +1 -23
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_log_data.d.ts +1 -1
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +8 -8
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data_builder.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data_builder.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +1 -17
- 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 +1 -16
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +1 -10
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/public_call_request.d.ts +6 -27
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/utils/index.d.ts +1 -1
- package/dest/kernel/utils/interfaces.d.ts +1 -1
- package/dest/kernel/utils/optional_number.d.ts +1 -7
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.d.ts +1 -1
- package/dest/keys/derivation.d.ts +1 -1
- package/dest/keys/index.d.ts +1 -1
- package/dest/keys/key_types.d.ts +1 -1
- package/dest/keys/public_key.d.ts +1 -1
- package/dest/keys/public_keys.d.ts +1 -5
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/utils.d.ts +1 -1
- package/dest/l1-contracts/index.d.ts +1 -1
- package/dest/l1-contracts/slash_factory.d.ts +3 -3
- package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
- package/dest/logs/contract_class_log.d.ts +4 -4
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/debug_log.d.ts +1 -1
- package/dest/logs/debug_log.d.ts.map +1 -1
- package/dest/logs/directional_app_tagging_secret.d.ts +1 -1
- package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/extended_contract_class_log.d.ts +1 -3
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +2 -4
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/index.d.ts +1 -1
- package/dest/logs/log_filter.d.ts +1 -1
- package/dest/logs/log_id.d.ts +1 -4
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts +1 -1
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/message_context.d.ts +1 -1
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.d.ts +1 -1
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pre_tag.d.ts +1 -1
- package/dest/logs/private_log.d.ts +1 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/public_log.d.ts +1 -1
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.d.ts +1 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +8 -8
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/messaging/in_hash.d.ts +1 -1
- package/dest/messaging/inbox_leaf.d.ts +1 -3
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/index.d.ts +1 -1
- package/dest/messaging/l1_actor.d.ts +1 -7
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +1 -6
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message_source.d.ts +1 -1
- package/dest/messaging/l2_actor.d.ts +1 -7
- 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_message.d.ts +21 -21
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/out_hash.d.ts +1 -1
- package/dest/noir/index.d.ts +1 -1
- package/dest/note/comparator.d.ts +1 -1
- package/dest/note/index.d.ts +2 -2
- package/dest/note/index.d.ts.map +1 -1
- package/dest/note/index.js +1 -1
- package/dest/note/note.d.ts +1 -1
- package/dest/note/note.d.ts.map +1 -1
- package/dest/note/note_dao.d.ts +71 -0
- package/dest/note/note_dao.d.ts.map +1 -0
- package/dest/note/note_dao.js +101 -0
- package/dest/note/note_status.d.ts +1 -1
- package/dest/note/notes_filter.d.ts +1 -1
- package/dest/p2p/attestation_utils.d.ts +1 -1
- package/dest/p2p/block_attestation.d.ts +1 -4
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +1 -5
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/client_type.d.ts +1 -1
- package/dest/p2p/consensus_payload.d.ts +20 -21
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +4 -0
- package/dest/p2p/gossipable.d.ts +1 -1
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/index.d.ts +1 -1
- package/dest/p2p/interface.d.ts +1 -1
- package/dest/p2p/message_validator.d.ts +1 -1
- package/dest/p2p/peer_error.d.ts +1 -1
- package/dest/p2p/signature_utils.d.ts +1 -1
- package/dest/p2p/topic_type.d.ts +1 -1
- package/dest/parity/index.d.ts +1 -1
- package/dest/parity/parity_base_private_inputs.d.ts +1 -3
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +1 -4
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +1 -2
- 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/index.d.ts +1 -1
- package/dest/proofs/proof.d.ts +1 -4
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof_data.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.d.ts +1 -1
- package/dest/proofs/recursive_proof.d.ts +1 -10
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.d.ts +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +1 -34
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +1 -12
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +1 -45
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +1 -64
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +1 -10
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +2 -11
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +13 -2
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -25
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +1 -25
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.d.ts +1 -16
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/index.d.ts +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +1 -6
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +1 -3
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tree_snapshot_diff_hints.d.ts +1 -24
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +1 -29
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/index.d.ts +1 -1
- package/dest/schemas/schemas.d.ts +2 -2
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +4 -3
- package/dest/slashing/helpers.d.ts +4 -3
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +2 -1
- package/dest/slashing/index.d.ts +1 -1
- package/dest/slashing/interfaces.d.ts +1 -1
- package/dest/slashing/serialization.d.ts +1 -1
- package/dest/slashing/tally.d.ts +1 -1
- package/dest/slashing/types.d.ts +9 -9
- package/dest/snapshots/download.d.ts +1 -1
- package/dest/snapshots/index.d.ts +1 -1
- package/dest/snapshots/types.d.ts +18 -18
- package/dest/snapshots/upload.d.ts +1 -1
- package/dest/stats/index.d.ts +1 -1
- package/dest/stats/stats.d.ts +1 -1
- package/dest/tests/factories.d.ts +5 -8
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +8 -18
- package/dest/tests/fixtures.d.ts +1 -1
- package/dest/tests/index.d.ts +1 -1
- package/dest/tests/jest.d.ts +1 -1
- package/dest/tests/mocks.d.ts +37 -21
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +22 -18
- package/dest/trees/append_only_tree_snapshot.d.ts +1 -13
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/database_public_state_source.d.ts +1 -1
- package/dest/trees/database_public_state_source.d.ts.map +1 -1
- package/dest/trees/index.d.ts +1 -1
- package/dest/trees/merkle_tree_id.d.ts +5 -5
- package/dest/trees/merkle_tree_id.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.d.ts +1 -13
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +1 -10
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +12 -27
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +8 -18
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +2 -10
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +12 -1
- package/dest/tx/call_context.d.ts +6 -18
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +1 -4
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/content_commitment.d.ts +1 -1
- package/dest/tx/content_commitment.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +1 -9
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -6
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +1 -1
- package/dest/tx/global_variables.d.ts +10 -17
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +14 -0
- package/dest/tx/hashed_values.d.ts +1 -7
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/index.d.ts +1 -1
- package/dest/tx/indexed_tx_effect.d.ts +2 -2
- package/dest/tx/indexed_tx_effect.js +3 -1
- package/dest/tx/offchain_effect.d.ts +1 -1
- package/dest/tx/partial_state_reference.d.ts +1 -4
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +6 -28
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_tx_constant_data.d.ts +1 -16
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/processed_tx.d.ts +1 -1
- package/dest/tx/profiling.d.ts +35 -35
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.d.ts +2 -2
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/proven_tx.d.ts +18 -18
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.d.ts +1 -7
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.d.ts +1 -1
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/simulated_tx.d.ts +21 -21
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/state_reference.d.ts +7 -9
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.d.ts +7 -7
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +1 -16
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.d.ts +1 -1
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_context.d.ts +1 -2
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +12 -33
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +4 -2
- package/dest/tx/tx_execution_request.d.ts +1 -30
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_hash.d.ts +1 -2
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +1 -7
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_request.d.ts +1 -6
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/validator/empty_validator.d.ts +1 -1
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +1 -1
- package/dest/tx/validator/tx_validator.d.ts +5 -5
- package/dest/types/index.d.ts +1 -1
- package/dest/types/shared.d.ts +1 -4
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/update-checker/index.d.ts +1 -1
- package/dest/update-checker/update-checker.d.ts +2 -3
- package/dest/update-checker/update-checker.d.ts.map +1 -1
- package/dest/validators/errors.d.ts +1 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/index.d.ts +1 -1
- package/dest/validators/schemas.d.ts +184 -180
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +1 -1
- package/dest/validators/types.d.ts +3 -2
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/index.d.ts +1 -1
- package/dest/versioning/versioning.d.ts +1 -1
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/verification_key.d.ts +1 -22
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_data.d.ts +1 -7
- package/dest/vks/vk_data.d.ts.map +1 -1
- package/dest/world-state/index.d.ts +1 -1
- package/dest/world-state/world_state_revision.d.ts +7 -7
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +1 -1
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/block/attestation_info.ts +8 -1
- package/src/block/body.ts +9 -7
- package/src/block/l2_block.ts +27 -1
- package/src/block/l2_block_new.ts +28 -0
- package/src/block/l2_block_source.ts +7 -6
- package/src/block/published_l2_block.ts +14 -31
- package/src/block/validate_block_result.ts +9 -7
- package/src/checkpoint/checkpoint.ts +48 -7
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +91 -0
- package/src/epoch-helpers/index.ts +13 -11
- package/src/interfaces/archiver.ts +5 -4
- package/src/interfaces/epoch-prover.ts +3 -2
- package/src/interfaces/proving-job.ts +14 -5
- package/src/note/index.ts +1 -1
- package/src/note/note_dao.ts +151 -0
- package/src/p2p/consensus_payload.ts +6 -0
- package/src/rollup/checkpoint_header.ts +13 -12
- package/src/slashing/empire.ts +5 -3
- package/src/slashing/helpers.ts +6 -4
- package/src/tests/factories.ts +22 -21
- package/src/tests/mocks.ts +35 -27
- package/src/tx/block_header.ts +13 -1
- package/src/tx/global_variables.ts +15 -0
- package/src/tx/indexed_tx_effect.ts +1 -1
- package/src/tx/tx_effect.ts +27 -23
- package/src/validators/schemas.ts +1 -1
- package/src/validators/types.ts +2 -1
- package/dest/note/unique_note.d.ts +0 -39
- package/dest/note/unique_note.d.ts.map +0 -1
- package/dest/note/unique_note.js +0 -62
- package/src/note/unique_note.ts +0 -70
package/src/tests/factories.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
makeBlobAccumulator,
|
|
3
|
+
makeFinalBlobAccumulator,
|
|
4
|
+
makeFinalBlobBatchingChallenges,
|
|
5
|
+
makeSpongeBlob,
|
|
6
|
+
} from '@aztec/blob-lib/testing';
|
|
2
7
|
import {
|
|
3
8
|
ARCHIVE_HEIGHT,
|
|
4
9
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
@@ -77,7 +82,7 @@ import {
|
|
|
77
82
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
78
83
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
79
84
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
80
|
-
import { L2BlockHeader } from '../block/
|
|
85
|
+
import { L2BlockHeader } from '../block/l2_block_header.js';
|
|
81
86
|
import {
|
|
82
87
|
type ContractClassPublic,
|
|
83
88
|
ContractDeploymentData,
|
|
@@ -296,7 +301,12 @@ export function makeContractStorageRead(seed = 1): ContractStorageRead {
|
|
|
296
301
|
}
|
|
297
302
|
|
|
298
303
|
function makeTxConstantData(seed = 1) {
|
|
299
|
-
return new TxConstantData(
|
|
304
|
+
return new TxConstantData(
|
|
305
|
+
makeBlockHeader(seed),
|
|
306
|
+
makeTxContext(seed + 0x100),
|
|
307
|
+
new Fr(seed + 0x200),
|
|
308
|
+
new Fr(seed + 0x201),
|
|
309
|
+
);
|
|
300
310
|
}
|
|
301
311
|
|
|
302
312
|
function makePaddedTuple<T, N extends number>(
|
|
@@ -673,7 +683,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
673
683
|
endSideEffectCounter: fr(seed + 0x850),
|
|
674
684
|
expectedNonRevertibleSideEffectCounter: fr(seed + 0x860),
|
|
675
685
|
expectedRevertibleSideEffectCounter: fr(seed + 0x861),
|
|
676
|
-
anchorBlockHeader:
|
|
686
|
+
anchorBlockHeader: makeBlockHeader(seed + 0xd00),
|
|
677
687
|
txContext: makeTxContext(seed + 0x1400),
|
|
678
688
|
isFeePayer: false,
|
|
679
689
|
});
|
|
@@ -825,16 +835,15 @@ export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
|
825
835
|
}
|
|
826
836
|
|
|
827
837
|
export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
828
|
-
const startBlobAccumulator = makeBatchedBlobAccumulator(seed);
|
|
829
838
|
return new CheckpointRollupPublicInputs(
|
|
830
839
|
makeEpochConstantData(seed),
|
|
831
840
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
832
841
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
833
842
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
834
|
-
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed),
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
843
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x400),
|
|
844
|
+
makeBlobAccumulator(seed + 0x500),
|
|
845
|
+
makeBlobAccumulator(seed + 0x600),
|
|
846
|
+
makeFinalBlobBatchingChallenges(seed + 0x700),
|
|
838
847
|
);
|
|
839
848
|
}
|
|
840
849
|
|
|
@@ -869,7 +878,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
869
878
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
870
879
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
871
880
|
makeEpochConstantData(seed + 0x600),
|
|
872
|
-
|
|
881
|
+
makeFinalBlobAccumulator(seed + 0x700),
|
|
873
882
|
);
|
|
874
883
|
}
|
|
875
884
|
|
|
@@ -880,23 +889,15 @@ export function makeContentCommitment(seed = 0): ContentCommitment {
|
|
|
880
889
|
return new ContentCommitment(fr(seed + 0x100), fr(seed + 0x200), fr(seed + 0x300));
|
|
881
890
|
}
|
|
882
891
|
|
|
883
|
-
|
|
884
|
-
* Makes header.
|
|
885
|
-
*/
|
|
886
|
-
export function makeHeader(
|
|
892
|
+
export function makeBlockHeader(
|
|
887
893
|
seed = 0,
|
|
888
|
-
|
|
889
|
-
slotNumber: number | undefined = undefined,
|
|
890
|
-
overrides: Partial<FieldsOf<BlockHeader>> = {},
|
|
894
|
+
overrides: Partial<FieldsOf<Omit<BlockHeader, 'globalVariables'>>> & Partial<FieldsOf<GlobalVariables>> = {},
|
|
891
895
|
): BlockHeader {
|
|
892
896
|
return BlockHeader.from({
|
|
893
897
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
894
898
|
state: makeStateReference(seed + 0x200),
|
|
895
899
|
spongeBlobHash: fr(seed + 0x300),
|
|
896
|
-
globalVariables: makeGlobalVariables((seed += 0x700),
|
|
897
|
-
...(blockNumber ? { blockNumber } : {}),
|
|
898
|
-
...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
|
|
899
|
-
}),
|
|
900
|
+
globalVariables: makeGlobalVariables((seed += 0x700), overrides),
|
|
900
901
|
totalFees: fr(seed + 0x800),
|
|
901
902
|
totalManaUsed: fr(seed + 0x900),
|
|
902
903
|
...overrides,
|
package/src/tests/mocks.ts
CHANGED
|
@@ -17,10 +17,12 @@ import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
|
17
17
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
18
18
|
import { RevertCode } from '../avm/revert_code.js';
|
|
19
19
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
20
|
-
import { CommitteeAttestation,
|
|
20
|
+
import { CommitteeAttestation, L2BlockHeader } from '../block/index.js';
|
|
21
21
|
import { L2Block } from '../block/l2_block.js';
|
|
22
22
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
23
23
|
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
24
|
+
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
25
|
+
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
24
26
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
25
27
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
26
28
|
import { SerializableContractInstance } from '../contract/contract_instance.js';
|
|
@@ -40,8 +42,6 @@ import {
|
|
|
40
42
|
import { PrivateToAvmAccumulatedData } from '../kernel/private_to_avm_accumulated_data.js';
|
|
41
43
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
42
44
|
import { PublicCallRequestArrayLengths } from '../kernel/public_call_request.js';
|
|
43
|
-
import { Note } from '../note/note.js';
|
|
44
|
-
import { UniqueNote } from '../note/unique_note.js';
|
|
45
45
|
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
46
46
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
47
47
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
@@ -69,9 +69,9 @@ import { TxHash } from '../tx/tx_hash.js';
|
|
|
69
69
|
import {
|
|
70
70
|
makeAvmCircuitInputs,
|
|
71
71
|
makeAztecAddress,
|
|
72
|
+
makeBlockHeader,
|
|
72
73
|
makeGas,
|
|
73
74
|
makeGlobalVariables,
|
|
74
|
-
makeHeader,
|
|
75
75
|
makeL2BlockHeader,
|
|
76
76
|
makePrivateToPublicAccumulatedData,
|
|
77
77
|
makePrivateToRollupAccumulatedData,
|
|
@@ -82,16 +82,6 @@ import {
|
|
|
82
82
|
|
|
83
83
|
export const randomTxHash = (): TxHash => TxHash.random();
|
|
84
84
|
|
|
85
|
-
export const randomUniqueNote = async ({
|
|
86
|
-
note = Note.random(),
|
|
87
|
-
contractAddress = undefined,
|
|
88
|
-
txHash = randomTxHash(),
|
|
89
|
-
storageSlot = Fr.random(),
|
|
90
|
-
noteNonce = Fr.random(),
|
|
91
|
-
}: Partial<UniqueNote> = {}) => {
|
|
92
|
-
return new UniqueNote(note, contractAddress ?? (await AztecAddress.random()), storageSlot, txHash, noteNonce);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
85
|
export const mockTx = async (
|
|
96
86
|
seed = 1,
|
|
97
87
|
{
|
|
@@ -223,7 +213,7 @@ export async function mockProcessedTx({
|
|
|
223
213
|
privateOnly?: boolean;
|
|
224
214
|
} & Parameters<typeof mockTx>[1] = {}) {
|
|
225
215
|
seed *= 0x1000; // Avoid clashing with the previous mock values if seed only increases by 1.
|
|
226
|
-
anchorBlockHeader ??= db?.getInitialHeader() ??
|
|
216
|
+
anchorBlockHeader ??= db?.getInitialHeader() ?? makeBlockHeader(seed);
|
|
227
217
|
feePayer ??= makeAztecAddress(seed + 0x100);
|
|
228
218
|
feePaymentPublicDataWrite ??= makePublicDataWrite(seed + 0x200);
|
|
229
219
|
|
|
@@ -460,15 +450,15 @@ export const makeBlockProposal = (options?: MakeConsensusPayloadOptions): BlockP
|
|
|
460
450
|
};
|
|
461
451
|
|
|
462
452
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028)
|
|
463
|
-
export const makeBlockAttestation = (options
|
|
464
|
-
const header = options
|
|
453
|
+
export const makeBlockAttestation = (options: MakeConsensusPayloadOptions = {}): BlockAttestation => {
|
|
454
|
+
const header = options.header ?? makeL2BlockHeader(1);
|
|
465
455
|
const {
|
|
466
456
|
signer,
|
|
467
|
-
attesterSigner = signer
|
|
468
|
-
proposerSigner = signer
|
|
457
|
+
attesterSigner = signer,
|
|
458
|
+
proposerSigner = signer,
|
|
469
459
|
archive = Fr.random(),
|
|
470
460
|
stateReference = header.state,
|
|
471
|
-
} = options
|
|
461
|
+
} = options;
|
|
472
462
|
|
|
473
463
|
const payload = ConsensusPayload.fromFields({
|
|
474
464
|
header: header.toCheckpointHeader(),
|
|
@@ -476,15 +466,25 @@ export const makeBlockAttestation = (options?: MakeConsensusPayloadOptions): Blo
|
|
|
476
466
|
stateReference,
|
|
477
467
|
});
|
|
478
468
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const attestationSignature = attesterSigner.sign(attestationHash);
|
|
469
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
470
|
+
};
|
|
482
471
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
472
|
+
export const makeAttestationFromCheckpoint = (
|
|
473
|
+
checkpoint: Checkpoint,
|
|
474
|
+
attesterSigner?: Secp256k1Signer,
|
|
475
|
+
proposerSigner?: Secp256k1Signer,
|
|
476
|
+
): BlockAttestation => {
|
|
477
|
+
const header = checkpoint.header;
|
|
478
|
+
const archive = checkpoint.archive.root;
|
|
479
|
+
const stateReference = checkpoint.blocks.at(-1)!.header.state;
|
|
486
480
|
|
|
487
|
-
|
|
481
|
+
const payload = ConsensusPayload.fromFields({
|
|
482
|
+
header,
|
|
483
|
+
archive,
|
|
484
|
+
stateReference,
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
488
488
|
};
|
|
489
489
|
|
|
490
490
|
export const makeBlockAttestationFromBlock = (
|
|
@@ -502,6 +502,14 @@ export const makeBlockAttestationFromBlock = (
|
|
|
502
502
|
stateReference,
|
|
503
503
|
});
|
|
504
504
|
|
|
505
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
export const makeBlockAttestationFromPayload = (
|
|
509
|
+
payload: ConsensusPayload,
|
|
510
|
+
attesterSigner?: Secp256k1Signer,
|
|
511
|
+
proposerSigner?: Secp256k1Signer,
|
|
512
|
+
): BlockAttestation => {
|
|
505
513
|
// Sign as attester
|
|
506
514
|
const attestationHash = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockAttestation);
|
|
507
515
|
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
package/src/tx/block_header.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '@aztec/constants';
|
|
2
|
-
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
|
|
2
|
+
import { poseidon2HashWithSeparator, randomInt } from '@aztec/foundation/crypto';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
5
5
|
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
@@ -161,6 +161,18 @@ export class BlockHeader {
|
|
|
161
161
|
return poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
|
|
165
|
+
return BlockHeader.from({
|
|
166
|
+
lastArchive: AppendOnlyTreeSnapshot.random(),
|
|
167
|
+
state: StateReference.random(),
|
|
168
|
+
spongeBlobHash: Fr.random(),
|
|
169
|
+
globalVariables: GlobalVariables.random(overrides),
|
|
170
|
+
totalFees: new Fr(randomInt(100_000)),
|
|
171
|
+
totalManaUsed: new Fr(randomInt(100_000_000)),
|
|
172
|
+
...overrides,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
164
176
|
toInspect() {
|
|
165
177
|
return {
|
|
166
178
|
lastArchive: this.lastArchive.root.toString(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GLOBAL_VARIABLES_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { randomInt } from '@aztec/foundation/crypto';
|
|
2
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
5
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
@@ -195,6 +196,20 @@ export class GlobalVariables {
|
|
|
195
196
|
);
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
static random(overrides: Partial<FieldsOf<GlobalVariables>> = {}): GlobalVariables {
|
|
200
|
+
return GlobalVariables.from({
|
|
201
|
+
chainId: new Fr(randomInt(100_000)),
|
|
202
|
+
version: new Fr(randomInt(100_000)),
|
|
203
|
+
blockNumber: randomInt(100_000),
|
|
204
|
+
slotNumber: new Fr(randomInt(100_000)),
|
|
205
|
+
coinbase: EthAddress.random(),
|
|
206
|
+
feeRecipient: AztecAddress.fromField(Fr.random()),
|
|
207
|
+
gasFees: GasFees.random(),
|
|
208
|
+
timestamp: BigInt(randomInt(100_000_000)),
|
|
209
|
+
...overrides,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
198
213
|
toInspect() {
|
|
199
214
|
return {
|
|
200
215
|
chainId: this.chainId.toNumber(),
|
|
@@ -13,7 +13,7 @@ export function indexedTxSchema() {
|
|
|
13
13
|
|
|
14
14
|
export async function randomIndexedTxEffect(): Promise<IndexedTxEffect> {
|
|
15
15
|
return {
|
|
16
|
-
...randomInBlock(await TxEffect.random()),
|
|
16
|
+
...randomInBlock(await TxEffect.random({ numNullifiers: 1 + Math.floor(Math.random() * 64) })),
|
|
17
17
|
txIndexInBlock: Math.floor(Math.random() * 1000),
|
|
18
18
|
};
|
|
19
19
|
}
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
15
15
|
} from '@aztec/constants';
|
|
16
16
|
import { type FieldsOf, makeTuple, makeTupleAsync } from '@aztec/foundation/array';
|
|
17
|
+
import { randomInt } from '@aztec/foundation/crypto';
|
|
17
18
|
import { Fr } from '@aztec/foundation/fields';
|
|
18
19
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
19
20
|
import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -191,36 +192,39 @@ export class TxEffect {
|
|
|
191
192
|
return computeTxOutHash(this.l2ToL1Msgs);
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
static async random(
|
|
195
|
+
static async random({
|
|
196
|
+
numNoteHashes,
|
|
197
|
+
numNullifiers,
|
|
198
|
+
numL2ToL1Msgs,
|
|
199
|
+
numPublicDataWrites,
|
|
200
|
+
numPrivateLogs,
|
|
195
201
|
numPublicCallsPerTx = 3,
|
|
196
202
|
numPublicLogsPerCall = 1,
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
numContractClassLogs,
|
|
204
|
+
maxEffects,
|
|
205
|
+
}: {
|
|
206
|
+
numNoteHashes?: number;
|
|
207
|
+
numNullifiers?: number;
|
|
208
|
+
numL2ToL1Msgs?: number;
|
|
209
|
+
numPublicDataWrites?: number;
|
|
210
|
+
numPrivateLogs?: number;
|
|
211
|
+
numPublicCallsPerTx?: number;
|
|
212
|
+
numPublicLogsPerCall?: number;
|
|
213
|
+
numContractClassLogs?: number;
|
|
214
|
+
maxEffects?: number;
|
|
215
|
+
} = {}): Promise<TxEffect> {
|
|
216
|
+
const count = (max: number, num?: number) => num ?? Math.min(maxEffects ?? randomInt(max), max);
|
|
199
217
|
return new TxEffect(
|
|
200
218
|
RevertCode.random(),
|
|
201
219
|
TxHash.random(),
|
|
202
220
|
new Fr(Math.floor(Math.random() * 100_000)),
|
|
203
|
-
makeTuple(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
),
|
|
207
|
-
makeTuple(
|
|
208
|
-
maxEffects === undefined ? MAX_NULLIFIERS_PER_TX : Math.min(maxEffects, MAX_NULLIFIERS_PER_TX),
|
|
209
|
-
Fr.random,
|
|
210
|
-
),
|
|
211
|
-
makeTuple(
|
|
212
|
-
maxEffects === undefined ? MAX_L2_TO_L1_MSGS_PER_TX : Math.min(maxEffects, MAX_L2_TO_L1_MSGS_PER_TX),
|
|
213
|
-
Fr.random,
|
|
214
|
-
),
|
|
215
|
-
makeTuple(
|
|
216
|
-
maxEffects === undefined
|
|
217
|
-
? MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX
|
|
218
|
-
: Math.min(maxEffects, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX),
|
|
219
|
-
PublicDataWrite.random,
|
|
220
|
-
),
|
|
221
|
-
makeTuple(MAX_PRIVATE_LOGS_PER_TX, () => PrivateLog.random()),
|
|
221
|
+
makeTuple(count(MAX_NOTE_HASHES_PER_TX, numNoteHashes), Fr.random),
|
|
222
|
+
makeTuple(count(MAX_NULLIFIERS_PER_TX, numNullifiers), Fr.random),
|
|
223
|
+
makeTuple(count(MAX_L2_TO_L1_MSGS_PER_TX, numL2ToL1Msgs), Fr.random),
|
|
224
|
+
makeTuple(count(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, numPublicDataWrites), PublicDataWrite.random),
|
|
225
|
+
makeTuple(count(MAX_PRIVATE_LOGS_PER_TX, numPrivateLogs), () => PrivateLog.random()),
|
|
222
226
|
await Promise.all(new Array(numPublicCallsPerTx * numPublicLogsPerCall).fill(null).map(() => PublicLog.random())),
|
|
223
|
-
await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random),
|
|
227
|
+
await makeTupleAsync(count(MAX_CONTRACT_CLASS_LOGS_PER_TX, numContractClassLogs), ContractClassLog.random),
|
|
224
228
|
);
|
|
225
229
|
}
|
|
226
230
|
|
package/src/validators/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EpochNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
|
|
3
4
|
export type ValidatorStatusType = 'block' | 'attestation';
|
|
@@ -39,7 +40,7 @@ export type ValidatorsEpochPerformance = Record<`0x${string}`, { missed: number;
|
|
|
39
40
|
|
|
40
41
|
export type SingleValidatorStats = {
|
|
41
42
|
validator: ValidatorStats;
|
|
42
|
-
allTimeProvenPerformance: { missed: number; total: number; epoch:
|
|
43
|
+
allTimeProvenPerformance: { missed: number; total: number; epoch: EpochNumber }[];
|
|
43
44
|
lastProcessedSlot?: bigint;
|
|
44
45
|
initialSlot?: bigint;
|
|
45
46
|
slotWindow: number;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
4
|
-
import { type ZodFor } from '../schemas/index.js';
|
|
5
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
6
|
-
import { Note } from './note.js';
|
|
7
|
-
/**
|
|
8
|
-
* A note with contextual data and a nonce that makes it unique.
|
|
9
|
-
*/
|
|
10
|
-
export declare class UniqueNote {
|
|
11
|
-
/** The note as emitted from the Noir contract. */
|
|
12
|
-
note: Note;
|
|
13
|
-
/** The contract address this note is created in. */
|
|
14
|
-
contractAddress: AztecAddress;
|
|
15
|
-
/** The specific storage location of the note on the contract. */
|
|
16
|
-
storageSlot: Fr;
|
|
17
|
-
/** The hash of the tx the note was created in. */
|
|
18
|
-
txHash: TxHash;
|
|
19
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
20
|
-
noteNonce: Fr;
|
|
21
|
-
constructor(
|
|
22
|
-
/** The note as emitted from the Noir contract. */
|
|
23
|
-
note: Note,
|
|
24
|
-
/** The contract address this note is created in. */
|
|
25
|
-
contractAddress: AztecAddress,
|
|
26
|
-
/** The specific storage location of the note on the contract. */
|
|
27
|
-
storageSlot: Fr,
|
|
28
|
-
/** The hash of the tx the note was created in. */
|
|
29
|
-
txHash: TxHash,
|
|
30
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
31
|
-
noteNonce: Fr);
|
|
32
|
-
static get schema(): ZodFor<UniqueNote>;
|
|
33
|
-
toBuffer(): Buffer;
|
|
34
|
-
static random(): Promise<UniqueNote>;
|
|
35
|
-
static fromBuffer(buffer: Buffer | BufferReader): UniqueNote;
|
|
36
|
-
static fromString(str: string): UniqueNote;
|
|
37
|
-
toString(): `0x${string}`;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=unique_note.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unique_note.d.ts","sourceRoot":"","sources":["../../src/note/unique_note.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAK9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,qBAAa,UAAU;IAEnB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;;IATpB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGtB,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,CAYtC;IAED,QAAQ,IAAI,MAAM;WAIL,MAAM;IAInB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAY/C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;CAGT"}
|
package/dest/note/unique_note.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
|
-
import { schemas } from '../schemas/index.js';
|
|
7
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
8
|
-
import { Note } from './note.js';
|
|
9
|
-
/**
|
|
10
|
-
* A note with contextual data and a nonce that makes it unique.
|
|
11
|
-
*/ export class UniqueNote {
|
|
12
|
-
note;
|
|
13
|
-
contractAddress;
|
|
14
|
-
storageSlot;
|
|
15
|
-
txHash;
|
|
16
|
-
noteNonce;
|
|
17
|
-
constructor(/** The note as emitted from the Noir contract. */ note, /** The contract address this note is created in. */ contractAddress, /** The specific storage location of the note on the contract. */ storageSlot, /** The hash of the tx the note was created in. */ txHash, /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce){
|
|
18
|
-
this.note = note;
|
|
19
|
-
this.contractAddress = contractAddress;
|
|
20
|
-
this.storageSlot = storageSlot;
|
|
21
|
-
this.txHash = txHash;
|
|
22
|
-
this.noteNonce = noteNonce;
|
|
23
|
-
}
|
|
24
|
-
static get schema() {
|
|
25
|
-
return z.object({
|
|
26
|
-
note: Note.schema,
|
|
27
|
-
contractAddress: schemas.AztecAddress,
|
|
28
|
-
storageSlot: schemas.Fr,
|
|
29
|
-
txHash: TxHash.schema,
|
|
30
|
-
noteNonce: schemas.Fr
|
|
31
|
-
}).transform(({ note, contractAddress, storageSlot, txHash, noteNonce })=>{
|
|
32
|
-
return new UniqueNote(note, contractAddress, storageSlot, txHash, noteNonce);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
toBuffer() {
|
|
36
|
-
return serializeToBuffer([
|
|
37
|
-
this.note,
|
|
38
|
-
this.contractAddress,
|
|
39
|
-
this.storageSlot,
|
|
40
|
-
this.txHash,
|
|
41
|
-
this.noteNonce
|
|
42
|
-
]);
|
|
43
|
-
}
|
|
44
|
-
static async random() {
|
|
45
|
-
return new UniqueNote(Note.random(), await AztecAddress.random(), Fr.random(), TxHash.random(), Fr.random());
|
|
46
|
-
}
|
|
47
|
-
static fromBuffer(buffer) {
|
|
48
|
-
const reader = BufferReader.asReader(buffer);
|
|
49
|
-
const note = reader.readObject(Note);
|
|
50
|
-
const contractAddress = reader.readObject(AztecAddress);
|
|
51
|
-
const storageSlot = reader.readObject(Fr);
|
|
52
|
-
const txHash = reader.readObject(TxHash);
|
|
53
|
-
const noteNonce = reader.readObject(Fr);
|
|
54
|
-
return new UniqueNote(note, contractAddress, storageSlot, txHash, noteNonce);
|
|
55
|
-
}
|
|
56
|
-
static fromString(str) {
|
|
57
|
-
return UniqueNote.fromBuffer(hexToBuffer(str));
|
|
58
|
-
}
|
|
59
|
-
toString() {
|
|
60
|
-
return bufferToHex(this.toBuffer());
|
|
61
|
-
}
|
|
62
|
-
}
|
package/src/note/unique_note.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
-
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
|
|
7
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
|
-
import { type ZodFor, schemas } from '../schemas/index.js';
|
|
9
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
10
|
-
import { Note } from './note.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* A note with contextual data and a nonce that makes it unique.
|
|
14
|
-
*/
|
|
15
|
-
export class UniqueNote {
|
|
16
|
-
constructor(
|
|
17
|
-
/** The note as emitted from the Noir contract. */
|
|
18
|
-
public note: Note,
|
|
19
|
-
/** The contract address this note is created in. */
|
|
20
|
-
public contractAddress: AztecAddress,
|
|
21
|
-
/** The specific storage location of the note on the contract. */
|
|
22
|
-
public storageSlot: Fr,
|
|
23
|
-
/** The hash of the tx the note was created in. */
|
|
24
|
-
public txHash: TxHash,
|
|
25
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
26
|
-
public noteNonce: Fr,
|
|
27
|
-
) {}
|
|
28
|
-
|
|
29
|
-
static get schema(): ZodFor<UniqueNote> {
|
|
30
|
-
return z
|
|
31
|
-
.object({
|
|
32
|
-
note: Note.schema,
|
|
33
|
-
contractAddress: schemas.AztecAddress,
|
|
34
|
-
storageSlot: schemas.Fr,
|
|
35
|
-
txHash: TxHash.schema,
|
|
36
|
-
noteNonce: schemas.Fr,
|
|
37
|
-
})
|
|
38
|
-
.transform(({ note, contractAddress, storageSlot, txHash, noteNonce }) => {
|
|
39
|
-
return new UniqueNote(note, contractAddress, storageSlot, txHash, noteNonce);
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
toBuffer(): Buffer {
|
|
44
|
-
return serializeToBuffer([this.note, this.contractAddress, this.storageSlot, this.txHash, this.noteNonce]);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static async random() {
|
|
48
|
-
return new UniqueNote(Note.random(), await AztecAddress.random(), Fr.random(), TxHash.random(), Fr.random());
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
52
|
-
const reader = BufferReader.asReader(buffer);
|
|
53
|
-
|
|
54
|
-
const note = reader.readObject(Note);
|
|
55
|
-
const contractAddress = reader.readObject(AztecAddress);
|
|
56
|
-
const storageSlot = reader.readObject(Fr);
|
|
57
|
-
const txHash = reader.readObject(TxHash);
|
|
58
|
-
const noteNonce = reader.readObject(Fr);
|
|
59
|
-
|
|
60
|
-
return new UniqueNote(note, contractAddress, storageSlot, txHash, noteNonce);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
static fromString(str: string) {
|
|
64
|
-
return UniqueNote.fromBuffer(hexToBuffer(str));
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
toString() {
|
|
68
|
-
return bufferToHex(this.toBuffer());
|
|
69
|
-
}
|
|
70
|
-
}
|