@aztec/stdlib 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a
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 +121 -1197
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +31 -16
- package/dest/abi/authorization_selector.d.ts +2 -2
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +14 -7
- package/dest/abi/event_selector.d.ts +2 -2
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_call.d.ts +7 -25
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/note_selector.d.ts +2 -2
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/utils.d.ts +1 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +1 -1
- package/dest/auth_witness/auth_witness.d.ts +2 -2
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +1756 -10463
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +6 -3
- package/dest/avm/avm_accumulated_data.d.ts +22 -86
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +180 -932
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +653 -5446
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/message_pack.js +12 -3
- package/dest/avm/public_data_write.d.ts +6 -12
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/revert_code.d.ts +1 -7
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +0 -3
- package/dest/aztec-address/index.d.ts +6 -3
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +7 -2
- package/dest/block/attestation_info.d.ts +3 -2
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -5
- package/dest/block/block_data.d.ts +9 -34
- package/dest/block/block_data.d.ts.map +1 -1
- package/dest/block/block_parameter.d.ts +37 -4
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +53 -2
- package/dest/block/in_block.d.ts +5 -24
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -2
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -1
- package/dest/block/l2_block.d.ts +13 -41
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block_info.d.ts +7 -27
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_source.d.ts +199 -425
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +66 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +2 -2
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +44 -17
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +3 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +3 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +4 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +26 -7
- package/dest/block/proposal/attestations_and_signers.d.ts +19 -30
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +26 -18
- package/dest/block/proposal/committee_attestation.d.ts +6 -12
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +1 -1
- package/dest/checkpoint/checkpoint.d.ts +24 -96
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.d.ts +40 -129
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +2 -0
- package/dest/checkpoint/checkpoint_info.d.ts +7 -23
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +60 -0
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_reexecution_tracker.js +108 -0
- package/dest/checkpoint/digest.d.ts +18 -0
- package/dest/checkpoint/digest.d.ts.map +1 -0
- package/dest/checkpoint/digest.js +12 -0
- package/dest/checkpoint/index.d.ts +4 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +3 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts +33 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts.map +1 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.js +45 -0
- package/dest/checkpoint/published_checkpoint.d.ts +42 -194
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/config/chain-config.d.ts +4 -9
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +6 -11
- package/dest/config/index.d.ts +1 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +0 -1
- package/dest/config/sequencer-config.d.ts +5 -3
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +13 -6
- package/dest/contract/complete_address.d.ts +3 -2
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/complete_address.js +6 -2
- package/dest/contract/contract_address.d.ts +5 -5
- package/dest/contract/contract_address.d.ts.map +1 -1
- package/dest/contract/contract_address.js +5 -4
- package/dest/contract/contract_deployment_data.d.ts +15 -61
- package/dest/contract/contract_deployment_data.d.ts.map +1 -1
- package/dest/contract/contract_instance.d.ts +4 -2
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +10 -3
- package/dest/contract/interfaces/contract_class.d.ts +15 -86
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +41 -95
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +4 -2
- package/dest/contract/interfaces/contract_instance_update.d.ts +6 -26
- package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts +2 -12
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
- package/dest/database-version/database_version.d.ts +5 -11
- package/dest/database-version/database_version.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +6 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +12 -1
- package/dest/epoch-helpers/index.d.ts +4 -22
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/gas/gas.d.ts +9 -14
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +6 -3
- package/dest/gas/gas_fees.d.ts +9 -14
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +7 -3
- package/dest/gas/gas_settings.d.ts +27 -84
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +6 -3
- package/dest/ha-signing/config.d.ts +9 -73
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +5 -15
- package/dest/ha-signing/local_config.d.ts +3 -34
- package/dest/ha-signing/local_config.d.ts.map +1 -1
- package/dest/ha-signing/local_config.js +2 -2
- package/dest/hash/hash.d.ts +1 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +2 -2
- package/dest/interfaces/allowed_element.d.ts +4 -28
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/api_limit.d.ts +1 -1
- package/dest/interfaces/api_limit.js +1 -1
- package/dest/interfaces/archiver.d.ts +16 -36
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +211 -71
- package/dest/interfaces/aztec-node-admin.d.ts +62 -292
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +57 -14
- package/dest/interfaces/aztec-node-debug.js +4 -1
- package/dest/interfaces/aztec-node.d.ts +100 -106
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +308 -70
- package/dest/interfaces/block-builder.d.ts +3 -1
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block_response.d.ts +90 -0
- package/dest/interfaces/block_response.d.ts.map +1 -0
- package/dest/interfaces/block_response.js +30 -0
- package/dest/interfaces/chain_tips.d.ts +50 -0
- package/dest/interfaces/chain_tips.d.ts.map +1 -0
- package/dest/interfaces/chain_tips.js +11 -0
- package/dest/interfaces/checkpoint_parameter.d.ts +14 -0
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_parameter.js +18 -0
- package/dest/interfaces/checkpoint_response.d.ts +122 -0
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_response.js +26 -0
- package/dest/interfaces/client.d.ts +7 -2
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +6 -1
- package/dest/interfaces/configs.d.ts +41 -130
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +9 -1
- package/dest/interfaces/l1_publish_info.d.ts +29 -0
- package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
- package/dest/interfaces/l1_publish_info.js +26 -0
- package/dest/interfaces/l2_logs_source.d.ts +14 -36
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/l2_logs_source.js +5 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +9 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p-bootstrap.js +8 -2
- package/dest/interfaces/p2p.d.ts +15 -5
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +28 -5
- package/dest/interfaces/private_kernel_prover.d.ts +62 -2
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.d.ts +5 -23
- package/dest/interfaces/prover-agent.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.js +4 -1
- package/dest/interfaces/prover-client.d.ts +6 -27
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +22 -8
- package/dest/interfaces/proving-job-source.js +24 -4
- package/dest/interfaces/proving-job.d.ts +725 -5776
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +1 -1
- package/dest/interfaces/public_storage_override.d.ts +22 -0
- package/dest/interfaces/public_storage_override.d.ts.map +1 -0
- package/dest/interfaces/public_storage_override.js +7 -0
- package/dest/interfaces/server.d.ts +6 -1
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +5 -0
- package/dest/interfaces/slasher.d.ts +25 -56
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +8 -2
- package/dest/interfaces/tx_provider.d.ts +6 -1
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +40 -229
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +5 -0
- package/dest/interfaces/world_state.d.ts +2 -2
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +12 -8
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.js +20 -18
- package/dest/kernel/index.d.ts +5 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +4 -0
- package/dest/kernel/log_hash.d.ts +6 -2
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +21 -9
- package/dest/kernel/private_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +23 -0
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +35 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +24 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +37 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts +16 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.js +23 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts +17 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.js +25 -0
- package/dest/kernel/private_kernel_prover_output.d.ts +3 -29
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +9 -6
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +22 -7
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +25 -69
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +11 -5
- package/dest/kernel/private_to_public_accumulated_data.d.ts +4 -3
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data.js +6 -3
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +5 -4
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -3
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +5 -4
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +6 -3
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +5 -4
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -3
- package/dest/kernel/public_call_request.d.ts +15 -30
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +16 -7
- package/dest/keys/derivation.d.ts +6 -2
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +16 -6
- package/dest/keys/public_key.d.ts +22 -3
- package/dest/keys/public_key.d.ts.map +1 -1
- package/dest/keys/public_key.js +20 -1
- package/dest/keys/public_keys.d.ts +55 -82
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +102 -74
- package/dest/kv-store/config.d.ts +3 -6
- package/dest/kv-store/config.d.ts.map +1 -1
- package/dest/kv-store/config.js +2 -7
- package/dest/logs/app_tagging_secret.d.ts +46 -0
- package/dest/logs/app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/{extended_directional_app_tagging_secret.js → app_tagging_secret.js} +51 -21
- package/dest/logs/app_tagging_secret_kind.d.ts +7 -0
- package/dest/logs/app_tagging_secret_kind.d.ts.map +1 -0
- package/dest/logs/app_tagging_secret_kind.js +17 -0
- package/dest/logs/contract_class_log.d.ts +16 -34
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +11 -9
- package/dest/logs/index.d.ts +7 -7
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +6 -6
- package/dest/logs/log_cursor.d.ts +51 -0
- package/dest/logs/log_cursor.d.ts.map +1 -0
- package/dest/logs/log_cursor.js +82 -0
- package/dest/logs/log_result.d.ts +54 -0
- package/dest/logs/log_result.d.ts.map +1 -0
- package/dest/logs/log_result.js +56 -0
- package/dest/logs/logs_query.d.ts +82 -0
- package/dest/logs/logs_query.d.ts.map +1 -0
- package/dest/logs/logs_query.js +50 -0
- package/dest/logs/message_context.d.ts +3 -2
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +4 -0
- package/dest/logs/pre_tag.d.ts +11 -24
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/private_log.d.ts +7 -12
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +6 -3
- package/dest/logs/query_all_logs_by_tags.d.ts +24 -0
- package/dest/logs/query_all_logs_by_tags.d.ts.map +1 -0
- package/dest/logs/query_all_logs_by_tags.js +64 -0
- package/dest/logs/siloed_tag.d.ts +1 -1
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +3 -1
- package/dest/logs/tagging_index_range.d.ts +13 -31
- package/dest/logs/tagging_index_range.d.ts.map +1 -1
- package/dest/logs/tagging_index_range.js +2 -2
- package/dest/messaging/append_l1_to_l2_messages.d.ts +9 -0
- package/dest/messaging/append_l1_to_l2_messages.d.ts.map +1 -0
- package/dest/messaging/append_l1_to_l2_messages.js +12 -0
- package/dest/messaging/index.d.ts +2 -1
- package/dest/messaging/index.d.ts.map +1 -1
- package/dest/messaging/index.js +1 -0
- package/dest/messaging/l2_to_l1_membership.d.ts +43 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +72 -12
- package/dest/messaging/l2_to_l1_message.d.ts +38 -112
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +21 -12
- package/dest/noir/index.d.ts +3 -1
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/note.d.ts +2 -2
- package/dest/note/note.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +29 -10
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +56 -33
- package/dest/p2p/checkpoint_attestation.d.ts +14 -6
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +24 -20
- package/dest/p2p/checkpoint_proposal.d.ts +31 -10
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +58 -31
- package/dest/p2p/consensus_payload.d.ts +26 -20
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +38 -19
- package/dest/p2p/signature_utils.d.ts +28 -19
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +118 -21
- package/dest/p2p/signed_txs.d.ts +15 -13
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +26 -24
- package/dest/parity/parity_base_private_inputs.d.ts +8 -4
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +7 -5
- package/dest/parity/parity_public_inputs.d.ts +8 -4
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +6 -3
- package/dest/parity/parity_root_private_inputs.d.ts +2 -2
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +17 -11
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +44 -22
- package/dest/proofs/recursive_proof.d.ts +2 -2
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +12 -2
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +12 -0
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +6 -6
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +9 -2
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +9 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +5 -5
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +2 -2
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts +2 -2
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +2 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +2 -2
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +32 -78
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +2 -2
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +10 -7
- package/dest/slashing/types.d.ts +15 -23
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +16 -10
- package/dest/snapshots/types.d.ts +15 -78
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +23 -23
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +70 -47
- package/dest/tests/mocks.d.ts +8 -5
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +31 -38
- package/dest/timetable/index.d.ts +7 -10
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +60 -80
- package/dest/trees/append_only_tree_snapshot.d.ts +9 -14
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +6 -3
- package/dest/trees/nullifier_leaf.d.ts +18 -42
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +16 -59
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +2 -14
- package/dest/trees/public_data_leaf.d.ts +21 -53
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +16 -58
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +4 -3
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +6 -3
- package/dest/tx/call_context.d.ts +4 -14
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +2 -2
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -10
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +16 -49
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +8 -12
- package/dest/tx/hashed_values.d.ts +4 -3
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/hashed_values.js +6 -3
- package/dest/tx/in_tx.d.ts +5 -17
- package/dest/tx/in_tx.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.d.ts +8 -19
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +8 -4
- package/dest/tx/partial_state_reference.d.ts +22 -65
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +6 -3
- package/dest/tx/private_execution_result.d.ts +6 -16
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +54 -352
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +4 -4
- package/dest/tx/protocol_contracts.d.ts +5 -9
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/proven_tx.d.ts +30 -74
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +6 -0
- package/dest/tx/public_call_request_with_calldata.d.ts +4 -3
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +6 -3
- package/dest/tx/simulated_tx.d.ts +62 -1249
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +12 -10
- package/dest/tx/state_reference.d.ts +30 -117
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +6 -4
- package/dest/tx/tree_snapshots.d.ts +27 -84
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.js +6 -4
- package/dest/tx/tx.d.ts +12 -11
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +30 -23
- package/dest/tx/tx_constant_data.d.ts +4 -3
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +6 -3
- package/dest/tx/tx_context.d.ts +32 -131
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_context.js +6 -6
- package/dest/tx/tx_hash.d.ts +6 -4
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_hash.js +13 -5
- package/dest/tx/tx_receipt.d.ts +144 -67
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +141 -51
- package/dest/tx/validator/tx_validator.d.ts +5 -27
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +0 -4
- package/dest/types/shared.d.ts +4 -3
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +6 -3
- package/dest/update-checker/dev_version.d.ts +3 -0
- package/dest/update-checker/dev_version.d.ts.map +1 -0
- package/dest/update-checker/dev_version.js +1 -0
- package/dest/update-checker/index.d.ts +2 -1
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +1 -0
- package/dest/update-checker/package_version.d.ts +6 -3
- package/dest/update-checker/package_version.d.ts.map +1 -1
- package/dest/update-checker/package_version.js +8 -19
- package/dest/validators/schemas.d.ts +147 -614
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +6 -4
- package/dest/validators/types.d.ts +20 -3
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/versioning.js +1 -1
- package/dest/vks/verification_key.d.ts +3 -3
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/world-state/genesis_data.d.ts +3 -1
- package/dest/world-state/genesis_data.d.ts.map +1 -1
- package/dest/world-state/genesis_data.js +3 -0
- package/dest/world-state/world_state_revision.d.ts +4 -39
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +0 -20
- package/package.json +12 -11
- package/src/abi/abi.ts +53 -19
- package/src/abi/contract_artifact.ts +11 -6
- package/src/abi/utils.ts +6 -4
- package/src/avm/avm.ts +5 -0
- package/src/avm/message_pack.ts +12 -3
- package/src/avm/revert_code.ts +0 -6
- package/src/aztec-address/index.ts +12 -3
- package/src/block/attestation_info.ts +11 -11
- package/src/block/block_parameter.ts +72 -4
- package/src/block/index.ts +0 -1
- package/src/block/l2_block_source.ts +201 -149
- package/src/block/l2_block_stream/l2_block_stream.ts +39 -28
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +5 -0
- package/src/block/l2_block_stream/l2_tips_store_base.ts +29 -7
- package/src/block/proposal/attestations_and_signers.ts +32 -17
- package/src/block/test/l2_tips_store_test_suite.ts +1 -1
- package/src/checkpoint/checkpoint_data.ts +4 -0
- package/src/checkpoint/checkpoint_reexecution_tracker.ts +167 -0
- package/src/checkpoint/digest.ts +28 -0
- package/src/checkpoint/index.ts +3 -0
- package/src/checkpoint/previous_checkpoint_out_hashes.ts +61 -0
- package/src/config/chain-config.ts +6 -15
- package/src/config/index.ts +0 -1
- package/src/config/sequencer-config.ts +25 -7
- package/src/contract/complete_address.ts +7 -3
- package/src/contract/contract_address.ts +6 -6
- package/src/contract/contract_instance.ts +11 -2
- package/src/contract/interfaces/contract_instance.ts +6 -2
- package/src/database-version/version_manager.ts +17 -0
- package/src/gas/gas.ts +8 -3
- package/src/gas/gas_fees.ts +9 -9
- package/src/gas/gas_settings.ts +8 -3
- package/src/ha-signing/config.ts +9 -16
- package/src/ha-signing/local_config.ts +2 -2
- package/src/hash/hash.ts +2 -2
- package/src/interfaces/api_limit.ts +1 -1
- package/src/interfaces/archiver.ts +80 -94
- package/src/interfaces/aztec-node-admin.ts +32 -15
- package/src/interfaces/aztec-node-debug.ts +1 -1
- package/src/interfaces/aztec-node.ts +296 -262
- package/src/interfaces/block-builder.ts +2 -0
- package/src/interfaces/block_response.ts +92 -0
- package/src/interfaces/chain_tips.ts +24 -0
- package/src/interfaces/checkpoint_parameter.ts +20 -0
- package/src/interfaces/checkpoint_response.ts +84 -0
- package/src/interfaces/client.ts +6 -1
- package/src/interfaces/configs.ts +40 -1
- package/src/interfaces/l1_publish_info.ts +40 -0
- package/src/interfaces/l2_logs_source.ts +13 -42
- package/src/interfaces/merkle_tree_operations.ts +9 -2
- package/src/interfaces/p2p-bootstrap.ts +2 -2
- package/src/interfaces/p2p.ts +35 -15
- package/src/interfaces/private_kernel_prover.ts +88 -0
- package/src/interfaces/prover-agent.ts +1 -1
- package/src/interfaces/prover-node.ts +7 -7
- package/src/interfaces/proving-job-source.ts +4 -4
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/public_storage_override.ts +26 -0
- package/src/interfaces/server.ts +5 -0
- package/src/interfaces/slasher.ts +17 -4
- package/src/interfaces/tx_provider.ts +6 -0
- package/src/interfaces/validator.ts +18 -2
- package/src/interfaces/world_state.ts +1 -1
- package/src/kernel/hints/key_validation_request.ts +18 -16
- package/src/kernel/index.ts +4 -0
- package/src/kernel/log_hash.ts +29 -9
- package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +49 -0
- package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +52 -0
- package/src/kernel/private_kernel_inner_2_circuit_private_inputs.ts +29 -0
- package/src/kernel/private_kernel_inner_3_circuit_private_inputs.ts +31 -0
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +29 -14
- package/src/kernel/private_to_avm_accumulated_data.ts +16 -5
- package/src/kernel/private_to_public_accumulated_data.ts +9 -3
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +10 -4
- package/src/kernel/private_to_rollup_accumulated_data.ts +8 -3
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +9 -9
- package/src/kernel/public_call_request.ts +22 -7
- package/src/keys/derivation.ts +21 -9
- package/src/keys/public_key.ts +26 -2
- package/src/keys/public_keys.ts +124 -110
- package/src/kv-store/config.ts +3 -10
- package/src/logs/{extended_directional_app_tagging_secret.ts → app_tagging_secret.ts} +62 -23
- package/src/logs/app_tagging_secret_kind.ts +21 -0
- package/src/logs/contract_class_log.ts +15 -5
- package/src/logs/index.ts +6 -6
- package/src/logs/log_cursor.ts +110 -0
- package/src/logs/log_result.ts +104 -0
- package/src/logs/logs_query.ts +138 -0
- package/src/logs/message_context.ts +5 -1
- package/src/logs/pre_tag.ts +3 -6
- package/src/logs/private_log.ts +9 -3
- package/src/logs/query_all_logs_by_tags.ts +98 -0
- package/src/logs/siloed_tag.ts +6 -1
- package/src/logs/tagging_index_range.ts +4 -10
- package/src/messaging/append_l1_to_l2_messages.ts +21 -0
- package/src/messaging/index.ts +1 -0
- package/src/messaging/l2_to_l1_membership.ts +108 -19
- package/src/messaging/l2_to_l1_message.ts +29 -9
- package/src/noir/index.ts +2 -0
- package/src/p2p/block_proposal.ts +99 -28
- package/src/p2p/checkpoint_attestation.ts +26 -26
- package/src/p2p/checkpoint_proposal.ts +109 -39
- package/src/p2p/consensus_payload.ts +59 -28
- package/src/p2p/signature_utils.ts +110 -25
- package/src/p2p/signed_txs.ts +46 -28
- package/src/parity/parity_base_private_inputs.ts +10 -4
- package/src/parity/parity_public_inputs.ts +9 -2
- package/src/proofs/chonk_proof.ts +49 -15
- package/src/rollup/block_rollup_public_inputs.ts +13 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +10 -0
- package/src/schemas/schemas.ts +6 -1
- package/src/slashing/helpers.ts +13 -9
- package/src/slashing/types.ts +21 -14
- package/src/stats/stats.ts +4 -0
- package/src/tests/factories.ts +97 -68
- package/src/tests/mocks.ts +49 -57
- package/src/timetable/index.ts +63 -105
- package/src/trees/append_only_tree_snapshot.ts +8 -3
- package/src/trees/nullifier_membership_witness.ts +2 -12
- package/src/tx/block_header.ts +8 -3
- package/src/tx/global_variables.ts +10 -18
- package/src/tx/hashed_values.ts +8 -3
- package/src/tx/indexed_tx_effect.ts +17 -4
- package/src/tx/partial_state_reference.ts +8 -3
- package/src/tx/profiling.ts +4 -4
- package/src/tx/proven_tx.ts +6 -0
- package/src/tx/public_call_request_with_calldata.ts +8 -3
- package/src/tx/simulated_tx.ts +18 -21
- package/src/tx/state_reference.ts +9 -4
- package/src/tx/tree_snapshots.ts +9 -4
- package/src/tx/tx.ts +41 -22
- package/src/tx/tx_constant_data.ts +8 -3
- package/src/tx/tx_context.ts +8 -3
- package/src/tx/tx_hash.ts +20 -5
- package/src/tx/tx_receipt.ts +263 -80
- package/src/tx/validator/tx_validator.ts +1 -5
- package/src/types/shared.ts +8 -3
- package/src/update-checker/dev_version.ts +2 -0
- package/src/update-checker/index.ts +1 -0
- package/src/update-checker/package_version.ts +10 -23
- package/src/validators/schemas.ts +6 -4
- package/src/validators/types.ts +21 -2
- package/src/versioning/versioning.ts +1 -1
- package/src/world-state/genesis_data.ts +12 -0
- package/src/world-state/world_state_revision.ts +0 -33
- package/dest/block/checkpointed_l2_block.d.ts +0 -150
- package/dest/block/checkpointed_l2_block.d.ts.map +0 -1
- package/dest/block/checkpointed_l2_block.js +0 -46
- package/dest/config/pipelining-config.d.ts +0 -19
- package/dest/config/pipelining-config.d.ts.map +0 -1
- package/dest/config/pipelining-config.js +0 -18
- package/dest/interfaces/get_logs_response.d.ts +0 -97
- package/dest/interfaces/get_logs_response.d.ts.map +0 -1
- package/dest/interfaces/get_logs_response.js +0 -12
- package/dest/logs/extended_contract_class_log.d.ts +0 -51
- package/dest/logs/extended_contract_class_log.d.ts.map +0 -1
- package/dest/logs/extended_contract_class_log.js +0 -67
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +0 -47
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +0 -1
- package/dest/logs/extended_public_log.d.ts +0 -106
- package/dest/logs/extended_public_log.d.ts.map +0 -1
- package/dest/logs/extended_public_log.js +0 -73
- package/dest/logs/log_filter.d.ts +0 -25
- package/dest/logs/log_filter.d.ts.map +0 -1
- package/dest/logs/log_filter.js +0 -12
- package/dest/logs/log_id.d.ts +0 -85
- package/dest/logs/log_id.d.ts.map +0 -1
- package/dest/logs/log_id.js +0 -93
- package/dest/logs/tx_scoped_l2_log.d.ts +0 -51
- package/dest/logs/tx_scoped_l2_log.d.ts.map +0 -1
- package/dest/logs/tx_scoped_l2_log.js +0 -77
- package/src/block/checkpointed_l2_block.ts +0 -70
- package/src/config/pipelining-config.ts +0 -31
- package/src/interfaces/get_logs_response.ts +0 -35
- package/src/logs/extended_contract_class_log.ts +0 -87
- package/src/logs/extended_public_log.ts +0 -94
- package/src/logs/log_filter.ts +0 -36
- package/src/logs/log_id.ts +0 -124
- package/src/logs/tx_scoped_l2_log.ts +0 -114
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { times } from '@aztec/foundation/collection';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
-
import { schemas as foundationSchemas } from '@aztec/foundation/schemas';
|
|
5
|
-
import { BufferReader, bigintToUInt64BE, numToUInt32BE, serializeArrayOfBufferableToVector } from '@aztec/foundation/serialize';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { schemas } from '../schemas/schemas.js';
|
|
8
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
9
|
-
export class TxScopedL2Log {
|
|
10
|
-
txHash;
|
|
11
|
-
blockNumber;
|
|
12
|
-
blockTimestamp;
|
|
13
|
-
logData;
|
|
14
|
-
noteHashes;
|
|
15
|
-
firstNullifier;
|
|
16
|
-
constructor(/*
|
|
17
|
-
* Hash of the tx where the log is included
|
|
18
|
-
*/ txHash, /*
|
|
19
|
-
* The block this log is included in
|
|
20
|
-
*/ blockNumber, /*
|
|
21
|
-
* The timestamp of the block this log is included in
|
|
22
|
-
*/ blockTimestamp, /*
|
|
23
|
-
* The log data as an array of field elements
|
|
24
|
-
*/ logData, /*
|
|
25
|
-
* The note hashes from the tx effect
|
|
26
|
-
*/ noteHashes, /*
|
|
27
|
-
* The first nullifier from the tx effect. Used for nonce discovery when processing notes from logs.
|
|
28
|
-
*
|
|
29
|
-
* (Note nonces are computed as `hash(firstNullifier, noteIndexInTx)`.)
|
|
30
|
-
*/ firstNullifier){
|
|
31
|
-
this.txHash = txHash;
|
|
32
|
-
this.blockNumber = blockNumber;
|
|
33
|
-
this.blockTimestamp = blockTimestamp;
|
|
34
|
-
this.logData = logData;
|
|
35
|
-
this.noteHashes = noteHashes;
|
|
36
|
-
this.firstNullifier = firstNullifier;
|
|
37
|
-
}
|
|
38
|
-
static get schema() {
|
|
39
|
-
return z.object({
|
|
40
|
-
txHash: TxHash.schema,
|
|
41
|
-
blockNumber: BlockNumberSchema,
|
|
42
|
-
blockTimestamp: schemas.UInt64,
|
|
43
|
-
logData: z.array(foundationSchemas.Fr),
|
|
44
|
-
noteHashes: z.array(foundationSchemas.Fr),
|
|
45
|
-
firstNullifier: foundationSchemas.Fr
|
|
46
|
-
}).transform(({ txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier })=>new TxScopedL2Log(txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier));
|
|
47
|
-
}
|
|
48
|
-
toBuffer() {
|
|
49
|
-
return Buffer.concat([
|
|
50
|
-
this.txHash.toBuffer(),
|
|
51
|
-
numToUInt32BE(this.blockNumber),
|
|
52
|
-
bigintToUInt64BE(this.blockTimestamp),
|
|
53
|
-
serializeArrayOfBufferableToVector(this.logData),
|
|
54
|
-
serializeArrayOfBufferableToVector(this.noteHashes),
|
|
55
|
-
this.firstNullifier.toBuffer()
|
|
56
|
-
]);
|
|
57
|
-
}
|
|
58
|
-
static fromBuffer(buffer) {
|
|
59
|
-
const reader = BufferReader.asReader(buffer);
|
|
60
|
-
const txHash = reader.readObject(TxHash);
|
|
61
|
-
const blockNumber = BlockNumber(reader.readNumber());
|
|
62
|
-
const blockTimestamp = reader.readUInt64();
|
|
63
|
-
const logData = reader.readVector(Fr);
|
|
64
|
-
const noteHashes = reader.readVector(Fr);
|
|
65
|
-
const firstNullifier = reader.readObject(Fr);
|
|
66
|
-
return new TxScopedL2Log(txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier);
|
|
67
|
-
}
|
|
68
|
-
static getBlockNumberFromBuffer(buffer) {
|
|
69
|
-
return BlockNumber(buffer.readUint32BE(Fr.SIZE_IN_BYTES));
|
|
70
|
-
}
|
|
71
|
-
static random() {
|
|
72
|
-
return new TxScopedL2Log(TxHash.fromField(Fr.random()), BlockNumber(Math.floor(Math.random() * 100000) + 1), BigInt(Math.floor(Date.now() / 1000)), times(3, Fr.random), times(3, Fr.random), Fr.random());
|
|
73
|
-
}
|
|
74
|
-
equals(other) {
|
|
75
|
-
return this.txHash.equals(other.txHash) && this.blockNumber === other.blockNumber && this.blockTimestamp === other.blockTimestamp && this.logData.length === other.logData.length && this.logData.every((f, i)=>f.equals(other.logData[i])) && this.noteHashes.length === other.noteHashes.length && this.noteHashes.every((h, i)=>h.equals(other.noteHashes[i])) && this.firstNullifier.equals(other.firstNullifier);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
// Ignoring import issue to fix portable inferred type issue in zod schema
|
|
2
|
-
import { CheckpointNumber, CheckpointNumberSchema } from '@aztec/foundation/branded-types';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
|
-
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
|
|
8
|
-
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
9
|
-
import { MAX_BLOCK_HASH_STRING_LENGTH, MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
10
|
-
import { L2Block } from './l2_block.js';
|
|
11
|
-
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Encapsulates an L2 Block along with the checkpoint data associated with it.
|
|
15
|
-
*/
|
|
16
|
-
export class CheckpointedL2Block {
|
|
17
|
-
constructor(
|
|
18
|
-
public checkpointNumber: CheckpointNumber,
|
|
19
|
-
public block: L2Block,
|
|
20
|
-
public l1: L1PublishedData,
|
|
21
|
-
public attestations: CommitteeAttestation[],
|
|
22
|
-
) {}
|
|
23
|
-
static get schema() {
|
|
24
|
-
return z
|
|
25
|
-
.object({
|
|
26
|
-
checkpointNumber: CheckpointNumberSchema,
|
|
27
|
-
block: L2Block.schema,
|
|
28
|
-
l1: L1PublishedData.schema,
|
|
29
|
-
attestations: z.array(CommitteeAttestation.schema),
|
|
30
|
-
})
|
|
31
|
-
.transform(obj => CheckpointedL2Block.fromFields(obj));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static fromBuffer(bufferOrReader: Buffer | BufferReader): CheckpointedL2Block {
|
|
35
|
-
const reader = BufferReader.asReader(bufferOrReader);
|
|
36
|
-
const checkpointNumber = reader.readNumber();
|
|
37
|
-
const block = reader.readObject(L2Block);
|
|
38
|
-
const l1BlockNumber = reader.readBigInt();
|
|
39
|
-
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
40
|
-
const l1Timestamp = reader.readBigInt();
|
|
41
|
-
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
42
|
-
return new CheckpointedL2Block(
|
|
43
|
-
CheckpointNumber(checkpointNumber),
|
|
44
|
-
block,
|
|
45
|
-
new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash),
|
|
46
|
-
attestations,
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
static fromFields(fields: FieldsOf<CheckpointedL2Block>) {
|
|
51
|
-
return new CheckpointedL2Block(
|
|
52
|
-
CheckpointNumber(fields.checkpointNumber),
|
|
53
|
-
fields.block,
|
|
54
|
-
fields.l1,
|
|
55
|
-
fields.attestations,
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
public toBuffer(): Buffer {
|
|
60
|
-
return serializeToBuffer(
|
|
61
|
-
this.checkpointNumber,
|
|
62
|
-
this.block,
|
|
63
|
-
this.l1.blockNumber,
|
|
64
|
-
this.l1.blockHash,
|
|
65
|
-
this.l1.timestamp,
|
|
66
|
-
this.attestations.length,
|
|
67
|
-
this.attestations,
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
import { zodFor } from '../schemas/index.js';
|
|
6
|
-
|
|
7
|
-
export type PipelineConfig = {
|
|
8
|
-
/** Whether to enable build-ahead proposer pipelining. */
|
|
9
|
-
enableProposerPipelining: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Pipelining config mappings for fields that need to be shared across packages.
|
|
14
|
-
*/
|
|
15
|
-
export const pipelineConfigMappings: ConfigMappingsType<PipelineConfig> = {
|
|
16
|
-
enableProposerPipelining: {
|
|
17
|
-
env: 'SEQ_ENABLE_PROPOSER_PIPELINING',
|
|
18
|
-
description: 'Whether to enable build-ahead proposer pipelining.',
|
|
19
|
-
...booleanConfigHelper(false),
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const PipelineConfigSchema = zodFor<PipelineConfig>()(
|
|
24
|
-
z.object({
|
|
25
|
-
enableProposerPipelining: z.boolean(),
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export function getPipelineConfigEnvVars(): PipelineConfig {
|
|
30
|
-
return getConfigFromMappings(pipelineConfigMappings);
|
|
31
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
import { ExtendedContractClassLog } from '../logs/extended_contract_class_log.js';
|
|
4
|
-
import { ExtendedPublicLog } from '../logs/extended_public_log.js';
|
|
5
|
-
import { zodFor } from '../schemas/index.js';
|
|
6
|
-
|
|
7
|
-
/** Response for the getContractClassLogs archiver call. */
|
|
8
|
-
export type GetContractClassLogsResponse = {
|
|
9
|
-
/** An array of ExtendedContractClassLog elements. */
|
|
10
|
-
logs: ExtendedContractClassLog[];
|
|
11
|
-
/** Indicates if a limit has been reached. */
|
|
12
|
-
maxLogsHit: boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const GetContractClassLogsResponseSchema = zodFor<GetContractClassLogsResponse>()(
|
|
16
|
-
z.object({
|
|
17
|
-
logs: z.array(ExtendedContractClassLog.schema),
|
|
18
|
-
maxLogsHit: z.boolean(),
|
|
19
|
-
}),
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
/** Response for the getPublicLogs archiver call. */
|
|
23
|
-
export type GetPublicLogsResponse = {
|
|
24
|
-
/** An array of ExtendedPublicLog elements. */
|
|
25
|
-
logs: ExtendedPublicLog[];
|
|
26
|
-
/** Indicates if a limit has been reached. */
|
|
27
|
-
maxLogsHit: boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const GetPublicLogsResponseSchema = zodFor<GetPublicLogsResponse>()(
|
|
31
|
-
z.object({
|
|
32
|
-
logs: z.array(ExtendedPublicLog.schema),
|
|
33
|
-
maxLogsHit: z.boolean(),
|
|
34
|
-
}),
|
|
35
|
-
);
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
|
-
|
|
6
|
-
import isEqual from 'lodash.isequal';
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
|
|
9
|
-
import { ContractClassLog } from './contract_class_log.js';
|
|
10
|
-
import { LogId } from './log_id.js';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Represents an individual contract class log entry extended with info about the block and tx it was emitted in.
|
|
14
|
-
*/
|
|
15
|
-
export class ExtendedContractClassLog {
|
|
16
|
-
constructor(
|
|
17
|
-
/** Globally unique id of the log. */
|
|
18
|
-
public readonly id: LogId,
|
|
19
|
-
/** The data contents of the log. */
|
|
20
|
-
public readonly log: ContractClassLog,
|
|
21
|
-
) {}
|
|
22
|
-
|
|
23
|
-
static async random() {
|
|
24
|
-
return new ExtendedContractClassLog(LogId.random(), await ContractClassLog.random());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static get schema(): ZodFor<ExtendedContractClassLog> {
|
|
28
|
-
return z
|
|
29
|
-
.object({
|
|
30
|
-
id: LogId.schema,
|
|
31
|
-
log: ContractClassLog.schema,
|
|
32
|
-
})
|
|
33
|
-
.transform(ExtendedContractClassLog.from);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static from(fields: FieldsOf<ExtendedContractClassLog>) {
|
|
37
|
-
return new ExtendedContractClassLog(fields.id, fields.log);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Serializes log to a buffer.
|
|
42
|
-
* @returns A buffer containing the serialized log.
|
|
43
|
-
*/
|
|
44
|
-
public toBuffer(): Buffer {
|
|
45
|
-
return Buffer.concat([this.id.toBuffer(), this.log.toBuffer()]);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Serializes log to a string.
|
|
50
|
-
* @returns A string containing the serialized log.
|
|
51
|
-
*/
|
|
52
|
-
public toString(): string {
|
|
53
|
-
return bufferToHex(this.toBuffer());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Checks if two ExtendedContractClassLog objects are equal.
|
|
58
|
-
* @param other - Another ExtendedContractClassLog object to compare with.
|
|
59
|
-
* @returns True if the two objects are equal, false otherwise.
|
|
60
|
-
*/
|
|
61
|
-
public equals(other: ExtendedContractClassLog): boolean {
|
|
62
|
-
return isEqual(this, other);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Deserializes log from a buffer.
|
|
67
|
-
* @param buffer - The buffer or buffer reader containing the log.
|
|
68
|
-
* @returns Deserialized instance of `Log`.
|
|
69
|
-
*/
|
|
70
|
-
public static fromBuffer(buffer: Buffer | BufferReader): ExtendedContractClassLog {
|
|
71
|
-
const reader = BufferReader.asReader(buffer);
|
|
72
|
-
|
|
73
|
-
const logId = LogId.fromBuffer(reader);
|
|
74
|
-
const log = ContractClassLog.fromBuffer(reader);
|
|
75
|
-
|
|
76
|
-
return new ExtendedContractClassLog(logId, log);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Deserializes `ExtendedContractClassLog` object from a hex string representation.
|
|
81
|
-
* @param data - A hex string representation of the log.
|
|
82
|
-
* @returns An `ExtendedContractClassLog` object.
|
|
83
|
-
*/
|
|
84
|
-
public static fromString(data: string): ExtendedContractClassLog {
|
|
85
|
-
return ExtendedContractClassLog.fromBuffer(hexToBuffer(data));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
3
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
4
|
-
|
|
5
|
-
import isEqual from 'lodash.isequal';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
|
|
8
|
-
import { LogId } from './log_id.js';
|
|
9
|
-
import { PublicLog } from './public_log.js';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Represents an individual public log entry extended with info about the block and tx it was emitted in.
|
|
13
|
-
*/
|
|
14
|
-
export class ExtendedPublicLog {
|
|
15
|
-
constructor(
|
|
16
|
-
/** Globally unique id of the log. */
|
|
17
|
-
public readonly id: LogId,
|
|
18
|
-
/** The data contents of the log. */
|
|
19
|
-
public readonly log: PublicLog,
|
|
20
|
-
) {}
|
|
21
|
-
|
|
22
|
-
static async random() {
|
|
23
|
-
return new ExtendedPublicLog(LogId.random(), await PublicLog.random());
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static get schema() {
|
|
27
|
-
return z
|
|
28
|
-
.object({
|
|
29
|
-
id: LogId.schema,
|
|
30
|
-
log: PublicLog.schema,
|
|
31
|
-
})
|
|
32
|
-
.transform(ExtendedPublicLog.from);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static from(fields: FieldsOf<ExtendedPublicLog>) {
|
|
36
|
-
return new ExtendedPublicLog(fields.id, fields.log);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Serializes log to a buffer.
|
|
41
|
-
* @returns A buffer containing the serialized log.
|
|
42
|
-
*/
|
|
43
|
-
public toBuffer(): Buffer {
|
|
44
|
-
return Buffer.concat([this.id.toBuffer(), this.log.toBuffer()]);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Serializes log to a string.
|
|
49
|
-
* @returns A string containing the serialized log.
|
|
50
|
-
*/
|
|
51
|
-
public toString(): string {
|
|
52
|
-
return bufferToHex(this.toBuffer());
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Serializes log to a human readable string.
|
|
57
|
-
* @returns A human readable representation of the log.
|
|
58
|
-
*/
|
|
59
|
-
public toHumanReadable(): string {
|
|
60
|
-
return `${this.id.toHumanReadable()}, ${this.log.toHumanReadable()}`;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Checks if two ExtendedPublicLog objects are equal.
|
|
65
|
-
* @param other - Another ExtendedPublicLog object to compare with.
|
|
66
|
-
* @returns True if the two objects are equal, false otherwise.
|
|
67
|
-
*/
|
|
68
|
-
public equals(other: ExtendedPublicLog): boolean {
|
|
69
|
-
return isEqual(this, other);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Deserializes log from a buffer.
|
|
74
|
-
* @param buffer - The buffer or buffer reader containing the log.
|
|
75
|
-
* @returns Deserialized instance of `Log`.
|
|
76
|
-
*/
|
|
77
|
-
public static fromBuffer(buffer: Buffer | BufferReader): ExtendedPublicLog {
|
|
78
|
-
const reader = BufferReader.asReader(buffer);
|
|
79
|
-
|
|
80
|
-
const logId = LogId.fromBuffer(reader);
|
|
81
|
-
const log = PublicLog.fromBuffer(reader);
|
|
82
|
-
|
|
83
|
-
return new ExtendedPublicLog(logId, log);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Deserializes `ExtendedPublicLog` object from a hex string representation.
|
|
88
|
-
* @param data - A hex string representation of the log.
|
|
89
|
-
* @returns An `ExtendedPublicLog` object.
|
|
90
|
-
*/
|
|
91
|
-
public static fromString(data: string): ExtendedPublicLog {
|
|
92
|
-
return ExtendedPublicLog.fromBuffer(hexToBuffer(data));
|
|
93
|
-
}
|
|
94
|
-
}
|
package/src/logs/log_filter.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
|
|
5
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
6
|
-
import { type ZodFor, schemas } from '../schemas/index.js';
|
|
7
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
8
|
-
import { LogId } from './log_id.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Log filter used to fetch L2 logs.
|
|
12
|
-
* @remarks This filter is applied as an intersection of all it's params.
|
|
13
|
-
*/
|
|
14
|
-
export type LogFilter = {
|
|
15
|
-
/** Hash of a transaction from which to fetch the logs. */
|
|
16
|
-
txHash?: TxHash;
|
|
17
|
-
/** The block number from which to start fetching logs (inclusive). */
|
|
18
|
-
fromBlock?: number;
|
|
19
|
-
/** The block number until which to fetch logs (not inclusive). */
|
|
20
|
-
toBlock?: number;
|
|
21
|
-
/** Log id after which to start fetching logs. */
|
|
22
|
-
afterLog?: LogId;
|
|
23
|
-
/** The contract address to filter logs by. */
|
|
24
|
-
contractAddress?: AztecAddress;
|
|
25
|
-
/** The tag (first field of the log) to filter logs by. */
|
|
26
|
-
tag?: Fr;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const LogFilterSchema: ZodFor<LogFilter> = z.object({
|
|
30
|
-
txHash: TxHash.schema.optional(),
|
|
31
|
-
fromBlock: schemas.Integer.optional(),
|
|
32
|
-
toBlock: schemas.Integer.optional(),
|
|
33
|
-
afterLog: LogId.schema.optional(),
|
|
34
|
-
contractAddress: schemas.AztecAddress.optional(),
|
|
35
|
-
tag: schemas.Fr.optional(),
|
|
36
|
-
});
|
package/src/logs/log_id.ts
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
2
|
-
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
3
|
-
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
|
-
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
|
|
8
|
-
import { BlockHash } from '../block/block_hash.js';
|
|
9
|
-
import { schemas } from '../schemas/index.js';
|
|
10
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
11
|
-
|
|
12
|
-
/** A globally unique log id. */
|
|
13
|
-
export class LogId {
|
|
14
|
-
constructor(
|
|
15
|
-
/** The block number the log was emitted in. */
|
|
16
|
-
public readonly blockNumber: BlockNumber,
|
|
17
|
-
/** The hash of the block the log was emitted in. */
|
|
18
|
-
public readonly blockHash: BlockHash,
|
|
19
|
-
/** The hash of the transaction the log was emitted in. */
|
|
20
|
-
public readonly txHash: TxHash,
|
|
21
|
-
/** The index of a tx in a block the log was emitted in. */
|
|
22
|
-
public readonly txIndex: number,
|
|
23
|
-
/** The index of a log the tx was emitted in. */
|
|
24
|
-
public readonly logIndex: number,
|
|
25
|
-
) {
|
|
26
|
-
if (!Number.isInteger(blockNumber) || blockNumber < INITIAL_L2_BLOCK_NUM) {
|
|
27
|
-
throw new Error(`Invalid block number: ${blockNumber}`);
|
|
28
|
-
}
|
|
29
|
-
if (!Number.isInteger(txIndex)) {
|
|
30
|
-
throw new Error(`Invalid tx index: ${txIndex}`);
|
|
31
|
-
}
|
|
32
|
-
if (!Number.isInteger(logIndex)) {
|
|
33
|
-
throw new Error(`Invalid log index: ${logIndex}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static random() {
|
|
38
|
-
return new LogId(
|
|
39
|
-
BlockNumber(Math.floor(Math.random() * 1000) + 1),
|
|
40
|
-
BlockHash.random(),
|
|
41
|
-
TxHash.random(),
|
|
42
|
-
Math.floor(Math.random() * 1000),
|
|
43
|
-
Math.floor(Math.random() * 100),
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
static get schema() {
|
|
48
|
-
return z
|
|
49
|
-
.object({
|
|
50
|
-
blockNumber: BlockNumberSchema,
|
|
51
|
-
blockHash: BlockHash.schema,
|
|
52
|
-
txHash: TxHash.schema,
|
|
53
|
-
txIndex: schemas.Integer,
|
|
54
|
-
logIndex: schemas.Integer,
|
|
55
|
-
})
|
|
56
|
-
.transform(
|
|
57
|
-
({ blockNumber, blockHash, txHash, txIndex, logIndex }) =>
|
|
58
|
-
new LogId(blockNumber, blockHash, txHash, txIndex, logIndex),
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Serializes log id to a buffer.
|
|
64
|
-
* @returns A buffer containing the serialized log id.
|
|
65
|
-
*/
|
|
66
|
-
public toBuffer(): Buffer {
|
|
67
|
-
return Buffer.concat([
|
|
68
|
-
toBufferBE(BigInt(this.blockNumber), 4),
|
|
69
|
-
this.blockHash.toBuffer(),
|
|
70
|
-
this.txHash.toBuffer(),
|
|
71
|
-
toBufferBE(BigInt(this.txIndex), 4),
|
|
72
|
-
toBufferBE(BigInt(this.logIndex), 4),
|
|
73
|
-
]);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Creates a LogId from a buffer.
|
|
78
|
-
* @param buffer - A buffer containing the serialized log id.
|
|
79
|
-
* @returns A log id.
|
|
80
|
-
*/
|
|
81
|
-
static fromBuffer(buffer: Buffer | BufferReader): LogId {
|
|
82
|
-
const reader = BufferReader.asReader(buffer);
|
|
83
|
-
|
|
84
|
-
const blockNumber = BlockNumber(reader.readNumber());
|
|
85
|
-
const blockHash = BlockHash.fromBuffer(reader);
|
|
86
|
-
const txHash = reader.readObject(TxHash);
|
|
87
|
-
const txIndex = reader.readNumber();
|
|
88
|
-
const logIndex = reader.readNumber();
|
|
89
|
-
|
|
90
|
-
return new LogId(blockNumber, blockHash, txHash, txIndex, logIndex);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Converts the LogId instance to a string.
|
|
95
|
-
* @returns A string representation of the log id.
|
|
96
|
-
*/
|
|
97
|
-
public toString(): string {
|
|
98
|
-
return `${this.blockNumber}-${this.txIndex}-${this.logIndex}-${this.blockHash.toString()}-${this.txHash.toString()}`;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Creates a LogId from a string.
|
|
103
|
-
* @param data - A string representation of a log id.
|
|
104
|
-
* @returns A log id.
|
|
105
|
-
*/
|
|
106
|
-
static fromString(data: string): LogId {
|
|
107
|
-
const [rawBlockNumber, rawTxIndex, rawLogIndex, rawBlockHash, rawTxHash] = data.split('-');
|
|
108
|
-
const blockNumber = BlockNumber(Number(rawBlockNumber));
|
|
109
|
-
const blockHash = BlockHash.fromString(rawBlockHash);
|
|
110
|
-
const txHash = TxHash.fromString(rawTxHash);
|
|
111
|
-
const txIndex = Number(rawTxIndex);
|
|
112
|
-
const logIndex = Number(rawLogIndex);
|
|
113
|
-
|
|
114
|
-
return new LogId(blockNumber, blockHash, txHash, txIndex, logIndex);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Serializes log id to a human readable string.
|
|
119
|
-
* @returns A human readable representation of the log id.
|
|
120
|
-
*/
|
|
121
|
-
public toHumanReadable(): string {
|
|
122
|
-
return `logId: (blockNumber: ${this.blockNumber}, blockHash: ${this.blockHash.toString()}, txHash: ${this.txHash.toString()}, txIndex: ${this.txIndex}, logIndex: ${this.logIndex})`;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { times } from '@aztec/foundation/collection';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
-
import { schemas as foundationSchemas } from '@aztec/foundation/schemas';
|
|
5
|
-
import {
|
|
6
|
-
BufferReader,
|
|
7
|
-
bigintToUInt64BE,
|
|
8
|
-
numToUInt32BE,
|
|
9
|
-
serializeArrayOfBufferableToVector,
|
|
10
|
-
} from '@aztec/foundation/serialize';
|
|
11
|
-
|
|
12
|
-
import { z } from 'zod';
|
|
13
|
-
|
|
14
|
-
import { schemas } from '../schemas/schemas.js';
|
|
15
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
16
|
-
import type { UInt64 } from '../types/shared.js';
|
|
17
|
-
|
|
18
|
-
export class TxScopedL2Log {
|
|
19
|
-
constructor(
|
|
20
|
-
/*
|
|
21
|
-
* Hash of the tx where the log is included
|
|
22
|
-
*/
|
|
23
|
-
public txHash: TxHash,
|
|
24
|
-
/*
|
|
25
|
-
* The block this log is included in
|
|
26
|
-
*/
|
|
27
|
-
public blockNumber: BlockNumber,
|
|
28
|
-
/*
|
|
29
|
-
* The timestamp of the block this log is included in
|
|
30
|
-
*/
|
|
31
|
-
public blockTimestamp: UInt64,
|
|
32
|
-
/*
|
|
33
|
-
* The log data as an array of field elements
|
|
34
|
-
*/
|
|
35
|
-
public logData: Fr[],
|
|
36
|
-
/*
|
|
37
|
-
* The note hashes from the tx effect
|
|
38
|
-
*/
|
|
39
|
-
public noteHashes: Fr[],
|
|
40
|
-
/*
|
|
41
|
-
* The first nullifier from the tx effect. Used for nonce discovery when processing notes from logs.
|
|
42
|
-
*
|
|
43
|
-
* (Note nonces are computed as `hash(firstNullifier, noteIndexInTx)`.)
|
|
44
|
-
*/
|
|
45
|
-
public firstNullifier: Fr,
|
|
46
|
-
) {}
|
|
47
|
-
|
|
48
|
-
static get schema() {
|
|
49
|
-
return z
|
|
50
|
-
.object({
|
|
51
|
-
txHash: TxHash.schema,
|
|
52
|
-
blockNumber: BlockNumberSchema,
|
|
53
|
-
blockTimestamp: schemas.UInt64,
|
|
54
|
-
logData: z.array(foundationSchemas.Fr),
|
|
55
|
-
noteHashes: z.array(foundationSchemas.Fr),
|
|
56
|
-
firstNullifier: foundationSchemas.Fr,
|
|
57
|
-
})
|
|
58
|
-
.transform(
|
|
59
|
-
({ txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier }) =>
|
|
60
|
-
new TxScopedL2Log(txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier),
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
toBuffer() {
|
|
65
|
-
return Buffer.concat([
|
|
66
|
-
this.txHash.toBuffer(),
|
|
67
|
-
numToUInt32BE(this.blockNumber),
|
|
68
|
-
bigintToUInt64BE(this.blockTimestamp),
|
|
69
|
-
serializeArrayOfBufferableToVector(this.logData),
|
|
70
|
-
serializeArrayOfBufferableToVector(this.noteHashes),
|
|
71
|
-
this.firstNullifier.toBuffer(),
|
|
72
|
-
]);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
static fromBuffer(buffer: Buffer) {
|
|
76
|
-
const reader = BufferReader.asReader(buffer);
|
|
77
|
-
const txHash = reader.readObject(TxHash);
|
|
78
|
-
const blockNumber = BlockNumber(reader.readNumber());
|
|
79
|
-
const blockTimestamp = reader.readUInt64();
|
|
80
|
-
const logData = reader.readVector(Fr);
|
|
81
|
-
const noteHashes = reader.readVector(Fr);
|
|
82
|
-
const firstNullifier = reader.readObject(Fr);
|
|
83
|
-
|
|
84
|
-
return new TxScopedL2Log(txHash, blockNumber, blockTimestamp, logData, noteHashes, firstNullifier);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static getBlockNumberFromBuffer(buffer: Buffer) {
|
|
88
|
-
return BlockNumber(buffer.readUint32BE(Fr.SIZE_IN_BYTES));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
static random() {
|
|
92
|
-
return new TxScopedL2Log(
|
|
93
|
-
TxHash.fromField(Fr.random()),
|
|
94
|
-
BlockNumber(Math.floor(Math.random() * 100000) + 1),
|
|
95
|
-
BigInt(Math.floor(Date.now() / 1000)),
|
|
96
|
-
times(3, Fr.random),
|
|
97
|
-
times(3, Fr.random),
|
|
98
|
-
Fr.random(),
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
equals(other: TxScopedL2Log) {
|
|
103
|
-
return (
|
|
104
|
-
this.txHash.equals(other.txHash) &&
|
|
105
|
-
this.blockNumber === other.blockNumber &&
|
|
106
|
-
this.blockTimestamp === other.blockTimestamp &&
|
|
107
|
-
this.logData.length === other.logData.length &&
|
|
108
|
-
this.logData.every((f, i) => f.equals(other.logData[i])) &&
|
|
109
|
-
this.noteHashes.length === other.noteHashes.length &&
|
|
110
|
-
this.noteHashes.every((h, i) => h.equals(other.noteHashes[i])) &&
|
|
111
|
-
this.firstNullifier.equals(other.firstNullifier)
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
}
|