@aztec/stdlib 3.0.0-nightly.20251127 → 3.0.0-nightly.20251201.2
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 +83 -83
- package/dest/abi/authorization_selector.d.ts +1 -1
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/decoder.d.ts +1 -1
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/event_metadata_definition.d.ts +1 -1
- package/dest/abi/event_selector.d.ts +1 -1
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_call.d.ts +1 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +1 -1
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/index.d.ts +1 -1
- package/dest/abi/mocked_keys.d.ts +1 -1
- package/dest/abi/note_selector.d.ts +1 -1
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/selector.d.ts +1 -1
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/utils.d.ts +1 -1
- package/dest/auth_witness/auth_witness.d.ts +1 -2
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/index.d.ts +1 -1
- package/dest/avm/avm.d.ts +2433 -2431
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.d.ts +16 -43
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +175 -173
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +1660 -1656
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/contract_storage_read.d.ts +1 -13
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +1 -13
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/index.d.ts +1 -1
- package/dest/avm/message_pack.d.ts +1 -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_read.d.ts +1 -10
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +1 -10
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +4 -10
- package/dest/avm/public_data_write.d.ts.map +1 -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/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/aztec-address/index.d.ts +1 -1
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/block/attestation_info.d.ts +3 -1
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -1
- package/dest/block/block_hash.d.ts +1 -1
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/body.d.ts +5 -2
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -2
- package/dest/block/in_block.d.ts +3 -11
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -1
- package/dest/block/l2_block.d.ts +10 -7
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +22 -1
- package/dest/block/l2_block_code_to_purge.d.ts +1 -1
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +3 -2
- package/dest/block/l2_block_header.d.ts +4 -11
- package/dest/block/l2_block_header.d.ts.map +1 -1
- package/dest/block/l2_block_header.js +1 -1
- package/dest/block/l2_block_info.d.ts +9 -9
- package/dest/block/l2_block_new.d.ts +17 -6
- package/dest/block/l2_block_new.d.ts.map +1 -1
- package/dest/block/l2_block_new.js +22 -0
- package/dest/block/l2_block_number.d.ts +1 -1
- package/dest/block/l2_block_source.d.ts +10 -9
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.d.ts +1 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -6
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.d.ts +1 -1
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.d.ts +1 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/index.d.ts +1 -1
- package/dest/block/published_l2_block.d.ts +15 -28
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +12 -27
- package/dest/block/test/index.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/validate_block_result.d.ts +6 -178
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +4 -3
- package/dest/checkpoint/checkpoint.d.ts +20 -7
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +33 -8
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/published_checkpoint.d.ts +212 -0
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -0
- package/dest/checkpoint/published_checkpoint.js +71 -0
- package/dest/config/chain-config.d.ts +1 -1
- package/dest/config/index.d.ts +1 -1
- package/dest/config/node-rpc-config.d.ts +1 -1
- package/dest/contract/artifact_hash.d.ts +2 -2
- package/dest/contract/artifact_hash.d.ts.map +1 -1
- package/dest/contract/complete_address.d.ts +1 -4
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_address.d.ts +1 -1
- package/dest/contract/contract_class.d.ts +1 -1
- package/dest/contract/contract_class_id.d.ts +1 -1
- package/dest/contract/contract_class_metadata.d.ts +1 -1
- package/dest/contract/contract_deployment_data.d.ts +17 -17
- package/dest/contract/contract_deployment_data.d.ts.map +1 -1
- package/dest/contract/contract_function_dao.d.ts +1 -1
- package/dest/contract/contract_instance.d.ts +1 -1
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance_update.d.ts +1 -1
- package/dest/contract/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/contract_metadata.d.ts +1 -1
- package/dest/contract/deployment_info.d.ts +1 -1
- package/dest/contract/index.d.ts +1 -1
- package/dest/contract/interfaces/contract_class.d.ts +29 -29
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_data_source.d.ts +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +11 -11
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.d.ts +3 -3
- package/dest/contract/interfaces/index.d.ts +1 -1
- package/dest/contract/interfaces/node-info.d.ts +1 -1
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts +1 -1
- package/dest/contract/partial_address.d.ts +1 -1
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/utility_function_membership_proof.d.ts +1 -1
- package/dest/database-version/index.d.ts +1 -1
- package/dest/database-version/version_manager.d.ts +6 -8
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -1
- package/dest/delayed_public_mutable/index.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -1
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts +1 -1
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -1
- package/dest/epoch-helpers/index.d.ts +12 -11
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +10 -9
- package/dest/errors/index.d.ts +1 -1
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/errors/simulation_error.d.ts +1 -1
- package/dest/errors/simulation_error.d.ts.map +1 -1
- package/dest/fees/index.d.ts +1 -1
- package/dest/fees/transaction_fee.d.ts +1 -1
- package/dest/file-store/factory.d.ts +1 -1
- package/dest/file-store/gcs.d.ts +1 -1
- package/dest/file-store/gcs.d.ts.map +1 -1
- package/dest/file-store/http.d.ts +1 -1
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/index.d.ts +1 -1
- package/dest/file-store/interface.d.ts +1 -1
- package/dest/file-store/local.d.ts +1 -1
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/file-store/s3.d.ts +1 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/gas/gas.d.ts +1 -1
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas_fees.d.ts +1 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_settings.d.ts +1 -1
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_used.d.ts +1 -1
- package/dest/gas/index.d.ts +1 -1
- package/dest/hash/hash.d.ts +2 -2
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/index.d.ts +1 -1
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/interfaces/allowed_element.d.ts +5 -5
- package/dest/interfaces/api_limit.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +6 -5
- package/dest/interfaces/aztec-node-admin.d.ts +88 -88
- package/dest/interfaces/aztec-node.d.ts +8 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +2 -1
- package/dest/interfaces/block-builder.d.ts +1 -1
- package/dest/interfaces/client.d.ts +1 -1
- package/dest/interfaces/configs.d.ts +21 -21
- package/dest/interfaces/epoch-prover.d.ts +4 -3
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.d.ts +1 -1
- package/dest/interfaces/l2_logs_source.d.ts +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +1 -1
- package/dest/interfaces/p2p-bootstrap.d.ts +1 -1
- package/dest/interfaces/p2p.d.ts +3 -2
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +1 -1
- package/dest/interfaces/private_kernel_prover.d.ts +1 -1
- package/dest/interfaces/processed-tx-handler.d.ts +1 -1
- package/dest/interfaces/prover-agent.d.ts +1 -1
- package/dest/interfaces/prover-broker.d.ts +1 -1
- package/dest/interfaces/prover-client.d.ts +5 -5
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-coordination.d.ts +1 -1
- package/dest/interfaces/prover-node.d.ts +1 -1
- package/dest/interfaces/proving-job-source.d.ts +1 -1
- package/dest/interfaces/proving-job.d.ts +1273 -1276
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +3 -2
- package/dest/interfaces/public_state_source.d.ts +1 -1
- package/dest/interfaces/server.d.ts +1 -1
- package/dest/interfaces/server_circuit_prover.d.ts +2 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/service.d.ts +1 -1
- package/dest/interfaces/slasher.d.ts +3 -3
- package/dest/interfaces/tx_provider.d.ts +1 -1
- package/dest/interfaces/validator.d.ts +23 -23
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/world_state.d.ts +1 -1
- package/dest/kernel/claimed_length_array.d.ts +1 -1
- package/dest/kernel/claimed_length_array.d.ts.map +1 -1
- package/dest/kernel/hiding_kernel_private_inputs.d.ts +1 -1
- package/dest/kernel/hiding_kernel_private_inputs.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/build_transient_data_hints.d.ts +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +1 -1
- package/dest/kernel/hints/index.d.ts +1 -1
- package/dest/kernel/hints/key_validation_hint.d.ts +1 -2
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +1 -2
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +1 -6
- 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 +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +1 -13
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +1 -7
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +1 -7
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts +1 -1
- package/dest/kernel/hints/scoped_key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/scoped_value_cache.d.ts +1 -1
- package/dest/kernel/hints/scoped_value_cache.d.ts.map +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts +1 -1
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts +1 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +1 -1
- package/dest/kernel/index.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/note_hash.d.ts +1 -1
- package/dest/kernel/note_hash.d.ts.map +1 -1
- package/dest/kernel/nullifier.d.ts +1 -1
- package/dest/kernel/nullifier.d.ts.map +1 -1
- package/dest/kernel/padded_side_effects.d.ts +1 -1
- package/dest/kernel/padded_side_effects.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.d.ts +1 -23
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +62 -29
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.js +105 -4
- package/dest/kernel/private_call_request.d.ts +1 -16
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +1 -74
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.d.ts +1 -1
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +1 -31
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.d.ts +1 -7
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -22
- 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 -7
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +8 -8
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +1 -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 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_simulated_output.d.ts +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- 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 +1 -23
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_log_data.d.ts +1 -1
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +8 -8
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data_builder.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data_builder.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +1 -1
- 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 +1 -17
- 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 +1 -16
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +1 -10
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/public_call_request.d.ts +6 -27
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/utils/index.d.ts +1 -1
- package/dest/kernel/utils/interfaces.d.ts +1 -1
- package/dest/kernel/utils/optional_number.d.ts +1 -7
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.d.ts +1 -1
- package/dest/keys/derivation.d.ts +1 -1
- package/dest/keys/index.d.ts +1 -1
- package/dest/keys/key_types.d.ts +1 -1
- package/dest/keys/public_key.d.ts +1 -1
- package/dest/keys/public_keys.d.ts +1 -5
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/utils.d.ts +1 -1
- package/dest/l1-contracts/index.d.ts +1 -1
- package/dest/l1-contracts/slash_factory.d.ts +3 -3
- package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
- package/dest/logs/contract_class_log.d.ts +4 -4
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/debug_log.d.ts +1 -1
- package/dest/logs/debug_log.d.ts.map +1 -1
- package/dest/logs/directional_app_tagging_secret.d.ts +1 -1
- package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/extended_contract_class_log.d.ts +1 -3
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +2 -4
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/index.d.ts +1 -1
- package/dest/logs/log_filter.d.ts +1 -1
- package/dest/logs/log_id.d.ts +1 -4
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.d.ts +1 -1
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/message_context.d.ts +1 -1
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.d.ts +1 -1
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pre_tag.d.ts +1 -1
- package/dest/logs/private_log.d.ts +1 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/public_log.d.ts +1 -1
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.d.ts +1 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +8 -8
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/messaging/in_hash.d.ts +1 -1
- package/dest/messaging/inbox_leaf.d.ts +1 -3
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/index.d.ts +1 -1
- package/dest/messaging/l1_actor.d.ts +1 -7
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +1 -6
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message_source.d.ts +1 -1
- package/dest/messaging/l2_actor.d.ts +1 -7
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
- package/dest/messaging/l2_to_l1_message.d.ts +21 -21
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/out_hash.d.ts +1 -1
- package/dest/noir/index.d.ts +1 -1
- package/dest/note/comparator.d.ts +1 -1
- package/dest/note/index.d.ts +1 -1
- package/dest/note/note.d.ts +1 -1
- package/dest/note/note.d.ts.map +1 -1
- package/dest/note/note_dao.d.ts +2 -28
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_status.d.ts +1 -1
- package/dest/note/notes_filter.d.ts +1 -1
- package/dest/p2p/attestation_utils.d.ts +1 -1
- package/dest/p2p/block_attestation.d.ts +4 -12
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +3 -6
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +1 -1
- package/dest/p2p/client_type.d.ts +1 -1
- package/dest/p2p/consensus_payload.d.ts +9 -188
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +16 -23
- package/dest/p2p/gossipable.d.ts +1 -1
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/index.d.ts +1 -1
- package/dest/p2p/interface.d.ts +1 -1
- package/dest/p2p/message_validator.d.ts +1 -1
- package/dest/p2p/peer_error.d.ts +1 -1
- package/dest/p2p/signature_utils.d.ts +1 -1
- package/dest/p2p/topic_type.d.ts +1 -1
- package/dest/parity/index.d.ts +1 -1
- package/dest/parity/parity_base_private_inputs.d.ts +1 -3
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +1 -4
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +1 -2
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +1 -1
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/index.d.ts +1 -1
- package/dest/proofs/proof.d.ts +1 -4
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof_data.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.d.ts +1 -1
- package/dest/proofs/recursive_proof.d.ts +1 -10
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.d.ts +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +1 -34
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +1 -12
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +1 -45
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +1 -64
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +11 -14
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +11 -4
- package/dest/rollup/checkpoint_header.d.ts +12 -15
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +30 -12
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -25
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +1 -25
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.d.ts +1 -16
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/index.d.ts +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +1 -6
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +1 -3
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tree_snapshot_diff_hints.d.ts +1 -24
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +1 -4
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +1 -29
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/index.d.ts +1 -1
- package/dest/schemas/schemas.d.ts +7 -2
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +2 -0
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +5 -4
- package/dest/slashing/helpers.d.ts +7 -6
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +8 -6
- package/dest/slashing/index.d.ts +1 -1
- package/dest/slashing/interfaces.d.ts +3 -2
- package/dest/slashing/interfaces.d.ts.map +1 -1
- package/dest/slashing/serialization.d.ts +1 -1
- package/dest/slashing/tally.d.ts +1 -1
- package/dest/slashing/types.d.ts +9 -9
- package/dest/snapshots/download.d.ts +1 -1
- package/dest/snapshots/index.d.ts +1 -1
- package/dest/snapshots/types.d.ts +18 -18
- package/dest/snapshots/upload.d.ts +1 -1
- package/dest/stats/index.d.ts +1 -1
- package/dest/stats/stats.d.ts +1 -1
- package/dest/tests/factories.d.ts +5 -8
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +13 -22
- package/dest/tests/fixtures.d.ts +1 -1
- package/dest/tests/index.d.ts +1 -1
- package/dest/tests/jest.d.ts +1 -1
- package/dest/tests/mocks.d.ts +38 -21
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +24 -21
- package/dest/trees/append_only_tree_snapshot.d.ts +1 -16
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +0 -9
- package/dest/trees/database_public_state_source.d.ts +1 -1
- package/dest/trees/database_public_state_source.d.ts.map +1 -1
- package/dest/trees/index.d.ts +1 -1
- package/dest/trees/merkle_tree_id.d.ts +5 -5
- package/dest/trees/merkle_tree_id.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.d.ts +1 -13
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +1 -10
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +12 -27
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +8 -18
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +5 -12
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +13 -2
- package/dest/tx/call_context.d.ts +6 -18
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +1 -4
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/content_commitment.d.ts +1 -1
- package/dest/tx/content_commitment.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +1 -9
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -6
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +3 -2
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +35 -24
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +40 -9
- package/dest/tx/hashed_values.d.ts +1 -7
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/index.d.ts +1 -1
- package/dest/tx/indexed_tx_effect.d.ts +2 -2
- package/dest/tx/indexed_tx_effect.js +3 -1
- package/dest/tx/offchain_effect.d.ts +1 -1
- package/dest/tx/partial_state_reference.d.ts +1 -7
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +0 -10
- package/dest/tx/private_execution_result.d.ts +6 -28
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_tx_constant_data.d.ts +1 -16
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/processed_tx.d.ts +1 -1
- package/dest/tx/profiling.d.ts +35 -35
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.d.ts +2 -2
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/proven_tx.d.ts +18 -18
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.d.ts +1 -7
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.d.ts +1 -1
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/simulated_tx.d.ts +21 -21
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/state_reference.d.ts +7 -12
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +0 -9
- package/dest/tx/tree_snapshots.d.ts +7 -7
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +2 -17
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +1 -0
- package/dest/tx/tx_constant_data.d.ts +1 -1
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_context.d.ts +1 -2
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +12 -33
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +4 -2
- package/dest/tx/tx_execution_request.d.ts +1 -30
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_hash.d.ts +1 -2
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +1 -7
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_request.d.ts +1 -6
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/validator/empty_validator.d.ts +1 -1
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +1 -1
- package/dest/tx/validator/tx_validator.d.ts +5 -5
- package/dest/types/index.d.ts +1 -1
- package/dest/types/shared.d.ts +1 -4
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/update-checker/index.d.ts +1 -1
- package/dest/update-checker/update-checker.d.ts +2 -3
- package/dest/update-checker/update-checker.d.ts.map +1 -1
- package/dest/validators/errors.d.ts +6 -7
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +2 -4
- package/dest/validators/index.d.ts +1 -1
- package/dest/validators/schemas.d.ts +266 -208
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +7 -7
- package/dest/validators/types.d.ts +10 -9
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/index.d.ts +1 -1
- package/dest/versioning/versioning.d.ts +1 -1
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/index.d.ts +1 -1
- package/dest/vks/verification_key.d.ts +1 -22
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_data.d.ts +1 -7
- package/dest/vks/vk_data.d.ts.map +1 -1
- package/dest/world-state/index.d.ts +1 -1
- package/dest/world-state/world_state_revision.d.ts +7 -7
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +1 -1
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/block/attestation_info.ts +8 -1
- package/src/block/body.ts +9 -7
- package/src/block/l2_block.ts +29 -2
- package/src/block/l2_block_code_to_purge.ts +3 -2
- package/src/block/l2_block_header.ts +3 -2
- package/src/block/l2_block_new.ts +28 -0
- package/src/block/l2_block_source.ts +9 -8
- package/src/block/published_l2_block.ts +14 -31
- package/src/block/validate_block_result.ts +9 -7
- package/src/checkpoint/checkpoint.ts +48 -7
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +91 -0
- package/src/epoch-helpers/index.ts +28 -21
- package/src/interfaces/archiver.ts +6 -5
- package/src/interfaces/aztec-node.ts +12 -3
- package/src/interfaces/epoch-prover.ts +3 -2
- package/src/interfaces/p2p.ts +4 -2
- package/src/interfaces/proving-job.ts +14 -5
- package/src/interfaces/validator.ts +1 -2
- package/src/kernel/private_call_data.ts +130 -3
- package/src/p2p/block_attestation.ts +2 -1
- package/src/p2p/block_proposal.ts +3 -2
- package/src/p2p/consensus_payload.ts +16 -26
- package/src/rollup/checkpoint_constant_data.ts +24 -5
- package/src/rollup/checkpoint_header.ts +33 -23
- package/src/schemas/schemas.ts +7 -0
- package/src/slashing/empire.ts +6 -4
- package/src/slashing/helpers.ts +17 -12
- package/src/slashing/interfaces.ts +3 -1
- package/src/tests/factories.ts +27 -25
- package/src/tests/mocks.ts +32 -26
- package/src/trees/append_only_tree_snapshot.ts +0 -12
- package/src/tx/block_header.ts +16 -3
- package/src/tx/global_variable_builder.ts +2 -1
- package/src/tx/global_variables.ts +44 -10
- package/src/tx/indexed_tx_effect.ts +1 -1
- package/src/tx/partial_state_reference.ts +0 -17
- package/src/tx/state_reference.ts +0 -15
- package/src/tx/tx.ts +2 -1
- package/src/tx/tx_effect.ts +27 -23
- package/src/validators/errors.ts +3 -4
- package/src/validators/schemas.ts +7 -7
- package/src/validators/types.ts +9 -8
package/src/tests/factories.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
makeBlobAccumulator,
|
|
3
|
+
makeFinalBlobAccumulator,
|
|
4
|
+
makeFinalBlobBatchingChallenges,
|
|
5
|
+
makeSpongeBlob,
|
|
6
|
+
} from '@aztec/blob-lib/testing';
|
|
2
7
|
import {
|
|
3
8
|
ARCHIVE_HEIGHT,
|
|
4
9
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
@@ -38,6 +43,7 @@ import {
|
|
|
38
43
|
VK_TREE_HEIGHT,
|
|
39
44
|
} from '@aztec/constants';
|
|
40
45
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
46
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
41
47
|
import { compact } from '@aztec/foundation/collection';
|
|
42
48
|
import { Grumpkin, SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
|
|
43
49
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -77,7 +83,7 @@ import {
|
|
|
77
83
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
78
84
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
79
85
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
80
|
-
import { L2BlockHeader } from '../block/
|
|
86
|
+
import { L2BlockHeader } from '../block/l2_block_header.js';
|
|
81
87
|
import {
|
|
82
88
|
type ContractClassPublic,
|
|
83
89
|
ContractDeploymentData,
|
|
@@ -296,7 +302,12 @@ export function makeContractStorageRead(seed = 1): ContractStorageRead {
|
|
|
296
302
|
}
|
|
297
303
|
|
|
298
304
|
function makeTxConstantData(seed = 1) {
|
|
299
|
-
return new TxConstantData(
|
|
305
|
+
return new TxConstantData(
|
|
306
|
+
makeBlockHeader(seed),
|
|
307
|
+
makeTxContext(seed + 0x100),
|
|
308
|
+
new Fr(seed + 0x200),
|
|
309
|
+
new Fr(seed + 0x201),
|
|
310
|
+
);
|
|
300
311
|
}
|
|
301
312
|
|
|
302
313
|
function makePaddedTuple<T, N extends number>(
|
|
@@ -673,7 +684,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
673
684
|
endSideEffectCounter: fr(seed + 0x850),
|
|
674
685
|
expectedNonRevertibleSideEffectCounter: fr(seed + 0x860),
|
|
675
686
|
expectedRevertibleSideEffectCounter: fr(seed + 0x861),
|
|
676
|
-
anchorBlockHeader:
|
|
687
|
+
anchorBlockHeader: makeBlockHeader(seed + 0xd00),
|
|
677
688
|
txContext: makeTxContext(seed + 0x1400),
|
|
678
689
|
isFeePayer: false,
|
|
679
690
|
});
|
|
@@ -684,7 +695,7 @@ export function makeGlobalVariables(seed = 1, overrides: Partial<FieldsOf<Global
|
|
|
684
695
|
chainId: new Fr(seed),
|
|
685
696
|
version: new Fr(seed + 1),
|
|
686
697
|
blockNumber: seed + 2,
|
|
687
|
-
slotNumber:
|
|
698
|
+
slotNumber: SlotNumber(seed + 3),
|
|
688
699
|
timestamp: BigInt(seed + 4),
|
|
689
700
|
coinbase: EthAddress.fromField(new Fr(seed + 5)),
|
|
690
701
|
feeRecipient: AztecAddress.fromField(new Fr(seed + 6)),
|
|
@@ -765,7 +776,7 @@ function makeCheckpointConstantData(seed = 1) {
|
|
|
765
776
|
fr(seed + 2),
|
|
766
777
|
fr(seed + 3),
|
|
767
778
|
fr(seed + 4),
|
|
768
|
-
|
|
779
|
+
SlotNumber(seed + 5),
|
|
769
780
|
makeEthAddress(seed + 6),
|
|
770
781
|
makeAztecAddress(seed + 7),
|
|
771
782
|
makeGasFees(seed + 8),
|
|
@@ -825,16 +836,15 @@ export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
|
825
836
|
}
|
|
826
837
|
|
|
827
838
|
export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
828
|
-
const startBlobAccumulator = makeBatchedBlobAccumulator(seed);
|
|
829
839
|
return new CheckpointRollupPublicInputs(
|
|
830
840
|
makeEpochConstantData(seed),
|
|
831
841
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
832
842
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
833
843
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
834
|
-
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed),
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
844
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x400),
|
|
845
|
+
makeBlobAccumulator(seed + 0x500),
|
|
846
|
+
makeBlobAccumulator(seed + 0x600),
|
|
847
|
+
makeFinalBlobBatchingChallenges(seed + 0x700),
|
|
838
848
|
);
|
|
839
849
|
}
|
|
840
850
|
|
|
@@ -869,7 +879,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
869
879
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
870
880
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
871
881
|
makeEpochConstantData(seed + 0x600),
|
|
872
|
-
|
|
882
|
+
makeFinalBlobAccumulator(seed + 0x700),
|
|
873
883
|
);
|
|
874
884
|
}
|
|
875
885
|
|
|
@@ -880,23 +890,15 @@ export function makeContentCommitment(seed = 0): ContentCommitment {
|
|
|
880
890
|
return new ContentCommitment(fr(seed + 0x100), fr(seed + 0x200), fr(seed + 0x300));
|
|
881
891
|
}
|
|
882
892
|
|
|
883
|
-
|
|
884
|
-
* Makes header.
|
|
885
|
-
*/
|
|
886
|
-
export function makeHeader(
|
|
893
|
+
export function makeBlockHeader(
|
|
887
894
|
seed = 0,
|
|
888
|
-
|
|
889
|
-
slotNumber: number | undefined = undefined,
|
|
890
|
-
overrides: Partial<FieldsOf<BlockHeader>> = {},
|
|
895
|
+
overrides: Partial<FieldsOf<Omit<BlockHeader, 'globalVariables'>>> & Partial<FieldsOf<GlobalVariables>> = {},
|
|
891
896
|
): BlockHeader {
|
|
892
897
|
return BlockHeader.from({
|
|
893
898
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
894
899
|
state: makeStateReference(seed + 0x200),
|
|
895
900
|
spongeBlobHash: fr(seed + 0x300),
|
|
896
|
-
globalVariables: makeGlobalVariables((seed += 0x700),
|
|
897
|
-
...(blockNumber ? { blockNumber } : {}),
|
|
898
|
-
...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
|
|
899
|
-
}),
|
|
901
|
+
globalVariables: makeGlobalVariables((seed += 0x700), overrides),
|
|
900
902
|
totalFees: fr(seed + 0x800),
|
|
901
903
|
totalManaUsed: fr(seed + 0x900),
|
|
902
904
|
...overrides,
|
|
@@ -915,7 +917,7 @@ export function makeL2BlockHeader(
|
|
|
915
917
|
overrides?.state ?? makeStateReference(seed + 0x600),
|
|
916
918
|
makeGlobalVariables((seed += 0x700), {
|
|
917
919
|
...(blockNumber ? { blockNumber } : {}),
|
|
918
|
-
...(slotNumber ? { slotNumber:
|
|
920
|
+
...(slotNumber ? { slotNumber: SlotNumber(slotNumber) } : {}),
|
|
919
921
|
}),
|
|
920
922
|
new Fr(seed + 0x800),
|
|
921
923
|
new Fr(seed + 0x900),
|
|
@@ -929,7 +931,7 @@ export function makeCheckpointHeader(seed = 0) {
|
|
|
929
931
|
lastArchiveRoot: fr(seed + 0x100),
|
|
930
932
|
blockHeadersHash: fr(seed + 0x150),
|
|
931
933
|
contentCommitment: makeContentCommitment(seed + 0x200),
|
|
932
|
-
slotNumber:
|
|
934
|
+
slotNumber: SlotNumber(seed + 0x300),
|
|
933
935
|
timestamp: BigInt(seed + 0x400),
|
|
934
936
|
coinbase: makeEthAddress(seed + 0x500),
|
|
935
937
|
feeRecipient: makeAztecAddress(seed + 0x600),
|
package/src/tests/mocks.ts
CHANGED
|
@@ -17,10 +17,12 @@ import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
|
17
17
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
18
18
|
import { RevertCode } from '../avm/revert_code.js';
|
|
19
19
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
20
|
-
import { CommitteeAttestation,
|
|
20
|
+
import { CommitteeAttestation, L2BlockHeader } from '../block/index.js';
|
|
21
21
|
import { L2Block } from '../block/l2_block.js';
|
|
22
22
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
23
23
|
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
24
|
+
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
25
|
+
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
24
26
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
25
27
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
26
28
|
import { SerializableContractInstance } from '../contract/contract_instance.js';
|
|
@@ -54,7 +56,6 @@ import {
|
|
|
54
56
|
PrivateCallExecutionResult,
|
|
55
57
|
PrivateExecutionResult,
|
|
56
58
|
ProtocolContracts,
|
|
57
|
-
StateReference,
|
|
58
59
|
Tx,
|
|
59
60
|
TxConstantData,
|
|
60
61
|
makeProcessedTxFromPrivateOnlyTx,
|
|
@@ -67,9 +68,9 @@ import { TxHash } from '../tx/tx_hash.js';
|
|
|
67
68
|
import {
|
|
68
69
|
makeAvmCircuitInputs,
|
|
69
70
|
makeAztecAddress,
|
|
71
|
+
makeBlockHeader,
|
|
70
72
|
makeGas,
|
|
71
73
|
makeGlobalVariables,
|
|
72
|
-
makeHeader,
|
|
73
74
|
makeL2BlockHeader,
|
|
74
75
|
makePrivateToPublicAccumulatedData,
|
|
75
76
|
makePrivateToRollupAccumulatedData,
|
|
@@ -211,7 +212,7 @@ export async function mockProcessedTx({
|
|
|
211
212
|
privateOnly?: boolean;
|
|
212
213
|
} & Parameters<typeof mockTx>[1] = {}) {
|
|
213
214
|
seed *= 0x1000; // Avoid clashing with the previous mock values if seed only increases by 1.
|
|
214
|
-
anchorBlockHeader ??= db?.getInitialHeader() ??
|
|
215
|
+
anchorBlockHeader ??= db?.getInitialHeader() ?? makeBlockHeader(seed);
|
|
215
216
|
feePayer ??= makeAztecAddress(seed + 0x100);
|
|
216
217
|
feePaymentPublicDataWrite ??= makePublicDataWrite(seed + 0x200);
|
|
217
218
|
|
|
@@ -406,7 +407,6 @@ export interface MakeConsensusPayloadOptions {
|
|
|
406
407
|
proposerSigner?: Secp256k1Signer;
|
|
407
408
|
header?: L2BlockHeader;
|
|
408
409
|
archive?: Fr;
|
|
409
|
-
stateReference?: StateReference;
|
|
410
410
|
txHashes?: TxHash[];
|
|
411
411
|
txs?: Tx[];
|
|
412
412
|
}
|
|
@@ -416,12 +416,11 @@ const makeAndSignConsensusPayload = (
|
|
|
416
416
|
options?: MakeConsensusPayloadOptions,
|
|
417
417
|
) => {
|
|
418
418
|
const header = options?.header ?? makeL2BlockHeader(1);
|
|
419
|
-
const { signer = Secp256k1Signer.random(), archive = Fr.random()
|
|
419
|
+
const { signer = Secp256k1Signer.random(), archive = Fr.random() } = options ?? {};
|
|
420
420
|
|
|
421
421
|
const payload = ConsensusPayload.fromFields({
|
|
422
422
|
header: header.toCheckpointHeader(),
|
|
423
423
|
archive,
|
|
424
|
-
stateReference,
|
|
425
424
|
});
|
|
426
425
|
|
|
427
426
|
const hash = getHashedSignaturePayloadEthSignedMessage(payload, domainSeparator);
|
|
@@ -448,31 +447,32 @@ export const makeBlockProposal = (options?: MakeConsensusPayloadOptions): BlockP
|
|
|
448
447
|
};
|
|
449
448
|
|
|
450
449
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/8028)
|
|
451
|
-
export const makeBlockAttestation = (options
|
|
452
|
-
const header = options
|
|
453
|
-
const {
|
|
454
|
-
signer,
|
|
455
|
-
attesterSigner = signer ?? Secp256k1Signer.random(),
|
|
456
|
-
proposerSigner = signer ?? Secp256k1Signer.random(),
|
|
457
|
-
archive = Fr.random(),
|
|
458
|
-
stateReference = header.state,
|
|
459
|
-
} = options ?? {};
|
|
450
|
+
export const makeBlockAttestation = (options: MakeConsensusPayloadOptions = {}): BlockAttestation => {
|
|
451
|
+
const header = options.header ?? makeL2BlockHeader(1);
|
|
452
|
+
const { signer, attesterSigner = signer, proposerSigner = signer, archive = Fr.random() } = options;
|
|
460
453
|
|
|
461
454
|
const payload = ConsensusPayload.fromFields({
|
|
462
455
|
header: header.toCheckpointHeader(),
|
|
463
456
|
archive,
|
|
464
|
-
stateReference,
|
|
465
457
|
});
|
|
466
458
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const attestationSignature = attesterSigner.sign(attestationHash);
|
|
459
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
460
|
+
};
|
|
470
461
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
462
|
+
export const makeAttestationFromCheckpoint = (
|
|
463
|
+
checkpoint: Checkpoint,
|
|
464
|
+
attesterSigner?: Secp256k1Signer,
|
|
465
|
+
proposerSigner?: Secp256k1Signer,
|
|
466
|
+
): BlockAttestation => {
|
|
467
|
+
const header = checkpoint.header;
|
|
468
|
+
const archive = checkpoint.archive.root;
|
|
474
469
|
|
|
475
|
-
|
|
470
|
+
const payload = ConsensusPayload.fromFields({
|
|
471
|
+
header,
|
|
472
|
+
archive,
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
476
476
|
};
|
|
477
477
|
|
|
478
478
|
export const makeBlockAttestationFromBlock = (
|
|
@@ -482,14 +482,20 @@ export const makeBlockAttestationFromBlock = (
|
|
|
482
482
|
): BlockAttestation => {
|
|
483
483
|
const header = block.header;
|
|
484
484
|
const archive = block.archive.root;
|
|
485
|
-
const stateReference = block.header.state;
|
|
486
485
|
|
|
487
486
|
const payload = ConsensusPayload.fromFields({
|
|
488
487
|
header: header.toCheckpointHeader(),
|
|
489
488
|
archive,
|
|
490
|
-
stateReference,
|
|
491
489
|
});
|
|
492
490
|
|
|
491
|
+
return makeBlockAttestationFromPayload(payload, attesterSigner, proposerSigner);
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
export const makeBlockAttestationFromPayload = (
|
|
495
|
+
payload: ConsensusPayload,
|
|
496
|
+
attesterSigner?: Secp256k1Signer,
|
|
497
|
+
proposerSigner?: Secp256k1Signer,
|
|
498
|
+
): BlockAttestation => {
|
|
493
499
|
// Sign as attester
|
|
494
500
|
const attestationHash = getHashedSignaturePayloadEthSignedMessage(payload, SignatureDomainSeparator.blockAttestation);
|
|
495
501
|
const attestationSigner = attesterSigner ?? Secp256k1Signer.random();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ViemAppendOnlyTreeSnapshot } from '@aztec/ethereum';
|
|
2
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
4
3
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -72,17 +71,6 @@ export class AppendOnlyTreeSnapshot {
|
|
|
72
71
|
return new AppendOnlyTreeSnapshot(reader.readField(), Number(reader.readField().toBigInt()));
|
|
73
72
|
}
|
|
74
73
|
|
|
75
|
-
static fromViem(snapshot: ViemAppendOnlyTreeSnapshot) {
|
|
76
|
-
return new AppendOnlyTreeSnapshot(Fr.fromString(snapshot.root), snapshot.nextAvailableLeafIndex);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
toViem(): ViemAppendOnlyTreeSnapshot {
|
|
80
|
-
return {
|
|
81
|
-
root: this.root.toString(),
|
|
82
|
-
nextAvailableLeafIndex: this.nextAvailableLeafIndex,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
74
|
toAbi(): [`0x${string}`, number] {
|
|
87
75
|
return [this.root.toString(), this.nextAvailableLeafIndex];
|
|
88
76
|
}
|
package/src/tx/block_header.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BLOCK_HEADER_LENGTH, GeneratorIndex } from '@aztec/constants';
|
|
2
|
-
import {
|
|
2
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { poseidon2HashWithSeparator, randomInt } from '@aztec/foundation/crypto';
|
|
3
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
5
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
5
6
|
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
@@ -61,8 +62,8 @@ export class BlockHeader {
|
|
|
61
62
|
return new BlockHeader(...BlockHeader.getFields(fields));
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
getSlot() {
|
|
65
|
-
return this.globalVariables.slotNumber
|
|
65
|
+
getSlot(): SlotNumber {
|
|
66
|
+
return this.globalVariables.slotNumber;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
getBlockNumber() {
|
|
@@ -161,6 +162,18 @@ export class BlockHeader {
|
|
|
161
162
|
return poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH);
|
|
162
163
|
}
|
|
163
164
|
|
|
165
|
+
static random(overrides: Partial<FieldsOf<BlockHeader>> & Partial<FieldsOf<GlobalVariables>> = {}): BlockHeader {
|
|
166
|
+
return BlockHeader.from({
|
|
167
|
+
lastArchive: AppendOnlyTreeSnapshot.random(),
|
|
168
|
+
state: StateReference.random(),
|
|
169
|
+
spongeBlobHash: Fr.random(),
|
|
170
|
+
globalVariables: GlobalVariables.random(overrides),
|
|
171
|
+
totalFees: new Fr(randomInt(100_000)),
|
|
172
|
+
totalManaUsed: new Fr(randomInt(100_000_000)),
|
|
173
|
+
...overrides,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
164
177
|
toInspect() {
|
|
165
178
|
return {
|
|
166
179
|
lastArchive: this.lastArchive.root.toString(),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { SlotNumber } from '@aztec/foundation/schemas';
|
|
2
3
|
|
|
3
4
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
5
|
import type { GasFees } from '../gas/gas_fees.js';
|
|
@@ -23,6 +24,6 @@ export interface GlobalVariableBuilder {
|
|
|
23
24
|
blockNumber: UInt32,
|
|
24
25
|
coinbase: EthAddress,
|
|
25
26
|
feeRecipient: AztecAddress,
|
|
26
|
-
slotNumber?:
|
|
27
|
+
slotNumber?: SlotNumber,
|
|
27
28
|
): Promise<GlobalVariables>;
|
|
28
29
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { GLOBAL_VARIABLES_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { randomInt } from '@aztec/foundation/crypto';
|
|
2
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
6
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
@@ -31,7 +33,7 @@ export class GlobalVariables {
|
|
|
31
33
|
/** Block number of the L2 block. */
|
|
32
34
|
public blockNumber: UInt32,
|
|
33
35
|
/** Slot number of the L2 block */
|
|
34
|
-
public slotNumber:
|
|
36
|
+
public slotNumber: SlotNumber,
|
|
35
37
|
/** Timestamp of the L2 block. */
|
|
36
38
|
public timestamp: UInt64,
|
|
37
39
|
/** Recipient of block reward. */
|
|
@@ -48,7 +50,7 @@ export class GlobalVariables {
|
|
|
48
50
|
chainId: schemas.Fr,
|
|
49
51
|
version: schemas.Fr,
|
|
50
52
|
blockNumber: schemas.UInt32,
|
|
51
|
-
slotNumber: schemas.
|
|
53
|
+
slotNumber: schemas.SlotNumber,
|
|
52
54
|
timestamp: schemas.BigInt,
|
|
53
55
|
coinbase: schemas.EthAddress,
|
|
54
56
|
feeRecipient: schemas.AztecAddress,
|
|
@@ -77,7 +79,7 @@ export class GlobalVariables {
|
|
|
77
79
|
Fr.fromPlainObject(obj.chainId),
|
|
78
80
|
Fr.fromPlainObject(obj.version),
|
|
79
81
|
obj.blockNumber,
|
|
80
|
-
Fr.fromPlainObject(obj.slotNumber),
|
|
82
|
+
SlotNumber(Fr.fromPlainObject(obj.slotNumber).toNumber()),
|
|
81
83
|
typeof obj.timestamp === 'bigint' ? obj.timestamp : BigInt(obj.timestamp),
|
|
82
84
|
EthAddress.fromPlainObject(obj.coinbase),
|
|
83
85
|
AztecAddress.fromPlainObject(obj.feeRecipient),
|
|
@@ -88,7 +90,7 @@ export class GlobalVariables {
|
|
|
88
90
|
static empty(fields: Partial<FieldsOf<GlobalVariables>> = {}): GlobalVariables {
|
|
89
91
|
return GlobalVariables.from({
|
|
90
92
|
blockNumber: 0,
|
|
91
|
-
slotNumber:
|
|
93
|
+
slotNumber: SlotNumber.ZERO,
|
|
92
94
|
timestamp: 0n,
|
|
93
95
|
chainId: Fr.ZERO,
|
|
94
96
|
version: Fr.ZERO,
|
|
@@ -105,7 +107,7 @@ export class GlobalVariables {
|
|
|
105
107
|
Fr.fromBuffer(reader),
|
|
106
108
|
Fr.fromBuffer(reader),
|
|
107
109
|
reader.readNumber(),
|
|
108
|
-
|
|
110
|
+
SlotNumber(reader.readNumber()),
|
|
109
111
|
reader.readUInt64(),
|
|
110
112
|
reader.readObject(EthAddress),
|
|
111
113
|
reader.readObject(AztecAddress),
|
|
@@ -120,7 +122,7 @@ export class GlobalVariables {
|
|
|
120
122
|
reader.readField(),
|
|
121
123
|
reader.readField(),
|
|
122
124
|
reader.readU32(),
|
|
123
|
-
reader.
|
|
125
|
+
SlotNumber(reader.readU32()),
|
|
124
126
|
reader.readField().toBigInt(),
|
|
125
127
|
EthAddress.fromField(reader.readField()),
|
|
126
128
|
AztecAddress.fromField(reader.readField()),
|
|
@@ -171,13 +173,31 @@ export class GlobalVariables {
|
|
|
171
173
|
toFriendlyJSON() {
|
|
172
174
|
return {
|
|
173
175
|
blockNumber: this.blockNumber,
|
|
174
|
-
slotNumber: this.slotNumber
|
|
176
|
+
slotNumber: this.slotNumber,
|
|
175
177
|
timestamp: this.timestamp.toString(),
|
|
176
178
|
coinbase: this.coinbase.toString(),
|
|
177
179
|
gasFees: jsonStringify(this.gasFees),
|
|
178
180
|
};
|
|
179
181
|
}
|
|
180
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Converts GlobalVariables to a plain object suitable for MessagePack serialization.
|
|
185
|
+
* This method ensures that slotNumber is serialized as a Fr (Field element) to match
|
|
186
|
+
* the C++ struct definition which expects slot_number as FF.
|
|
187
|
+
*/
|
|
188
|
+
toJSON() {
|
|
189
|
+
return {
|
|
190
|
+
chainId: this.chainId,
|
|
191
|
+
version: this.version,
|
|
192
|
+
blockNumber: this.blockNumber,
|
|
193
|
+
slotNumber: new Fr(this.slotNumber), // Convert to Fr for C++ compatibility
|
|
194
|
+
timestamp: this.timestamp,
|
|
195
|
+
coinbase: this.coinbase,
|
|
196
|
+
feeRecipient: this.feeRecipient,
|
|
197
|
+
gasFees: this.gasFees,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
181
201
|
clone(): GlobalVariables {
|
|
182
202
|
return GlobalVariables.fromBuffer(this.toBuffer());
|
|
183
203
|
}
|
|
@@ -187,7 +207,7 @@ export class GlobalVariables {
|
|
|
187
207
|
this.chainId.isZero() &&
|
|
188
208
|
this.version.isZero() &&
|
|
189
209
|
this.blockNumber === 0 &&
|
|
190
|
-
this.slotNumber
|
|
210
|
+
this.slotNumber === 0 &&
|
|
191
211
|
this.timestamp === 0n &&
|
|
192
212
|
this.coinbase.isZero() &&
|
|
193
213
|
this.feeRecipient.isZero() &&
|
|
@@ -195,12 +215,26 @@ export class GlobalVariables {
|
|
|
195
215
|
);
|
|
196
216
|
}
|
|
197
217
|
|
|
218
|
+
static random(overrides: Partial<FieldsOf<GlobalVariables>> = {}): GlobalVariables {
|
|
219
|
+
return GlobalVariables.from({
|
|
220
|
+
chainId: new Fr(randomInt(100_000)),
|
|
221
|
+
version: new Fr(randomInt(100_000)),
|
|
222
|
+
blockNumber: randomInt(100_000),
|
|
223
|
+
slotNumber: SlotNumber(randomInt(100_000)),
|
|
224
|
+
coinbase: EthAddress.random(),
|
|
225
|
+
feeRecipient: AztecAddress.fromField(Fr.random()),
|
|
226
|
+
gasFees: GasFees.random(),
|
|
227
|
+
timestamp: BigInt(randomInt(100_000_000)),
|
|
228
|
+
...overrides,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
198
232
|
toInspect() {
|
|
199
233
|
return {
|
|
200
234
|
chainId: this.chainId.toNumber(),
|
|
201
235
|
version: this.version.toNumber(),
|
|
202
236
|
blockNumber: this.blockNumber,
|
|
203
|
-
slotNumber: this.slotNumber
|
|
237
|
+
slotNumber: this.slotNumber,
|
|
204
238
|
timestamp: this.timestamp,
|
|
205
239
|
coinbase: this.coinbase.toString(),
|
|
206
240
|
feeRecipient: this.feeRecipient.toString(),
|
|
@@ -218,7 +252,7 @@ export class GlobalVariables {
|
|
|
218
252
|
this.chainId.equals(other.chainId) &&
|
|
219
253
|
this.version.equals(other.version) &&
|
|
220
254
|
this.blockNumber === other.blockNumber &&
|
|
221
|
-
this.slotNumber
|
|
255
|
+
this.slotNumber === other.slotNumber &&
|
|
222
256
|
this.timestamp === other.timestamp &&
|
|
223
257
|
this.coinbase.equals(other.coinbase) &&
|
|
224
258
|
this.feeRecipient.equals(other.feeRecipient) &&
|
|
@@ -13,7 +13,7 @@ export function indexedTxSchema() {
|
|
|
13
13
|
|
|
14
14
|
export async function randomIndexedTxEffect(): Promise<IndexedTxEffect> {
|
|
15
15
|
return {
|
|
16
|
-
...randomInBlock(await TxEffect.random()),
|
|
16
|
+
...randomInBlock(await TxEffect.random({ numNullifiers: 1 + Math.floor(Math.random() * 64) })),
|
|
17
17
|
txIndexInBlock: Math.floor(Math.random() * 1000),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PARTIAL_STATE_REFERENCE_LENGTH } from '@aztec/constants';
|
|
2
|
-
import type { ViemPartialStateReference } from '@aztec/ethereum';
|
|
3
2
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
3
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
@@ -65,14 +64,6 @@ export class PartialStateReference {
|
|
|
65
64
|
return new PartialStateReference(noteHashTree, nullifierTree, publicDataTree);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
|
-
static fromViem(stateReference: ViemPartialStateReference) {
|
|
69
|
-
return new PartialStateReference(
|
|
70
|
-
AppendOnlyTreeSnapshot.fromViem(stateReference.noteHashTree),
|
|
71
|
-
AppendOnlyTreeSnapshot.fromViem(stateReference.nullifierTree),
|
|
72
|
-
AppendOnlyTreeSnapshot.fromViem(stateReference.publicDataTree),
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
67
|
static random(): PartialStateReference {
|
|
77
68
|
return new PartialStateReference(
|
|
78
69
|
AppendOnlyTreeSnapshot.random(),
|
|
@@ -81,14 +72,6 @@ export class PartialStateReference {
|
|
|
81
72
|
);
|
|
82
73
|
}
|
|
83
74
|
|
|
84
|
-
toViem(): ViemPartialStateReference {
|
|
85
|
-
return {
|
|
86
|
-
noteHashTree: this.noteHashTree.toViem(),
|
|
87
|
-
nullifierTree: this.nullifierTree.toViem(),
|
|
88
|
-
publicDataTree: this.publicDataTree.toViem(),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
75
|
toAbi(): [
|
|
93
76
|
ReturnType<AppendOnlyTreeSnapshot['toAbi']>,
|
|
94
77
|
ReturnType<AppendOnlyTreeSnapshot['toAbi']>,
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
5
5
|
STATE_REFERENCE_LENGTH,
|
|
6
6
|
} from '@aztec/constants';
|
|
7
|
-
import type { ViemStateReference } from '@aztec/ethereum';
|
|
8
7
|
import type { Fr } from '@aztec/foundation/fields';
|
|
9
8
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
10
9
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
@@ -76,13 +75,6 @@ export class StateReference {
|
|
|
76
75
|
return new StateReference(l1ToL2MessageTree, partial);
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
static fromViem(stateReference: ViemStateReference) {
|
|
80
|
-
return new StateReference(
|
|
81
|
-
AppendOnlyTreeSnapshot.fromViem(stateReference.l1ToL2MessageTree),
|
|
82
|
-
PartialStateReference.fromViem(stateReference.partialStateReference),
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
78
|
static empty(): StateReference {
|
|
87
79
|
return new StateReference(AppendOnlyTreeSnapshot.empty(), PartialStateReference.empty());
|
|
88
80
|
}
|
|
@@ -91,13 +83,6 @@ export class StateReference {
|
|
|
91
83
|
return new StateReference(AppendOnlyTreeSnapshot.random(), PartialStateReference.random());
|
|
92
84
|
}
|
|
93
85
|
|
|
94
|
-
toViem(): ViemStateReference {
|
|
95
|
-
return {
|
|
96
|
-
l1ToL2MessageTree: this.l1ToL2MessageTree.toViem(),
|
|
97
|
-
partialStateReference: this.partial.toViem(),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
86
|
toAbi(): [ReturnType<AppendOnlyTreeSnapshot['toAbi']>, ReturnType<PartialStateReference['toAbi']>] {
|
|
102
87
|
return [this.l1ToL2MessageTree.toAbi(), [...this.partial.toAbi()]];
|
|
103
88
|
}
|
package/src/tx/tx.ts
CHANGED
|
@@ -300,8 +300,9 @@ export class Tx extends Gossipable {
|
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
/** Recomputes the tx hash. Used for testing purposes only when a property of the tx was mutated. */
|
|
303
|
-
public async recomputeHash() {
|
|
303
|
+
public async recomputeHash(): Promise<TxHash> {
|
|
304
304
|
(this as any).txHash = await Tx.computeTxHash(this);
|
|
305
|
+
return this.txHash;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
308
|
#combinePublicCallRequestWithCallData(request: PublicCallRequest) {
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
15
15
|
} from '@aztec/constants';
|
|
16
16
|
import { type FieldsOf, makeTuple, makeTupleAsync } from '@aztec/foundation/array';
|
|
17
|
+
import { randomInt } from '@aztec/foundation/crypto';
|
|
17
18
|
import { Fr } from '@aztec/foundation/fields';
|
|
18
19
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
19
20
|
import { BufferReader, serializeArrayOfBufferableToVector, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -191,36 +192,39 @@ export class TxEffect {
|
|
|
191
192
|
return computeTxOutHash(this.l2ToL1Msgs);
|
|
192
193
|
}
|
|
193
194
|
|
|
194
|
-
static async random(
|
|
195
|
+
static async random({
|
|
196
|
+
numNoteHashes,
|
|
197
|
+
numNullifiers,
|
|
198
|
+
numL2ToL1Msgs,
|
|
199
|
+
numPublicDataWrites,
|
|
200
|
+
numPrivateLogs,
|
|
195
201
|
numPublicCallsPerTx = 3,
|
|
196
202
|
numPublicLogsPerCall = 1,
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
numContractClassLogs,
|
|
204
|
+
maxEffects,
|
|
205
|
+
}: {
|
|
206
|
+
numNoteHashes?: number;
|
|
207
|
+
numNullifiers?: number;
|
|
208
|
+
numL2ToL1Msgs?: number;
|
|
209
|
+
numPublicDataWrites?: number;
|
|
210
|
+
numPrivateLogs?: number;
|
|
211
|
+
numPublicCallsPerTx?: number;
|
|
212
|
+
numPublicLogsPerCall?: number;
|
|
213
|
+
numContractClassLogs?: number;
|
|
214
|
+
maxEffects?: number;
|
|
215
|
+
} = {}): Promise<TxEffect> {
|
|
216
|
+
const count = (max: number, num?: number) => num ?? Math.min(maxEffects ?? randomInt(max), max);
|
|
199
217
|
return new TxEffect(
|
|
200
218
|
RevertCode.random(),
|
|
201
219
|
TxHash.random(),
|
|
202
220
|
new Fr(Math.floor(Math.random() * 100_000)),
|
|
203
|
-
makeTuple(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
),
|
|
207
|
-
makeTuple(
|
|
208
|
-
maxEffects === undefined ? MAX_NULLIFIERS_PER_TX : Math.min(maxEffects, MAX_NULLIFIERS_PER_TX),
|
|
209
|
-
Fr.random,
|
|
210
|
-
),
|
|
211
|
-
makeTuple(
|
|
212
|
-
maxEffects === undefined ? MAX_L2_TO_L1_MSGS_PER_TX : Math.min(maxEffects, MAX_L2_TO_L1_MSGS_PER_TX),
|
|
213
|
-
Fr.random,
|
|
214
|
-
),
|
|
215
|
-
makeTuple(
|
|
216
|
-
maxEffects === undefined
|
|
217
|
-
? MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX
|
|
218
|
-
: Math.min(maxEffects, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX),
|
|
219
|
-
PublicDataWrite.random,
|
|
220
|
-
),
|
|
221
|
-
makeTuple(MAX_PRIVATE_LOGS_PER_TX, () => PrivateLog.random()),
|
|
221
|
+
makeTuple(count(MAX_NOTE_HASHES_PER_TX, numNoteHashes), Fr.random),
|
|
222
|
+
makeTuple(count(MAX_NULLIFIERS_PER_TX, numNullifiers), Fr.random),
|
|
223
|
+
makeTuple(count(MAX_L2_TO_L1_MSGS_PER_TX, numL2ToL1Msgs), Fr.random),
|
|
224
|
+
makeTuple(count(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, numPublicDataWrites), PublicDataWrite.random),
|
|
225
|
+
makeTuple(count(MAX_PRIVATE_LOGS_PER_TX, numPrivateLogs), () => PrivateLog.random()),
|
|
222
226
|
await Promise.all(new Array(numPublicCallsPerTx * numPublicLogsPerCall).fill(null).map(() => PublicLog.random())),
|
|
223
|
-
await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random),
|
|
227
|
+
await makeTupleAsync(count(MAX_CONTRACT_CLASS_LOGS_PER_TX, numContractClassLogs), ContractClassLog.random),
|
|
224
228
|
);
|
|
225
229
|
}
|
|
226
230
|
|