@aztec/stdlib 3.0.0-nightly.20251126 → 3.0.0-nightly.20251128
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 +2413 -2419
- 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 +171 -171
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +1654 -1654
- 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 +8 -6
- 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_header.d.ts +1 -9
- package/dest/block/l2_block_header.d.ts.map +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 +8 -7
- 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 +9 -8
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +4 -3
- 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 +5 -4
- package/dest/interfaces/aztec-node-admin.d.ts +88 -88
- package/dest/interfaces/aztec-node.d.ts +1 -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 +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 +1265 -1272
- 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 +21 -21
- 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 +1 -25
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- 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 +2 -2
- package/dest/note/index.d.ts.map +1 -1
- package/dest/note/index.js +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 +71 -0
- package/dest/note/note_dao.d.ts.map +1 -0
- package/dest/note/note_dao.js +101 -0
- 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 +1 -4
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +1 -5
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/client_type.d.ts +1 -1
- package/dest/p2p/consensus_payload.d.ts +20 -21
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +4 -0
- 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 +1 -10
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +2 -11
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +13 -2
- 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 +2 -2
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +4 -3
- package/dest/slashing/helpers.d.ts +4 -3
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +2 -1
- package/dest/slashing/index.d.ts +1 -1
- package/dest/slashing/interfaces.d.ts +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 +8 -18
- 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 +37 -21
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +22 -18
- package/dest/trees/append_only_tree_snapshot.d.ts +1 -13
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- 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 +2 -10
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +12 -1
- 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 +1 -1
- package/dest/tx/global_variables.d.ts +10 -17
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +14 -0
- 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 -4
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- 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 -9
- package/dest/tx/state_reference.d.ts.map +1 -1
- 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 +1 -16
- package/dest/tx/tx.d.ts.map +1 -1
- 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 +1 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/index.d.ts +1 -1
- package/dest/validators/schemas.d.ts +184 -180
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +1 -1
- package/dest/validators/types.d.ts +3 -2
- 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 +12 -11
- package/src/block/attestation_info.ts +8 -1
- package/src/block/body.ts +9 -7
- package/src/block/l2_block.ts +27 -1
- package/src/block/l2_block_new.ts +28 -0
- package/src/block/l2_block_source.ts +7 -6
- 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 +13 -11
- package/src/interfaces/archiver.ts +5 -4
- package/src/interfaces/epoch-prover.ts +3 -2
- package/src/interfaces/proving-job.ts +14 -5
- package/src/note/index.ts +1 -1
- package/src/note/note_dao.ts +151 -0
- package/src/p2p/consensus_payload.ts +6 -0
- package/src/rollup/checkpoint_header.ts +13 -12
- package/src/slashing/empire.ts +5 -3
- package/src/slashing/helpers.ts +6 -4
- package/src/tests/factories.ts +22 -21
- package/src/tests/mocks.ts +35 -27
- package/src/tx/block_header.ts +13 -1
- package/src/tx/global_variables.ts +15 -0
- package/src/tx/indexed_tx_effect.ts +1 -1
- package/src/tx/tx_effect.ts +27 -23
- package/src/validators/schemas.ts +1 -1
- package/src/validators/types.ts +2 -1
- package/dest/note/unique_note.d.ts +0 -39
- package/dest/note/unique_note.d.ts.map +0 -1
- package/dest/note/unique_note.js +0 -62
- package/src/note/unique_note.ts +0 -70
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { encodeCheckpointBlobDataFromBlocks } from '@aztec/blob-lib/encoding';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
3
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
4
6
|
|
|
5
7
|
import { z } from 'zod';
|
|
6
8
|
|
|
@@ -16,6 +18,8 @@ export class Checkpoint {
|
|
|
16
18
|
public header: CheckpointHeader,
|
|
17
19
|
/** L2 blocks in the checkpoint. */
|
|
18
20
|
public blocks: L2BlockNew[],
|
|
21
|
+
/** Number of the checkpoint. */
|
|
22
|
+
public number: number,
|
|
19
23
|
) {}
|
|
20
24
|
|
|
21
25
|
static get schema() {
|
|
@@ -24,24 +28,61 @@ export class Checkpoint {
|
|
|
24
28
|
archive: AppendOnlyTreeSnapshot.schema,
|
|
25
29
|
header: CheckpointHeader.schema,
|
|
26
30
|
blocks: z.array(L2BlockNew.schema),
|
|
31
|
+
number: schemas.UInt32,
|
|
27
32
|
})
|
|
28
|
-
.transform(({ archive, header, blocks }) => new Checkpoint(archive, header, blocks));
|
|
33
|
+
.transform(({ archive, header, blocks, number }) => new Checkpoint(archive, header, blocks, number));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static from(fields: FieldsOf<Checkpoint>) {
|
|
37
|
+
return new Checkpoint(...Checkpoint.getFields(fields));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static getFields(fields: FieldsOf<Checkpoint>) {
|
|
41
|
+
return [fields.archive, fields.header, fields.blocks, fields.number] as const;
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
32
45
|
const reader = BufferReader.asReader(buf);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
46
|
+
return new Checkpoint(
|
|
47
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
48
|
+
reader.readObject(CheckpointHeader),
|
|
49
|
+
reader.readVector(L2BlockNew),
|
|
50
|
+
reader.readNumber(),
|
|
51
|
+
);
|
|
37
52
|
}
|
|
38
53
|
|
|
39
|
-
toBuffer() {
|
|
40
|
-
return serializeToBuffer(this.archive, this.header, this.blocks.length, this.blocks);
|
|
54
|
+
public toBuffer() {
|
|
55
|
+
return serializeToBuffer(this.archive, this.header, this.blocks.length, this.blocks, this.number);
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
public toBlobFields(): Fr[] {
|
|
44
59
|
const blocks = this.blocks.map((block, i) => block.toBlockBlobData(i === 0));
|
|
45
60
|
return encodeCheckpointBlobDataFromBlocks(blocks);
|
|
46
61
|
}
|
|
62
|
+
|
|
63
|
+
public hash(): Fr {
|
|
64
|
+
return this.header.hash();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public getState() {
|
|
68
|
+
return this.blocks.at(-1)!.header.state;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static async random(
|
|
72
|
+
checkpointNumber = 1,
|
|
73
|
+
{
|
|
74
|
+
numBlocks = 1,
|
|
75
|
+
startBlockNumber = 1,
|
|
76
|
+
...options
|
|
77
|
+
}: { numBlocks?: number; startBlockNumber?: number } & Partial<FieldsOf<CheckpointHeader>> &
|
|
78
|
+
Partial<Parameters<typeof L2BlockNew.random>[1]> = {},
|
|
79
|
+
) {
|
|
80
|
+
const header = CheckpointHeader.random(options);
|
|
81
|
+
|
|
82
|
+
const blocks = await Promise.all(
|
|
83
|
+
Array.from({ length: numBlocks }, (_, i) => L2BlockNew.random(startBlockNumber + i, options)),
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
return new Checkpoint(AppendOnlyTreeSnapshot.random(), header, blocks, checkpointNumber);
|
|
87
|
+
}
|
|
47
88
|
}
|
package/src/checkpoint/index.ts
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Ignoring import issue to fix portable inferred type issue in zod schema
|
|
2
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
3
|
+
import { randomBigInt } from '@aztec/foundation/crypto';
|
|
4
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
5
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
|
+
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
11
|
+
import { Checkpoint } from './checkpoint.js';
|
|
12
|
+
|
|
13
|
+
export class L1PublishedData {
|
|
14
|
+
constructor(
|
|
15
|
+
public blockNumber: bigint,
|
|
16
|
+
public timestamp: bigint,
|
|
17
|
+
public blockHash: string,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
static get schema() {
|
|
21
|
+
return z.object({
|
|
22
|
+
blockNumber: schemas.BigInt,
|
|
23
|
+
timestamp: schemas.BigInt,
|
|
24
|
+
blockHash: z.string(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static random() {
|
|
29
|
+
return new L1PublishedData(
|
|
30
|
+
randomBigInt(1000n) + 1n,
|
|
31
|
+
BigInt(Math.floor(Date.now() / 1000)),
|
|
32
|
+
Buffer32.random().toString(),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static fromFields(fields: FieldsOf<L1PublishedData>) {
|
|
37
|
+
return new L1PublishedData(fields.blockNumber, fields.timestamp, fields.blockHash);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class PublishedCheckpoint {
|
|
42
|
+
constructor(
|
|
43
|
+
public checkpoint: Checkpoint,
|
|
44
|
+
public l1: L1PublishedData,
|
|
45
|
+
// The attestations for the last block in the checkpoint.
|
|
46
|
+
public attestations: CommitteeAttestation[],
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
static get schema() {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
checkpoint: Checkpoint.schema,
|
|
53
|
+
l1: L1PublishedData.schema,
|
|
54
|
+
attestations: z.array(CommitteeAttestation.schema),
|
|
55
|
+
})
|
|
56
|
+
.transform(obj => PublishedCheckpoint.from(obj));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static getFields(fields: FieldsOf<PublishedCheckpoint>) {
|
|
60
|
+
return [fields.checkpoint, fields.l1, fields.attestations] as const;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static from(fields: FieldsOf<PublishedCheckpoint>) {
|
|
64
|
+
return new PublishedCheckpoint(...PublishedCheckpoint.getFields(fields));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static fromBuffer(bufferOrReader: Buffer | BufferReader): PublishedCheckpoint {
|
|
68
|
+
const reader = BufferReader.asReader(bufferOrReader);
|
|
69
|
+
const checkpoint = reader.readObject(Checkpoint);
|
|
70
|
+
const l1BlockNumber = reader.readBigInt();
|
|
71
|
+
const l1BlockHash = reader.readString();
|
|
72
|
+
const l1Timestamp = reader.readBigInt();
|
|
73
|
+
const attestations = reader.readVector(CommitteeAttestation);
|
|
74
|
+
return new PublishedCheckpoint(
|
|
75
|
+
checkpoint,
|
|
76
|
+
new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash),
|
|
77
|
+
attestations,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public toBuffer(): Buffer {
|
|
82
|
+
return serializeToBuffer(
|
|
83
|
+
this.checkpoint,
|
|
84
|
+
this.l1.blockNumber,
|
|
85
|
+
this.l1.blockHash,
|
|
86
|
+
this.l1.timestamp,
|
|
87
|
+
this.attestations.length,
|
|
88
|
+
this.attestations,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
|
|
1
3
|
import { z } from 'zod';
|
|
2
4
|
|
|
3
5
|
import { type ZodFor, schemas } from '../schemas/index.js';
|
|
@@ -46,21 +48,21 @@ export function getSlotAtTimestamp(ts: bigint, constants: Pick<L1RollupConstants
|
|
|
46
48
|
export function getEpochNumberAtTimestamp(
|
|
47
49
|
ts: bigint,
|
|
48
50
|
constants: Pick<L1RollupConstants, 'epochDuration' | 'slotDuration' | 'l1GenesisTime'>,
|
|
49
|
-
) {
|
|
51
|
+
): EpochNumber {
|
|
50
52
|
return getEpochAtSlot(getSlotAtTimestamp(ts, constants), constants);
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
/** Returns the epoch number for a given slot. */
|
|
54
|
-
export function getEpochAtSlot(slot: bigint, constants: Pick<L1RollupConstants, 'epochDuration'>) {
|
|
55
|
-
return slot / BigInt(constants.epochDuration);
|
|
56
|
+
export function getEpochAtSlot(slot: bigint, constants: Pick<L1RollupConstants, 'epochDuration'>): EpochNumber {
|
|
57
|
+
return EpochNumber.fromBigInt(slot / BigInt(constants.epochDuration));
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
/** Returns the range of L2 slots (inclusive) for a given epoch number. */
|
|
59
61
|
export function getSlotRangeForEpoch(
|
|
60
|
-
epochNumber:
|
|
62
|
+
epochNumber: EpochNumber,
|
|
61
63
|
constants: Pick<L1RollupConstants, 'epochDuration'>,
|
|
62
64
|
): [bigint, bigint] {
|
|
63
|
-
const startSlot = epochNumber * BigInt(constants.epochDuration);
|
|
65
|
+
const startSlot = BigInt(epochNumber) * BigInt(constants.epochDuration);
|
|
64
66
|
return [startSlot, startSlot + BigInt(constants.epochDuration) - 1n];
|
|
65
67
|
}
|
|
66
68
|
|
|
@@ -69,7 +71,7 @@ export function getSlotRangeForEpoch(
|
|
|
69
71
|
* Note that the endTimestamp is the start timestamp of the last L1 slot for the epoch.
|
|
70
72
|
*/
|
|
71
73
|
export function getTimestampRangeForEpoch(
|
|
72
|
-
epochNumber:
|
|
74
|
+
epochNumber: EpochNumber,
|
|
73
75
|
constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'ethereumSlotDuration'>,
|
|
74
76
|
): [bigint, bigint] {
|
|
75
77
|
const [startSlot, endSlot] = getSlotRangeForEpoch(epochNumber, constants);
|
|
@@ -86,7 +88,7 @@ export function getTimestampRangeForEpoch(
|
|
|
86
88
|
* Returns the start timestamp for a given epoch number.
|
|
87
89
|
*/
|
|
88
90
|
export function getStartTimestampForEpoch(
|
|
89
|
-
epochNumber:
|
|
91
|
+
epochNumber: EpochNumber,
|
|
90
92
|
constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration'>,
|
|
91
93
|
) {
|
|
92
94
|
const [startSlot] = getSlotRangeForEpoch(epochNumber, constants);
|
|
@@ -98,10 +100,10 @@ export function getStartTimestampForEpoch(
|
|
|
98
100
|
* See l1-contracts/src/core/libraries/TimeLib.sol
|
|
99
101
|
*/
|
|
100
102
|
export function getProofSubmissionDeadlineEpoch(
|
|
101
|
-
epochNumber:
|
|
103
|
+
epochNumber: EpochNumber,
|
|
102
104
|
constants: Pick<L1RollupConstants, 'proofSubmissionEpochs'>,
|
|
103
|
-
) {
|
|
104
|
-
return epochNumber +
|
|
105
|
+
): EpochNumber {
|
|
106
|
+
return EpochNumber(epochNumber + constants.proofSubmissionEpochs + 1);
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
/**
|
|
@@ -109,7 +111,7 @@ export function getProofSubmissionDeadlineEpoch(
|
|
|
109
111
|
* Computed as the start of the given epoch plus the proof submission window.
|
|
110
112
|
*/
|
|
111
113
|
export function getProofSubmissionDeadlineTimestamp(
|
|
112
|
-
epochNumber:
|
|
114
|
+
epochNumber: EpochNumber,
|
|
113
115
|
constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'proofSubmissionEpochs'>,
|
|
114
116
|
) {
|
|
115
117
|
// See l1-contracts/src/core/libraries/TimeLib.sol:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { L1ContractAddresses } from '@aztec/ethereum';
|
|
2
|
+
import { EpochNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
3
|
import type { ApiSchemaFor } from '@aztec/foundation/schemas';
|
|
3
4
|
|
|
4
5
|
import { z } from 'zod';
|
|
@@ -94,10 +95,10 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
94
95
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
95
96
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
96
97
|
getL2SlotNumber: z.function().args().returns(schemas.BigInt.optional()),
|
|
97
|
-
getL2EpochNumber: z.function().args().returns(
|
|
98
|
-
getBlocksForEpoch: z.function().args(
|
|
99
|
-
getBlockHeadersForEpoch: z.function().args(
|
|
100
|
-
isEpochComplete: z.function().args(
|
|
98
|
+
getL2EpochNumber: z.function().args().returns(EpochNumberSchema.optional()),
|
|
99
|
+
getBlocksForEpoch: z.function().args(EpochNumberSchema).returns(z.array(L2Block.schema)),
|
|
100
|
+
getBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
|
|
101
|
+
isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
|
|
101
102
|
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
102
103
|
getPrivateLogs: z.function().args(z.number(), z.number()).returns(z.array(PrivateLog.schema)),
|
|
103
104
|
getLogsByTags: z
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
1
|
+
import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
+
import type { EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import type { Fr } from '@aztec/foundation/fields';
|
|
4
5
|
|
|
@@ -19,7 +20,7 @@ export interface EpochProver extends Omit<IBlockFactory, 'setBlockCompleted' | '
|
|
|
19
20
|
* @param finalBlobBatchingChallenges - The final blob batching challenges for the epoch.
|
|
20
21
|
**/
|
|
21
22
|
startNewEpoch(
|
|
22
|
-
epochNumber:
|
|
23
|
+
epochNumber: EpochNumber,
|
|
23
24
|
totalNumCheckpoints: number,
|
|
24
25
|
finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
|
|
25
26
|
): void;
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
5
|
RECURSIVE_PROOF_LENGTH,
|
|
6
6
|
} from '@aztec/constants';
|
|
7
|
+
import { EpochNumber, EpochNumberSchema } from '@aztec/foundation/branded-types';
|
|
7
8
|
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
8
9
|
|
|
9
10
|
import { z } from 'zod';
|
|
@@ -400,24 +401,32 @@ export const ProofUri = z.string().brand('ProvingJobUri');
|
|
|
400
401
|
export type ProofUri = z.infer<typeof ProofUri>;
|
|
401
402
|
|
|
402
403
|
export type ProvingJobId = z.infer<typeof ProvingJobId>;
|
|
403
|
-
|
|
404
|
+
|
|
405
|
+
type ProvingJobShape = {
|
|
406
|
+
id: ProvingJobId;
|
|
407
|
+
type: ProvingRequestType;
|
|
408
|
+
epochNumber: EpochNumber;
|
|
409
|
+
inputsUri: ProofUri;
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
export const ProvingJob: z.ZodType<ProvingJobShape, z.ZodTypeDef, any> = z.object({
|
|
404
413
|
id: ProvingJobId,
|
|
405
414
|
type: z.nativeEnum(ProvingRequestType),
|
|
406
|
-
epochNumber:
|
|
415
|
+
epochNumber: EpochNumberSchema,
|
|
407
416
|
inputsUri: ProofUri,
|
|
408
417
|
});
|
|
409
418
|
|
|
410
|
-
export const makeProvingJobId = (epochNumber:
|
|
419
|
+
export const makeProvingJobId = (epochNumber: EpochNumber, type: ProvingRequestType, inputsHash: string) => {
|
|
411
420
|
return `${epochNumber}:${ProvingRequestType[type]}:${inputsHash}`;
|
|
412
421
|
};
|
|
413
422
|
|
|
414
|
-
export const getEpochFromProvingJobId = (id: ProvingJobId) => {
|
|
423
|
+
export const getEpochFromProvingJobId = (id: ProvingJobId): EpochNumber => {
|
|
415
424
|
const components = id.split(':');
|
|
416
425
|
const epochNumber = components.length < 1 ? Number.NaN : parseInt(components[0], 10);
|
|
417
426
|
if (!Number.isSafeInteger(epochNumber) || epochNumber < 0) {
|
|
418
427
|
throw new Error(`Proving Job ID ${id} does not contain valid epoch`);
|
|
419
428
|
}
|
|
420
|
-
return epochNumber;
|
|
429
|
+
return EpochNumber(epochNumber);
|
|
421
430
|
};
|
|
422
431
|
|
|
423
432
|
export type ProvingJob = z.infer<typeof ProvingJob>;
|
package/src/note/index.ts
CHANGED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
+
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { Note } from '@aztec/stdlib/note';
|
|
6
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
10
|
+
* information required to use it during execution and manage its state.
|
|
11
|
+
*/
|
|
12
|
+
export class NoteDao {
|
|
13
|
+
constructor(
|
|
14
|
+
// Note information
|
|
15
|
+
|
|
16
|
+
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
17
|
+
public note: Note,
|
|
18
|
+
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
19
|
+
public contractAddress: AztecAddress,
|
|
20
|
+
/**
|
|
21
|
+
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
22
|
+
* since contracts typically make queries based on it.
|
|
23
|
+
*/
|
|
24
|
+
public storageSlot: Fr,
|
|
25
|
+
/**
|
|
26
|
+
* The randomness injected to the note.
|
|
27
|
+
*/
|
|
28
|
+
public randomness: Fr,
|
|
29
|
+
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
30
|
+
public noteNonce: Fr,
|
|
31
|
+
|
|
32
|
+
// Computed values
|
|
33
|
+
/**
|
|
34
|
+
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
35
|
+
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
36
|
+
*/
|
|
37
|
+
public noteHash: Fr,
|
|
38
|
+
/**
|
|
39
|
+
* The nullifier of the note, siloed by contract address.
|
|
40
|
+
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
41
|
+
*/
|
|
42
|
+
public siloedNullifier: Fr,
|
|
43
|
+
|
|
44
|
+
// Metadata
|
|
45
|
+
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
46
|
+
* when searching for txEffects.
|
|
47
|
+
*/
|
|
48
|
+
public txHash: TxHash,
|
|
49
|
+
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
50
|
+
* reorgs.*/
|
|
51
|
+
public l2BlockNumber: number,
|
|
52
|
+
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
53
|
+
* reorgs.*/
|
|
54
|
+
public l2BlockHash: string,
|
|
55
|
+
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
56
|
+
public index: bigint,
|
|
57
|
+
) {}
|
|
58
|
+
|
|
59
|
+
toBuffer(): Buffer {
|
|
60
|
+
return serializeToBuffer([
|
|
61
|
+
this.note,
|
|
62
|
+
this.contractAddress,
|
|
63
|
+
this.storageSlot,
|
|
64
|
+
this.randomness,
|
|
65
|
+
this.noteNonce,
|
|
66
|
+
this.noteHash,
|
|
67
|
+
this.siloedNullifier,
|
|
68
|
+
this.txHash,
|
|
69
|
+
this.l2BlockNumber,
|
|
70
|
+
Fr.fromHexString(this.l2BlockHash),
|
|
71
|
+
this.index,
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
76
|
+
const reader = BufferReader.asReader(buffer);
|
|
77
|
+
|
|
78
|
+
const note = Note.fromBuffer(reader);
|
|
79
|
+
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
80
|
+
const storageSlot = Fr.fromBuffer(reader);
|
|
81
|
+
const randomness = Fr.fromBuffer(reader);
|
|
82
|
+
const noteNonce = Fr.fromBuffer(reader);
|
|
83
|
+
const noteHash = Fr.fromBuffer(reader);
|
|
84
|
+
const siloedNullifier = Fr.fromBuffer(reader);
|
|
85
|
+
const txHash = reader.readObject(TxHash);
|
|
86
|
+
const l2BlockNumber = reader.readNumber();
|
|
87
|
+
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
88
|
+
const index = toBigIntBE(reader.readBytes(32));
|
|
89
|
+
|
|
90
|
+
return new NoteDao(
|
|
91
|
+
note,
|
|
92
|
+
contractAddress,
|
|
93
|
+
storageSlot,
|
|
94
|
+
randomness,
|
|
95
|
+
noteNonce,
|
|
96
|
+
noteHash,
|
|
97
|
+
siloedNullifier,
|
|
98
|
+
txHash,
|
|
99
|
+
l2BlockNumber,
|
|
100
|
+
l2BlockHash,
|
|
101
|
+
index,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
toString() {
|
|
106
|
+
return '0x' + this.toBuffer().toString('hex');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static fromString(str: string) {
|
|
110
|
+
const hex = str.replace(/^0x/, '');
|
|
111
|
+
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Returns the size in bytes of the Note Dao.
|
|
116
|
+
* @returns - Its size in bytes.
|
|
117
|
+
*/
|
|
118
|
+
public getSize() {
|
|
119
|
+
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
120
|
+
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
121
|
+
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static async random({
|
|
125
|
+
note = Note.random(),
|
|
126
|
+
contractAddress = undefined,
|
|
127
|
+
storageSlot = Fr.random(),
|
|
128
|
+
randomness = Fr.random(),
|
|
129
|
+
noteNonce = Fr.random(),
|
|
130
|
+
noteHash = Fr.random(),
|
|
131
|
+
siloedNullifier = Fr.random(),
|
|
132
|
+
txHash = TxHash.random(),
|
|
133
|
+
l2BlockNumber = Math.floor(Math.random() * 1000),
|
|
134
|
+
l2BlockHash = Fr.random().toString(),
|
|
135
|
+
index = Fr.random().toBigInt(),
|
|
136
|
+
}: Partial<NoteDao> = {}) {
|
|
137
|
+
return new NoteDao(
|
|
138
|
+
note,
|
|
139
|
+
contractAddress ?? (await AztecAddress.random()),
|
|
140
|
+
storageSlot,
|
|
141
|
+
randomness,
|
|
142
|
+
noteNonce,
|
|
143
|
+
noteHash,
|
|
144
|
+
siloedNullifier,
|
|
145
|
+
txHash,
|
|
146
|
+
l2BlockNumber,
|
|
147
|
+
l2BlockHash,
|
|
148
|
+
index,
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -8,6 +8,7 @@ import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
10
|
import type { L2Block } from '../block/l2_block.js';
|
|
11
|
+
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
11
12
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
12
13
|
import { StateReference } from '../tx/state_reference.js';
|
|
13
14
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
@@ -90,6 +91,11 @@ export class ConsensusPayload implements Signable {
|
|
|
90
91
|
return new ConsensusPayload(block.header.toCheckpointHeader(), block.archive.root, block.header.state);
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
static fromCheckpoint(checkpoint: Checkpoint): ConsensusPayload {
|
|
95
|
+
const lastBlock = checkpoint.blocks.at(-1)!;
|
|
96
|
+
return new ConsensusPayload(checkpoint.header, checkpoint.archive.root, lastBlock.header.state);
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
static empty(): ConsensusPayload {
|
|
94
100
|
return new ConsensusPayload(CheckpointHeader.empty(), Fr.ZERO, StateReference.empty());
|
|
95
101
|
}
|
|
@@ -136,18 +136,19 @@ export class CheckpointHeader {
|
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
static random(): CheckpointHeader {
|
|
140
|
-
return
|
|
141
|
-
Fr.random(),
|
|
142
|
-
Fr.random(),
|
|
143
|
-
ContentCommitment.random(),
|
|
144
|
-
new Fr(BigInt(Math.floor(Math.random() * 1000) + 1)),
|
|
145
|
-
BigInt(Math.floor(Date.now() / 1000)),
|
|
146
|
-
EthAddress.random(),
|
|
147
|
-
new AztecAddress(Fr.random()),
|
|
148
|
-
GasFees.random(),
|
|
149
|
-
new Fr(BigInt(Math.floor(Math.random() * 1000000))),
|
|
150
|
-
|
|
139
|
+
static random(overrides: Partial<FieldsOf<CheckpointHeader>> = {}): CheckpointHeader {
|
|
140
|
+
return CheckpointHeader.from({
|
|
141
|
+
lastArchiveRoot: Fr.random(),
|
|
142
|
+
blockHeadersHash: Fr.random(),
|
|
143
|
+
contentCommitment: ContentCommitment.random(),
|
|
144
|
+
slotNumber: new Fr(BigInt(Math.floor(Math.random() * 1000) + 1)),
|
|
145
|
+
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
146
|
+
coinbase: EthAddress.random(),
|
|
147
|
+
feeRecipient: new AztecAddress(Fr.random()),
|
|
148
|
+
gasFees: GasFees.random(),
|
|
149
|
+
totalManaUsed: new Fr(BigInt(Math.floor(Math.random() * 1000000))),
|
|
150
|
+
...overrides,
|
|
151
|
+
});
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
isEmpty(): boolean {
|
package/src/slashing/empire.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
|
|
1
3
|
import { getRoundForSlot, getRoundsForEpoch } from './helpers.js';
|
|
2
4
|
import type { Offense, OffenseIdentifier, SlashPayload, SlashPayloadRound, ValidatorSlash } from './types.js';
|
|
3
5
|
import { OffenseType } from './types.js';
|
|
@@ -66,7 +68,7 @@ export function getFirstEligibleRoundForOffense(
|
|
|
66
68
|
// Inactivity is detected at the end of the epoch, so we flag it as detected in the first fresh round for the next epoch
|
|
67
69
|
case OffenseType.INACTIVITY: {
|
|
68
70
|
const epoch = offense.epochOrSlot;
|
|
69
|
-
const detectedEpoch = epoch + 1n;
|
|
71
|
+
const detectedEpoch = EpochNumber.fromBigInt(epoch + 1n);
|
|
70
72
|
return getRoundsForEpoch(detectedEpoch, constants)[0] + 1n;
|
|
71
73
|
}
|
|
72
74
|
// These offenses are detected once an epoch is pruned, which happens after the proof submission window
|
|
@@ -74,7 +76,7 @@ export function getFirstEligibleRoundForOffense(
|
|
|
74
76
|
case OffenseType.DATA_WITHHOLDING: {
|
|
75
77
|
// TODO(palla/slash): Check for off-by-ones especially here
|
|
76
78
|
const epoch = offense.epochOrSlot;
|
|
77
|
-
const detectedEpoch = epoch + BigInt(constants.proofSubmissionEpochs);
|
|
79
|
+
const detectedEpoch = EpochNumber.fromBigInt(epoch + BigInt(constants.proofSubmissionEpochs));
|
|
78
80
|
return getRoundsForEpoch(detectedEpoch, constants)[0] + 1n;
|
|
79
81
|
}
|
|
80
82
|
// These offenses are detected immediately in the slot they occur, so we assume they are detected in the first round for the following slot
|
|
@@ -89,7 +91,7 @@ export function getFirstEligibleRoundForOffense(
|
|
|
89
91
|
// Assume these are epoch-based offenses, even though we should never have to process these
|
|
90
92
|
case OffenseType.UNKNOWN: {
|
|
91
93
|
const epoch = offense.epochOrSlot;
|
|
92
|
-
const detectedEpoch = epoch + 1n;
|
|
94
|
+
const detectedEpoch = EpochNumber.fromBigInt(epoch + 1n);
|
|
93
95
|
return getRoundsForEpoch(detectedEpoch, constants)[0] + 1n;
|
|
94
96
|
}
|
|
95
97
|
default: {
|
package/src/slashing/helpers.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
|
|
1
3
|
import { type L1RollupConstants, getEpochAtSlot, getSlotRangeForEpoch } from '../epoch-helpers/index.js';
|
|
2
4
|
import type { SlasherConfig } from '../interfaces/slasher.js';
|
|
3
5
|
import { type Offense, OffenseType } from './types.js';
|
|
@@ -15,7 +17,7 @@ export function getRoundForSlot(
|
|
|
15
17
|
|
|
16
18
|
/** Returns the voting round(s) lower and upper bounds (inclusive) covered by the given epoch */
|
|
17
19
|
export function getRoundsForEpoch(
|
|
18
|
-
epoch:
|
|
20
|
+
epoch: EpochNumber,
|
|
19
21
|
constants: { slashingRoundSize: number; epochDuration: number },
|
|
20
22
|
): [bigint, bigint] {
|
|
21
23
|
const [start, end] = getSlotRangeForEpoch(epoch, constants);
|
|
@@ -28,13 +30,13 @@ export function getRoundsForEpoch(
|
|
|
28
30
|
export function getEpochsForRound(
|
|
29
31
|
round: bigint,
|
|
30
32
|
constants: { slashingRoundSize: number; epochDuration: number },
|
|
31
|
-
):
|
|
32
|
-
const epochs:
|
|
33
|
+
): EpochNumber[] {
|
|
34
|
+
const epochs: EpochNumber[] = [];
|
|
33
35
|
const firstSlot = round * BigInt(constants.slashingRoundSize);
|
|
34
36
|
const lastSlot = firstSlot + BigInt(constants.slashingRoundSize) - 1n;
|
|
35
37
|
const startEpoch = getEpochAtSlot(firstSlot, constants);
|
|
36
38
|
const endEpoch = getEpochAtSlot(lastSlot, constants);
|
|
37
|
-
for (let epoch = startEpoch; epoch <= endEpoch; epoch
|
|
39
|
+
for (let epoch = startEpoch; epoch <= endEpoch; epoch = EpochNumber(epoch + 1)) {
|
|
38
40
|
epochs.push(epoch);
|
|
39
41
|
}
|
|
40
42
|
return epochs;
|