@aztec/stdlib 3.0.3 → 4.0.0-devnet.1-patch.0
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 +602 -4
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +7 -7
- package/dest/abi/contract_artifact.d.ts +2 -2
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +1 -1
- package/dest/abi/function_call.d.ts +47 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +20 -3
- package/dest/abi/function_selector.d.ts +2 -1
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +7 -0
- package/dest/abi/selector.js +3 -1
- package/dest/abi/utils.d.ts +7 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +7 -0
- package/dest/auth_witness/auth_witness.d.ts +2 -1
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +62 -62
- package/dest/avm/avm.js +1 -1
- package/dest/avm/avm_accumulated_data.d.ts +30 -3
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +5 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +9 -9
- package/dest/avm/avm_circuit_public_inputs.js +3 -1
- package/dest/avm/avm_proving_request.d.ts +299 -299
- package/dest/avm/contract_storage_read.d.ts +13 -1
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +13 -1
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +3 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +10 -1
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +10 -1
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.js +3 -1
- package/dest/avm/public_data_write.d.ts +7 -1
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.d.ts +4 -1
- package/dest/avm/public_inner_call_request.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.js +3 -1
- package/dest/avm/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +3 -1
- package/dest/aztec-address/index.js +4 -2
- package/dest/block/attestation_info.d.ts +5 -5
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -4
- package/dest/block/block_hash.d.ts +18 -14
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +22 -20
- package/dest/block/block_parameter.d.ts +4 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +2 -0
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -2
- package/dest/block/checkpointed_l2_block.d.ts +150 -0
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -0
- package/dest/block/checkpointed_l2_block.js +46 -0
- package/dest/block/in_block.d.ts +9 -9
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/in_block.js +5 -5
- package/dest/block/index.d.ts +2 -4
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -3
- package/dest/block/l2_block.d.ts +57 -57
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -108
- package/dest/block/l2_block_source.d.ts +344 -90
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +25 -6
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +15 -5
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +13 -3
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +115 -32
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +478 -41
- package/dest/block/validate_block_result.d.ts +24 -24
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -17
- package/dest/checkpoint/checkpoint.d.ts +45 -20
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +59 -8
- package/dest/checkpoint/checkpoint_info.d.ts +38 -0
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_info.js +34 -0
- 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 +30 -22
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +14 -3
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/node-rpc-config.js +1 -1
- package/dest/config/sequencer-config.d.ts +10 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +12 -0
- package/dest/contract/complete_address.d.ts +4 -1
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_address.js +1 -1
- package/dest/contract/contract_class_id.d.ts +1 -1
- package/dest/contract/contract_class_id.js +2 -2
- package/dest/contract/contract_deployment_data.d.ts +5 -5
- package/dest/contract/index.d.ts +1 -3
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -2
- package/dest/contract/interfaces/contract_class.d.ts +11 -13
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +18 -18
- package/dest/contract/interfaces/contract_instance.d.ts +28 -29
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +5 -5
- package/dest/contract/interfaces/contract_instance_update.d.ts +6 -7
- package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.js +5 -5
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +2 -3
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.js +1 -1
- package/dest/database-version/database_version.d.ts +58 -0
- package/dest/database-version/database_version.d.ts.map +1 -0
- package/dest/database-version/database_version.js +69 -0
- package/dest/database-version/version_manager.d.ts +3 -49
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +1 -64
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +2 -2
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.js +7 -10
- package/dest/deserialization/index.d.ts +11 -0
- package/dest/deserialization/index.d.ts.map +1 -0
- package/dest/deserialization/index.js +10 -0
- package/dest/epoch-helpers/index.d.ts +7 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +12 -6
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/gas/gas.js +3 -1
- package/dest/gas/gas_fees.js +3 -1
- package/dest/hash/hash.d.ts +1 -9
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +2 -14
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/hash/map_slot.d.ts.map +1 -1
- package/dest/hash/map_slot.js +4 -3
- package/dest/interfaces/allowed_element.d.ts +7 -8
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +3 -3
- package/dest/interfaces/api_limit.d.ts +3 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +2 -0
- package/dest/interfaces/archiver.d.ts +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +25 -15
- package/dest/interfaces/aztec-node-admin.d.ts +110 -41
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +6 -4
- package/dest/interfaces/aztec-node.d.ts +77 -79
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +16 -17
- package/dest/interfaces/block-builder.d.ts +22 -13
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +16 -1
- package/dest/interfaces/configs.d.ts +56 -27
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +12 -6
- package/dest/interfaces/get_logs_response.d.ts +27 -5
- package/dest/interfaces/get_logs_response.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.js +5 -4
- package/dest/interfaces/l2_logs_source.d.ts +21 -8
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +7 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +3 -4
- package/dest/interfaces/prover-broker.d.ts +16 -1
- package/dest/interfaces/prover-broker.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.js +4 -1
- package/dest/interfaces/prover-client.d.ts +19 -3
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +16 -4
- package/dest/interfaces/proving-job.d.ts +218 -218
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +1 -7
- package/dest/interfaces/server_circuit_prover.d.ts +4 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +9 -1
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +5 -3
- package/dest/interfaces/tx_provider.d.ts +3 -3
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +161 -26
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +12 -7
- package/dest/interfaces/world_state.d.ts +17 -8
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/claimed_length_array.js +3 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -5
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +19 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +16 -8
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +1 -3
- package/dest/kernel/hints/key_validation_hint.d.ts +2 -1
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +2 -1
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +6 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +13 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +7 -1
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +7 -1
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.js +3 -1
- package/dest/kernel/log_hash.js +3 -1
- package/dest/kernel/private_accumulated_data.d.ts +23 -1
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +25 -1
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_request.d.ts +16 -1
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +120 -47
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +59 -59
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +31 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.d.ts +7 -1
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +22 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts +7 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +4 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +23 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_log_data.js +5 -2
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
- package/dest/kernel/private_to_public_accumulated_data.js +3 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +17 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +3 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +16 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +10 -1
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +3 -1
- package/dest/kernel/public_call_request.d.ts +22 -1
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +5 -2
- package/dest/kernel/utils/optional_number.d.ts +7 -1
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/derivation.d.ts +3 -3
- package/dest/keys/derivation.js +8 -8
- package/dest/keys/key_types.d.ts +1 -1
- package/dest/keys/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/utils.d.ts +1 -1
- package/dest/keys/utils.d.ts.map +1 -1
- package/dest/keys/utils.js +7 -3
- package/dest/l1-contracts/slash_factory.d.ts +1 -1
- package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
- package/dest/l1-contracts/slash_factory.js +1 -0
- package/dest/logs/contract_class_log.js +3 -1
- package/dest/logs/extended_contract_class_log.d.ts +3 -1
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +17 -3
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/index.d.ts +3 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/log_id.d.ts +22 -7
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +23 -13
- package/dest/logs/private_log.d.ts +1 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +5 -2
- package/dest/logs/public_log.js +3 -1
- package/dest/logs/siloed_tag.d.ts +23 -0
- package/dest/logs/siloed_tag.d.ts.map +1 -0
- package/dest/logs/siloed_tag.js +31 -0
- package/dest/logs/tag.d.ts +21 -0
- package/dest/logs/tag.d.ts.map +1 -0
- package/dest/logs/tag.js +30 -0
- package/dest/logs/tx_scoped_l2_log.d.ts +24 -33
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +37 -43
- package/dest/messaging/in_hash.d.ts +4 -2
- package/dest/messaging/in_hash.d.ts.map +1 -1
- package/dest/messaging/in_hash.js +3 -1
- package/dest/messaging/inbox_leaf.d.ts +3 -1
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/l1_actor.d.ts +7 -1
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +6 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l2_actor.d.ts +7 -1
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +88 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +160 -42
- package/dest/messaging/out_hash.d.ts +41 -3
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +54 -19
- package/dest/note/note_dao.d.ts +36 -5
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +15 -12
- package/dest/p2p/attestation_utils.d.ts +3 -3
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +1 -1
- package/dest/p2p/block_proposal.d.ts +102 -23
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +140 -39
- package/dest/p2p/checkpoint_attestation.d.ts +81 -0
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -0
- package/dest/p2p/{block_attestation.js → checkpoint_attestation.js} +22 -19
- package/dest/p2p/checkpoint_proposal.d.ts +174 -0
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
- package/dest/p2p/checkpoint_proposal.js +238 -0
- package/dest/p2p/consensus_payload.d.ts +9 -9
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -5
- package/dest/p2p/constants.d.ts +5 -0
- package/dest/p2p/constants.d.ts.map +1 -0
- package/dest/p2p/constants.js +3 -0
- package/dest/p2p/gossipable.d.ts +4 -3
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +16 -5
- package/dest/p2p/index.d.ts +5 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +4 -1
- package/dest/p2p/message_validator.d.ts +18 -3
- package/dest/p2p/message_validator.d.ts.map +1 -1
- package/dest/p2p/message_validator.js +2 -1
- package/dest/p2p/signature_utils.d.ts +5 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +3 -1
- package/dest/p2p/signed_txs.d.ts +42 -0
- package/dest/p2p/signed_txs.d.ts.map +1 -0
- package/dest/p2p/signed_txs.js +75 -0
- package/dest/p2p/topic_type.d.ts +3 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +10 -3
- package/dest/parity/parity_base_private_inputs.d.ts +3 -1
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +4 -1
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +2 -1
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +1 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +9 -4
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/recursive_proof.d.ts +10 -1
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.d.ts +1 -3
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +1 -9
- package/dest/rollup/base_rollup_hints.d.ts +34 -1
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +12 -1
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +47 -11
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -12
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +11 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +4 -1
- package/dest/rollup/checkpoint_header.d.ts +46 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +53 -20
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +46 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +11 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +44 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +13 -2
- package/dest/rollup/epoch_constant_data.d.ts +16 -1
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +6 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +21 -6
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +10 -4
- package/dest/rollup/tree_snapshot_diff_hints.d.ts +24 -1
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +29 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +5 -3
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +2 -1
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +2 -0
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +6 -0
- package/dest/slashing/tally.d.ts +2 -1
- package/dest/slashing/tally.d.ts.map +1 -1
- package/dest/slashing/tally.js +6 -2
- package/dest/slashing/types.d.ts +10 -7
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +18 -6
- package/dest/snapshots/types.d.ts +1 -1
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/snapshots/types.js +5 -5
- package/dest/stats/stats.d.ts +10 -8
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +39 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +81 -26
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +76 -20
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +139 -60
- package/dest/timetable/index.d.ts +37 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +39 -0
- package/dest/trees/append_only_tree_snapshot.d.ts +13 -1
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +3 -1
- package/dest/trees/nullifier_leaf.d.ts +13 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +10 -1
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +16 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +11 -1
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +21 -8
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +12 -2
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/call_context.js +3 -1
- package/dest/tx/capsule.d.ts +4 -1
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +9 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -2
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +5 -3
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +14 -1
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +3 -1
- package/dest/tx/hashed_values.d.ts +7 -1
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/in_tx.d.ts +4 -4
- package/dest/tx/index.d.ts +1 -2
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/indexed_tx_effect.d.ts +5 -5
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +3 -2
- package/dest/tx/partial_state_reference.d.ts +4 -1
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +24 -7
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +4 -21
- package/dest/tx/private_tx_constant_data.d.ts +16 -1
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +149 -26
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +44 -7
- package/dest/tx/protocol_contracts.d.ts +1 -1
- package/dest/tx/public_call_request_with_calldata.d.ts +7 -1
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +3 -1
- package/dest/tx/simulated_tx.d.ts +1031 -7
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/state_reference.d.ts +3 -1
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -1
- package/dest/tx/tree_snapshots.js +3 -1
- package/dest/tx/tx.d.ts +33 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -6
- package/dest/tx/tx_context.d.ts +2 -1
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +32 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +6 -9
- package/dest/tx/tx_execution_request.d.ts +30 -1
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_execution_request.js +6 -2
- package/dest/tx/tx_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +47 -13
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +46 -15
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/validator/empty_validator.d.ts +2 -2
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +2 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +2 -0
- package/dest/tx/validator/tx_validator.d.ts +2 -5
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +4 -4
- package/dest/types/shared.d.ts +4 -1
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/validators/schemas.d.ts +9 -9
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +13 -13
- package/dest/vks/verification_key.d.ts +22 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_data.d.ts +7 -1
- package/dest/vks/vk_data.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +3 -4
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +9 -9
- package/package.json +27 -13
- package/src/abi/abi.ts +39 -33
- package/src/abi/contract_artifact.ts +10 -10
- package/src/abi/function_call.ts +25 -3
- package/src/abi/function_selector.ts +8 -0
- package/src/abi/utils.ts +17 -0
- package/src/avm/avm.ts +1 -1
- package/src/block/attestation_info.ts +9 -6
- package/src/block/block_hash.ts +26 -25
- package/src/block/block_parameter.ts +4 -2
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +70 -0
- package/src/block/in_block.ts +6 -6
- package/src/block/index.ts +1 -3
- package/src/block/l2_block.ts +102 -149
- package/src/block/l2_block_source.ts +175 -68
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +15 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +139 -39
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
- package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
- package/src/block/test/l2_tips_store_test_suite.ts +480 -35
- package/src/block/validate_block_result.ts +40 -35
- package/src/checkpoint/checkpoint.ts +82 -12
- package/src/checkpoint/checkpoint_info.ts +52 -0
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +22 -7
- package/src/config/index.ts +1 -0
- package/src/config/node-rpc-config.ts +1 -1
- package/src/config/sequencer-config.ts +19 -0
- package/src/contract/contract_address.ts +1 -1
- package/src/contract/contract_class_id.ts +2 -2
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +59 -46
- package/src/contract/interfaces/contract_instance.ts +15 -13
- package/src/contract/interfaces/contract_instance_update.ts +11 -9
- package/src/contract/private_function.ts +2 -3
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/database-version/database_version.ts +87 -0
- package/src/database-version/version_manager.ts +1 -77
- package/src/delayed_public_mutable/delayed_public_mutable_values.ts +9 -10
- package/src/deserialization/index.ts +21 -0
- package/src/epoch-helpers/index.ts +24 -10
- package/src/hash/hash.ts +2 -13
- package/src/hash/map_slot.ts +3 -2
- package/src/interfaces/allowed_element.ts +9 -7
- package/src/interfaces/api_limit.ts +2 -0
- package/src/interfaces/archiver.ts +33 -23
- package/src/interfaces/aztec-node-admin.ts +10 -6
- package/src/interfaces/aztec-node.ts +118 -134
- package/src/interfaces/block-builder.ts +50 -23
- package/src/interfaces/configs.ts +67 -33
- package/src/interfaces/get_logs_response.ts +13 -9
- package/src/interfaces/l2_logs_source.ts +25 -7
- package/src/interfaces/merkle_tree_operations.ts +4 -1
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/prover-broker.ts +22 -0
- package/src/interfaces/prover-client.ts +35 -10
- package/src/interfaces/proving-job.ts +2 -11
- package/src/interfaces/server_circuit_prover.ts +3 -3
- package/src/interfaces/slasher.ts +28 -22
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +92 -31
- package/src/interfaces/world_state.ts +16 -9
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +20 -12
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +2 -4
- package/src/kernel/private_circuit_public_inputs.ts +85 -85
- package/src/keys/derivation.ts +8 -8
- package/src/keys/key_types.ts +1 -1
- package/src/keys/utils.ts +7 -3
- package/src/l1-contracts/slash_factory.ts +1 -0
- package/src/logs/index.ts +2 -1
- package/src/logs/log_id.ts +26 -12
- package/src/logs/private_log.ts +2 -1
- package/src/logs/siloed_tag.ts +45 -0
- package/src/logs/tag.ts +42 -0
- package/src/logs/tx_scoped_l2_log.ts +45 -43
- package/src/messaging/in_hash.ts +3 -1
- package/src/messaging/l1_to_l2_message.ts +1 -0
- package/src/messaging/l2_to_l1_membership.ts +178 -52
- package/src/messaging/out_hash.ts +62 -21
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +3 -3
- package/src/p2p/block_proposal.ts +213 -46
- package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +31 -25
- package/src/p2p/checkpoint_proposal.ts +365 -0
- package/src/p2p/consensus_payload.ts +5 -7
- package/src/p2p/constants.ts +6 -0
- package/src/p2p/gossipable.ts +14 -4
- package/src/p2p/index.ts +4 -1
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signature_utils.ts +3 -1
- package/src/p2p/signed_txs.ts +88 -0
- package/src/p2p/topic_type.ts +4 -3
- package/src/proofs/chonk_proof.ts +9 -5
- package/src/rollup/avm_proof_data.ts +0 -7
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +5 -11
- package/src/rollup/checkpoint_constant_data.ts +1 -0
- package/src/rollup/checkpoint_header.ts +67 -20
- package/src/rollup/checkpoint_rollup_public_inputs.ts +17 -5
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +16 -7
- package/src/schemas/schemas.ts +4 -0
- package/src/slashing/empire.ts +3 -1
- package/src/slashing/helpers.ts +8 -0
- package/src/slashing/tally.ts +8 -2
- package/src/slashing/types.ts +38 -20
- package/src/snapshots/types.ts +33 -29
- package/src/stats/stats.ts +10 -7
- package/src/tests/factories.ts +103 -42
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +226 -92
- package/src/timetable/index.ts +66 -0
- package/src/tx/block_header.ts +21 -8
- package/src/tx/global_variable_builder.ts +9 -2
- package/src/tx/global_variables.ts +6 -0
- package/src/tx/index.ts +0 -1
- package/src/tx/indexed_tx_effect.ts +3 -2
- package/src/tx/private_execution_result.ts +2 -17
- package/src/tx/profiling.ts +46 -4
- package/src/tx/tx.ts +19 -11
- package/src/tx/tx_effect.ts +3 -10
- package/src/tx/tx_execution_request.ts +2 -0
- package/src/tx/tx_receipt.ts +75 -18
- package/src/tx/validator/empty_validator.ts +1 -1
- package/src/tx/validator/error_texts.ts +3 -0
- package/src/tx/validator/tx_validator.ts +9 -7
- package/src/validators/schemas.ts +54 -48
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block_code_to_purge.d.ts +0 -12
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -61
- package/dest/block/l2_block_header.d.ts +0 -98
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -153
- package/dest/block/l2_block_new.d.ts +0 -130
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -151
- package/dest/block/published_l2_block.d.ts +0 -130
- package/dest/block/published_l2_block.d.ts.map +0 -1
- package/dest/block/published_l2_block.js +0 -48
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/dest/database-version/index.d.ts +0 -2
- package/dest/database-version/index.d.ts.map +0 -1
- package/dest/database-version/index.js +0 -1
- package/dest/logs/log_with_tx_data.d.ts +0 -19
- package/dest/logs/log_with_tx_data.d.ts.map +0 -1
- package/dest/logs/log_with_tx_data.js +0 -49
- package/dest/p2p/block_attestation.d.ts +0 -80
- package/dest/p2p/block_attestation.d.ts.map +0 -1
- package/dest/tx/content_commitment.d.ts +0 -49
- package/dest/tx/content_commitment.d.ts.map +0 -1
- package/dest/tx/content_commitment.js +0 -90
- package/src/block/l2_block_code_to_purge.ts +0 -88
- package/src/block/l2_block_header.ts +0 -246
- package/src/block/l2_block_new.ts +0 -197
- package/src/block/published_l2_block.ts +0 -65
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/database-version/index.ts +0 -1
- package/src/logs/log_with_tx_data.ts +0 -46
- package/src/tx/content_commitment.ts +0 -113
|
@@ -21,6 +21,12 @@ import { GasFees } from '../gas/gas_fees.js';
|
|
|
21
21
|
import { schemas } from '../schemas/index.js';
|
|
22
22
|
import type { UInt64 } from '../types/index.js';
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Global variables that are constant across the entire slot.
|
|
26
|
+
* TODO(palla/mbps): Should timestamp be included here as well?
|
|
27
|
+
*/
|
|
28
|
+
export type CheckpointGlobalVariables = Omit<FieldsOf<GlobalVariables>, 'blockNumber' | 'timestamp'>;
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* Global variables of the L2 block.
|
|
26
32
|
*/
|
package/src/tx/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './block_header.js';
|
|
2
2
|
export * from './call_context.js';
|
|
3
3
|
export * from './global_variables.js';
|
|
4
|
-
export * from './content_commitment.js';
|
|
5
4
|
export * from './state_reference.js';
|
|
6
5
|
export * from './partial_state_reference.js';
|
|
7
6
|
export * from './function_data.js';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
3
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { BlockHash } from '../block/block_hash.js';
|
|
6
7
|
import { type DataInBlock, dataInBlockSchemaFor, randomDataInBlock } from '../block/in_block.js';
|
|
7
8
|
import { TxEffect } from './tx_effect.js';
|
|
8
9
|
|
|
@@ -26,7 +27,7 @@ export function serializeIndexedTxEffect(effect: IndexedTxEffect): Buffer {
|
|
|
26
27
|
export function deserializeIndexedTxEffect(buffer: Buffer): IndexedTxEffect {
|
|
27
28
|
const reader = BufferReader.asReader(buffer);
|
|
28
29
|
|
|
29
|
-
const l2BlockHash = reader.readObject(
|
|
30
|
+
const l2BlockHash = new BlockHash(reader.readObject(Fr));
|
|
30
31
|
const l2BlockNumber = BlockNumber(reader.readNumber());
|
|
31
32
|
const txIndexInBlock = reader.readNumber();
|
|
32
33
|
const data = reader.readObject(TxEffect);
|
|
@@ -79,7 +79,7 @@ export class CountedContractClassLog implements IsEmpty {
|
|
|
79
79
|
export class PrivateExecutionResult {
|
|
80
80
|
constructor(
|
|
81
81
|
public entrypoint: PrivateCallExecutionResult,
|
|
82
|
-
/** The first non
|
|
82
|
+
/** The first non-revertible nullifier emitted by any private call, or the protocol nullifier if there was none. */
|
|
83
83
|
public firstNullifier: Fr,
|
|
84
84
|
/** An array of calldata for the enqueued public function calls and the teardown function call. */
|
|
85
85
|
public publicFunctionCalldata: HashedValues[],
|
|
@@ -129,8 +129,6 @@ export class PrivateCallExecutionResult {
|
|
|
129
129
|
// Needed for the verifier (kernel)
|
|
130
130
|
/** The call stack item. */
|
|
131
131
|
public publicInputs: PrivateCircuitPublicInputs,
|
|
132
|
-
/** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */
|
|
133
|
-
public noteHashLeafIndexMap: Map<bigint, bigint>,
|
|
134
132
|
/** The notes created in the executed function. */
|
|
135
133
|
public newNotes: NoteAndSlot[],
|
|
136
134
|
/** Mapping of note hash counter to the counter of its nullifier. */
|
|
@@ -139,7 +137,7 @@ export class PrivateCallExecutionResult {
|
|
|
139
137
|
public returnValues: Fr[],
|
|
140
138
|
/** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */
|
|
141
139
|
public offchainEffects: { data: Fr[] }[],
|
|
142
|
-
/** The pre
|
|
140
|
+
/** The pre-tags used in this tx to compute tags for private logs */
|
|
143
141
|
public preTags: PreTag[],
|
|
144
142
|
/** The nested executions. */
|
|
145
143
|
public nestedExecutionResults: PrivateCallExecutionResult[],
|
|
@@ -159,7 +157,6 @@ export class PrivateCallExecutionResult {
|
|
|
159
157
|
vk: schemas.Buffer,
|
|
160
158
|
partialWitness: mapSchema(z.coerce.number(), z.string()),
|
|
161
159
|
publicInputs: PrivateCircuitPublicInputs.schema,
|
|
162
|
-
noteHashLeafIndexMap: mapSchema(schemas.BigInt, schemas.BigInt),
|
|
163
160
|
newNotes: z.array(NoteAndSlot.schema),
|
|
164
161
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
165
162
|
returnValues: z.array(schemas.Fr),
|
|
@@ -177,7 +174,6 @@ export class PrivateCallExecutionResult {
|
|
|
177
174
|
fields.vk,
|
|
178
175
|
fields.partialWitness,
|
|
179
176
|
fields.publicInputs,
|
|
180
|
-
fields.noteHashLeafIndexMap,
|
|
181
177
|
fields.newNotes,
|
|
182
178
|
fields.noteHashNullifierCounterMap,
|
|
183
179
|
fields.returnValues,
|
|
@@ -194,7 +190,6 @@ export class PrivateCallExecutionResult {
|
|
|
194
190
|
randomBytes(4),
|
|
195
191
|
new Map([[1, 'one']]),
|
|
196
192
|
PrivateCircuitPublicInputs.empty(),
|
|
197
|
-
new Map([[1n, 1n]]),
|
|
198
193
|
[NoteAndSlot.random()],
|
|
199
194
|
new Map([[0, 0]]),
|
|
200
195
|
[Fr.random()],
|
|
@@ -210,16 +205,6 @@ export class PrivateCallExecutionResult {
|
|
|
210
205
|
}
|
|
211
206
|
}
|
|
212
207
|
|
|
213
|
-
export function collectNoteHashLeafIndexMap(execResult: PrivateExecutionResult) {
|
|
214
|
-
const accum: Map<bigint, bigint> = new Map();
|
|
215
|
-
const collectNoteHashLeafIndexMapRecursive = (callResult: PrivateCallExecutionResult, accum: Map<bigint, bigint>) => {
|
|
216
|
-
callResult.noteHashLeafIndexMap.forEach((value, key) => accum.set(key, value));
|
|
217
|
-
callResult.nestedExecutionResults.forEach(nested => collectNoteHashLeafIndexMapRecursive(nested, accum));
|
|
218
|
-
};
|
|
219
|
-
collectNoteHashLeafIndexMapRecursive(execResult.entrypoint, accum);
|
|
220
|
-
return accum;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
208
|
export function collectNoteHashNullifierCounterMap(execResult: PrivateExecutionResult) {
|
|
224
209
|
const accum: Map<number, number> = new Map();
|
|
225
210
|
const collectNoteHashNullifierCounterMapRecursive = (
|
package/src/tx/profiling.ts
CHANGED
|
@@ -6,9 +6,35 @@ import { z } from 'zod';
|
|
|
6
6
|
import type { AztecNode } from '../interfaces/aztec-node.js';
|
|
7
7
|
import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
8
8
|
|
|
9
|
-
export type
|
|
9
|
+
export type RoundTripStats = {
|
|
10
|
+
/** Number of round trips (times we blocked waiting for node responses) */
|
|
11
|
+
roundTrips: number;
|
|
12
|
+
/** Total wall-clock time spent waiting on node (excludes parallel overlap) */
|
|
13
|
+
totalBlockingTime: number;
|
|
14
|
+
/** Individual round trip durations */
|
|
15
|
+
roundTripDurations: number[];
|
|
16
|
+
/** Methods called in each round trip (parallel calls grouped together) */
|
|
17
|
+
roundTripMethods: string[][];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const RoundTripStatsSchema = z.object({
|
|
21
|
+
roundTrips: z.number(),
|
|
22
|
+
totalBlockingTime: z.number(),
|
|
23
|
+
roundTripDurations: z.array(z.number()),
|
|
24
|
+
roundTripMethods: z.array(z.array(z.string())),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type NodeStats = {
|
|
28
|
+
/** Per-method call stats */
|
|
29
|
+
perMethod: Partial<Record<keyof AztecNode, { times: number[] }>>;
|
|
30
|
+
/** Round trip stats tracking actual blocking waits */
|
|
31
|
+
roundTrips: RoundTripStats;
|
|
32
|
+
};
|
|
10
33
|
|
|
11
|
-
const NodeStatsSchema = z.
|
|
34
|
+
const NodeStatsSchema = z.object({
|
|
35
|
+
perMethod: z.record(z.string(), z.object({ times: z.array(z.number()) })),
|
|
36
|
+
roundTrips: RoundTripStatsSchema,
|
|
37
|
+
});
|
|
12
38
|
|
|
13
39
|
type FunctionTiming = {
|
|
14
40
|
functionName: string;
|
|
@@ -105,7 +131,15 @@ export class TxProfileResult {
|
|
|
105
131
|
},
|
|
106
132
|
],
|
|
107
133
|
{
|
|
108
|
-
nodeRPCCalls: {
|
|
134
|
+
nodeRPCCalls: {
|
|
135
|
+
perMethod: { getBlockHeader: { times: [1] } },
|
|
136
|
+
roundTrips: {
|
|
137
|
+
roundTrips: 1,
|
|
138
|
+
totalBlockingTime: 1,
|
|
139
|
+
roundTripDurations: [1],
|
|
140
|
+
roundTripMethods: [['getBlockHeader']],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
109
143
|
timings: {
|
|
110
144
|
sync: 1,
|
|
111
145
|
proving: 1,
|
|
@@ -140,7 +174,15 @@ export class UtilitySimulationResult {
|
|
|
140
174
|
|
|
141
175
|
static random(): UtilitySimulationResult {
|
|
142
176
|
return new UtilitySimulationResult([Fr.random()], {
|
|
143
|
-
nodeRPCCalls: {
|
|
177
|
+
nodeRPCCalls: {
|
|
178
|
+
perMethod: { getBlockHeader: { times: [1] } },
|
|
179
|
+
roundTrips: {
|
|
180
|
+
roundTrips: 1,
|
|
181
|
+
totalBlockingTime: 1,
|
|
182
|
+
roundTripDurations: [1],
|
|
183
|
+
roundTripMethods: [['getBlockHeader']],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
144
186
|
timings: {
|
|
145
187
|
sync: 1,
|
|
146
188
|
publicSimulation: 1,
|
package/src/tx/tx.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
-
import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection';
|
|
3
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
3
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
5
4
|
import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -24,13 +23,18 @@ import { TxHash } from './tx_hash.js';
|
|
|
24
23
|
/**
|
|
25
24
|
* The interface of an L2 transaction.
|
|
26
25
|
*/
|
|
26
|
+
// docs:start:tx_class
|
|
27
27
|
export class Tx extends Gossipable {
|
|
28
28
|
static override p2pTopic = TopicType.tx;
|
|
29
29
|
|
|
30
30
|
private calldataMap: Map<string, Fr[]> | undefined;
|
|
31
31
|
|
|
32
32
|
constructor(
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Identifier of the tx.
|
|
35
|
+
* It's a hash of the public inputs of the tx's proof.
|
|
36
|
+
* This claimed hash is reconciled against the tx's public inputs (`this.data`) in data_validator.ts.
|
|
37
|
+
*/
|
|
34
38
|
public readonly txHash: TxHash,
|
|
35
39
|
/**
|
|
36
40
|
* Output of the private kernel circuit for this tx.
|
|
@@ -43,16 +47,20 @@ export class Tx extends Gossipable {
|
|
|
43
47
|
/**
|
|
44
48
|
* Contract class log fields emitted from the tx.
|
|
45
49
|
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
46
|
-
*
|
|
50
|
+
* This claimed data is reconciled against a hash of this data (that is contained within
|
|
51
|
+
* the tx's public inputs (`this.data`)), in data_validator.ts.
|
|
47
52
|
*/
|
|
48
53
|
public readonly contractClassLogFields: ContractClassLogFields[],
|
|
49
54
|
/**
|
|
50
55
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
56
|
+
* This claimed data is reconciled against hashes of this data (that are contained within
|
|
57
|
+
* the tx's public inputs (`this.data`)), in data_validator.ts.
|
|
51
58
|
*/
|
|
52
59
|
public readonly publicFunctionCalldata: HashedValues[],
|
|
53
60
|
) {
|
|
54
61
|
super();
|
|
55
62
|
}
|
|
63
|
+
// docs:end:tx_class
|
|
56
64
|
|
|
57
65
|
// Gossipable method
|
|
58
66
|
override generateP2PMessageIdentifier(): Promise<Buffer32> {
|
|
@@ -238,7 +246,7 @@ export class Tx extends Gossipable {
|
|
|
238
246
|
contractClassLogSize: this.data.getEmittedContractClassLogsLength(),
|
|
239
247
|
|
|
240
248
|
proofSize: this.chonkProof.fields.length,
|
|
241
|
-
size: this.
|
|
249
|
+
size: this.getSize(),
|
|
242
250
|
|
|
243
251
|
feePaymentMethod:
|
|
244
252
|
// needsSetup? then we pay through a fee payment contract
|
|
@@ -246,13 +254,13 @@ export class Tx extends Gossipable {
|
|
|
246
254
|
};
|
|
247
255
|
}
|
|
248
256
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
257
|
+
private sizeCache: number | undefined;
|
|
258
|
+
|
|
259
|
+
getSize(): number {
|
|
260
|
+
if (this.sizeCache == undefined) {
|
|
261
|
+
this.sizeCache = this.toBuffer().length;
|
|
262
|
+
}
|
|
263
|
+
return this.sizeCache;
|
|
256
264
|
}
|
|
257
265
|
|
|
258
266
|
/**
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -28,7 +28,6 @@ import { RevertCode } from '../avm/revert_code.js';
|
|
|
28
28
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
29
29
|
import { PrivateLog } from '../logs/private_log.js';
|
|
30
30
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
31
|
-
import { computeTxOutHash } from '../messaging/out_hash.js';
|
|
32
31
|
import { TxHash } from './tx_hash.js';
|
|
33
32
|
|
|
34
33
|
export class TxEffect {
|
|
@@ -184,14 +183,6 @@ export class TxEffect {
|
|
|
184
183
|
);
|
|
185
184
|
}
|
|
186
185
|
|
|
187
|
-
/**
|
|
188
|
-
* Computes txOutHash of this tx effect.
|
|
189
|
-
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
190
|
-
*/
|
|
191
|
-
txOutHash(): Fr {
|
|
192
|
-
return computeTxOutHash(this.l2ToL1Msgs);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
186
|
static async random({
|
|
196
187
|
numNoteHashes,
|
|
197
188
|
numNullifiers,
|
|
@@ -214,12 +205,14 @@ export class TxEffect {
|
|
|
214
205
|
maxEffects?: number;
|
|
215
206
|
} = {}): Promise<TxEffect> {
|
|
216
207
|
const count = (max: number, num?: number) => num ?? Math.min(maxEffects ?? randomInt(max), max);
|
|
208
|
+
// Every tx effect must have at least 1 nullifier (the first nullifier is used for log indexing)
|
|
209
|
+
const countNullifiers = (max: number, num?: number) => Math.max(1, count(max, num));
|
|
217
210
|
return new TxEffect(
|
|
218
211
|
RevertCode.random(),
|
|
219
212
|
TxHash.random(),
|
|
220
213
|
new Fr(Math.floor(Math.random() * 100_000)),
|
|
221
214
|
makeTuple(count(MAX_NOTE_HASHES_PER_TX, numNoteHashes), Fr.random),
|
|
222
|
-
makeTuple(
|
|
215
|
+
makeTuple(countNullifiers(MAX_NULLIFIERS_PER_TX, numNullifiers), Fr.random),
|
|
223
216
|
makeTuple(count(MAX_L2_TO_L1_MSGS_PER_TX, numL2ToL1Msgs), Fr.random),
|
|
224
217
|
makeTuple(count(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, numPublicDataWrites), PublicDataWrite.random),
|
|
225
218
|
makeTuple(count(MAX_PRIVATE_LOGS_PER_TX, numPrivateLogs), () => PrivateLog.random()),
|
|
@@ -20,6 +20,7 @@ import { TxRequest } from './tx_request.js';
|
|
|
20
20
|
/**
|
|
21
21
|
* Request to execute a transaction. Similar to TxRequest, but has the full args.
|
|
22
22
|
*/
|
|
23
|
+
// docs:start:tx_execution_request_class
|
|
23
24
|
export class TxExecutionRequest {
|
|
24
25
|
constructor(
|
|
25
26
|
/**
|
|
@@ -60,6 +61,7 @@ export class TxExecutionRequest {
|
|
|
60
61
|
*/
|
|
61
62
|
public salt = Fr.random(),
|
|
62
63
|
) {}
|
|
64
|
+
// docs:end:tx_execution_request_class
|
|
63
65
|
|
|
64
66
|
static get schema(): ZodFor<TxExecutionRequest> {
|
|
65
67
|
return z
|
package/src/tx/tx_receipt.ts
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
2
|
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
|
|
6
5
|
import { RevertCode } from '../avm/revert_code.js';
|
|
7
|
-
import {
|
|
6
|
+
import { BlockHash } from '../block/block_hash.js';
|
|
8
7
|
import { type ZodFor, schemas } from '../schemas/schemas.js';
|
|
9
8
|
import { TxHash } from './tx_hash.js';
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* Possible status of a transaction.
|
|
13
|
-
*/
|
|
10
|
+
/** Block inclusion/finalization status. */
|
|
14
11
|
export enum TxStatus {
|
|
15
12
|
DROPPED = 'dropped',
|
|
16
13
|
PENDING = 'pending',
|
|
14
|
+
PROPOSED = 'proposed',
|
|
15
|
+
CHECKPOINTED = 'checkpointed',
|
|
16
|
+
PROVEN = 'proven',
|
|
17
|
+
FINALIZED = 'finalized', // TODO(#13569): Implement finalized status properly
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Tx status sorted by finalization progress. */
|
|
21
|
+
export const SortedTxStatuses: TxStatus[] = [
|
|
22
|
+
TxStatus.DROPPED,
|
|
23
|
+
TxStatus.PENDING,
|
|
24
|
+
TxStatus.PROPOSED,
|
|
25
|
+
TxStatus.CHECKPOINTED,
|
|
26
|
+
TxStatus.PROVEN,
|
|
27
|
+
TxStatus.FINALIZED,
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/** Execution result - only set when tx is in a block. */
|
|
31
|
+
export enum TxExecutionResult {
|
|
17
32
|
SUCCESS = 'success',
|
|
18
33
|
APP_LOGIC_REVERTED = 'app_logic_reverted',
|
|
19
34
|
TEARDOWN_REVERTED = 'teardown_reverted',
|
|
@@ -30,20 +45,52 @@ export class TxReceipt {
|
|
|
30
45
|
constructor(
|
|
31
46
|
/** A unique identifier for a transaction. */
|
|
32
47
|
public txHash: TxHash,
|
|
33
|
-
/** The transaction's status. */
|
|
48
|
+
/** The transaction's block finalization status. */
|
|
34
49
|
public status: TxStatus,
|
|
50
|
+
/** The execution result of the transaction, only set when tx is in a block. */
|
|
51
|
+
public executionResult: TxExecutionResult | undefined,
|
|
35
52
|
/** Description of transaction error, if any. */
|
|
36
|
-
public error: string,
|
|
53
|
+
public error: string | undefined,
|
|
37
54
|
/** The transaction fee paid for the transaction. */
|
|
38
55
|
public transactionFee?: bigint,
|
|
39
56
|
/** The hash of the block containing the transaction. */
|
|
40
|
-
public blockHash?:
|
|
57
|
+
public blockHash?: BlockHash,
|
|
41
58
|
/** The block number in which the transaction was included. */
|
|
42
59
|
public blockNumber?: BlockNumber,
|
|
43
60
|
) {}
|
|
44
61
|
|
|
62
|
+
/** Returns true if the transaction was executed successfully. */
|
|
63
|
+
hasExecutionSucceeded(): boolean {
|
|
64
|
+
return this.executionResult === TxExecutionResult.SUCCESS;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Returns true if the transaction execution reverted. */
|
|
68
|
+
hasExecutionReverted(): boolean {
|
|
69
|
+
return this.executionResult !== undefined && this.executionResult !== TxExecutionResult.SUCCESS;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Returns true if the transaction has been included in a block (proposed, checkpointed, proven, or finalized). */
|
|
73
|
+
isMined(): boolean {
|
|
74
|
+
return (
|
|
75
|
+
this.status === TxStatus.PROPOSED ||
|
|
76
|
+
this.status === TxStatus.CHECKPOINTED ||
|
|
77
|
+
this.status === TxStatus.PROVEN ||
|
|
78
|
+
this.status === TxStatus.FINALIZED
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Returns true if the transaction is pending. */
|
|
83
|
+
isPending(): boolean {
|
|
84
|
+
return this.status === TxStatus.PENDING;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Returns true if the transaction was dropped. */
|
|
88
|
+
isDropped(): boolean {
|
|
89
|
+
return this.status === TxStatus.DROPPED;
|
|
90
|
+
}
|
|
91
|
+
|
|
45
92
|
static empty() {
|
|
46
|
-
return new TxReceipt(TxHash.zero(), TxStatus.DROPPED,
|
|
93
|
+
return new TxReceipt(TxHash.zero(), TxStatus.DROPPED, undefined, undefined);
|
|
47
94
|
}
|
|
48
95
|
|
|
49
96
|
static get schema(): ZodFor<TxReceipt> {
|
|
@@ -51,18 +98,28 @@ export class TxReceipt {
|
|
|
51
98
|
.object({
|
|
52
99
|
txHash: TxHash.schema,
|
|
53
100
|
status: z.nativeEnum(TxStatus),
|
|
54
|
-
|
|
55
|
-
|
|
101
|
+
executionResult: z.nativeEnum(TxExecutionResult).optional(),
|
|
102
|
+
error: z.string().optional(),
|
|
103
|
+
blockHash: BlockHash.schema.optional(),
|
|
56
104
|
blockNumber: BlockNumberSchema.optional(),
|
|
57
105
|
transactionFee: schemas.BigInt.optional(),
|
|
58
106
|
})
|
|
59
|
-
.transform(TxReceipt.from);
|
|
107
|
+
.transform(fields => TxReceipt.from(fields));
|
|
60
108
|
}
|
|
61
109
|
|
|
62
|
-
static from(fields:
|
|
110
|
+
static from(fields: {
|
|
111
|
+
txHash: TxHash;
|
|
112
|
+
status: TxStatus;
|
|
113
|
+
executionResult?: TxExecutionResult;
|
|
114
|
+
error?: string;
|
|
115
|
+
transactionFee?: bigint;
|
|
116
|
+
blockHash?: BlockHash;
|
|
117
|
+
blockNumber?: BlockNumber;
|
|
118
|
+
}) {
|
|
63
119
|
return new TxReceipt(
|
|
64
120
|
fields.txHash,
|
|
65
121
|
fields.status,
|
|
122
|
+
fields.executionResult,
|
|
66
123
|
fields.error,
|
|
67
124
|
fields.transactionFee,
|
|
68
125
|
fields.blockHash,
|
|
@@ -70,15 +127,15 @@ export class TxReceipt {
|
|
|
70
127
|
);
|
|
71
128
|
}
|
|
72
129
|
|
|
73
|
-
public static
|
|
130
|
+
public static executionResultFromRevertCode(revertCode: RevertCode): TxExecutionResult {
|
|
74
131
|
if (revertCode.equals(RevertCode.OK)) {
|
|
75
|
-
return
|
|
132
|
+
return TxExecutionResult.SUCCESS;
|
|
76
133
|
} else if (revertCode.equals(RevertCode.APP_LOGIC_REVERTED)) {
|
|
77
|
-
return
|
|
134
|
+
return TxExecutionResult.APP_LOGIC_REVERTED;
|
|
78
135
|
} else if (revertCode.equals(RevertCode.TEARDOWN_REVERTED)) {
|
|
79
|
-
return
|
|
136
|
+
return TxExecutionResult.TEARDOWN_REVERTED;
|
|
80
137
|
} else if (revertCode.equals(RevertCode.BOTH_REVERTED)) {
|
|
81
|
-
return
|
|
138
|
+
return TxExecutionResult.BOTH_REVERTED;
|
|
82
139
|
} else {
|
|
83
140
|
throw new Error(`Unknown revert code: ${revertCode.getCode()}`);
|
|
84
141
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnyTx, TxValidationResult, TxValidator } from './tx_validator.js';
|
|
2
2
|
|
|
3
|
-
export class EmptyTxValidator<T
|
|
3
|
+
export class EmptyTxValidator<T = AnyTx> implements TxValidator<T> {
|
|
4
4
|
public validateTx(_tx: T): Promise<TxValidationResult> {
|
|
5
5
|
return Promise.resolve({ result: 'valid' });
|
|
6
6
|
}
|
|
@@ -31,6 +31,9 @@ export const TX_ERROR_CONTRACT_CLASS_LOGS = 'Mismatched contract class logs';
|
|
|
31
31
|
export const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = 'Incorrectly sorted contract class logs';
|
|
32
32
|
export const TX_ERROR_INCORRECT_HASH = 'Incorrect tx hash';
|
|
33
33
|
|
|
34
|
+
// Size
|
|
35
|
+
export const TX_ERROR_SIZE_ABOVE_LIMIT = 'Transaction size above size limit';
|
|
36
|
+
|
|
34
37
|
// Block header
|
|
35
38
|
export const TX_ERROR_BLOCK_HEADER = 'Block header not found';
|
|
36
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { zodFor } from '../../schemas/schemas.js';
|
|
4
4
|
import type { ProcessedTx } from '../processed_tx.js';
|
|
5
5
|
import type { Tx } from '../tx.js';
|
|
6
6
|
import type { TxHash } from '../tx_hash.js';
|
|
@@ -20,12 +20,14 @@ export type TxValidationResult =
|
|
|
20
20
|
| { result: 'invalid'; reason: string[] }
|
|
21
21
|
| { result: 'skipped'; reason: string[] };
|
|
22
22
|
|
|
23
|
-
export interface TxValidator<T
|
|
23
|
+
export interface TxValidator<T = AnyTx> {
|
|
24
24
|
validateTx(tx: T): Promise<TxValidationResult>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const TxValidationResultSchema =
|
|
28
|
-
z.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
export const TxValidationResultSchema = zodFor<TxValidationResult>()(
|
|
28
|
+
z.discriminatedUnion('result', [
|
|
29
|
+
z.object({ result: z.literal('valid') }),
|
|
30
|
+
z.object({ result: z.literal('invalid'), reason: z.array(z.string()) }),
|
|
31
|
+
z.object({ result: z.literal('skipped'), reason: z.array(z.string()) }),
|
|
32
|
+
]),
|
|
33
|
+
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { schemas, zodFor } from '@aztec/foundation/schemas';
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -11,20 +11,18 @@ import type {
|
|
|
11
11
|
ValidatorsStats,
|
|
12
12
|
} from './types.js';
|
|
13
13
|
|
|
14
|
-
export const ValidatorStatusInSlotSchema =
|
|
15
|
-
'block-mined',
|
|
16
|
-
|
|
17
|
-
'block-missed',
|
|
18
|
-
'attestation-sent',
|
|
19
|
-
'attestation-missed',
|
|
20
|
-
]) satisfies ZodFor<ValidatorStatusInSlot>;
|
|
14
|
+
export const ValidatorStatusInSlotSchema = zodFor<ValidatorStatusInSlot>()(
|
|
15
|
+
z.enum(['block-mined', 'block-proposed', 'block-missed', 'attestation-sent', 'attestation-missed']),
|
|
16
|
+
);
|
|
21
17
|
|
|
22
|
-
export const ValidatorStatusHistorySchema =
|
|
23
|
-
z.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
18
|
+
export const ValidatorStatusHistorySchema = zodFor<ValidatorStatusHistory>()(
|
|
19
|
+
z.array(
|
|
20
|
+
z.object({
|
|
21
|
+
slot: schemas.SlotNumber,
|
|
22
|
+
status: ValidatorStatusInSlotSchema,
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
);
|
|
28
26
|
|
|
29
27
|
export const ValidatorStatusHistorySchemaArray = z.array(ValidatorStatusHistorySchema);
|
|
30
28
|
|
|
@@ -36,40 +34,48 @@ const ValidatorTimeStatSchema = z.object({
|
|
|
36
34
|
date: z.string(),
|
|
37
35
|
});
|
|
38
36
|
|
|
39
|
-
const ValidatorMissedStatsSchema =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
const ValidatorMissedStatsSchema = zodFor<ValidatorMissedStats>()(
|
|
38
|
+
z.object({
|
|
39
|
+
currentStreak: schemas.Integer,
|
|
40
|
+
rate: z.number().optional(),
|
|
41
|
+
count: schemas.Integer,
|
|
42
|
+
total: schemas.Integer,
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
45
|
|
|
46
|
-
export const ValidatorStatsSchema =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
export const ValidatorStatsSchema = zodFor<ValidatorStats>()(
|
|
47
|
+
z.object({
|
|
48
|
+
address: schemas.EthAddress,
|
|
49
|
+
lastProposal: ValidatorTimeStatSchema.optional(),
|
|
50
|
+
lastAttestation: ValidatorTimeStatSchema.optional(),
|
|
51
|
+
totalSlots: schemas.Integer,
|
|
52
|
+
missedProposals: ValidatorMissedStatsSchema,
|
|
53
|
+
missedAttestations: ValidatorMissedStatsSchema,
|
|
54
|
+
history: ValidatorStatusHistorySchema,
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
55
57
|
|
|
56
|
-
export const ValidatorsStatsSchema =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
export const ValidatorsStatsSchema = zodFor<ValidatorsStats>()(
|
|
59
|
+
z.object({
|
|
60
|
+
stats: z.record(ValidatorStatsSchema),
|
|
61
|
+
lastProcessedSlot: schemas.SlotNumber.optional(),
|
|
62
|
+
initialSlot: schemas.SlotNumber.optional(),
|
|
63
|
+
slotWindow: schemas.Integer,
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
62
66
|
|
|
63
|
-
export const SingleValidatorStatsSchema =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
z.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
export const SingleValidatorStatsSchema = zodFor<SingleValidatorStats>()(
|
|
68
|
+
z.object({
|
|
69
|
+
validator: ValidatorStatsSchema,
|
|
70
|
+
allTimeProvenPerformance: z.array(
|
|
71
|
+
z.object({
|
|
72
|
+
missed: schemas.Integer,
|
|
73
|
+
total: schemas.Integer,
|
|
74
|
+
epoch: schemas.EpochNumber,
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
77
|
+
lastProcessedSlot: schemas.SlotNumber.optional(),
|
|
78
|
+
initialSlot: schemas.SlotNumber.optional(),
|
|
79
|
+
slotWindow: schemas.Integer,
|
|
80
|
+
}),
|
|
81
|
+
);
|