@aztec/stdlib 0.86.0-starknet.1 → 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 +3 -5
- package/dest/abi/abi.d.ts.map +1 -1
- 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 -3
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +1 -1
- 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/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/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 +2 -3
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +2 -2
- 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 +5 -7
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -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 +1 -3
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +1 -1
- package/dest/p2p/block_proposal.d.ts +12 -6
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +25 -9
- package/dest/p2p/consensus_payload.d.ts +2 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -0
- 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/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 +3 -5
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +1 -1
- 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 +4 -6
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- 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/tests/factories.d.ts +0 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +17 -14
- package/dest/tests/mocks.d.ts +1 -0
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +1 -1
- 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 +1 -4
- package/dest/tx/block_header.d.ts.map +1 -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/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 +8 -8
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -2
- package/dest/tx/profiling.d.ts +8 -0
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +31 -0
- package/dest/tx/proposed_block_header.d.ts +1 -4
- package/dest/tx/proposed_block_header.d.ts.map +1 -1
- package/dest/tx/proposed_block_header.js +2 -1
- package/dest/tx/proven_tx.d.ts.map +1 -1
- 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.map +1 -1
- 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 +1 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/dest/types/shared.d.ts +1 -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/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 +2 -2
- 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 -1
- 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/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 +3 -4
- 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_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 +1 -1
- package/src/p2p/block_proposal.ts +36 -5
- package/src/p2p/consensus_payload.ts +4 -0
- package/src/p2p/gossipable.ts +44 -2
- package/src/p2p/topic_type.ts +2 -0
- package/src/rollup/base_rollup_hints.ts +7 -7
- package/src/rollup/block_root_or_block_merge_public_inputs.ts +4 -1
- package/src/rollup/private_base_rollup_inputs.ts +4 -1
- 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/tests/factories.ts +31 -18
- package/src/tests/mocks.ts +2 -1
- package/src/tx/content_commitment.ts +6 -1
- package/src/tx/private_execution_result.ts +9 -5
- package/src/tx/profiling.ts +39 -1
- package/src/tx/proposed_block_header.ts +2 -1
- 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 +1 -1
- package/src/update-checker/index.ts +1 -0
- package/src/update-checker/update-checker.ts +152 -0
- 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/config/{config.js → chain-config.js} +0 -0
- /package/src/config/{config.ts → chain-config.ts} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { RegistryContract } from '@aztec/ethereum';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
4
|
+
import { fileURLToPath } from '@aztec/foundation/url';
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import { readFileSync } from 'fs';
|
|
7
|
+
import { dirname, resolve } from 'path';
|
|
8
|
+
import { isDeepStrictEqual } from 'util';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
const updateConfigSchema = z.object({
|
|
11
|
+
version: z.string().optional(),
|
|
12
|
+
config: z.any().optional()
|
|
13
|
+
});
|
|
14
|
+
export class UpdateChecker extends EventEmitter {
|
|
15
|
+
updatesUrl;
|
|
16
|
+
nodeVersion;
|
|
17
|
+
rollupVersion;
|
|
18
|
+
fetch;
|
|
19
|
+
getLatestRollupVersion;
|
|
20
|
+
checkIntervalMs;
|
|
21
|
+
log;
|
|
22
|
+
runningPromise;
|
|
23
|
+
lastPatchedConfig;
|
|
24
|
+
constructor(updatesUrl, nodeVersion, rollupVersion, fetch1, getLatestRollupVersion, checkIntervalMs = 60_000, log = createLogger('foundation:update-check')){
|
|
25
|
+
super(), this.updatesUrl = updatesUrl, this.nodeVersion = nodeVersion, this.rollupVersion = rollupVersion, this.fetch = fetch1, this.getLatestRollupVersion = getLatestRollupVersion, this.checkIntervalMs = checkIntervalMs, this.log = log, this.lastPatchedConfig = {}, this.runChecks = async ()=>{
|
|
26
|
+
await Promise.all([
|
|
27
|
+
this.checkRollupVersion(),
|
|
28
|
+
this.checkConfig()
|
|
29
|
+
]);
|
|
30
|
+
};
|
|
31
|
+
this.runningPromise = new RunningPromise(this.runChecks, this.log, this.checkIntervalMs);
|
|
32
|
+
}
|
|
33
|
+
static async new(config) {
|
|
34
|
+
const registryContract = new RegistryContract(config.publicClient, config.registryContractAddress);
|
|
35
|
+
const getLatestRollupVersion = ()=>registryContract.getRollupVersions().then((versions)=>versions.at(-1));
|
|
36
|
+
return new UpdateChecker(config.baseURL, config.nodeVersion ?? getPackageVersion(), await getLatestRollupVersion(), config.fetch ?? fetch, getLatestRollupVersion, config.checkIntervalMs);
|
|
37
|
+
}
|
|
38
|
+
start() {
|
|
39
|
+
if (this.runningPromise.isRunning()) {
|
|
40
|
+
this.log.debug(`Can't start update checker again`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
this.log.info('Starting update checker', {
|
|
44
|
+
nodeVersion: this.nodeVersion,
|
|
45
|
+
rollupVersion: this.rollupVersion
|
|
46
|
+
});
|
|
47
|
+
this.runningPromise.start();
|
|
48
|
+
}
|
|
49
|
+
stop() {
|
|
50
|
+
if (!this.runningPromise.isRunning()) {
|
|
51
|
+
this.log.debug(`Can't stop update checker because it is not running`);
|
|
52
|
+
return Promise.resolve();
|
|
53
|
+
}
|
|
54
|
+
return this.runningPromise.stop();
|
|
55
|
+
}
|
|
56
|
+
trigger() {
|
|
57
|
+
return this.runningPromise.trigger();
|
|
58
|
+
}
|
|
59
|
+
runChecks;
|
|
60
|
+
async checkRollupVersion() {
|
|
61
|
+
try {
|
|
62
|
+
const canonicalRollupVersion = await this.getLatestRollupVersion();
|
|
63
|
+
if (canonicalRollupVersion !== this.rollupVersion) {
|
|
64
|
+
this.log.debug('New canonical rollup version', {
|
|
65
|
+
currentVersion: this.rollupVersion,
|
|
66
|
+
latestVersion: canonicalRollupVersion
|
|
67
|
+
});
|
|
68
|
+
this.emit('newRollupVersion', {
|
|
69
|
+
currentVersion: this.rollupVersion,
|
|
70
|
+
latestVersion: canonicalRollupVersion
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
} catch (err) {
|
|
74
|
+
this.log.warn(`Failed to check if there is a new rollup`, err);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async checkConfig() {
|
|
78
|
+
try {
|
|
79
|
+
const response = await this.fetch(this.updatesUrl);
|
|
80
|
+
const body = await response.json();
|
|
81
|
+
if (!response.ok) {
|
|
82
|
+
this.log.warn(`Unexpected HTTP response checking for updates`, {
|
|
83
|
+
status: response.status,
|
|
84
|
+
body: await response.text(),
|
|
85
|
+
url: this.updatesUrl
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const { version, config } = updateConfigSchema.parse(body);
|
|
89
|
+
if (this.nodeVersion && version && version !== this.nodeVersion) {
|
|
90
|
+
this.log.debug('New node version', {
|
|
91
|
+
currentVersion: this.nodeVersion,
|
|
92
|
+
latestVersion: version
|
|
93
|
+
});
|
|
94
|
+
this.emit('newNodeVersion', {
|
|
95
|
+
currentVersion: this.nodeVersion,
|
|
96
|
+
latestVersion: version
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (config && Object.keys(config).length > 0 && !isDeepStrictEqual(config, this.lastPatchedConfig)) {
|
|
100
|
+
this.log.debug('New node config', {
|
|
101
|
+
config
|
|
102
|
+
});
|
|
103
|
+
this.lastPatchedConfig = config;
|
|
104
|
+
this.emit('updateNodeConfig', config);
|
|
105
|
+
}
|
|
106
|
+
} catch (err) {
|
|
107
|
+
this.log.warn(`Failed to check if there is an update`, err);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Returns package version.
|
|
113
|
+
*/ export function getPackageVersion() {
|
|
114
|
+
try {
|
|
115
|
+
const releasePleaseManifestPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../../../.release-please-manifest.json');
|
|
116
|
+
const version = JSON.parse(readFileSync(releasePleaseManifestPath).toString())['.'];
|
|
117
|
+
return version;
|
|
118
|
+
} catch {
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import type Koa from 'koa';
|
|
4
|
-
import type { ChainConfig } from '../config/config.js';
|
|
4
|
+
import type { ChainConfig } from '../config/chain-config.js';
|
|
5
5
|
/** Fields that identify a version of the Aztec protocol. Any mismatch between these fields should signal an incompatibility between nodes. */
|
|
6
6
|
export type ComponentsVersions = {
|
|
7
7
|
l1ChainId: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAK7D,8IAA8I;AAC9I,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAIlB,eAAe,EAAE,UAAU,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,qDAAqD;AACrD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,WAAW,EACnB,2BAA2B,EAAE,MAAM,GAAG,EAAE,EACxC,oBAAoB,EAAE,MAAM,GAAG,EAAE,GAChC,kBAAkB,CAQpB;AAED,qGAAqG;AACrG,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAiB9E;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAIzD;AAED,iGAAiG;AACjG,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,QA6B/F;AAED,8EAA8E;AAC9E,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACrC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,QAiBpC;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,IAC7D,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,MAAM,OAAO,CAAC,IAAI,CAAC,mBAS1D;AAED,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,IACxE,aAAa;IAAE,OAAO,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,mBAYzF"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { Fq, Fr } from '@aztec/foundation/fields';
|
|
4
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
3
|
import { CircuitType } from '../types/shared.js';
|
|
@@ -20,7 +18,7 @@ export declare class G1AffineElement {
|
|
|
20
18
|
* Serialize as a buffer.
|
|
21
19
|
* @returns The buffer.
|
|
22
20
|
*/
|
|
23
|
-
toBuffer(): Buffer
|
|
21
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
24
22
|
/**
|
|
25
23
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
26
24
|
* @param buffer - Buffer or BufferReader to read from.
|
|
@@ -50,7 +48,7 @@ export declare class CommitmentMap {
|
|
|
50
48
|
* Serialize as a buffer.
|
|
51
49
|
* @returns The buffer.
|
|
52
50
|
*/
|
|
53
|
-
toBuffer(): Buffer
|
|
51
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
54
52
|
/**
|
|
55
53
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
56
54
|
* @param buffer - Buffer or BufferReader to read from.
|
|
@@ -72,12 +70,12 @@ export declare class VerificationKeyAsFields {
|
|
|
72
70
|
get circuitSize(): number;
|
|
73
71
|
get isRecursive(): boolean;
|
|
74
72
|
static get schema(): import("zod").ZodType<VerificationKeyAsFields, any, string>;
|
|
75
|
-
toJSON(): Buffer
|
|
73
|
+
toJSON(): Buffer<ArrayBufferLike>;
|
|
76
74
|
/**
|
|
77
75
|
* Serialize as a buffer.
|
|
78
76
|
* @returns The buffer.
|
|
79
77
|
*/
|
|
80
|
-
toBuffer(): Buffer
|
|
78
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
81
79
|
toFields(): (number | Fr)[];
|
|
82
80
|
/**
|
|
83
81
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
@@ -152,7 +150,7 @@ export declare class VerificationKey {
|
|
|
152
150
|
* Serialize as a buffer.
|
|
153
151
|
* @returns The buffer.
|
|
154
152
|
*/
|
|
155
|
-
toBuffer(): Buffer
|
|
153
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
156
154
|
/**
|
|
157
155
|
* Deserializes class from a buffer.
|
|
158
156
|
* @returns A VerificationKey instance.
|
|
@@ -184,13 +182,13 @@ export declare class VerificationKeyData {
|
|
|
184
182
|
* Serialize as a buffer.
|
|
185
183
|
* @returns The buffer.
|
|
186
184
|
*/
|
|
187
|
-
toBuffer(): Buffer
|
|
185
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
188
186
|
toString(): `0x${string}`;
|
|
189
187
|
static fromBuffer(buffer: Buffer | BufferReader): VerificationKeyData;
|
|
190
188
|
static fromString(str: string): VerificationKeyData;
|
|
191
189
|
clone(): VerificationKeyData;
|
|
192
190
|
/** Returns a hex representation for JSON serialization. */
|
|
193
|
-
toJSON(): Buffer
|
|
191
|
+
toJSON(): Buffer<ArrayBufferLike>;
|
|
194
192
|
/** Creates an instance from a hex string. */
|
|
195
193
|
static get schema(): import("zod").ZodType<VerificationKeyData, any, string>;
|
|
196
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification_key.d.ts","sourceRoot":"","sources":["../../src/vks/verification_key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification_key.d.ts","sourceRoot":"","sources":["../../src/vks/verification_key.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { VK_TREE_HEIGHT } from '@aztec/constants';
|
|
4
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
3
|
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
@@ -26,7 +24,7 @@ export declare class VkWitnessData {
|
|
|
26
24
|
vkPath: Tuple<Fr, typeof VK_TREE_HEIGHT>);
|
|
27
25
|
static empty(): VkWitnessData;
|
|
28
26
|
static fromBuffer(buffer: Buffer | BufferReader): VkWitnessData;
|
|
29
|
-
toBuffer(): Buffer
|
|
27
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
30
28
|
toString(): `0x${string}`;
|
|
31
29
|
}
|
|
32
30
|
//# sourceMappingURL=vk_witness_data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vk_witness_data.d.ts","sourceRoot":"","sources":["../../src/vks/vk_witness_data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vk_witness_data.d.ts","sourceRoot":"","sources":["../../src/vks/vk_witness_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,aAAa;IAEf,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,OAAO,EAAE,MAAM;IACtB;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;gBARxC,EAAE,EAAE,mBAAmB;IAC9B;;OAEG;IACI,OAAO,EAAE,MAAM;IACtB;;OAEG;IACI,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,cAAc,CAAC;IAGjD,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAS/C,QAAQ;IAIR,QAAQ;CAGT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"./database-version": "./dest/database-version/index.js",
|
|
50
50
|
"./validators": "./dest/validators/index.js",
|
|
51
51
|
"./file-store": "./dest/file-store/index.js",
|
|
52
|
-
"./snapshots": "./dest/snapshots/index.js"
|
|
52
|
+
"./snapshots": "./dest/snapshots/index.js",
|
|
53
|
+
"./update-checker": "./dest/update-checker/index.js"
|
|
53
54
|
},
|
|
54
55
|
"typedocOptions": {
|
|
55
56
|
"entryPoints": [
|
|
@@ -66,13 +67,15 @@
|
|
|
66
67
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
|
-
"@aztec/bb.js": "0.
|
|
70
|
-
"@aztec/blob-lib": "0.
|
|
71
|
-
"@aztec/constants": "0.
|
|
72
|
-
"@aztec/ethereum": "0.
|
|
73
|
-
"@aztec/foundation": "0.
|
|
74
|
-
"@aztec/noir-noirc_abi": "0.
|
|
70
|
+
"@aztec/bb.js": "0.87.0",
|
|
71
|
+
"@aztec/blob-lib": "0.87.0",
|
|
72
|
+
"@aztec/constants": "0.87.0",
|
|
73
|
+
"@aztec/ethereum": "0.87.0",
|
|
74
|
+
"@aztec/foundation": "0.87.0",
|
|
75
|
+
"@aztec/noir-noirc_abi": "0.87.0",
|
|
75
76
|
"@google-cloud/storage": "^7.15.0",
|
|
77
|
+
"axios": "^1.9.0",
|
|
78
|
+
"json-stringify-deterministic": "1.0.12",
|
|
76
79
|
"lodash.chunk": "^4.2.0",
|
|
77
80
|
"lodash.isequal": "^4.5.0",
|
|
78
81
|
"lodash.omit": "^4.5.0",
|
|
@@ -91,14 +94,14 @@
|
|
|
91
94
|
"@types/lodash.isequal": "^4.5.8",
|
|
92
95
|
"@types/lodash.omit": "^4.5.7",
|
|
93
96
|
"@types/lodash.times": "^4.3.9",
|
|
94
|
-
"@types/node": "^
|
|
97
|
+
"@types/node": "^22.15.17",
|
|
95
98
|
"@types/pako": "^2.0.3",
|
|
96
|
-
"eslint": "^
|
|
99
|
+
"eslint": "^9.26.0",
|
|
97
100
|
"jest": "^29.5.0",
|
|
98
101
|
"jest-mock-extended": "^4.0.0-beta1",
|
|
99
|
-
"prettier": "^
|
|
102
|
+
"prettier": "^3.5.3",
|
|
100
103
|
"ts-node": "^10.9.1",
|
|
101
|
-
"typescript": "^5.
|
|
104
|
+
"typescript": "^5.3.3"
|
|
102
105
|
},
|
|
103
106
|
"files": [
|
|
104
107
|
"dest",
|
|
@@ -108,7 +111,7 @@
|
|
|
108
111
|
],
|
|
109
112
|
"types": "./dest/index.d.ts",
|
|
110
113
|
"engines": {
|
|
111
|
-
"node": ">=
|
|
114
|
+
"node": ">=20.10"
|
|
112
115
|
},
|
|
113
116
|
"jest": {
|
|
114
117
|
"extensionsToTreatAsEsm": [
|
package/src/abi/abi.ts
CHANGED
|
@@ -498,11 +498,11 @@ export function getDefaultInitializer(contractArtifact: ContractArtifact): Funct
|
|
|
498
498
|
const functionAbis = getAllFunctionAbis(contractArtifact);
|
|
499
499
|
const initializers = functionAbis.filter(f => f.isInitializer);
|
|
500
500
|
return initializers.length > 1
|
|
501
|
-
? initializers.find(f => f.name === 'constructor') ??
|
|
501
|
+
? (initializers.find(f => f.name === 'constructor') ??
|
|
502
502
|
initializers.find(f => f.name === 'initializer') ??
|
|
503
503
|
initializers.find(f => f.parameters?.length === 0) ??
|
|
504
504
|
initializers.find(f => f.functionType === FunctionType.PRIVATE) ??
|
|
505
|
-
initializers[0]
|
|
505
|
+
initializers[0])
|
|
506
506
|
: initializers[0];
|
|
507
507
|
}
|
|
508
508
|
|
|
@@ -216,31 +216,17 @@ function generateFunctionArtifact(
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
function getFunctionType(fn: NoirCompiledContractFunction): FunctionType {
|
|
219
|
-
if (fn.custom_attributes.
|
|
219
|
+
if (fn.custom_attributes.includes(AZTEC_PRIVATE_ATTRIBUTE)) {
|
|
220
220
|
return FunctionType.PRIVATE;
|
|
221
|
-
} else if (fn.custom_attributes.
|
|
221
|
+
} else if (fn.custom_attributes.includes(AZTEC_PUBLIC_ATTRIBUTE)) {
|
|
222
222
|
return FunctionType.PUBLIC;
|
|
223
|
-
} else if (fn.custom_attributes.
|
|
223
|
+
} else if (fn.custom_attributes.includes(AZTEC_UTILITY_ATTRIBUTE)) {
|
|
224
224
|
return FunctionType.UTILITY;
|
|
225
225
|
} else {
|
|
226
226
|
throw new Error(`Invalid function type for a noir contract function ${fn.name}`);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
// TODO(https://github.com/noir-lang/noir/issues/7912): Replace the above function with this one once the linked issue
|
|
231
|
-
// is fixed.
|
|
232
|
-
// function getFunctionType(fn: NoirCompiledContractFunction): FunctionType {
|
|
233
|
-
// if (fn.custom_attributes.includes(AZTEC_PRIVATE_ATTRIBUTE)) {
|
|
234
|
-
// return FunctionType.PRIVATE;
|
|
235
|
-
// } else if (fn.custom_attributes.includes(AZTEC_PUBLIC_ATTRIBUTE)) {
|
|
236
|
-
// return FunctionType.PUBLIC;
|
|
237
|
-
// } else if (fn.custom_attributes.includes(AZTEC_UTILITY_ATTRIBUTE)) {
|
|
238
|
-
// return FunctionType.UTILITY;
|
|
239
|
-
// } else {
|
|
240
|
-
// throw new Error(`Invalid function type for a noir contract function ${fn.name}`);
|
|
241
|
-
// }
|
|
242
|
-
// }
|
|
243
|
-
|
|
244
230
|
/**
|
|
245
231
|
* Returns true if the first parameter is kernel function inputs.
|
|
246
232
|
*
|
package/src/abi/decoder.ts
CHANGED
|
@@ -13,7 +13,10 @@ export type AbiDecoded = bigint | boolean | AztecAddress | AbiDecoded[] | { [key
|
|
|
13
13
|
* Decodes values using a provided ABI.
|
|
14
14
|
*/
|
|
15
15
|
class AbiDecoder {
|
|
16
|
-
constructor(
|
|
16
|
+
constructor(
|
|
17
|
+
private types: AbiType[],
|
|
18
|
+
private flattened: Fr[],
|
|
19
|
+
) {}
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* Decodes a single return value from field to the given type.
|
|
@@ -116,7 +119,11 @@ export function decodeFromAbi(typ: AbiType[], buffer: Fr[]) {
|
|
|
116
119
|
*/
|
|
117
120
|
export class FunctionSignatureDecoder {
|
|
118
121
|
private separator: string;
|
|
119
|
-
constructor(
|
|
122
|
+
constructor(
|
|
123
|
+
private name: string,
|
|
124
|
+
private parameters: ABIParameter[],
|
|
125
|
+
private includeNames = false,
|
|
126
|
+
) {
|
|
120
127
|
this.separator = includeNames ? ', ' : ',';
|
|
121
128
|
}
|
|
122
129
|
|
|
@@ -143,7 +150,7 @@ export class FunctionSignatureDecoder {
|
|
|
143
150
|
case 'struct':
|
|
144
151
|
return `(${param.fields.map(field => `${this.decodeParameter(field)}`).join(this.separator)})`;
|
|
145
152
|
default:
|
|
146
|
-
throw new Error(`Unsupported type: ${param}`);
|
|
153
|
+
throw new Error(`Unsupported type: ${param.kind}`);
|
|
147
154
|
}
|
|
148
155
|
}
|
|
149
156
|
|
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));
|