@aztec/stdlib 0.0.1-commit.b655e406 → 0.0.1-commit.fce3e4f
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 +92 -107
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +2 -2
- 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/contract_artifact.js +3 -3
- 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 +4189 -2057
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +375 -16
- package/dest/avm/avm_accumulated_data.d.ts +25 -36
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +18 -0
- package/dest/avm/avm_circuit_public_inputs.d.ts +156 -146
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +9 -0
- package/dest/avm/avm_proving_request.d.ts +2023 -1503
- 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 +2 -2
- package/dest/avm/message_pack.d.ts.map +1 -1
- package/dest/avm/message_pack.js +3 -0
- 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 +13 -11
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +9 -0
- 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 +16 -7
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +24 -8
- package/dest/aztec-address/index.d.ts +10 -1
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +24 -2
- 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 +8 -8
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +11 -27
- 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 +2 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +15 -7
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +54 -4
- 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 +4 -3
- package/dest/block/l2_block_header.d.ts +10 -12
- package/dest/block/l2_block_header.d.ts.map +1 -1
- package/dest/block/l2_block_header.js +18 -11
- package/dest/block/l2_block_info.d.ts +9 -9
- package/dest/block/l2_block_new.d.ts +108 -0
- package/dest/block/l2_block_new.d.ts.map +1 -0
- package/dest/block/l2_block_new.js +135 -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 +16 -5
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +14 -0
- 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 +121 -0
- package/dest/checkpoint/checkpoint.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint.js +62 -0
- package/dest/checkpoint/index.d.ts +3 -2
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +2 -1
- 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 +119 -0
- package/dest/contract/contract_deployment_data.d.ts.map +1 -0
- package/dest/contract/contract_deployment_data.js +99 -0
- 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 +2 -1
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +1 -0
- package/dest/contract/interfaces/contract_class.d.ts +41 -122
- 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 +2 -2
- package/dest/contract/private_function_membership_proof.js +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/http.js +8 -3
- 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/file-store/s3.js +3 -7
- package/dest/gas/gas.d.ts +9 -1
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +12 -0
- package/dest/gas/gas_fees.d.ts +9 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +12 -0
- package/dest/gas/gas_settings.d.ts +9 -1
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +12 -0
- package/dest/gas/gas_used.d.ts +13 -2
- package/dest/gas/gas_used.d.ts.map +1 -1
- package/dest/gas/gas_used.js +19 -1
- package/dest/gas/index.d.ts +1 -1
- package/dest/hash/hash.d.ts +11 -3
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +11 -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 +6 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +8 -6
- package/dest/interfaces/aztec-node-admin.d.ts +92 -85
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +3 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +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 +31 -21
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +3 -1
- package/dest/interfaces/epoch-prover.d.ts +5 -5
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.d.ts +2 -2
- package/dest/interfaces/l2_logs_source.d.ts +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +3 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +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 +1672 -1159
- 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 +27 -19
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +2 -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 +2 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +2 -2
- 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 +2 -24
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.js +4 -9
- 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 +17 -74
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +17 -5
- 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 +7 -29
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +8 -4
- 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_data.js +0 -2
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +7 -20
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.js +7 -3
- 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 +10 -10
- 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 +17 -1
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +18 -0
- 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 +2 -24
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +5 -13
- package/dest/kernel/public_call_request.d.ts +22 -27
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +18 -0
- 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 +9 -5
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +12 -0
- 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 +20 -4
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +24 -0
- package/dest/logs/debug_log.d.ts +10 -2
- package/dest/logs/debug_log.d.ts.map +1 -1
- package/dest/logs/debug_log.js +13 -0
- 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 +3 -5
- 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 +10 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +14 -5
- package/dest/logs/public_log.d.ts +9 -1
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +9 -0
- 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 +4 -0
- package/dest/messaging/in_hash.d.ts.map +1 -0
- package/dest/messaging/in_hash.js +8 -0
- 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 +3 -1
- package/dest/messaging/index.d.ts.map +1 -1
- package/dest/messaging/index.js +2 -0
- 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_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +2 -2
- package/dest/messaging/l2_to_l1_message.d.ts +17 -1
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +18 -0
- package/dest/messaging/out_hash.d.ts +5 -0
- package/dest/messaging/out_hash.d.ts.map +1 -0
- package/dest/messaging/out_hash.js +28 -0
- package/dest/noir/index.d.ts +7 -7
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/noir/index.js +6 -6
- 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 +2 -17
- 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 +5 -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 +10 -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 +6 -5
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +16 -10
- 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 +2 -26
- 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 +4 -0
- package/dest/rollup/block_headers_hash.d.ts.map +1 -0
- package/dest/rollup/block_headers_hash.js +9 -0
- 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 +8 -40
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -2
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +2 -76
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.js +1 -9
- package/dest/rollup/checkpoint_constant_data.d.ts +26 -13
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +27 -3
- package/dest/rollup/checkpoint_header.d.ts +16 -14
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +40 -13
- 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 +5 -29
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +4 -4
- 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 +2 -1
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +1 -0
- 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 +86 -15
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +12 -1
- 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 +10 -10
- 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 +34 -29
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +72 -147
- 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 +54 -23
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +133 -33
- package/dest/trees/append_only_tree_snapshot.d.ts +9 -16
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +9 -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 +17 -13
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +24 -0
- package/dest/trees/nullifier_membership_witness.d.ts +4 -37
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +28 -27
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +24 -0
- package/dest/trees/public_data_witness.d.ts +11 -45
- 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 +37 -0
- package/dest/tx/execution_payload.d.ts.map +1 -0
- package/dest/tx/execution_payload.js +40 -0
- 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 +43 -24
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +48 -8
- 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 +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- 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 +4 -7
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +10 -10
- package/dest/tx/private_execution_result.d.ts +14 -49
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +6 -3
- 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 +38 -38
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +5 -4
- package/dest/tx/protocol_contracts.d.ts +10 -2
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.js +9 -0
- 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 +9 -7
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +12 -0
- package/dest/tx/public_simulation_output.d.ts +3 -1
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +8 -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 +10 -12
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +9 -9
- package/dest/tx/tree_snapshots.d.ts +15 -7
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.js +9 -0
- package/dest/tx/tx.d.ts +3 -17
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +5 -4
- 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 +20 -42
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +54 -59
- 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 +10 -22
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +20 -0
- 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 +34 -2
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +24 -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/abi/abi.ts +4 -4
- package/src/abi/contract_artifact.ts +3 -3
- package/src/avm/avm.ts +562 -6
- package/src/avm/avm_accumulated_data.ts +40 -0
- package/src/avm/avm_circuit_public_inputs.ts +40 -0
- package/src/avm/message_pack.ts +4 -1
- package/src/avm/public_data_write.ts +12 -1
- package/src/avm/revert_code.ts +29 -9
- package/src/aztec-address/index.ts +26 -2
- package/src/block/attestation_info.ts +8 -1
- package/src/block/body.ts +16 -39
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +62 -4
- package/src/block/l2_block_code_to_purge.ts +4 -2
- package/src/block/l2_block_header.ts +19 -5
- package/src/block/l2_block_new.ts +171 -0
- package/src/block/l2_block_source.ts +9 -8
- package/src/block/proposal/attestations_and_signers.ts +20 -1
- package/src/block/published_l2_block.ts +14 -31
- package/src/block/validate_block_result.ts +9 -7
- package/src/checkpoint/checkpoint.ts +88 -0
- package/src/checkpoint/index.ts +2 -1
- package/src/checkpoint/published_checkpoint.ts +91 -0
- package/src/contract/contract_deployment_data.ts +125 -0
- package/src/contract/index.ts +1 -0
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/epoch-helpers/index.ts +28 -21
- package/src/file-store/http.ts +6 -3
- package/src/file-store/s3.ts +3 -7
- package/src/gas/gas.ts +14 -0
- package/src/gas/gas_fees.ts +14 -0
- package/src/gas/gas_settings.ts +19 -0
- package/src/gas/gas_used.ts +22 -1
- package/src/hash/hash.ts +13 -2
- package/src/interfaces/archiver.ts +10 -5
- package/src/interfaces/aztec-node.ts +4 -3
- package/src/interfaces/configs.ts +6 -0
- package/src/interfaces/epoch-prover.ts +3 -4
- package/src/interfaces/merkle_tree_operations.ts +2 -2
- package/src/interfaces/p2p.ts +4 -2
- package/src/interfaces/proving-job.ts +14 -5
- package/src/interfaces/validator.ts +5 -2
- package/src/kernel/hints/build_transient_data_hints.ts +2 -2
- package/src/kernel/hints/private_kernel_reset_hints.ts +0 -8
- package/src/kernel/private_circuit_public_inputs.ts +29 -9
- package/src/kernel/private_kernel_circuit_public_inputs.ts +7 -0
- package/src/kernel/private_kernel_data.ts +0 -2
- package/src/kernel/private_kernel_init_circuit_private_inputs.ts +6 -0
- package/src/kernel/private_to_avm_accumulated_data.ts +35 -0
- package/src/kernel/private_validation_requests.ts +1 -13
- package/src/kernel/public_call_request.ts +27 -0
- package/src/keys/public_keys.ts +19 -0
- package/src/logs/contract_class_log.ts +32 -0
- package/src/logs/debug_log.ts +20 -1
- package/src/logs/private_log.ts +19 -3
- package/src/logs/public_log.ts +14 -0
- package/src/messaging/in_hash.ts +10 -0
- package/src/messaging/index.ts +2 -0
- package/src/messaging/l2_to_l1_membership.ts +2 -2
- package/src/messaging/l2_to_l1_message.ts +25 -0
- package/src/messaging/out_hash.ts +36 -0
- package/src/noir/index.ts +6 -6
- package/src/note/index.ts +1 -1
- package/src/note/note_dao.ts +151 -0
- 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/p2p/gossipable.ts +17 -8
- package/src/rollup/block_headers_hash.ts +12 -0
- package/src/rollup/block_rollup_public_inputs.ts +8 -0
- package/src/rollup/block_root_rollup_private_inputs.ts +0 -9
- package/src/rollup/checkpoint_constant_data.ts +43 -4
- package/src/rollup/checkpoint_header.ts +46 -22
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +5 -5
- package/src/rollup/index.ts +1 -0
- package/src/schemas/schemas.ts +18 -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 +211 -227
- package/src/tests/mocks.ts +228 -50
- package/src/trees/append_only_tree_snapshot.ts +11 -12
- package/src/trees/nullifier_leaf.ts +32 -0
- package/src/trees/public_data_leaf.ts +32 -0
- package/src/tx/block_header.ts +16 -3
- package/src/tx/execution_payload.ts +60 -0
- package/src/tx/global_variable_builder.ts +2 -1
- package/src/tx/global_variables.ts +63 -9
- package/src/tx/index.ts +1 -0
- package/src/tx/indexed_tx_effect.ts +1 -1
- package/src/tx/partial_state_reference.ts +9 -17
- package/src/tx/private_execution_result.ts +5 -2
- package/src/tx/profiling.ts +4 -6
- package/src/tx/protocol_contracts.ts +16 -0
- package/src/tx/public_call_request_with_calldata.ts +17 -0
- package/src/tx/public_simulation_output.ts +18 -1
- package/src/tx/state_reference.ts +9 -15
- package/src/tx/tree_snapshots.ts +16 -0
- package/src/tx/tx.ts +5 -5
- package/src/tx/tx_effect.ts +84 -90
- package/src/validators/errors.ts +3 -4
- package/src/validators/schemas.ts +7 -7
- package/src/validators/types.ts +9 -8
- package/src/vks/verification_key.ts +25 -0
- package/src/world-state/world_state_revision.ts +47 -5
- package/dest/checkpoint/checkpoint_body.d.ts +0 -4
- package/dest/checkpoint/checkpoint_body.d.ts.map +0 -1
- package/dest/checkpoint/checkpoint_body.js +0 -9
- package/dest/note/unique_note.d.ts +0 -43
- package/dest/note/unique_note.d.ts.map +0 -1
- package/dest/note/unique_note.js +0 -67
- package/src/checkpoint/checkpoint_body.ts +0 -10
- package/src/note/unique_note.ts +0 -88
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { type BlockBlobData, encodeBlockBlobData } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
|
|
7
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
8
|
+
import { BlockHeader } from '../tx/block_header.js';
|
|
9
|
+
import { Body } from './body.js';
|
|
10
|
+
import type { L2BlockInfo } from './l2_block_info.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An L2 block with a header and a body.
|
|
14
|
+
* TODO: Delete the existing `L2Block` class and rename this to `L2Block`.
|
|
15
|
+
*/
|
|
16
|
+
export class L2BlockNew {
|
|
17
|
+
constructor(
|
|
18
|
+
/** Snapshot of archive tree after the block is applied. */
|
|
19
|
+
public archive: AppendOnlyTreeSnapshot,
|
|
20
|
+
/** Header of the block. */
|
|
21
|
+
public header: BlockHeader,
|
|
22
|
+
/** L2 block body. */
|
|
23
|
+
public body: Body,
|
|
24
|
+
private blockHash: Fr | undefined = undefined,
|
|
25
|
+
) {}
|
|
26
|
+
|
|
27
|
+
get number(): number {
|
|
28
|
+
return this.header.globalVariables.blockNumber;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get timestamp(): bigint {
|
|
32
|
+
return this.header.globalVariables.timestamp;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static get schema() {
|
|
36
|
+
return z
|
|
37
|
+
.object({
|
|
38
|
+
archive: AppendOnlyTreeSnapshot.schema,
|
|
39
|
+
header: BlockHeader.schema,
|
|
40
|
+
body: Body.schema,
|
|
41
|
+
})
|
|
42
|
+
.transform(({ archive, header, body }) => new L2BlockNew(archive, header, body));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Deserializes a block from a buffer
|
|
47
|
+
* @returns A deserialized L2 block.
|
|
48
|
+
*/
|
|
49
|
+
static fromBuffer(buf: Buffer | BufferReader) {
|
|
50
|
+
const reader = BufferReader.asReader(buf);
|
|
51
|
+
const header = reader.readObject(BlockHeader);
|
|
52
|
+
const archive = reader.readObject(AppendOnlyTreeSnapshot);
|
|
53
|
+
const body = reader.readObject(Body);
|
|
54
|
+
|
|
55
|
+
return new L2BlockNew(archive, header, body);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Serializes a block
|
|
60
|
+
* @returns A serialized L2 block as a Buffer.
|
|
61
|
+
*/
|
|
62
|
+
toBuffer() {
|
|
63
|
+
return serializeToBuffer(this.header, this.archive, this.body);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Returns the block's hash (hash of block header).
|
|
68
|
+
* @returns The block's hash.
|
|
69
|
+
*/
|
|
70
|
+
public async hash(): Promise<Fr> {
|
|
71
|
+
if (this.blockHash === undefined) {
|
|
72
|
+
this.blockHash = await this.header.hash();
|
|
73
|
+
}
|
|
74
|
+
return this.blockHash;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public toBlobFields(isFirstBlock: boolean): Fr[] {
|
|
78
|
+
const blockBlobData = this.toBlockBlobData(isFirstBlock);
|
|
79
|
+
return encodeBlockBlobData(blockBlobData);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public toBlockBlobData(isFirstBlock: boolean): BlockBlobData {
|
|
83
|
+
return {
|
|
84
|
+
blockEndMarker: {
|
|
85
|
+
numTxs: this.body.txEffects.length,
|
|
86
|
+
timestamp: this.header.globalVariables.timestamp,
|
|
87
|
+
blockNumber: this.number,
|
|
88
|
+
},
|
|
89
|
+
blockEndStateField: {
|
|
90
|
+
l1ToL2MessageNextAvailableLeafIndex: this.header.state.l1ToL2MessageTree.nextAvailableLeafIndex,
|
|
91
|
+
noteHashNextAvailableLeafIndex: this.header.state.partial.noteHashTree.nextAvailableLeafIndex,
|
|
92
|
+
nullifierNextAvailableLeafIndex: this.header.state.partial.nullifierTree.nextAvailableLeafIndex,
|
|
93
|
+
publicDataNextAvailableLeafIndex: this.header.state.partial.publicDataTree.nextAvailableLeafIndex,
|
|
94
|
+
totalManaUsed: this.header.totalManaUsed.toBigInt(),
|
|
95
|
+
},
|
|
96
|
+
lastArchiveRoot: this.header.lastArchive.root,
|
|
97
|
+
noteHashRoot: this.header.state.partial.noteHashTree.root,
|
|
98
|
+
nullifierRoot: this.header.state.partial.nullifierTree.root,
|
|
99
|
+
publicDataRoot: this.header.state.partial.publicDataTree.root,
|
|
100
|
+
l1ToL2MessageRoot: isFirstBlock ? this.header.state.l1ToL2MessageTree.root : undefined,
|
|
101
|
+
txs: this.body.toTxBlobData(),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Creates an L2 block containing random data.
|
|
107
|
+
* @param l2BlockNum - The number of the L2 block.
|
|
108
|
+
* @param txsPerBlock - The number of transactions to include in the block.
|
|
109
|
+
* @param numPublicCallsPerTx - The number of public function calls to include in each transaction.
|
|
110
|
+
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
111
|
+
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
112
|
+
* @returns The L2 block.
|
|
113
|
+
*/
|
|
114
|
+
static async random(
|
|
115
|
+
blockNumber: number,
|
|
116
|
+
{
|
|
117
|
+
txsPerBlock = 1,
|
|
118
|
+
txOptions = {},
|
|
119
|
+
makeTxOptions,
|
|
120
|
+
...blockHeaderOverrides
|
|
121
|
+
}: {
|
|
122
|
+
txsPerBlock?: number;
|
|
123
|
+
txOptions?: Partial<Parameters<typeof Body.random>[0]>;
|
|
124
|
+
makeTxOptions?: (txIndex: number) => Partial<Parameters<typeof Body.random>[0]>;
|
|
125
|
+
} & Partial<Parameters<typeof BlockHeader.random>[0]> = {},
|
|
126
|
+
): Promise<L2BlockNew> {
|
|
127
|
+
const archive = new AppendOnlyTreeSnapshot(Fr.random(), blockNumber + 1);
|
|
128
|
+
const header = BlockHeader.random({ blockNumber, ...blockHeaderOverrides });
|
|
129
|
+
const body = await Body.random({ txsPerBlock, makeTxOptions, ...txOptions });
|
|
130
|
+
return new L2BlockNew(archive, header, body);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Returns stats used for logging.
|
|
135
|
+
* @returns Stats on tx count, number, and log size and count.
|
|
136
|
+
*/
|
|
137
|
+
getStats() {
|
|
138
|
+
const logsStats = {
|
|
139
|
+
privateLogCount: this.body.txEffects.reduce((logCount, txEffect) => logCount + txEffect.privateLogs.length, 0),
|
|
140
|
+
publicLogCount: this.body.txEffects.reduce((logCount, txEffect) => logCount + txEffect.publicLogs.length, 0),
|
|
141
|
+
contractClassLogCount: this.body.txEffects.reduce(
|
|
142
|
+
(logCount, txEffect) => logCount + txEffect.contractClassLogs.length,
|
|
143
|
+
0,
|
|
144
|
+
),
|
|
145
|
+
contractClassLogSize: this.body.txEffects.reduce(
|
|
146
|
+
(totalLogSize, txEffect) =>
|
|
147
|
+
totalLogSize + txEffect.contractClassLogs.reduce((acc, log) => acc + log.emittedLength, 0),
|
|
148
|
+
0,
|
|
149
|
+
),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
txCount: this.body.txEffects.length,
|
|
154
|
+
blockNumber: this.number,
|
|
155
|
+
blockTimestamp: Number(this.header.globalVariables.timestamp),
|
|
156
|
+
...logsStats,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
toBlockInfo(): L2BlockInfo {
|
|
161
|
+
return {
|
|
162
|
+
blockHash: this.blockHash,
|
|
163
|
+
archive: this.archive.root,
|
|
164
|
+
lastArchive: this.header.lastArchive.root,
|
|
165
|
+
blockNumber: this.number,
|
|
166
|
+
slotNumber: Number(this.header.getSlot()),
|
|
167
|
+
txCount: this.body.txEffects.length,
|
|
168
|
+
timestamp: this.header.globalVariables.timestamp,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import type { Fr } from '@aztec/foundation/fields';
|
|
3
4
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
@@ -112,32 +113,32 @@ export interface L2BlockSource {
|
|
|
112
113
|
/**
|
|
113
114
|
* Returns the current L2 slot number based on the currently synced L1 timestamp.
|
|
114
115
|
*/
|
|
115
|
-
getL2SlotNumber(): Promise<
|
|
116
|
+
getL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
116
117
|
|
|
117
118
|
/**
|
|
118
119
|
* Returns the current L2 epoch number based on the currently synced L1 timestamp.
|
|
119
120
|
*/
|
|
120
|
-
getL2EpochNumber(): Promise<
|
|
121
|
+
getL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
121
122
|
|
|
122
123
|
/**
|
|
123
124
|
* Returns all blocks for a given epoch.
|
|
124
125
|
* @dev Use this method only with recent epochs, since it walks the block list backwards.
|
|
125
126
|
* @param epochNumber - The epoch number to return blocks for.
|
|
126
127
|
*/
|
|
127
|
-
getBlocksForEpoch(epochNumber:
|
|
128
|
+
getBlocksForEpoch(epochNumber: EpochNumber): Promise<L2Block[]>;
|
|
128
129
|
|
|
129
130
|
/**
|
|
130
131
|
* Returns all block headers for a given epoch.
|
|
131
132
|
* @dev Use this method only with recent epochs, since it walks the block list backwards.
|
|
132
133
|
* @param epochNumber - The epoch number to return headers for.
|
|
133
134
|
*/
|
|
134
|
-
getBlockHeadersForEpoch(epochNumber:
|
|
135
|
+
getBlockHeadersForEpoch(epochNumber: EpochNumber): Promise<BlockHeader[]>;
|
|
135
136
|
|
|
136
137
|
/**
|
|
137
138
|
* Returns whether the given epoch is completed on L1, based on the current L1 and L2 block numbers.
|
|
138
139
|
* @param epochNumber - The epoch number to check.
|
|
139
140
|
*/
|
|
140
|
-
isEpochComplete(epochNumber:
|
|
141
|
+
isEpochComplete(epochNumber: EpochNumber): Promise<boolean>;
|
|
141
142
|
|
|
142
143
|
/**
|
|
143
144
|
* Returns the tips of the L2 chain.
|
|
@@ -231,13 +232,13 @@ export enum L2BlockSourceEvents {
|
|
|
231
232
|
export type L2BlockProvenEvent = {
|
|
232
233
|
type: 'l2BlockProven';
|
|
233
234
|
blockNumber: bigint;
|
|
234
|
-
slotNumber:
|
|
235
|
-
epochNumber:
|
|
235
|
+
slotNumber: SlotNumber;
|
|
236
|
+
epochNumber: EpochNumber;
|
|
236
237
|
};
|
|
237
238
|
|
|
238
239
|
export type L2BlockPruneEvent = {
|
|
239
240
|
type: 'l2PruneDetected';
|
|
240
|
-
epochNumber:
|
|
241
|
+
epochNumber: EpochNumber;
|
|
241
242
|
blocks: L2Block[];
|
|
242
243
|
};
|
|
243
244
|
|
|
@@ -5,7 +5,7 @@ import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
import type { Signable, SignatureDomainSeparator } from '../../p2p/signature_utils.js';
|
|
8
|
-
import { CommitteeAttestation } from './committee_attestation.js';
|
|
8
|
+
import { CommitteeAttestation, EthAddress } from './committee_attestation.js';
|
|
9
9
|
|
|
10
10
|
export class CommitteeAttestationsAndSigners implements Signable {
|
|
11
11
|
constructor(public attestations: CommitteeAttestation[]) {}
|
|
@@ -119,3 +119,22 @@ export class CommitteeAttestationsAndSigners implements Signable {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Malicious extension of CommitteeAttestationsAndSigners that keeps separate attestations and
|
|
125
|
+
* signers. Used for tricking the L1 contract into accepting attestations by reconstructing
|
|
126
|
+
* the correct committee commitment (which relies on the signers, ignoring the signatures)
|
|
127
|
+
* with an invalid set of attestation signatures.
|
|
128
|
+
*/
|
|
129
|
+
export class MaliciousCommitteeAttestationsAndSigners extends CommitteeAttestationsAndSigners {
|
|
130
|
+
constructor(
|
|
131
|
+
attestations: CommitteeAttestation[],
|
|
132
|
+
private signers: EthAddress[],
|
|
133
|
+
) {
|
|
134
|
+
super(attestations);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
override getSigners(): EthAddress[] {
|
|
138
|
+
return this.signers;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -1,43 +1,18 @@
|
|
|
1
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
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
3
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
4
|
|
|
8
5
|
import { z } from 'zod';
|
|
9
6
|
|
|
7
|
+
import { L1PublishedData, PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
10
8
|
import { L2Block } from './l2_block.js';
|
|
11
9
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated `PublishedCheckpoint` is what will be retrieved from L1.
|
|
13
|
+
* L2 blocks do not need to link to L1PublishedData directly.
|
|
14
|
+
* TODO: Create another type (AttestedL2Block?) for an L2 block and its attestations.
|
|
15
|
+
*/
|
|
41
16
|
export class PublishedL2Block {
|
|
42
17
|
constructor(
|
|
43
18
|
public block: L2Block,
|
|
@@ -79,4 +54,12 @@ export class PublishedL2Block {
|
|
|
79
54
|
this.attestations,
|
|
80
55
|
);
|
|
81
56
|
}
|
|
57
|
+
|
|
58
|
+
public toPublishedCheckpoint() {
|
|
59
|
+
return new PublishedCheckpoint(this.block.toCheckpoint(), this.l1, this.attestations);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static fromPublishedCheckpoint(checkpoint: PublishedCheckpoint) {
|
|
63
|
+
return new PublishedL2Block(L2Block.fromCheckpoint(checkpoint.checkpoint), checkpoint.l1, checkpoint.attestations);
|
|
64
|
+
}
|
|
82
65
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EpochNumber, EpochNumberSchema } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
3
4
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -16,7 +17,7 @@ export type ValidateBlockNegativeResult =
|
|
|
16
17
|
/** Committee members at the epoch this block was proposed */
|
|
17
18
|
committee: EthAddress[];
|
|
18
19
|
/** Epoch in which this block was proposed */
|
|
19
|
-
epoch:
|
|
20
|
+
epoch: EpochNumber;
|
|
20
21
|
/** Proposer selection seed for the epoch */
|
|
21
22
|
seed: bigint;
|
|
22
23
|
/** List of committee members who signed this block proposal */
|
|
@@ -33,7 +34,7 @@ export type ValidateBlockNegativeResult =
|
|
|
33
34
|
/** Committee members at the epoch this block was proposed */
|
|
34
35
|
committee: EthAddress[];
|
|
35
36
|
/** Epoch in which this block was proposed */
|
|
36
|
-
epoch:
|
|
37
|
+
epoch: EpochNumber;
|
|
37
38
|
/** Proposer selection seed for the epoch */
|
|
38
39
|
seed: bigint;
|
|
39
40
|
/** List of committee members who signed this block proposal */
|
|
@@ -46,16 +47,17 @@ export type ValidateBlockNegativeResult =
|
|
|
46
47
|
invalidIndex: number;
|
|
47
48
|
};
|
|
48
49
|
|
|
50
|
+
// TODO: Rename to ValidateAttestationsResult
|
|
49
51
|
/** Result type for validating a block attestations */
|
|
50
52
|
export type ValidateBlockResult = { valid: true } | ValidateBlockNegativeResult;
|
|
51
53
|
|
|
52
|
-
export const ValidateBlockResultSchema = z.union([
|
|
54
|
+
export const ValidateBlockResultSchema: ZodFor<ValidateBlockResult> = z.union([
|
|
53
55
|
z.object({ valid: z.literal(true) }),
|
|
54
56
|
z.object({
|
|
55
57
|
valid: z.literal(false),
|
|
56
58
|
block: BlockInfoSchema,
|
|
57
59
|
committee: z.array(schemas.EthAddress),
|
|
58
|
-
epoch:
|
|
60
|
+
epoch: EpochNumberSchema,
|
|
59
61
|
seed: schemas.BigInt,
|
|
60
62
|
attestors: z.array(schemas.EthAddress),
|
|
61
63
|
attestations: z.array(CommitteeAttestation.schema),
|
|
@@ -65,14 +67,14 @@ export const ValidateBlockResultSchema = z.union([
|
|
|
65
67
|
valid: z.literal(false),
|
|
66
68
|
block: BlockInfoSchema,
|
|
67
69
|
committee: z.array(schemas.EthAddress),
|
|
68
|
-
epoch:
|
|
70
|
+
epoch: EpochNumberSchema,
|
|
69
71
|
seed: schemas.BigInt,
|
|
70
72
|
attestors: z.array(schemas.EthAddress),
|
|
71
73
|
attestations: z.array(CommitteeAttestation.schema),
|
|
72
74
|
reason: z.literal('invalid-attestation'),
|
|
73
75
|
invalidIndex: z.number(),
|
|
74
76
|
}),
|
|
75
|
-
])
|
|
77
|
+
]);
|
|
76
78
|
|
|
77
79
|
export function serializeValidateBlockResult(result: ValidateBlockResult): Buffer {
|
|
78
80
|
if (result.valid) {
|
|
@@ -106,7 +108,7 @@ export function deserializeValidateBlockResult(bufferOrReader: Buffer | BufferRe
|
|
|
106
108
|
const reason = reader.readString() as 'insufficient-attestations' | 'invalid-attestation';
|
|
107
109
|
const block = deserializeBlockInfo(reader.readBuffer());
|
|
108
110
|
const committee = reader.readVector(EthAddress);
|
|
109
|
-
const epoch = reader.
|
|
111
|
+
const epoch = EpochNumber(reader.readNumber());
|
|
110
112
|
const seed = reader.readBigInt();
|
|
111
113
|
const attestors = reader.readVector(EthAddress);
|
|
112
114
|
const attestations = reader.readVector(CommitteeAttestation);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { encodeCheckpointBlobDataFromBlocks } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
4
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
|
+
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
|
|
9
|
+
import { L2BlockNew } from '../block/l2_block_new.js';
|
|
10
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
11
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
12
|
+
|
|
13
|
+
export class Checkpoint {
|
|
14
|
+
constructor(
|
|
15
|
+
/** Snapshot of archive tree after the checkpoint is added. */
|
|
16
|
+
public archive: AppendOnlyTreeSnapshot,
|
|
17
|
+
/** Header of the checkpoint. */
|
|
18
|
+
public header: CheckpointHeader,
|
|
19
|
+
/** L2 blocks in the checkpoint. */
|
|
20
|
+
public blocks: L2BlockNew[],
|
|
21
|
+
/** Number of the checkpoint. */
|
|
22
|
+
public number: number,
|
|
23
|
+
) {}
|
|
24
|
+
|
|
25
|
+
static get schema() {
|
|
26
|
+
return z
|
|
27
|
+
.object({
|
|
28
|
+
archive: AppendOnlyTreeSnapshot.schema,
|
|
29
|
+
header: CheckpointHeader.schema,
|
|
30
|
+
blocks: z.array(L2BlockNew.schema),
|
|
31
|
+
number: schemas.UInt32,
|
|
32
|
+
})
|
|
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;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static fromBuffer(buf: Buffer | BufferReader) {
|
|
45
|
+
const reader = BufferReader.asReader(buf);
|
|
46
|
+
return new Checkpoint(
|
|
47
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
48
|
+
reader.readObject(CheckpointHeader),
|
|
49
|
+
reader.readVector(L2BlockNew),
|
|
50
|
+
reader.readNumber(),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public toBuffer() {
|
|
55
|
+
return serializeToBuffer(this.archive, this.header, this.blocks.length, this.blocks, this.number);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
public toBlobFields(): Fr[] {
|
|
59
|
+
const blocks = this.blocks.map((block, i) => block.toBlockBlobData(i === 0));
|
|
60
|
+
return encodeCheckpointBlobDataFromBlocks(blocks);
|
|
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
|
+
}
|
|
88
|
+
}
|
package/src/checkpoint/index.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './checkpoint.js';
|
|
2
|
+
export * from './published_checkpoint.js';
|
|
@@ -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
|
+
}
|