@aztec/stdlib 0.86.0 → 0.87.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 +291 -241
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +14 -14
- package/dest/abi/buffer.d.ts +0 -2
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/contract_artifact.d.ts +0 -2
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +3 -16
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +1 -1
- package/dest/abi/event_selector.d.ts +0 -2
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +0 -2
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.d.ts +0 -2
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/selector.d.ts +0 -3
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/utils.d.ts +0 -2
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/auth_witness/auth_witness.d.ts +1 -3
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +39 -40
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +5 -5
- package/dest/avm/avm_accumulated_data.d.ts +4 -4
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +18 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +2 -4
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +26 -1
- package/dest/avm/avm_proving_request.d.ts +15 -17
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/contract_storage_read.d.ts +1 -3
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +1 -3
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/message_pack.d.ts +0 -2
- package/dest/avm/message_pack.d.ts.map +1 -1
- package/dest/avm/message_pack.js +7 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +1 -3
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_hint.d.ts +1 -3
- package/dest/avm/public_data_hint.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +1 -3
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +1 -4
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +4 -3
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +19 -1
- package/dest/avm/public_inner_call_request.d.ts +1 -4
- package/dest/avm/public_inner_call_request.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.js +1 -1
- package/dest/avm/revert_code.d.ts +0 -3
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/aztec-address/index.d.ts +1 -4
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/block/block_hash.d.ts +1 -3
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/body.d.ts +1 -4
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -11
- package/dest/block/l2_block.d.ts +1 -20
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +1 -41
- package/dest/block/l2_block_code_to_purge.d.ts +0 -2
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_source.d.ts +0 -1
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/published_l2_block.d.ts +2 -1
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +5 -18
- package/dest/config/{config.d.ts → chain-config.d.ts} +1 -1
- package/dest/config/chain-config.d.ts.map +1 -0
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +2 -1
- package/dest/config/node-rpc-config.d.ts +7 -0
- package/dest/config/node-rpc-config.d.ts.map +1 -0
- package/dest/config/node-rpc-config.js +8 -0
- package/dest/contract/artifact_hash.d.ts +1 -3
- package/dest/contract/artifact_hash.d.ts.map +1 -1
- package/dest/contract/artifact_hash.js +3 -2
- package/dest/contract/complete_address.d.ts +0 -2
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_class_id.d.ts +0 -2
- package/dest/contract/contract_class_id.d.ts.map +1 -1
- package/dest/contract/contract_instance.d.ts +1 -3
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance_update.d.ts +1 -3
- package/dest/contract/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.d.ts +17 -19
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +2 -2
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/private_function.d.ts +0 -2
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +0 -4
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/errors/simulation_error.d.ts.map +1 -1
- package/dest/errors/simulation_error.js +2 -2
- package/dest/file-store/factory.js +1 -1
- package/dest/file-store/gcs.d.ts +0 -2
- package/dest/file-store/gcs.d.ts.map +1 -1
- package/dest/file-store/http.d.ts +1 -2
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +32 -16
- package/dest/file-store/interface.d.ts +0 -2
- package/dest/file-store/interface.d.ts.map +1 -1
- package/dest/file-store/local.d.ts +0 -2
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/gas/gas.d.ts +1 -4
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas_fees.d.ts +1 -4
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_settings.d.ts +1 -3
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.d.ts +10 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +4 -1
- package/dest/interfaces/aztec-node.d.ts +1 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +7 -2
- package/dest/interfaces/configs.d.ts +5 -0
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +1 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +0 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +2 -0
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +1 -0
- package/dest/interfaces/private_kernel_prover.d.ts +0 -2
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +15 -17
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +6 -6
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +4 -4
- package/dest/interfaces/service.d.ts +2 -3
- package/dest/interfaces/service.d.ts.map +1 -1
- package/dest/interfaces/world_state.d.ts +4 -1
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/combined_constant_data.d.ts +1 -3
- package/dest/kernel/combined_constant_data.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_hint.d.ts +1 -3
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +1 -3
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +1 -3
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts +0 -2
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts +0 -2
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +1 -3
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +0 -2
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +4 -6
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/rollup_validation_requests.d.ts +1 -3
- package/dest/kernel/hints/rollup_validation_requests.d.ts.map +1 -1
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts +1 -3
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/transient_data_index_hint.d.ts +0 -3
- package/dest/kernel/hints/transient_data_index_hint.d.ts.map +1 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts +0 -2
- package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +1 -1
- package/dest/kernel/log_hash.d.ts +27 -9
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +72 -13
- package/dest/kernel/note_hash.d.ts +0 -2
- package/dest/kernel/note_hash.d.ts.map +1 -1
- package/dest/kernel/nullifier.d.ts +0 -2
- package/dest/kernel/nullifier.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.d.ts +4 -6
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_call_data.d.ts +0 -2
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_request.d.ts +1 -3
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_call_request.js +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +5 -7
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +4 -4
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +2 -4
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.d.ts +1 -3
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -3
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts +1 -3
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +31 -7
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.js +5 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +2 -4
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +1 -3
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_simulated_output.d.ts +0 -2
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -3
- 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 +8 -8
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +4 -2
- package/dest/kernel/private_log_data.d.ts +1 -4
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_log_data.js +4 -2
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +3 -5
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +7 -0
- package/dest/kernel/private_to_public_accumulated_data.d.ts +1 -4
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +1 -3
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +2 -5
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +2 -4
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +1 -4
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +1 -1
- package/dest/kernel/public_call_request.d.ts +2 -5
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/utils/optional_number.d.ts +1 -3
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/public_keys.d.ts +0 -2
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +0 -1
- package/dest/logs/contract_class_log.d.ts +53 -12
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +129 -66
- package/dest/logs/extended_contract_class_log.d.ts +0 -2
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +0 -2
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/indexed_tagging_secret.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +0 -2
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +8 -3
- package/dest/logs/private_log.d.ts +13 -7
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +44 -30
- package/dest/logs/public_log.d.ts +9 -9
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +45 -32
- package/dest/logs/tx_scoped_l2_log.d.ts +8 -6
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +1 -2
- package/dest/messaging/inbox_leaf.d.ts +5 -2
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/inbox_leaf.js +11 -0
- package/dest/messaging/l1_actor.d.ts +0 -2
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +0 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l2_actor.d.ts +0 -2
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.d.ts +0 -2
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/note/extended_note.d.ts +3 -5
- package/dest/note/extended_note.d.ts.map +1 -1
- package/dest/note/note.d.ts +5 -13
- package/dest/note/note.d.ts.map +1 -1
- package/dest/p2p/block_attestation.d.ts +6 -5
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +12 -11
- package/dest/p2p/block_proposal.d.ts +17 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +29 -13
- package/dest/p2p/consensus_payload.d.ts +185 -12
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +24 -14
- package/dest/p2p/gossipable.d.ts +14 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +43 -0
- package/dest/p2p/signature_utils.d.ts +0 -2
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +5 -0
- package/dest/parity/base_parity_inputs.d.ts +2 -4
- package/dest/parity/base_parity_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +2 -4
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/root_parity_input.d.ts +4 -6
- package/dest/parity/root_parity_input.d.ts.map +1 -1
- package/dest/parity/root_parity_inputs.d.ts +2 -4
- package/dest/parity/root_parity_inputs.d.ts.map +1 -1
- package/dest/proofs/client_ivc_proof.d.ts +2 -4
- package/dest/proofs/client_ivc_proof.d.ts.map +1 -1
- package/dest/proofs/proof.d.ts +1 -3
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +5 -5
- package/dest/proofs/recursive_proof.d.ts +4 -6
- 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/base_or_merge_rollup_public_inputs.d.ts +2 -4
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +9 -11
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +5 -5
- package/dest/rollup/block_merge_rollup.d.ts +2 -4
- package/dest/rollup/block_merge_rollup.d.ts.map +1 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +11 -5
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +6 -2
- package/dest/rollup/block_root_rollup.d.ts +8 -10
- package/dest/rollup/block_root_rollup.d.ts.map +1 -1
- package/dest/rollup/constant_rollup_data.d.ts +1 -3
- package/dest/rollup/constant_rollup_data.d.ts.map +1 -1
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +2 -4
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +1 -1
- package/dest/rollup/merge_rollup.d.ts +2 -4
- package/dest/rollup/merge_rollup.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_block_data.d.ts +0 -2
- package/dest/rollup/previous_rollup_block_data.d.ts.map +1 -1
- package/dest/rollup/previous_rollup_data.d.ts +0 -2
- package/dest/rollup/previous_rollup_data.d.ts.map +1 -1
- package/dest/rollup/private_base_rollup_inputs.d.ts +2 -4
- package/dest/rollup/private_base_rollup_inputs.d.ts.map +1 -1
- package/dest/rollup/private_tube_data.d.ts +1 -3
- package/dest/rollup/private_tube_data.d.ts.map +1 -1
- package/dest/rollup/public_base_rollup_inputs.d.ts +2 -4
- package/dest/rollup/public_base_rollup_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tube_data.d.ts +1 -3
- package/dest/rollup/public_tube_data.d.ts.map +1 -1
- package/dest/rollup/root_rollup.d.ts +9 -8
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +12 -3
- package/dest/rollup/state_diff_hints.d.ts +0 -2
- package/dest/rollup/state_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tube_inputs.d.ts +2 -4
- package/dest/rollup/tube_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +4 -6
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/shared_mutable/scheduled_delay_change.d.ts.map +1 -1
- package/dest/shared_mutable/scheduled_value_change.d.ts.map +1 -1
- package/dest/shared_mutable/shared_mutable_values.d.ts +0 -2
- package/dest/shared_mutable/shared_mutable_values.d.ts.map +1 -1
- package/dest/snapshots/download.d.ts +1 -1
- package/dest/snapshots/download.d.ts.map +1 -1
- package/dest/snapshots/download.js +3 -3
- package/dest/snapshots/index.d.ts +1 -1
- package/dest/snapshots/index.d.ts.map +1 -1
- package/dest/snapshots/index.js +1 -1
- package/dest/snapshots/types.d.ts +27 -4
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/snapshots/types.js +8 -0
- package/dest/snapshots/upload.d.ts +6 -3
- package/dest/snapshots/upload.d.ts.map +1 -1
- package/dest/snapshots/upload.js +10 -6
- package/dest/tests/factories.d.ts +0 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +19 -16
- package/dest/tests/mocks.d.ts +13 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +40 -8
- package/dest/trees/append_only_tree_snapshot.d.ts +1 -4
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.d.ts +0 -2
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +4 -6
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/protocol_contract_leaf.d.ts +0 -2
- package/dest/trees/protocol_contract_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +1 -3
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +4 -6
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +3 -4
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +5 -1
- package/dest/tx/call_context.d.ts +1 -4
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +1 -3
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/content_commitment.d.ts +10 -12
- package/dest/tx/content_commitment.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +0 -2
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +1 -4
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/hashed_values.d.ts +1 -3
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/index.d.ts +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -1
- package/dest/tx/max_block_number.d.ts +1 -3
- package/dest/tx/max_block_number.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.d.ts +1 -3
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +18 -9
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +12 -3
- package/dest/tx/profiling.d.ts +110 -0
- package/dest/tx/profiling.d.ts.map +1 -0
- package/dest/tx/profiling.js +97 -0
- package/dest/tx/proposed_block_header.d.ts +80 -0
- package/dest/tx/proposed_block_header.d.ts.map +1 -0
- package/dest/tx/proposed_block_header.js +130 -0
- package/dest/tx/proven_tx.d.ts +73 -1
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +7 -2
- package/dest/tx/public_call_request_with_calldata.d.ts +1 -4
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/simulated_tx.d.ts +5 -3
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +10 -5
- package/dest/tx/state_reference.d.ts +1 -4
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.d.ts +1 -4
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +6 -11
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -15
- package/dest/tx/tx_constant_data.d.ts +1 -3
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_context.d.ts +1 -3
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +1 -4
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +33 -63
- package/dest/tx/tx_execution_request.d.ts +13 -6
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_execution_request.js +14 -7
- package/dest/tx/tx_hash.d.ts +2 -4
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +1 -1
- package/dest/tx/tx_request.d.ts +7 -5
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/tx_request.js +8 -5
- package/dest/tx/validator/error_texts.d.ts +4 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +4 -2
- package/dest/types/shared.d.ts +5 -3
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/update-checker/index.d.ts +2 -0
- package/dest/update-checker/index.d.ts.map +1 -0
- package/dest/update-checker/index.js +1 -0
- package/dest/update-checker/update-checker.d.ts +48 -0
- package/dest/update-checker/update-checker.d.ts.map +1 -0
- package/dest/update-checker/update-checker.js +121 -0
- package/dest/validators/schemas.d.ts +24 -24
- package/dest/validators/schemas.js +1 -1
- package/dest/validators/types.d.ts +2 -2
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/versioning.d.ts +1 -1
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/verification_key.d.ts +7 -9
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_witness_data.d.ts +1 -3
- package/dest/vks/vk_witness_data.d.ts.map +1 -1
- package/package.json +16 -13
- package/src/abi/abi.ts +29 -12
- package/src/abi/contract_artifact.ts +3 -17
- package/src/abi/decoder.ts +10 -3
- package/src/abi/encoder.ts +5 -2
- package/src/avm/avm.ts +13 -7
- package/src/avm/avm_accumulated_data.ts +30 -2
- package/src/avm/avm_circuit_public_inputs.ts +26 -0
- package/src/avm/message_pack.ts +7 -1
- package/src/avm/public_data_write.ts +21 -1
- package/src/avm/public_inner_call_request.ts +1 -1
- package/src/avm/revert_code.ts +5 -5
- package/src/block/body.ts +5 -11
- package/src/block/l2_block.ts +1 -61
- package/src/block/published_l2_block.ts +8 -16
- package/src/config/index.ts +2 -1
- package/src/config/node-rpc-config.ts +14 -0
- package/src/contract/artifact_hash.ts +5 -3
- package/src/contract/private_function.ts +4 -2
- package/src/errors/proving_error.ts +5 -1
- package/src/errors/simulation_error.ts +2 -2
- package/src/file-store/factory.ts +1 -1
- package/src/file-store/http.ts +27 -18
- package/src/gas/gas.ts +4 -1
- package/src/interfaces/aztec-node-admin.ts +16 -0
- package/src/interfaces/aztec-node.ts +4 -2
- package/src/interfaces/configs.ts +3 -0
- package/src/interfaces/p2p.ts +4 -0
- package/src/interfaces/prover-client.ts +4 -1
- package/src/interfaces/pxe.ts +12 -7
- package/src/interfaces/service.ts +2 -3
- package/src/interfaces/world_state.ts +6 -1
- package/src/kernel/hints/note_hash_read_request_hints.ts +4 -1
- package/src/kernel/hints/nullifier_read_request_hints.ts +4 -1
- package/src/kernel/hints/read_request.ts +4 -1
- package/src/kernel/hints/read_request_hints.ts +12 -3
- package/src/kernel/hints/transient_data_index_hint.ts +4 -1
- package/src/kernel/hints/tree_leaf_read_request.ts +4 -1
- package/src/kernel/log_hash.ts +86 -14
- package/src/kernel/note_hash.ts +8 -2
- package/src/kernel/nullifier.ts +9 -2
- package/src/kernel/private_accumulated_data.ts +4 -4
- package/src/kernel/private_call_request.ts +1 -1
- package/src/kernel/private_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_kernel_prover_output.ts +10 -0
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +13 -2
- package/src/kernel/private_log_data.ts +13 -4
- package/src/kernel/private_to_avm_accumulated_data.ts +9 -1
- package/src/kernel/private_validation_requests.ts +1 -1
- package/src/kernel/public_call_request.ts +4 -1
- package/src/keys/public_keys.ts +1 -1
- package/src/logs/contract_class_log.ts +156 -57
- package/src/logs/indexed_tagging_secret.ts +4 -1
- package/src/logs/log_with_tx_data.ts +7 -2
- package/src/logs/private_log.ts +52 -30
- package/src/logs/public_log.ts +62 -38
- package/src/logs/tx_scoped_l2_log.ts +1 -2
- package/src/messaging/inbox_leaf.ts +10 -0
- package/src/messaging/l2_to_l1_message.ts +9 -2
- package/src/p2p/block_attestation.ts +16 -12
- package/src/p2p/block_proposal.ts +42 -11
- package/src/p2p/consensus_payload.ts +33 -16
- package/src/p2p/gossipable.ts +44 -2
- package/src/p2p/topic_type.ts +2 -0
- package/src/proofs/proof.ts +5 -5
- package/src/rollup/base_rollup_hints.ts +7 -7
- package/src/rollup/block_root_or_block_merge_public_inputs.ts +10 -1
- package/src/rollup/private_base_rollup_inputs.ts +4 -1
- package/src/rollup/root_rollup.ts +12 -0
- package/src/rollup/tube_inputs.ts +4 -1
- package/src/shared_mutable/scheduled_delay_change.ts +5 -1
- package/src/shared_mutable/scheduled_value_change.ts +5 -1
- package/src/shared_mutable/shared_mutable_values.ts +4 -1
- package/src/snapshots/download.ts +3 -4
- package/src/snapshots/index.ts +1 -1
- package/src/snapshots/types.ts +12 -0
- package/src/snapshots/upload.ts +19 -11
- package/src/tests/factories.ts +35 -18
- package/src/tests/mocks.ts +69 -10
- package/src/tx/block_header.ts +16 -2
- package/src/tx/content_commitment.ts +6 -1
- package/src/tx/index.ts +2 -1
- package/src/tx/private_execution_result.ts +14 -5
- package/src/tx/profiling.ts +126 -0
- package/src/tx/proposed_block_header.ts +169 -0
- package/src/tx/proven_tx.ts +4 -0
- package/src/tx/simulated_tx.ts +12 -2
- package/src/tx/tx.ts +18 -17
- package/src/tx/tx_effect.ts +36 -76
- package/src/tx/tx_execution_request.ts +11 -0
- package/src/tx/tx_receipt.ts +1 -1
- package/src/tx/tx_request.ts +12 -3
- package/src/tx/validator/error_texts.ts +4 -2
- package/src/types/shared.ts +5 -0
- package/src/update-checker/index.ts +1 -0
- package/src/update-checker/update-checker.ts +152 -0
- package/src/validators/schemas.ts +1 -1
- package/src/validators/types.ts +2 -2
- package/src/versioning/versioning.ts +1 -1
- package/src/vks/verification_key.ts +8 -2
- package/dest/config/config.d.ts.map +0 -1
- package/dest/tx/profiled_tx.d.ts +0 -9
- package/dest/tx/profiled_tx.d.ts.map +0 -1
- package/dest/tx/profiled_tx.js +0 -28
- package/src/tx/profiled_tx.ts +0 -28
- /package/dest/config/{config.js → chain-config.js} +0 -0
- /package/src/config/{config.ts → chain-config.ts} +0 -0
package/src/abi/encoder.ts
CHANGED
|
@@ -10,7 +10,10 @@ import { isAddressStruct, isFunctionSelectorStruct, isWrappedFieldStruct } from
|
|
|
10
10
|
class ArgumentEncoder {
|
|
11
11
|
private flattened: Fr[] = [];
|
|
12
12
|
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(
|
|
14
|
+
private abi: FunctionAbi,
|
|
15
|
+
private args: any[],
|
|
16
|
+
) {}
|
|
14
17
|
|
|
15
18
|
static typeSize(abiType: AbiType): number {
|
|
16
19
|
switch (abiType.kind) {
|
|
@@ -124,7 +127,7 @@ class ArgumentEncoder {
|
|
|
124
127
|
}
|
|
125
128
|
break;
|
|
126
129
|
default:
|
|
127
|
-
throw new Error(`Unsupported type: ${abiType}`);
|
|
130
|
+
throw new Error(`Unsupported type: ${abiType.kind}`);
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
|
package/src/avm/avm.ts
CHANGED
|
@@ -41,7 +41,10 @@ export class AvmContractClassHint {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export class AvmBytecodeCommitmentHint {
|
|
44
|
-
constructor(
|
|
44
|
+
constructor(
|
|
45
|
+
public readonly classId: Fr,
|
|
46
|
+
public readonly commitment: Fr,
|
|
47
|
+
) {}
|
|
45
48
|
|
|
46
49
|
static get schema() {
|
|
47
50
|
return z
|
|
@@ -159,7 +162,7 @@ type IndexedTreeLeafPreimagesClasses = typeof NullifierLeafPreimage | typeof Pub
|
|
|
159
162
|
// NOTE: I need this factory because in order to get hold of the schema, I need an actual instance of the class,
|
|
160
163
|
// having the type doesn't suffice since TS does type erasure in the end.
|
|
161
164
|
function AvmGetLeafPreimageHintFactory(klass: IndexedTreeLeafPreimagesClasses) {
|
|
162
|
-
return class
|
|
165
|
+
return class {
|
|
163
166
|
constructor(
|
|
164
167
|
public readonly hintKey: AppendOnlyTreeSnapshot,
|
|
165
168
|
// params (tree id will be implicit)
|
|
@@ -175,7 +178,7 @@ function AvmGetLeafPreimageHintFactory(klass: IndexedTreeLeafPreimagesClasses) {
|
|
|
175
178
|
index: schemas.BigInt,
|
|
176
179
|
leafPreimage: klass.schema,
|
|
177
180
|
})
|
|
178
|
-
.transform(({ hintKey, index, leafPreimage }) => new
|
|
181
|
+
.transform(({ hintKey, index, leafPreimage }) => new this(hintKey, index, leafPreimage));
|
|
179
182
|
}
|
|
180
183
|
};
|
|
181
184
|
}
|
|
@@ -212,7 +215,7 @@ export class AvmGetLeafValueHint {
|
|
|
212
215
|
// NOTE: I need this factory because in order to get hold of the schema, I need an actual instance of the class,
|
|
213
216
|
// having the type doesn't suffice since TS does type erasure in the end.
|
|
214
217
|
function AvmSequentialInsertHintFactory(klass: IndexedTreeLeafPreimagesClasses) {
|
|
215
|
-
return class
|
|
218
|
+
return class {
|
|
216
219
|
constructor(
|
|
217
220
|
public readonly hintKey: AppendOnlyTreeSnapshot,
|
|
218
221
|
public readonly stateAfter: AppendOnlyTreeSnapshot,
|
|
@@ -252,7 +255,7 @@ function AvmSequentialInsertHintFactory(klass: IndexedTreeLeafPreimagesClasses)
|
|
|
252
255
|
})
|
|
253
256
|
.transform(
|
|
254
257
|
({ hintKey, stateAfter, treeId, leaf, lowLeavesWitnessData, insertionWitnessData }) =>
|
|
255
|
-
new
|
|
258
|
+
new this(hintKey, stateAfter, treeId, leaf, lowLeavesWitnessData, insertionWitnessData),
|
|
256
259
|
);
|
|
257
260
|
}
|
|
258
261
|
};
|
|
@@ -306,7 +309,7 @@ class AvmCheckpointActionNoStateChangeHint {
|
|
|
306
309
|
})
|
|
307
310
|
.transform(
|
|
308
311
|
({ actionCounter, oldCheckpointId, newCheckpointId }) =>
|
|
309
|
-
new
|
|
312
|
+
new this(actionCounter, oldCheckpointId, newCheckpointId),
|
|
310
313
|
);
|
|
311
314
|
}
|
|
312
315
|
}
|
|
@@ -608,7 +611,10 @@ export class AvmExecutionHints {
|
|
|
608
611
|
}
|
|
609
612
|
|
|
610
613
|
export class AvmCircuitInputs {
|
|
611
|
-
constructor(
|
|
614
|
+
constructor(
|
|
615
|
+
public readonly hints: AvmExecutionHints,
|
|
616
|
+
public publicInputs: AvmCircuitPublicInputs,
|
|
617
|
+
) {}
|
|
612
618
|
|
|
613
619
|
static empty() {
|
|
614
620
|
return new AvmCircuitInputs(AvmExecutionHints.empty(), AvmCircuitPublicInputs.empty());
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
+
AVM_ACCUMULATED_DATA_LENGTH,
|
|
2
3
|
MAX_L2_TO_L1_MSGS_PER_TX,
|
|
3
4
|
MAX_NOTE_HASHES_PER_TX,
|
|
4
5
|
MAX_NULLIFIERS_PER_TX,
|
|
5
6
|
MAX_PUBLIC_LOGS_PER_TX,
|
|
6
7
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
7
8
|
} from '@aztec/constants';
|
|
8
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
9
|
+
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
9
10
|
import { arraySerializedSizeOfNonEmpty } from '@aztec/foundation/collection';
|
|
10
11
|
import { Fr } from '@aztec/foundation/fields';
|
|
11
12
|
import { schemas } from '@aztec/foundation/schemas';
|
|
12
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
BufferReader,
|
|
15
|
+
FieldReader,
|
|
16
|
+
type Tuple,
|
|
17
|
+
assertLength,
|
|
18
|
+
serializeToBuffer,
|
|
19
|
+
serializeToFields,
|
|
20
|
+
} from '@aztec/foundation/serialize';
|
|
13
21
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
14
22
|
|
|
15
23
|
import { inspect } from 'util';
|
|
@@ -92,6 +100,16 @@ export class AvmAccumulatedData {
|
|
|
92
100
|
return serializeToBuffer(this.noteHashes, this.nullifiers, this.l2ToL1Msgs, this.publicLogs, this.publicDataWrites);
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
static getFields(fields: FieldsOf<AvmAccumulatedData>) {
|
|
104
|
+
return [
|
|
105
|
+
fields.noteHashes,
|
|
106
|
+
fields.nullifiers,
|
|
107
|
+
fields.l2ToL1Msgs,
|
|
108
|
+
fields.publicLogs,
|
|
109
|
+
fields.publicDataWrites,
|
|
110
|
+
] as const;
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
static fromFields(fields: Fr[] | FieldReader) {
|
|
96
114
|
const reader = FieldReader.asReader(fields);
|
|
97
115
|
return new this(
|
|
@@ -103,6 +121,16 @@ export class AvmAccumulatedData {
|
|
|
103
121
|
);
|
|
104
122
|
}
|
|
105
123
|
|
|
124
|
+
toFields(): Fr[] {
|
|
125
|
+
const fields = serializeToFields(...AvmAccumulatedData.getFields(this));
|
|
126
|
+
if (fields.length !== AVM_ACCUMULATED_DATA_LENGTH) {
|
|
127
|
+
throw new Error(
|
|
128
|
+
`Invalid number of fields for AvmAccumulatedData. Expected ${AVM_ACCUMULATED_DATA_LENGTH}, got ${fields.length}`,
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return fields;
|
|
132
|
+
}
|
|
133
|
+
|
|
106
134
|
static fromString(str: string) {
|
|
107
135
|
return this.fromBuffer(hexToBuffer(str));
|
|
108
136
|
}
|
|
@@ -24,6 +24,8 @@ import { serializeWithMessagePack } from './message_pack.js';
|
|
|
24
24
|
// At some point it might be worth writing Zod schemas for all dependent types and get rid of that.
|
|
25
25
|
export class AvmCircuitPublicInputs {
|
|
26
26
|
constructor(
|
|
27
|
+
///////////////////////////////////
|
|
28
|
+
// Inputs.
|
|
27
29
|
public globalVariables: GlobalVariables,
|
|
28
30
|
public startTreeSnapshots: TreeSnapshots,
|
|
29
31
|
public startGasUsed: Gas,
|
|
@@ -36,6 +38,8 @@ export class AvmCircuitPublicInputs {
|
|
|
36
38
|
public previousRevertibleAccumulatedDataArrayLengths: PrivateToAvmAccumulatedDataArrayLengths,
|
|
37
39
|
public previousNonRevertibleAccumulatedData: PrivateToAvmAccumulatedData,
|
|
38
40
|
public previousRevertibleAccumulatedData: PrivateToAvmAccumulatedData,
|
|
41
|
+
///////////////////////////////////
|
|
42
|
+
// Outputs.
|
|
39
43
|
public endTreeSnapshots: TreeSnapshots,
|
|
40
44
|
public endGasUsed: Gas,
|
|
41
45
|
public accumulatedData: AvmAccumulatedData,
|
|
@@ -182,6 +186,28 @@ export class AvmCircuitPublicInputs {
|
|
|
182
186
|
);
|
|
183
187
|
}
|
|
184
188
|
|
|
189
|
+
toFields() {
|
|
190
|
+
return [
|
|
191
|
+
...this.globalVariables.toFields(),
|
|
192
|
+
...this.startTreeSnapshots.toFields(),
|
|
193
|
+
...this.startGasUsed.toFields(),
|
|
194
|
+
...this.gasSettings.toFields(),
|
|
195
|
+
this.feePayer,
|
|
196
|
+
...this.publicSetupCallRequests.map(request => request.toFields()),
|
|
197
|
+
...this.publicAppLogicCallRequests.map(request => request.toFields()),
|
|
198
|
+
...this.publicTeardownCallRequest.toFields(),
|
|
199
|
+
...this.previousNonRevertibleAccumulatedDataArrayLengths.toFields(),
|
|
200
|
+
...this.previousRevertibleAccumulatedDataArrayLengths.toFields(),
|
|
201
|
+
...this.previousNonRevertibleAccumulatedData.toFields(),
|
|
202
|
+
...this.previousRevertibleAccumulatedData.toFields(),
|
|
203
|
+
...this.endTreeSnapshots.toFields(),
|
|
204
|
+
...this.endGasUsed.toFields(),
|
|
205
|
+
...this.accumulatedData.toFields(),
|
|
206
|
+
this.transactionFee,
|
|
207
|
+
this.reverted,
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
|
|
185
211
|
static empty() {
|
|
186
212
|
return new AvmCircuitPublicInputs(
|
|
187
213
|
GlobalVariables.empty(),
|
package/src/avm/message_pack.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
1
2
|
import { Fq, Fr, Point } from '@aztec/foundation/fields';
|
|
2
3
|
|
|
3
4
|
import { strict as assert } from 'assert';
|
|
@@ -30,7 +31,7 @@ function setUpMessagePackExtensions() {
|
|
|
30
31
|
Class: Fq,
|
|
31
32
|
write: (fq: Fq) => fq.toBuffer(),
|
|
32
33
|
});
|
|
33
|
-
// AztecAddress is a class that has a field in TS, but
|
|
34
|
+
// AztecAddress is a class that has a field in TS, but is itself a field in C++.
|
|
34
35
|
addExtension({
|
|
35
36
|
Class: AztecAddress,
|
|
36
37
|
write: (addr: AztecAddress) => addr.toField(),
|
|
@@ -44,5 +45,10 @@ function setUpMessagePackExtensions() {
|
|
|
44
45
|
return { x: new Fq(p.x.toBigInt()), y: new Fq(p.y.toBigInt()) };
|
|
45
46
|
},
|
|
46
47
|
});
|
|
48
|
+
// EthAddress is a class that has a buffer in TS, but is itself just a field in C++.
|
|
49
|
+
addExtension({
|
|
50
|
+
Class: EthAddress,
|
|
51
|
+
write: (addr: EthAddress) => addr.toField().toBuffer(),
|
|
52
|
+
});
|
|
47
53
|
messagePackWasSetUp = true;
|
|
48
54
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { PUBLIC_DATA_WRITE_LENGTH } from '@aztec/constants';
|
|
1
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
3
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
4
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
7
|
|
|
@@ -45,6 +46,25 @@ export class PublicDataWrite {
|
|
|
45
46
|
return new PublicDataWrite(reader.readField(), reader.readField());
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
toFields(): Fr[] {
|
|
50
|
+
const fields = serializeToFields(...PublicDataWrite.getFields(this));
|
|
51
|
+
if (fields.length !== PUBLIC_DATA_WRITE_LENGTH) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Invalid number of fields for PublicDataWrite. Expected ${PUBLIC_DATA_WRITE_LENGTH}, got ${fields.length}`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return fields;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static fromBlobFields(fields: Fr[] | FieldReader) {
|
|
60
|
+
const reader = FieldReader.asReader(fields);
|
|
61
|
+
return new PublicDataWrite(reader.readField(), reader.readField());
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
toBlobFields(): Fr[] {
|
|
65
|
+
return [this.leafSlot, this.value];
|
|
66
|
+
}
|
|
67
|
+
|
|
48
68
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
49
69
|
const reader = BufferReader.asReader(buffer);
|
|
50
70
|
return new PublicDataWrite(Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
package/src/avm/revert_code.ts
CHANGED
|
@@ -13,10 +13,10 @@ export enum RevertCodeEnum {
|
|
|
13
13
|
|
|
14
14
|
function isRevertCodeEnum(value: number): value is RevertCodeEnum {
|
|
15
15
|
return (
|
|
16
|
-
value === RevertCodeEnum.OK ||
|
|
17
|
-
value === RevertCodeEnum.APP_LOGIC_REVERTED ||
|
|
18
|
-
value === RevertCodeEnum.TEARDOWN_REVERTED ||
|
|
19
|
-
value === RevertCodeEnum.BOTH_REVERTED
|
|
16
|
+
(value as RevertCodeEnum) === RevertCodeEnum.OK ||
|
|
17
|
+
(value as RevertCodeEnum) === RevertCodeEnum.APP_LOGIC_REVERTED ||
|
|
18
|
+
(value as RevertCodeEnum) === RevertCodeEnum.TEARDOWN_REVERTED ||
|
|
19
|
+
(value as RevertCodeEnum) === RevertCodeEnum.BOTH_REVERTED
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -46,7 +46,7 @@ export class RevertCode {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
public getDescription() {
|
|
49
|
-
switch (this.code) {
|
|
49
|
+
switch (this.code as RevertCodeEnum) {
|
|
50
50
|
case RevertCodeEnum.OK:
|
|
51
51
|
return 'OK';
|
|
52
52
|
case RevertCodeEnum.APP_LOGIC_REVERTED:
|
package/src/block/body.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
2
|
import { timesParallel } from '@aztec/foundation/collection';
|
|
3
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
|
|
6
6
|
import { inspect } from 'util';
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -73,17 +73,11 @@ export class Body {
|
|
|
73
73
|
* Decodes a block from blob fields.
|
|
74
74
|
*/
|
|
75
75
|
static fromBlobFields(fields: Fr[]) {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
while (
|
|
79
|
-
|
|
80
|
-
throw new Error('Invalid fields given to Body.fromBlobFields(): First field invalid.');
|
|
81
|
-
}
|
|
82
|
-
const len = TxEffect.decodeFirstField(fields[checkedFields]).length;
|
|
83
|
-
txEffectsFields.push(fields.slice(checkedFields, checkedFields + len));
|
|
84
|
-
checkedFields += len;
|
|
76
|
+
const txEffects: TxEffect[] = [];
|
|
77
|
+
const reader = new FieldReader(fields);
|
|
78
|
+
while (!reader.isFinished()) {
|
|
79
|
+
txEffects.push(TxEffect.fromBlobFields(reader));
|
|
85
80
|
}
|
|
86
|
-
const txEffects = txEffectsFields.filter(effect => effect.length).map(effect => TxEffect.fromBlobFields(effect));
|
|
87
81
|
return new this(txEffects);
|
|
88
82
|
}
|
|
89
83
|
|
package/src/block/l2_block.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { sha256, sha256ToField } from '@aztec/foundation/crypto';
|
|
2
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
@@ -117,65 +116,6 @@ export class L2Block {
|
|
|
117
116
|
return this.header.hash();
|
|
118
117
|
}
|
|
119
118
|
|
|
120
|
-
/**
|
|
121
|
-
* Computes the public inputs hash for the L2 block.
|
|
122
|
-
* The same output as the hash of RootRollupPublicInputs.
|
|
123
|
-
* TODO(Miranda): Check where/if this is used (v diff now with epochs and blobs)
|
|
124
|
-
* @returns The public input hash for the L2 block as a field element.
|
|
125
|
-
*/
|
|
126
|
-
// TODO(#4844)
|
|
127
|
-
getPublicInputsHash(): Fr {
|
|
128
|
-
const preimage = [
|
|
129
|
-
this.header.globalVariables,
|
|
130
|
-
AppendOnlyTreeSnapshot.zero(), // this.startNoteHashTreeSnapshot / commitments,
|
|
131
|
-
AppendOnlyTreeSnapshot.zero(), // this.startNullifierTreeSnapshot,
|
|
132
|
-
AppendOnlyTreeSnapshot.zero(), // this.startPublicDataTreeSnapshot,
|
|
133
|
-
AppendOnlyTreeSnapshot.zero(), // this.startL1ToL2MessageTreeSnapshot,
|
|
134
|
-
this.header.lastArchive,
|
|
135
|
-
this.header.state.partial.noteHashTree,
|
|
136
|
-
this.header.state.partial.nullifierTree,
|
|
137
|
-
this.header.state.partial.publicDataTree,
|
|
138
|
-
this.header.state.l1ToL2MessageTree,
|
|
139
|
-
this.archive,
|
|
140
|
-
];
|
|
141
|
-
|
|
142
|
-
return sha256ToField(preimage);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Computes the start state hash (should equal contract data before block).
|
|
147
|
-
* @returns The start state hash for the L2 block.
|
|
148
|
-
*/
|
|
149
|
-
// TODO(#4844)
|
|
150
|
-
getStartStateHash() {
|
|
151
|
-
const inputValue = serializeToBuffer(
|
|
152
|
-
new Fr(Number(this.header.globalVariables.blockNumber.toBigInt()) - 1),
|
|
153
|
-
AppendOnlyTreeSnapshot.zero(), // this.startNoteHashTreeSnapshot,
|
|
154
|
-
AppendOnlyTreeSnapshot.zero(), // this.startNullifierTreeSnapshot,
|
|
155
|
-
AppendOnlyTreeSnapshot.zero(), // this.startPublicDataTreeSnapshot,
|
|
156
|
-
AppendOnlyTreeSnapshot.zero(), // this.startL1ToL2MessageTreeSnapshot,
|
|
157
|
-
this.header.lastArchive,
|
|
158
|
-
);
|
|
159
|
-
return sha256(inputValue);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Computes the end state hash (should equal contract data after block).
|
|
164
|
-
* @returns The end state hash for the L2 block.
|
|
165
|
-
*/
|
|
166
|
-
// TODO(#4844)
|
|
167
|
-
getEndStateHash() {
|
|
168
|
-
const inputValue = serializeToBuffer(
|
|
169
|
-
this.header.globalVariables.blockNumber,
|
|
170
|
-
this.header.state.partial.noteHashTree,
|
|
171
|
-
this.header.state.partial.nullifierTree,
|
|
172
|
-
this.header.state.partial.publicDataTree,
|
|
173
|
-
this.header.state.l1ToL2MessageTree,
|
|
174
|
-
this.archive,
|
|
175
|
-
);
|
|
176
|
-
return sha256(inputValue);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
119
|
/**
|
|
180
120
|
* Returns stats used for logging.
|
|
181
121
|
* @returns Stats on tx count, number, and log size and count.
|
|
@@ -190,7 +130,7 @@ export class L2Block {
|
|
|
190
130
|
),
|
|
191
131
|
contractClassLogSize: this.body.txEffects.reduce(
|
|
192
132
|
(totalLogSize, txEffect) =>
|
|
193
|
-
totalLogSize + txEffect.contractClassLogs.reduce((
|
|
133
|
+
totalLogSize + txEffect.contractClassLogs.reduce((acc, log) => acc + log.emittedLength, 0),
|
|
194
134
|
0,
|
|
195
135
|
),
|
|
196
136
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
-
import { times } from '@aztec/foundation/collection';
|
|
3
|
-
import { Secp256k1Signer } from '@aztec/foundation/crypto';
|
|
4
1
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
6
3
|
import { L2Block } from '@aztec/stdlib/block';
|
|
7
4
|
|
|
8
5
|
import { z } from 'zod';
|
|
9
6
|
|
|
7
|
+
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
8
|
+
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
9
|
+
|
|
10
10
|
export type L1PublishedData = {
|
|
11
11
|
blockNumber: bigint;
|
|
12
12
|
timestamp: bigint;
|
|
@@ -29,17 +29,9 @@ export const PublishedL2BlockSchema = z.object({
|
|
|
29
29
|
signatures: z.array(Signature.schema),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
export
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
blockHash: Buffer32.random().toString(),
|
|
38
|
-
};
|
|
39
|
-
// Create valid signatures
|
|
40
|
-
const signers = times(3, () => Secp256k1Signer.random());
|
|
41
|
-
const signatures = await Promise.all(
|
|
42
|
-
times(3, async i => signers[i].signMessage(Buffer32.fromField(await block.hash()))),
|
|
43
|
-
);
|
|
44
|
-
return { block, l1, signatures };
|
|
32
|
+
export function getAttestationsFromPublishedL2Block(block: PublishedL2Block) {
|
|
33
|
+
const payload = ConsensusPayload.fromBlock(block.block);
|
|
34
|
+
return block.signatures
|
|
35
|
+
.filter(sig => !sig.isEmpty)
|
|
36
|
+
.map(signature => new BlockAttestation(block.block.header.globalVariables.blockNumber, payload, signature));
|
|
45
37
|
}
|
package/src/config/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './config.js';
|
|
1
|
+
export * from './chain-config.js';
|
|
2
|
+
export * from './node-rpc-config.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ConfigMappingsType, numberConfigHelper } from '@aztec/foundation/config';
|
|
2
|
+
|
|
3
|
+
export const nodeRpcConfigMappings: ConfigMappingsType<NodeRPCConfig> = {
|
|
4
|
+
rpcSimulatePublicMaxGasLimit: {
|
|
5
|
+
env: 'RPC_SIMULATE_PUBLIC_MAX_GAS_LIMIT',
|
|
6
|
+
description: 'Maximum gas limit for public tx simulation in the node on `simulatePublicCalls`.',
|
|
7
|
+
...numberConfigHelper(10e9),
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type NodeRPCConfig = {
|
|
12
|
+
/** Maximum gas limit for public tx simulation in the node on `simulatePublicCalls`. */
|
|
13
|
+
rpcSimulatePublicMaxGasLimit: number;
|
|
14
|
+
};
|
|
@@ -4,6 +4,8 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
4
4
|
import { numToUInt8 } from '@aztec/foundation/serialize';
|
|
5
5
|
import { MerkleTree, MerkleTreeCalculator } from '@aztec/foundation/trees';
|
|
6
6
|
|
|
7
|
+
import deterministicStringify from 'json-stringify-deterministic';
|
|
8
|
+
|
|
7
9
|
import { type ContractArtifact, type FunctionArtifact, FunctionSelector, FunctionType } from '../abi/index.js';
|
|
8
10
|
|
|
9
11
|
const VERSION = 1;
|
|
@@ -58,7 +60,7 @@ export async function computeArtifactHashPreimage(artifact: ContractArtifact) {
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
export function computeArtifactMetadataHash(artifact: ContractArtifact) {
|
|
61
|
-
return sha256Fr(Buffer.from(
|
|
63
|
+
return sha256Fr(Buffer.from(deterministicStringify({ name: artifact.name, outputs: artifact.outputs }), 'utf-8'));
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export async function computeArtifactFunctionTreeRoot(artifact: ContractArtifact, fnType: FunctionType) {
|
|
@@ -103,7 +105,7 @@ export async function computeFunctionArtifactHash(
|
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
export function computeFunctionMetadataHash(fn: FunctionArtifact) {
|
|
106
|
-
return sha256Fr(Buffer.from(
|
|
108
|
+
return sha256Fr(Buffer.from(deterministicStringify(fn.returnTypes), 'utf8'));
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
function getLogger() {
|
|
@@ -111,5 +113,5 @@ function getLogger() {
|
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
export function getArtifactMerkleTreeHasher() {
|
|
114
|
-
return (l: Buffer, r: Buffer) => Promise.resolve(sha256Fr(Buffer.concat([l, r])).toBuffer());
|
|
116
|
+
return (l: Buffer, r: Buffer) => Promise.resolve(sha256Fr(Buffer.concat([l, r])).toBuffer() as Buffer<ArrayBuffer>);
|
|
115
117
|
}
|
|
@@ -36,11 +36,13 @@ export async function computePrivateFunctionLeaf(fn: PrivateFunction): Promise<B
|
|
|
36
36
|
|
|
37
37
|
async function getPrivateFunctionTreeCalculator(): Promise<MerkleTreeCalculator> {
|
|
38
38
|
if (!privateFunctionTreeCalculator) {
|
|
39
|
-
const functionTreeZeroLeaf = (
|
|
39
|
+
const functionTreeZeroLeaf = (
|
|
40
|
+
await pedersenHash(new Array(PRIVATE_FUNCTION_SIZE).fill(0))
|
|
41
|
+
).toBuffer() as Buffer<ArrayBuffer>;
|
|
40
42
|
privateFunctionTreeCalculator = await MerkleTreeCalculator.create(
|
|
41
43
|
FUNCTION_TREE_HEIGHT,
|
|
42
44
|
functionTreeZeroLeaf,
|
|
43
|
-
async (left, right) => (await poseidon2Hash([left, right])).toBuffer()
|
|
45
|
+
async (left, right) => (await poseidon2Hash([left, right])).toBuffer() as Buffer<ArrayBuffer>,
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
48
|
return privateFunctionTreeCalculator;
|
|
@@ -10,7 +10,11 @@ export class ProvingError extends Error {
|
|
|
10
10
|
* @param cause - The cause of the error.
|
|
11
11
|
* @param retry - Whether the proof should be retried.
|
|
12
12
|
*/
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(
|
|
14
|
+
message: string,
|
|
15
|
+
cause?: unknown,
|
|
16
|
+
public readonly retry: boolean = false,
|
|
17
|
+
) {
|
|
14
18
|
super(message);
|
|
15
19
|
this.name = ProvingError.NAME;
|
|
16
20
|
this.cause = cause;
|
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
import type { OpcodeLocation } from '../abi/abi.js';
|
|
6
6
|
import { FunctionSelector } from '../abi/function_selector.js';
|
|
7
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
|
-
import { type ZodFor, schemas } from '../schemas/index.js';
|
|
8
|
+
import { type ZodFor, optional, schemas } from '../schemas/index.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Address and selector of a function that failed during simulation.
|
|
@@ -240,7 +240,7 @@ export class SimulationError extends Error {
|
|
|
240
240
|
z.object({
|
|
241
241
|
contractAddress: schemas.AztecAddress,
|
|
242
242
|
contractName: z.string().optional(),
|
|
243
|
-
functionSelector: schemas.FunctionSelector,
|
|
243
|
+
functionSelector: optional(schemas.FunctionSelector),
|
|
244
244
|
functionName: z.string().optional(),
|
|
245
245
|
}),
|
|
246
246
|
),
|
|
@@ -36,7 +36,7 @@ export async function createFileStore(
|
|
|
36
36
|
const store = new GoogleCloudFileStore(bucket, path);
|
|
37
37
|
await store.checkCredentials();
|
|
38
38
|
return store;
|
|
39
|
-
} catch
|
|
39
|
+
} catch {
|
|
40
40
|
throw new Error(`Invalid google cloud store definition: '${config}'.`);
|
|
41
41
|
}
|
|
42
42
|
} else {
|
package/src/file-store/http.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
2
|
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
3
3
|
|
|
4
|
+
import axios, { type AxiosInstance, type AxiosRequestConfig, type AxiosResponse } from 'axios';
|
|
4
5
|
import { createWriteStream } from 'fs';
|
|
5
6
|
import { mkdir } from 'fs/promises';
|
|
6
7
|
import { dirname } from 'path';
|
|
@@ -10,13 +11,18 @@ import { finished } from 'stream/promises';
|
|
|
10
11
|
import type { ReadOnlyFileStore } from './interface.js';
|
|
11
12
|
|
|
12
13
|
export class HttpFileStore implements ReadOnlyFileStore {
|
|
13
|
-
private readonly
|
|
14
|
+
private readonly axiosInstance: AxiosInstance;
|
|
15
|
+
private readonly fetch: <T>(config: AxiosRequestConfig) => Promise<AxiosResponse<T>>;
|
|
14
16
|
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
+
constructor(
|
|
18
|
+
private readonly baseUrl: string,
|
|
19
|
+
private readonly log: Logger = createLogger('stdlib:http-file-store'),
|
|
20
|
+
) {
|
|
21
|
+
this.axiosInstance = axios.create();
|
|
22
|
+
this.fetch = async <T>(config: AxiosRequestConfig) => {
|
|
17
23
|
return await retry(
|
|
18
|
-
() =>
|
|
19
|
-
`Fetching ${
|
|
24
|
+
() => this.axiosInstance.request<T>(config),
|
|
25
|
+
`Fetching ${config.url}`,
|
|
20
26
|
makeBackoff([1, 1, 3]),
|
|
21
27
|
this.log,
|
|
22
28
|
/*failSilently=*/ true,
|
|
@@ -26,30 +32,33 @@ export class HttpFileStore implements ReadOnlyFileStore {
|
|
|
26
32
|
|
|
27
33
|
public async read(pathOrUrl: string): Promise<Buffer> {
|
|
28
34
|
const url = this.getUrl(pathOrUrl);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return Buffer.from(
|
|
32
|
-
}
|
|
33
|
-
throw new Error(`Error fetching file from ${url}: ${
|
|
35
|
+
try {
|
|
36
|
+
const response = await this.fetch<ArrayBuffer>({ url, method: 'GET', responseType: 'arraybuffer' });
|
|
37
|
+
return Buffer.from(response.data);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
throw new Error(`Error fetching file from ${url}: ${error instanceof Error ? error.message : String(error)}`);
|
|
34
40
|
}
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
public async download(pathOrUrl: string, destPath: string): Promise<void> {
|
|
38
44
|
const url = this.getUrl(pathOrUrl);
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
try {
|
|
46
|
+
const response = await this.fetch<Readable>({ url, method: 'GET', responseType: 'stream' });
|
|
41
47
|
await mkdir(dirname(destPath), { recursive: true });
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
throw new Error(`Error fetching file from ${url}: ${response.statusText}`);
|
|
48
|
+
await finished(response.data.pipe(createWriteStream(destPath)));
|
|
49
|
+
} catch (error) {
|
|
50
|
+
throw new Error(`Error fetching file from ${url}: ${error instanceof Error ? error.message : String(error)}`);
|
|
46
51
|
}
|
|
47
52
|
}
|
|
48
53
|
|
|
49
54
|
public async exists(pathOrUrl: string): Promise<boolean> {
|
|
50
55
|
const url = this.getUrl(pathOrUrl);
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
try {
|
|
57
|
+
await this.fetch<unknown>({ url, method: 'HEAD' });
|
|
58
|
+
return true;
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
private getUrl(path: string): string {
|
package/src/gas/gas.ts
CHANGED
|
@@ -14,7 +14,10 @@ export type GasDimensions = (typeof GasDimensions)[number];
|
|
|
14
14
|
|
|
15
15
|
/** Gas amounts in each dimension. */
|
|
16
16
|
export class Gas {
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(
|
|
18
|
+
public readonly daGas: UInt32,
|
|
19
|
+
public readonly l2Gas: UInt32,
|
|
20
|
+
) {}
|
|
18
21
|
|
|
19
22
|
static get schema() {
|
|
20
23
|
return z
|