@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/logs/public_log.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
PRIVATE_LOG_SIZE_IN_FIELDS,
|
|
3
|
-
PUBLIC_LOG_DATA_SIZE_IN_FIELDS,
|
|
4
|
-
PUBLIC_LOG_SIZE_IN_FIELDS,
|
|
5
|
-
} from '@aztec/constants';
|
|
1
|
+
import { PUBLIC_LOG_LENGTH, PUBLIC_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
6
2
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
3
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
7
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
8
5
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
9
6
|
import {
|
|
@@ -20,29 +17,61 @@ import { z } from 'zod';
|
|
|
20
17
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
21
18
|
|
|
22
19
|
export class PublicLog {
|
|
23
|
-
static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES *
|
|
20
|
+
static SIZE_IN_BYTES = Fr.SIZE_IN_BYTES * PUBLIC_LOG_LENGTH;
|
|
24
21
|
|
|
25
|
-
constructor(
|
|
22
|
+
constructor(
|
|
23
|
+
public contractAddress: AztecAddress,
|
|
24
|
+
public fields: Tuple<Fr, typeof PUBLIC_LOG_SIZE_IN_FIELDS>,
|
|
25
|
+
public emittedLength: number,
|
|
26
|
+
) {}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
return
|
|
28
|
+
static from(fields: FieldsOf<PublicLog>) {
|
|
29
|
+
return new PublicLog(...PublicLog.getFields(fields));
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
static getFields(fields: FieldsOf<PublicLog>) {
|
|
32
|
-
return [fields.contractAddress, fields.
|
|
33
|
+
return [fields.contractAddress, fields.fields, fields.emittedLength] as const;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
toFields(): Fr[] {
|
|
37
|
+
return serializeToFields(...PublicLog.getFields(this));
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
static fromFields(fields: Fr[] | FieldReader) {
|
|
36
41
|
const reader = FieldReader.asReader(fields);
|
|
37
|
-
return new PublicLog(
|
|
42
|
+
return new PublicLog(
|
|
43
|
+
reader.readObject(AztecAddress),
|
|
44
|
+
reader.readFieldArray(PUBLIC_LOG_SIZE_IN_FIELDS),
|
|
45
|
+
reader.readU32(),
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
getEmittedFields() {
|
|
50
|
+
return this.fields.slice(0, this.emittedLength);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
toBlobFields(): Fr[] {
|
|
54
|
+
return [new Fr(this.emittedLength), this.contractAddress.toField()].concat(this.getEmittedFields());
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static fromBlobFields(fields: Fr[] | FieldReader) {
|
|
58
|
+
const reader = FieldReader.asReader(fields);
|
|
59
|
+
const emittedLength = reader.readU32();
|
|
60
|
+
const contractAddress = reader.readObject(AztecAddress);
|
|
61
|
+
const emittedFields = reader.readFieldArray(emittedLength);
|
|
62
|
+
return new PublicLog(
|
|
63
|
+
contractAddress,
|
|
64
|
+
padArrayEnd(emittedFields, Fr.ZERO, PUBLIC_LOG_SIZE_IN_FIELDS),
|
|
65
|
+
emittedLength,
|
|
66
|
+
);
|
|
38
67
|
}
|
|
39
68
|
|
|
40
69
|
isEmpty() {
|
|
41
|
-
return this.contractAddress.isZero() && this.
|
|
70
|
+
return this.contractAddress.isZero() && this.fields.every(f => f.isZero()) && this.emittedLength === 0;
|
|
42
71
|
}
|
|
43
72
|
|
|
44
73
|
static empty() {
|
|
45
|
-
return new PublicLog(AztecAddress.ZERO, makeTuple(
|
|
74
|
+
return new PublicLog(AztecAddress.ZERO, makeTuple(PUBLIC_LOG_SIZE_IN_FIELDS, Fr.zero), 0);
|
|
46
75
|
}
|
|
47
76
|
|
|
48
77
|
toBuffer(): Buffer {
|
|
@@ -51,55 +80,50 @@ export class PublicLog {
|
|
|
51
80
|
|
|
52
81
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
53
82
|
const reader = BufferReader.asReader(buffer);
|
|
54
|
-
return new PublicLog(
|
|
83
|
+
return new PublicLog(
|
|
84
|
+
reader.readObject(AztecAddress),
|
|
85
|
+
reader.readArray(PUBLIC_LOG_SIZE_IN_FIELDS, Fr),
|
|
86
|
+
reader.readNumber(),
|
|
87
|
+
);
|
|
55
88
|
}
|
|
56
89
|
|
|
57
90
|
static async random() {
|
|
58
|
-
return new PublicLog(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// Does not include length prefix.
|
|
64
|
-
return this.getEmittedFields().length;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
getEmittedFields() {
|
|
68
|
-
const fields = this.toFields();
|
|
69
|
-
const lastNonZeroIndex = fields.findLastIndex(f => !f.isZero());
|
|
70
|
-
return fields.slice(0, lastNonZeroIndex + 1);
|
|
91
|
+
return new PublicLog(
|
|
92
|
+
await AztecAddress.random(),
|
|
93
|
+
makeTuple(PUBLIC_LOG_SIZE_IN_FIELDS, Fr.random),
|
|
94
|
+
PUBLIC_LOG_SIZE_IN_FIELDS,
|
|
95
|
+
);
|
|
71
96
|
}
|
|
72
97
|
|
|
73
98
|
equals(other: this) {
|
|
74
99
|
return (
|
|
75
100
|
this.contractAddress.equals(other.contractAddress) &&
|
|
76
|
-
this.
|
|
101
|
+
this.fields.every((field, i) => field.equals(other.fields[i])) &&
|
|
102
|
+
this.emittedLength === other.emittedLength
|
|
77
103
|
);
|
|
78
104
|
}
|
|
79
105
|
|
|
80
106
|
toHumanReadable(): string {
|
|
81
|
-
return `PublicLog: (contractAddress: ${this.contractAddress}
|
|
107
|
+
return `PublicLog: (contractAddress: ${this.contractAddress} fields: ${this.fields}) emittedLength: ${this.emittedLength}`;
|
|
82
108
|
}
|
|
83
109
|
|
|
84
110
|
static get schema(): ZodFor<PublicLog> {
|
|
85
|
-
if (PUBLIC_LOG_DATA_SIZE_IN_FIELDS + 1 == PRIVATE_LOG_SIZE_IN_FIELDS) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
'Constants got updated and schema for PrivateLog matches that of PublicLog. This needs to be updated now as Zod is no longer able to differentiate the 2 in TxScopedL2Log.',
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
111
|
return z
|
|
92
112
|
.object({
|
|
93
113
|
contractAddress: AztecAddress.schema,
|
|
94
|
-
|
|
114
|
+
fields: z.array(schemas.Fr).refine(arr => arr.length === PUBLIC_LOG_SIZE_IN_FIELDS),
|
|
115
|
+
emittedLength: z.number(),
|
|
95
116
|
})
|
|
96
|
-
.transform(({ contractAddress,
|
|
117
|
+
.transform(({ contractAddress, fields, emittedLength }) =>
|
|
118
|
+
PublicLog.fromFields([contractAddress.toField(), ...fields, new Fr(emittedLength)]),
|
|
119
|
+
);
|
|
97
120
|
}
|
|
98
121
|
|
|
99
122
|
[inspect.custom](): string {
|
|
100
123
|
return `PublicLog {
|
|
101
124
|
contractAddress: ${inspect(this.contractAddress)},
|
|
102
|
-
|
|
125
|
+
fields: [${this.fields.map(x => inspect(x)).join(', ')}],
|
|
126
|
+
emittedLength: ${this.emittedLength},
|
|
103
127
|
}`;
|
|
104
128
|
}
|
|
105
129
|
}
|
|
@@ -75,8 +75,7 @@ export class TxScopedL2Log {
|
|
|
75
75
|
return new TxScopedL2Log(txHash, dataStartIndexForTx, logIndexInTx, blockNumber, log);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
static async random() {
|
|
79
|
-
const isFromPublic = Math.random() < 0.5;
|
|
78
|
+
static async random(isFromPublic = Math.random() < 0.5) {
|
|
80
79
|
const log = isFromPublic ? await PublicLog.random() : PrivateLog.random();
|
|
81
80
|
return new TxScopedL2Log(TxHash.random(), 1, 1, 1, log);
|
|
82
81
|
}
|
|
@@ -25,4 +25,14 @@ export class InboxLeaf {
|
|
|
25
25
|
static smallestIndexFromL2Block(l2block: bigint): bigint {
|
|
26
26
|
return (l2block - BigInt(INITIAL_L2_BLOCK_NUM)) * BigInt(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns the range of valid indices for a given L2 block.
|
|
31
|
+
* Start index is inclusive, end index is exclusive.
|
|
32
|
+
*/
|
|
33
|
+
static indexRangeFromL2Block(l2block: bigint): [bigint, bigint] {
|
|
34
|
+
const start = this.smallestIndexFromL2Block(l2block);
|
|
35
|
+
const end = start + BigInt(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
36
|
+
return [start, end];
|
|
37
|
+
}
|
|
28
38
|
}
|
|
@@ -10,7 +10,11 @@ import { z } from 'zod';
|
|
|
10
10
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
11
11
|
|
|
12
12
|
export class L2ToL1Message {
|
|
13
|
-
constructor(
|
|
13
|
+
constructor(
|
|
14
|
+
public recipient: EthAddress,
|
|
15
|
+
public content: Fr,
|
|
16
|
+
public counter: number,
|
|
17
|
+
) {}
|
|
14
18
|
|
|
15
19
|
static get schema() {
|
|
16
20
|
return z
|
|
@@ -97,7 +101,10 @@ export class L2ToL1Message {
|
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
export class ScopedL2ToL1Message {
|
|
100
|
-
constructor(
|
|
104
|
+
constructor(
|
|
105
|
+
public message: L2ToL1Message,
|
|
106
|
+
public contractAddress: AztecAddress,
|
|
107
|
+
) {}
|
|
101
108
|
|
|
102
109
|
static get schema() {
|
|
103
110
|
return z
|
|
@@ -2,7 +2,7 @@ import { Buffer32 } from '@aztec/foundation/buffer';
|
|
|
2
2
|
import { keccak256, recoverAddress } from '@aztec/foundation/crypto';
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
|
-
import
|
|
5
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
6
6
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
7
7
|
|
|
8
8
|
import { z } from 'zod';
|
|
@@ -31,6 +31,9 @@ export class BlockAttestation extends Gossipable {
|
|
|
31
31
|
private sender: EthAddress | undefined;
|
|
32
32
|
|
|
33
33
|
constructor(
|
|
34
|
+
/** The block number of the attestation. */
|
|
35
|
+
public readonly blockNumber: Fr,
|
|
36
|
+
|
|
34
37
|
/** The payload of the message, and what the signature is over */
|
|
35
38
|
public readonly payload: ConsensusPayload,
|
|
36
39
|
|
|
@@ -43,13 +46,14 @@ export class BlockAttestation extends Gossipable {
|
|
|
43
46
|
static get schema(): ZodFor<BlockAttestation> {
|
|
44
47
|
return z
|
|
45
48
|
.object({
|
|
49
|
+
blockNumber: Fr.schema,
|
|
46
50
|
payload: ConsensusPayload.schema,
|
|
47
51
|
signature: Signature.schema,
|
|
48
52
|
})
|
|
49
|
-
.transform(obj => new BlockAttestation(obj.payload, obj.signature));
|
|
53
|
+
.transform(obj => new BlockAttestation(obj.blockNumber, obj.payload, obj.signature));
|
|
50
54
|
}
|
|
51
55
|
|
|
52
|
-
override
|
|
56
|
+
override generateP2PMessageIdentifier(): Promise<Buffer32> {
|
|
53
57
|
return Promise.resolve(new BlockAttestationHash(keccak256(this.signature.toBuffer())));
|
|
54
58
|
}
|
|
55
59
|
|
|
@@ -58,11 +62,7 @@ export class BlockAttestation extends Gossipable {
|
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
get slotNumber(): Fr {
|
|
61
|
-
return this.payload.header.
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
get blockNumber(): Fr {
|
|
65
|
-
return this.payload.header.globalVariables.blockNumber;
|
|
65
|
+
return this.payload.header.slotNumber;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
/**Get sender
|
|
@@ -86,19 +86,23 @@ export class BlockAttestation extends Gossipable {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
toBuffer(): Buffer {
|
|
89
|
-
return serializeToBuffer([this.payload, this.signature]);
|
|
89
|
+
return serializeToBuffer([this.blockNumber, this.payload, this.signature]);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
static fromBuffer(buf: Buffer | BufferReader): BlockAttestation {
|
|
93
93
|
const reader = BufferReader.asReader(buf);
|
|
94
|
-
return new BlockAttestation(
|
|
94
|
+
return new BlockAttestation(
|
|
95
|
+
reader.readObject(Fr),
|
|
96
|
+
reader.readObject(ConsensusPayload),
|
|
97
|
+
reader.readObject(Signature),
|
|
98
|
+
);
|
|
95
99
|
}
|
|
96
100
|
|
|
97
101
|
static empty(): BlockAttestation {
|
|
98
|
-
return new BlockAttestation(ConsensusPayload.empty(), Signature.empty());
|
|
102
|
+
return new BlockAttestation(Fr.ZERO, ConsensusPayload.empty(), Signature.empty());
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
getSize(): number {
|
|
102
|
-
return this.payload.getSize() + this.signature.getSize();
|
|
106
|
+
return this.blockNumber.size + this.payload.getSize() + this.signature.getSize();
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -2,9 +2,10 @@ import { Buffer32 } from '@aztec/foundation/buffer';
|
|
|
2
2
|
import { keccak256, recoverAddress } from '@aztec/foundation/crypto';
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
|
-
import
|
|
5
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
6
6
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
7
7
|
|
|
8
|
+
import { Tx } from '../tx/tx.js';
|
|
8
9
|
import { ConsensusPayload } from './consensus_payload.js';
|
|
9
10
|
import { Gossipable } from './gossipable.js';
|
|
10
11
|
import {
|
|
@@ -20,6 +21,10 @@ export class BlockProposalHash extends Buffer32 {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
export type BlockProposalOptions = {
|
|
25
|
+
publishFullTxs: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* BlockProposal
|
|
25
30
|
*
|
|
@@ -32,16 +37,23 @@ export class BlockProposal extends Gossipable {
|
|
|
32
37
|
private sender: EthAddress | undefined;
|
|
33
38
|
|
|
34
39
|
constructor(
|
|
40
|
+
/** The number of the block */
|
|
41
|
+
public readonly blockNumber: Fr,
|
|
42
|
+
|
|
35
43
|
/** The payload of the message, and what the signature is over */
|
|
36
44
|
public readonly payload: ConsensusPayload,
|
|
37
45
|
|
|
38
46
|
/** The signer of the BlockProposal over the header of the new block*/
|
|
39
47
|
public readonly signature: Signature,
|
|
48
|
+
|
|
49
|
+
// Note(md): this is placed after the txs payload in order to be backwards compatible with previous versions
|
|
50
|
+
/** The transactions in the block */
|
|
51
|
+
public readonly txs?: Tx[],
|
|
40
52
|
) {
|
|
41
53
|
super();
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
override
|
|
56
|
+
override generateP2PMessageIdentifier(): Promise<Buffer32> {
|
|
45
57
|
return Promise.resolve(new BlockProposalHash(keccak256(this.signature.toBuffer())));
|
|
46
58
|
}
|
|
47
59
|
|
|
@@ -50,21 +62,20 @@ export class BlockProposal extends Gossipable {
|
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
get slotNumber(): Fr {
|
|
53
|
-
return this.payload.header.
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get blockNumber(): Fr {
|
|
57
|
-
return this.payload.header.globalVariables.blockNumber;
|
|
65
|
+
return this.payload.header.slotNumber;
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
static async createProposalFromSigner(
|
|
69
|
+
blockNumber: Fr,
|
|
61
70
|
payload: ConsensusPayload,
|
|
71
|
+
// Note(md): Provided separately to tx hashes such that this function can be optional
|
|
72
|
+
txs: Tx[] | undefined,
|
|
62
73
|
payloadSigner: (payload: Buffer32) => Promise<Signature>,
|
|
63
74
|
) {
|
|
64
75
|
const hashed = getHashedSignaturePayload(payload, SignatureDomainSeparator.blockProposal);
|
|
65
76
|
const sig = await payloadSigner(hashed);
|
|
66
77
|
|
|
67
|
-
return new BlockProposal(payload, sig);
|
|
78
|
+
return new BlockProposal(blockNumber, payload, sig, txs);
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
/**Get Sender
|
|
@@ -85,15 +96,35 @@ export class BlockProposal extends Gossipable {
|
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
toBuffer(): Buffer {
|
|
88
|
-
|
|
99
|
+
const buffer: any[] = [this.blockNumber, this.payload, this.signature];
|
|
100
|
+
if (this.txs) {
|
|
101
|
+
buffer.push(this.txs.length);
|
|
102
|
+
buffer.push(this.txs);
|
|
103
|
+
}
|
|
104
|
+
return serializeToBuffer(buffer);
|
|
89
105
|
}
|
|
90
106
|
|
|
91
107
|
static fromBuffer(buf: Buffer | BufferReader): BlockProposal {
|
|
92
108
|
const reader = BufferReader.asReader(buf);
|
|
93
|
-
|
|
109
|
+
|
|
110
|
+
const blockNumber = reader.readObject(Fr);
|
|
111
|
+
const payload = reader.readObject(ConsensusPayload);
|
|
112
|
+
const sig = reader.readObject(Signature);
|
|
113
|
+
|
|
114
|
+
if (!reader.isEmpty()) {
|
|
115
|
+
const txs = reader.readArray(reader.readNumber(), Tx);
|
|
116
|
+
return new BlockProposal(blockNumber, payload, sig, txs);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return new BlockProposal(blockNumber, payload, sig);
|
|
94
120
|
}
|
|
95
121
|
|
|
96
122
|
getSize(): number {
|
|
97
|
-
return
|
|
123
|
+
return (
|
|
124
|
+
this.blockNumber.size +
|
|
125
|
+
this.payload.getSize() +
|
|
126
|
+
this.signature.getSize() +
|
|
127
|
+
(this.txs ? this.txs.reduce((acc, tx) => acc + tx.getSize(), 0) : 0)
|
|
128
|
+
);
|
|
98
129
|
}
|
|
99
130
|
}
|
|
@@ -4,22 +4,23 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
4
4
|
import { hexToBuffer } from '@aztec/foundation/string';
|
|
5
5
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
6
|
|
|
7
|
-
import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
7
|
+
import { encodeAbiParameters, parseAbiParameters, toHex } from 'viem';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
import type { L2Block } from '../block/l2_block.js';
|
|
11
|
-
import {
|
|
12
|
-
import { TxHash } from '../tx/tx_hash.js';
|
|
11
|
+
import { ProposedBlockHeader, StateReference, TxHash } from '../tx/index.js';
|
|
13
12
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
14
13
|
|
|
15
14
|
export class ConsensusPayload implements Signable {
|
|
16
15
|
private size: number | undefined;
|
|
17
16
|
|
|
18
17
|
constructor(
|
|
19
|
-
/** The block header the attestation is made over */
|
|
20
|
-
public readonly header:
|
|
21
|
-
|
|
18
|
+
/** The proposed block header the attestation is made over */
|
|
19
|
+
public readonly header: ProposedBlockHeader,
|
|
20
|
+
/** The archive root after the block is added */
|
|
22
21
|
public readonly archive: Fr,
|
|
22
|
+
/** The state reference after the block is added */
|
|
23
|
+
public readonly stateReference: StateReference,
|
|
23
24
|
/** The sequence of transactions in the block */
|
|
24
25
|
public readonly txHashes: TxHash[],
|
|
25
26
|
) {}
|
|
@@ -27,30 +28,40 @@ export class ConsensusPayload implements Signable {
|
|
|
27
28
|
static get schema() {
|
|
28
29
|
return z
|
|
29
30
|
.object({
|
|
30
|
-
header:
|
|
31
|
+
header: ProposedBlockHeader.schema,
|
|
31
32
|
archive: schemas.Fr,
|
|
33
|
+
stateReference: StateReference.schema,
|
|
32
34
|
txHashes: z.array(TxHash.schema),
|
|
33
35
|
})
|
|
34
|
-
.transform(obj => new ConsensusPayload(obj.header, obj.archive, obj.txHashes));
|
|
36
|
+
.transform(obj => new ConsensusPayload(obj.header, obj.archive, obj.stateReference, obj.txHashes));
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
static getFields(fields: FieldsOf<ConsensusPayload>) {
|
|
38
|
-
return [fields.header, fields.archive, fields.txHashes] as const;
|
|
40
|
+
return [fields.header, fields.archive, fields.stateReference, fields.txHashes] as const;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
|
|
42
|
-
const abi = parseAbiParameters('uint8, (bytes32, (uint256),
|
|
44
|
+
const abi = parseAbiParameters('uint8, (bytes32, bytes, (uint256), bytes32, bytes32[])');
|
|
45
|
+
const archiveRoot = this.archive.toString();
|
|
46
|
+
const stateReference = toHex(this.stateReference.toBuffer());
|
|
47
|
+
const headerHash = this.header.hash().toString();
|
|
43
48
|
const txArray = this.txHashes.map(tx => tx.toString());
|
|
44
49
|
const encodedData = encodeAbiParameters(abi, [
|
|
45
50
|
domainSeparator,
|
|
46
|
-
[
|
|
51
|
+
[archiveRoot, stateReference, [0n] /* @todo See #9963 */, headerHash, txArray],
|
|
47
52
|
] as const);
|
|
48
53
|
|
|
49
54
|
return hexToBuffer(encodedData);
|
|
50
55
|
}
|
|
51
56
|
|
|
52
57
|
toBuffer(): Buffer {
|
|
53
|
-
const buffer = serializeToBuffer([
|
|
58
|
+
const buffer = serializeToBuffer([
|
|
59
|
+
this.header,
|
|
60
|
+
this.archive,
|
|
61
|
+
this.stateReference,
|
|
62
|
+
this.txHashes.length,
|
|
63
|
+
this.txHashes,
|
|
64
|
+
]);
|
|
54
65
|
this.size = buffer.length;
|
|
55
66
|
return buffer;
|
|
56
67
|
}
|
|
@@ -58,26 +69,28 @@ export class ConsensusPayload implements Signable {
|
|
|
58
69
|
static fromBuffer(buf: Buffer | BufferReader): ConsensusPayload {
|
|
59
70
|
const reader = BufferReader.asReader(buf);
|
|
60
71
|
return new ConsensusPayload(
|
|
61
|
-
reader.readObject(
|
|
72
|
+
reader.readObject(ProposedBlockHeader),
|
|
62
73
|
reader.readObject(Fr),
|
|
74
|
+
reader.readObject(StateReference),
|
|
63
75
|
reader.readArray(reader.readNumber(), TxHash),
|
|
64
76
|
);
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
static fromFields(fields: FieldsOf<ConsensusPayload>): ConsensusPayload {
|
|
68
|
-
return new ConsensusPayload(fields.header, fields.archive, fields.txHashes);
|
|
80
|
+
return new ConsensusPayload(fields.header, fields.archive, fields.stateReference, fields.txHashes);
|
|
69
81
|
}
|
|
70
82
|
|
|
71
83
|
static fromBlock(block: L2Block): ConsensusPayload {
|
|
72
84
|
return new ConsensusPayload(
|
|
73
|
-
block.header,
|
|
85
|
+
block.header.toPropose(),
|
|
74
86
|
block.archive.root,
|
|
87
|
+
block.header.state,
|
|
75
88
|
block.body.txEffects.map(tx => tx.txHash),
|
|
76
89
|
);
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
static empty(): ConsensusPayload {
|
|
80
|
-
return new ConsensusPayload(
|
|
93
|
+
return new ConsensusPayload(ProposedBlockHeader.empty(), Fr.ZERO, StateReference.empty(), []);
|
|
81
94
|
}
|
|
82
95
|
|
|
83
96
|
/**
|
|
@@ -92,4 +105,8 @@ export class ConsensusPayload implements Signable {
|
|
|
92
105
|
this.size = this.toBuffer().length;
|
|
93
106
|
return this.size;
|
|
94
107
|
}
|
|
108
|
+
|
|
109
|
+
toString() {
|
|
110
|
+
return `header: ${this.header.toString()}, archive: ${this.archive.toString()}, stateReference: ${this.stateReference.l1ToL2MessageTree.root.toString()}, txHashes: ${this.txHashes.join(', ')}`;
|
|
111
|
+
}
|
|
95
112
|
}
|
package/src/p2p/gossipable.ts
CHANGED
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
3
|
|
|
3
4
|
import type { TopicType } from './topic_type.js';
|
|
4
5
|
|
|
6
|
+
export class P2PMessage {
|
|
7
|
+
constructor(
|
|
8
|
+
public readonly publishTime: Date,
|
|
9
|
+
public readonly id: Buffer32,
|
|
10
|
+
public readonly payload: Buffer,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
static async fromGossipable(message: Gossipable): Promise<P2PMessage> {
|
|
14
|
+
return new P2PMessage(new Date(), await message.p2pMessageIdentifier(), message.toBuffer());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static fromMessageData(messageData: Buffer): P2PMessage {
|
|
18
|
+
const reader = new BufferReader(messageData);
|
|
19
|
+
const publishTime = reader.readUInt64();
|
|
20
|
+
const id = Buffer32.fromBuffer(reader);
|
|
21
|
+
const payload = reader.readBuffer();
|
|
22
|
+
return new P2PMessage(new Date(Number(publishTime)), id, payload);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
toMessageData(): Buffer {
|
|
26
|
+
return serializeToBuffer([
|
|
27
|
+
bigintToUInt64BE(BigInt(this.publishTime.getTime())),
|
|
28
|
+
this.id,
|
|
29
|
+
serializeToBuffer(this.payload.length, this.payload),
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
5
34
|
/**
|
|
6
35
|
* Gossipable
|
|
7
36
|
*
|
|
8
37
|
* Any class which extends gossipable will be able to be Gossiped over the p2p network
|
|
9
38
|
*/
|
|
10
39
|
export abstract class Gossipable {
|
|
40
|
+
private cachedId: Buffer32 | undefined;
|
|
11
41
|
/** p2p Topic
|
|
12
42
|
*
|
|
13
43
|
* - The p2p topic identifier, this determines how the message is handled
|
|
@@ -18,7 +48,15 @@ export abstract class Gossipable {
|
|
|
18
48
|
*
|
|
19
49
|
* - A digest of the message information, this key is used for deduplication
|
|
20
50
|
*/
|
|
21
|
-
|
|
51
|
+
async p2pMessageIdentifier(): Promise<Buffer32> {
|
|
52
|
+
if (this.cachedId) {
|
|
53
|
+
return this.cachedId;
|
|
54
|
+
}
|
|
55
|
+
this.cachedId = await this.generateP2PMessageIdentifier();
|
|
56
|
+
return this.cachedId;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
abstract generateP2PMessageIdentifier(): Promise<Buffer32>;
|
|
22
60
|
|
|
23
61
|
/** To Buffer
|
|
24
62
|
*
|
|
@@ -26,6 +64,10 @@ export abstract class Gossipable {
|
|
|
26
64
|
*/
|
|
27
65
|
abstract toBuffer(): Buffer;
|
|
28
66
|
|
|
67
|
+
toMessage(): Buffer {
|
|
68
|
+
return this.toBuffer();
|
|
69
|
+
}
|
|
70
|
+
|
|
29
71
|
/**
|
|
30
72
|
* Get the size of the gossipable object.
|
|
31
73
|
*
|
package/src/p2p/topic_type.ts
CHANGED
|
@@ -22,6 +22,8 @@ export enum TopicType {
|
|
|
22
22
|
export function getTopicTypeForClientType(clientType: P2PClientType) {
|
|
23
23
|
if (clientType === P2PClientType.Full) {
|
|
24
24
|
return Object.values(TopicType);
|
|
25
|
+
} else if (clientType === P2PClientType.Prover) {
|
|
26
|
+
return [TopicType.tx, TopicType.block_proposal];
|
|
25
27
|
}
|
|
26
28
|
return [TopicType.tx];
|
|
27
29
|
}
|
package/src/proofs/proof.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PAIRING_POINTS_SIZE } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
@@ -70,8 +70,8 @@ export class Proof {
|
|
|
70
70
|
// We are indexing to this particular size because we are assuming the proof buffer looks like:
|
|
71
71
|
// [binary public inputs, binary proof]
|
|
72
72
|
// Here, we are assuming the pairing point object is the last 16 fields of the public inputs.
|
|
73
|
-
assert(this.numPublicInputs >=
|
|
74
|
-
const proofStart = Fr.SIZE_IN_BYTES * (this.numPublicInputs -
|
|
73
|
+
assert(this.numPublicInputs >= PAIRING_POINTS_SIZE, 'Proof does not contain an aggregation object');
|
|
74
|
+
const proofStart = Fr.SIZE_IN_BYTES * (this.numPublicInputs - PAIRING_POINTS_SIZE);
|
|
75
75
|
assert(this.buffer.length >= proofStart, 'Proof buffer is not appropriately sized to call withoutPublicInputs()');
|
|
76
76
|
return this.buffer.subarray(proofStart);
|
|
77
77
|
}
|
|
@@ -84,8 +84,8 @@ export class Proof {
|
|
|
84
84
|
// return array of this.numPublicInputs 0s
|
|
85
85
|
return new Array(this.numPublicInputs).fill(Fr.zero());
|
|
86
86
|
}
|
|
87
|
-
assert(this.numPublicInputs >=
|
|
88
|
-
const numInnerPublicInputs = this.numPublicInputs -
|
|
87
|
+
assert(this.numPublicInputs >= PAIRING_POINTS_SIZE, 'Proof does not contain an aggregation object');
|
|
88
|
+
const numInnerPublicInputs = this.numPublicInputs - PAIRING_POINTS_SIZE;
|
|
89
89
|
const reader = BufferReader.asReader(this.buffer.subarray(0, Fr.SIZE_IN_BYTES * numInnerPublicInputs));
|
|
90
90
|
const publicInputs = reader.readArray(numInnerPublicInputs, Fr);
|
|
91
91
|
return publicInputs;
|