@aztec/stdlib 0.0.1-commit.7d4e6cd → 0.0.1-commit.858058eac
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/function_call.d.ts +47 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +20 -3
- package/dest/abi/utils.d.ts +7 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +7 -0
- package/dest/auth_witness/auth_witness.d.ts +2 -1
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +62 -62
- package/dest/avm/avm_accumulated_data.d.ts +30 -3
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +9 -9
- package/dest/avm/avm_proving_request.d.ts +299 -299
- package/dest/avm/contract_storage_read.d.ts +13 -1
- package/dest/avm/contract_storage_read.d.ts.map +1 -1
- package/dest/avm/contract_storage_update_request.d.ts +13 -1
- package/dest/avm/contract_storage_update_request.d.ts.map +1 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts +3 -1
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +1 -1
- package/dest/avm/public_data_read.d.ts +10 -1
- package/dest/avm/public_data_read.d.ts.map +1 -1
- package/dest/avm/public_data_update_request.d.ts +10 -1
- package/dest/avm/public_data_update_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +7 -1
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_inner_call_request.d.ts +4 -1
- 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/block/block_hash.d.ts +18 -14
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +22 -20
- package/dest/block/block_parameter.d.ts +4 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +2 -0
- package/dest/block/body.d.ts +1 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +2 -1
- package/dest/block/checkpointed_l2_block.d.ts +20 -137
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -1
- package/dest/block/checkpointed_l2_block.js +7 -45
- package/dest/block/in_block.d.ts +9 -9
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/in_block.js +5 -5
- package/dest/block/index.d.ts +1 -3
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -2
- package/dest/block/l2_block.d.ts +56 -59
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -110
- package/dest/block/l2_block_source.d.ts +65 -39
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +2 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +9 -6
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -3
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +37 -34
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +3 -3
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +2 -7
- package/dest/block/validate_block_result.d.ts +1 -1
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +5 -4
- package/dest/checkpoint/checkpoint.d.ts +30 -20
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +18 -6
- package/dest/checkpoint/published_checkpoint.d.ts +17 -15
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +4 -3
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/node-rpc-config.js +1 -1
- package/dest/config/sequencer-config.d.ts +10 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +12 -0
- package/dest/contract/complete_address.d.ts +4 -1
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/contract_address.js +1 -1
- package/dest/contract/contract_class_id.d.ts +1 -1
- package/dest/contract/contract_class_id.js +1 -1
- package/dest/contract/contract_deployment_data.d.ts +5 -5
- package/dest/contract/index.d.ts +1 -3
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -2
- package/dest/contract/interfaces/contract_instance.d.ts +16 -16
- package/dest/contract/interfaces/node-info.d.ts +3 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +2 -1
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +2 -3
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.js +1 -1
- package/dest/database-version/database_version.d.ts +58 -0
- package/dest/database-version/database_version.d.ts.map +1 -0
- package/dest/database-version/database_version.js +69 -0
- package/dest/database-version/version_manager.d.ts +3 -49
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +1 -66
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +2 -2
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.js +7 -10
- package/dest/deserialization/index.d.ts +11 -0
- package/dest/deserialization/index.d.ts.map +1 -0
- package/dest/deserialization/index.js +10 -0
- package/dest/epoch-helpers/index.d.ts +7 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +9 -3
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/hash/hash.js +2 -2
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/hash/map_slot.d.ts.map +1 -1
- package/dest/hash/map_slot.js +4 -3
- package/dest/interfaces/api_limit.d.ts +2 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +1 -0
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +18 -15
- package/dest/interfaces/aztec-node-admin.d.ts +72 -27
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +3 -1
- package/dest/interfaces/aztec-node.d.ts +65 -68
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +10 -16
- package/dest/interfaces/block-builder.d.ts +22 -14
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +7 -0
- package/dest/interfaces/configs.d.ts +8 -8
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.d.ts +16 -9
- package/dest/interfaces/get_logs_response.d.ts.map +1 -1
- package/dest/interfaces/l2_logs_source.d.ts +14 -5
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +2 -2
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.d.ts +16 -1
- package/dest/interfaces/prover-broker.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.js +4 -1
- package/dest/interfaces/prover-client.d.ts +15 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +12 -1
- package/dest/interfaces/proving-job.d.ts +214 -214
- package/dest/interfaces/slasher.d.ts +9 -1
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +2 -0
- package/dest/interfaces/tx_provider.d.ts +3 -3
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +117 -15
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +6 -3
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +16 -6
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +16 -8
- package/dest/kernel/hints/key_validation_hint.d.ts +2 -1
- package/dest/kernel/hints/key_validation_hint.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +2 -1
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +6 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +13 -1
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request.d.ts +7 -1
- package/dest/kernel/hints/read_request.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.d.ts +7 -1
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.d.ts +23 -1
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.d.ts +25 -1
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_request.d.ts +16 -1
- package/dest/kernel/private_call_request.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +74 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +31 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.d.ts +7 -1
- package/dest/kernel/private_kernel_data.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +22 -1
- 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 +7 -1
- package/dest/kernel/private_kernel_inner_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts +4 -1
- package/dest/kernel/private_kernel_reset_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- 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 +23 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +17 -1
- 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 +16 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.d.ts +10 -1
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/public_call_request.d.ts +22 -1
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/utils/optional_number.d.ts +7 -1
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/derivation.d.ts +3 -3
- package/dest/keys/derivation.js +8 -8
- package/dest/keys/key_types.d.ts +1 -1
- package/dest/keys/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/utils.d.ts +1 -1
- package/dest/keys/utils.d.ts.map +1 -1
- package/dest/keys/utils.js +7 -3
- package/dest/l1-contracts/slash_factory.d.ts +1 -1
- package/dest/l1-contracts/slash_factory.d.ts.map +1 -1
- package/dest/l1-contracts/slash_factory.js +1 -0
- package/dest/logs/extended_contract_class_log.d.ts +3 -1
- package/dest/logs/extended_contract_class_log.d.ts.map +1 -1
- package/dest/logs/extended_public_log.d.ts +17 -9
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +21 -14
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +20 -17
- package/dest/logs/siloed_tag.d.ts +1 -1
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +4 -3
- package/dest/messaging/inbox_leaf.d.ts +3 -1
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/l1_actor.d.ts +7 -1
- package/dest/messaging/l1_actor.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts +6 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l2_actor.d.ts +7 -1
- package/dest/messaging/l2_actor.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +3 -3
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +8 -6
- package/dest/messaging/out_hash.d.ts +41 -4
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +52 -26
- package/dest/note/note_dao.d.ts +36 -5
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +15 -12
- package/dest/p2p/block_proposal.d.ts +23 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +25 -7
- package/dest/p2p/checkpoint_attestation.d.ts +5 -1
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts +27 -7
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +26 -5
- package/dest/p2p/consensus_payload.d.ts +4 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +0 -3
- package/dest/p2p/constants.d.ts +5 -0
- package/dest/p2p/constants.d.ts.map +1 -0
- package/dest/p2p/constants.js +3 -0
- package/dest/p2p/index.d.ts +2 -1
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- package/dest/p2p/message_validator.d.ts +18 -3
- package/dest/p2p/message_validator.d.ts.map +1 -1
- package/dest/p2p/message_validator.js +2 -1
- package/dest/p2p/signed_txs.d.ts +3 -1
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +6 -1
- package/dest/p2p/topic_type.js +2 -1
- package/dest/parity/parity_base_private_inputs.d.ts +3 -1
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.d.ts +4 -1
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_root_private_inputs.d.ts +2 -1
- 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/chonk_proof.js +9 -4
- package/dest/proofs/proof.d.ts +4 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/recursive_proof.d.ts +10 -1
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +34 -1
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.d.ts +12 -1
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +1 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +44 -3
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +2 -2
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +64 -1
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.d.ts +10 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +29 -2
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +21 -5
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +45 -10
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +11 -7
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +44 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +13 -2
- package/dest/rollup/epoch_constant_data.d.ts +16 -1
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +6 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +17 -7
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +7 -4
- package/dest/rollup/tree_snapshot_diff_hints.d.ts +24 -1
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +4 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +29 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +1 -1
- package/dest/slashing/empire.d.ts +1 -1
- package/dest/slashing/empire.d.ts.map +1 -1
- package/dest/slashing/empire.js +2 -0
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +6 -0
- package/dest/slashing/tally.d.ts +2 -1
- package/dest/slashing/tally.d.ts.map +1 -1
- package/dest/slashing/tally.js +6 -2
- package/dest/slashing/types.d.ts +7 -3
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +13 -1
- package/dest/stats/stats.d.ts +1 -3
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +2 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +8 -17
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +20 -14
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +45 -27
- package/dest/timetable/index.d.ts +37 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +39 -0
- package/dest/trees/append_only_tree_snapshot.d.ts +13 -1
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.d.ts +13 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.d.ts +10 -1
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.d.ts +17 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +7 -6
- package/dest/trees/public_data_witness.d.ts +11 -1
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +14 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +5 -1
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +4 -1
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/execution_payload.d.ts +9 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/function_data.d.ts +4 -2
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +9 -1
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/hashed_values.d.ts +7 -1
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/in_tx.d.ts +4 -4
- package/dest/tx/indexed_tx_effect.d.ts +5 -5
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +3 -2
- package/dest/tx/partial_state_reference.d.ts +4 -1
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +23 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +1 -1
- package/dest/tx/private_tx_constant_data.d.ts +16 -1
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +149 -26
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +44 -7
- package/dest/tx/protocol_contracts.d.ts +1 -1
- package/dest/tx/public_call_request_with_calldata.d.ts +7 -1
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/state_reference.d.ts +3 -1
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +6 -3
- package/dest/tx/tx_context.d.ts +2 -1
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_effect.d.ts +32 -6
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +0 -7
- package/dest/tx/tx_execution_request.d.ts +30 -1
- package/dest/tx/tx_execution_request.d.ts.map +1 -1
- package/dest/tx/tx_hash.d.ts +2 -1
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +47 -13
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +46 -15
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/validator/empty_validator.d.ts +2 -2
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +2 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +2 -0
- package/dest/tx/validator/tx_validator.d.ts +2 -2
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/types/shared.d.ts +4 -1
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/validators/schemas.d.ts +8 -8
- package/dest/vks/verification_key.d.ts +22 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/vk_data.d.ts +7 -1
- package/dest/vks/vk_data.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +3 -4
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +9 -9
- package/package.json +27 -13
- package/src/abi/function_call.ts +25 -3
- package/src/abi/utils.ts +17 -0
- package/src/block/block_hash.ts +26 -25
- package/src/block/block_parameter.ts +4 -2
- package/src/block/body.ts +2 -1
- package/src/block/checkpointed_l2_block.ts +8 -58
- package/src/block/in_block.ts +6 -6
- package/src/block/index.ts +0 -2
- package/src/block/l2_block.ts +102 -150
- package/src/block/l2_block_source.ts +71 -42
- package/src/block/l2_block_stream/interfaces.ts +8 -5
- package/src/block/l2_block_stream/l2_block_stream.ts +45 -37
- package/src/block/l2_block_stream/l2_tips_store_base.ts +2 -2
- package/src/block/test/l2_tips_store_test_suite.ts +4 -9
- package/src/block/validate_block_result.ts +5 -4
- package/src/checkpoint/checkpoint.ts +33 -11
- package/src/checkpoint/published_checkpoint.ts +4 -3
- package/src/config/index.ts +1 -0
- package/src/config/node-rpc-config.ts +1 -1
- package/src/config/sequencer-config.ts +19 -0
- package/src/contract/contract_address.ts +1 -1
- package/src/contract/contract_class_id.ts +1 -1
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/node-info.ts +3 -0
- package/src/contract/private_function.ts +2 -3
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/database-version/database_version.ts +87 -0
- package/src/database-version/version_manager.ts +1 -77
- package/src/delayed_public_mutable/delayed_public_mutable_values.ts +9 -10
- package/src/deserialization/index.ts +21 -0
- package/src/epoch-helpers/index.ts +13 -1
- package/src/hash/hash.ts +2 -2
- package/src/hash/map_slot.ts +3 -2
- package/src/interfaces/api_limit.ts +1 -0
- package/src/interfaces/archiver.ts +18 -24
- package/src/interfaces/aztec-node-admin.ts +3 -2
- package/src/interfaces/aztec-node.ts +85 -134
- package/src/interfaces/block-builder.ts +40 -23
- package/src/interfaces/configs.ts +1 -3
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/p2p.ts +1 -1
- package/src/interfaces/prover-broker.ts +22 -0
- package/src/interfaces/prover-client.ts +22 -0
- package/src/interfaces/slasher.ts +4 -0
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +19 -12
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +17 -6
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- package/src/keys/derivation.ts +8 -8
- package/src/keys/key_types.ts +1 -1
- package/src/keys/utils.ts +7 -3
- package/src/l1-contracts/slash_factory.ts +1 -0
- package/src/logs/log_id.ts +22 -18
- package/src/logs/siloed_tag.ts +3 -2
- package/src/messaging/l2_to_l1_membership.ts +8 -6
- package/src/messaging/out_hash.ts +60 -29
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/block_proposal.ts +36 -13
- package/src/p2p/checkpoint_proposal.ts +39 -11
- package/src/p2p/consensus_payload.ts +0 -5
- package/src/p2p/constants.ts +6 -0
- package/src/p2p/index.ts +1 -0
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signed_txs.ts +6 -1
- package/src/p2p/topic_type.ts +1 -1
- package/src/proofs/chonk_proof.ts +9 -5
- package/src/rollup/block_headers_hash.ts +1 -1
- package/src/rollup/block_rollup_public_inputs.ts +2 -2
- package/src/rollup/checkpoint_header.ts +20 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +16 -10
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +11 -8
- package/src/slashing/empire.ts +3 -1
- package/src/slashing/helpers.ts +8 -0
- package/src/slashing/tally.ts +8 -2
- package/src/slashing/types.ts +14 -0
- package/src/stats/stats.ts +0 -2
- package/src/tests/factories.ts +11 -31
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +62 -42
- package/src/timetable/index.ts +66 -0
- package/src/trees/public_data_leaf.ts +11 -5
- package/src/tx/block_header.ts +11 -3
- package/src/tx/indexed_tx_effect.ts +3 -2
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/profiling.ts +46 -4
- package/src/tx/tx.ts +8 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_receipt.ts +75 -18
- package/src/tx/validator/empty_validator.ts +1 -1
- package/src/tx/validator/error_texts.ts +3 -0
- package/src/tx/validator/tx_validator.ts +1 -1
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block_code_to_purge.d.ts +0 -11
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -55
- package/dest/block/l2_block_header.d.ts +0 -94
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -160
- package/dest/block/l2_block_new.d.ts +0 -134
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -155
- package/dest/contract/contract_class_metadata.d.ts +0 -8
- package/dest/contract/contract_class_metadata.d.ts.map +0 -1
- package/dest/contract/contract_class_metadata.js +0 -1
- package/dest/contract/contract_metadata.d.ts +0 -7
- package/dest/contract/contract_metadata.d.ts.map +0 -1
- package/dest/contract/contract_metadata.js +0 -1
- package/dest/database-version/index.d.ts +0 -2
- package/dest/database-version/index.d.ts.map +0 -1
- package/dest/database-version/index.js +0 -1
- package/src/block/l2_block_code_to_purge.ts +0 -80
- package/src/block/l2_block_header.ts +0 -255
- package/src/block/l2_block_new.ts +0 -211
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/database-version/index.ts +0 -1
package/src/abi/function_call.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
3
|
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
4
6
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
|
-
import {
|
|
7
|
+
import { schemas } from '../schemas/index.js';
|
|
8
|
+
import { type AbiType, AbiTypeSchema, FunctionType } from './abi.js';
|
|
6
9
|
import { FunctionSelector } from './function_selector.js';
|
|
7
10
|
|
|
8
11
|
/** A request to call a function on a contract. */
|
|
@@ -43,12 +46,31 @@ export class FunctionCall {
|
|
|
43
46
|
return new FunctionCall(...FunctionCall.getFields(fields));
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
static get schema() {
|
|
50
|
+
return z
|
|
51
|
+
.object({
|
|
52
|
+
name: z.string(),
|
|
53
|
+
to: schemas.AztecAddress,
|
|
54
|
+
selector: schemas.FunctionSelector,
|
|
55
|
+
type: z.nativeEnum(FunctionType),
|
|
56
|
+
isStatic: z.boolean(),
|
|
57
|
+
hideMsgSender: z.boolean(),
|
|
58
|
+
args: z.array(schemas.Fr),
|
|
59
|
+
returnTypes: z.array(AbiTypeSchema),
|
|
60
|
+
})
|
|
61
|
+
.transform(FunctionCall.from);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public isPublicStatic(): boolean {
|
|
65
|
+
return this.type === FunctionType.PUBLIC && this.isStatic;
|
|
66
|
+
}
|
|
67
|
+
|
|
46
68
|
/**
|
|
47
69
|
* Creates an empty function call.
|
|
48
70
|
* @returns an empty function call.
|
|
49
71
|
*/
|
|
50
72
|
public static empty() {
|
|
51
|
-
return {
|
|
73
|
+
return FunctionCall.from({
|
|
52
74
|
name: '',
|
|
53
75
|
to: AztecAddress.ZERO,
|
|
54
76
|
selector: FunctionSelector.empty(),
|
|
@@ -57,6 +79,6 @@ export class FunctionCall {
|
|
|
57
79
|
isStatic: false,
|
|
58
80
|
args: [],
|
|
59
81
|
returnTypes: [],
|
|
60
|
-
};
|
|
82
|
+
});
|
|
61
83
|
}
|
|
62
84
|
}
|
package/src/abi/utils.ts
CHANGED
|
@@ -49,6 +49,23 @@ export function isWrappedFieldStruct(abiType: AbiType) {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Returns whether the ABI type is a PublicKeys struct from Aztec.nr.
|
|
54
|
+
* @param abiType - Type to check.
|
|
55
|
+
* @returns A boolean indicating whether the ABI type is a PublicKeys struct.
|
|
56
|
+
*/
|
|
57
|
+
export function isPublicKeysStruct(abiType: AbiType) {
|
|
58
|
+
return (
|
|
59
|
+
abiType.kind === 'struct' &&
|
|
60
|
+
abiType.path === 'aztec::protocol_types::public_keys::PublicKeys' &&
|
|
61
|
+
abiType.fields.length === 4 &&
|
|
62
|
+
abiType.fields[0].name === 'npk_m' &&
|
|
63
|
+
abiType.fields[1].name === 'ivpk_m' &&
|
|
64
|
+
abiType.fields[2].name === 'ovpk_m' &&
|
|
65
|
+
abiType.fields[3].name === 'tpk_m'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
52
69
|
/**
|
|
53
70
|
* Returns whether the ABI type is a BoundedVec struct from Noir's std::collections::bounded_vec.
|
|
54
71
|
* @param abiType - Type to check.
|
package/src/block/block_hash.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import {
|
|
2
|
+
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
4
3
|
|
|
5
|
-
import {
|
|
4
|
+
import { inspect } from 'util';
|
|
5
|
+
|
|
6
|
+
import { hexSchemaFor } from '../schemas/schemas.js';
|
|
7
|
+
|
|
8
|
+
const BLOCK_HASH_BRAND = Symbol.for('aztec.BlockHash');
|
|
6
9
|
|
|
7
10
|
/** Hash of an L2 block. */
|
|
8
|
-
export class
|
|
9
|
-
|
|
10
|
-
/** The buffer containing the hash. */
|
|
11
|
-
hash: Buffer,
|
|
12
|
-
) {
|
|
13
|
-
super(hash);
|
|
14
|
-
}
|
|
11
|
+
export class BlockHash extends Fr {
|
|
12
|
+
readonly [BLOCK_HASH_BRAND] = true as const;
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
constructor(hash: Fr) {
|
|
15
|
+
super(hash);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
return
|
|
18
|
+
override [inspect.custom]() {
|
|
19
|
+
return `BlockHash<${this.toString()}>`;
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return new L2BlockHash(reader.readBytes(L2BlockHash.SIZE));
|
|
22
|
+
toFr(): Fr {
|
|
23
|
+
return new Fr(this.toBigInt());
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Type guard that checks if a value is a BlockHash instance.
|
|
28
|
+
* Uses Symbol.for to ensure cross-module compatibility.
|
|
29
|
+
*/
|
|
30
|
+
static isBlockHash(value: unknown): value is BlockHash {
|
|
31
|
+
return typeof value === 'object' && value !== null && BLOCK_HASH_BRAND in value;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
static
|
|
34
|
-
return
|
|
34
|
+
static override random() {
|
|
35
|
+
return new BlockHash(Fr.random());
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
static
|
|
38
|
-
return new
|
|
38
|
+
static override fromString(str: string): BlockHash {
|
|
39
|
+
return new BlockHash(Fr.fromString(str));
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
static override
|
|
42
|
-
return
|
|
42
|
+
static override get schema() {
|
|
43
|
+
return hexSchemaFor(BlockHash) as ZodFor<BlockHash>;
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -2,7 +2,9 @@ import { BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { BlockHash } from './block_hash.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export const BlockParameterSchema = z.union([BlockHash.schema, BlockNumberSchema, z.literal('latest')]);
|
|
8
|
+
|
|
9
|
+
/** Block parameter - either a specific BlockNumber, block hash (BlockHash), or 'latest' */
|
|
8
10
|
export type BlockParameter = z.infer<typeof BlockParameterSchema>;
|
package/src/block/body.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
5
5
|
import { inspect } from 'util';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
+
import { MAX_TX_EFFECTS_PER_BODY } from '../deserialization/index.js';
|
|
8
9
|
import type { ZodFor } from '../schemas/index.js';
|
|
9
10
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
10
11
|
|
|
@@ -40,7 +41,7 @@ export class Body {
|
|
|
40
41
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
41
42
|
const reader = BufferReader.asReader(buf);
|
|
42
43
|
|
|
43
|
-
return new this(reader.readVector(TxEffect));
|
|
44
|
+
return new this(reader.readVector(TxEffect, MAX_TX_EFFECTS_PER_BODY));
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -5,9 +5,9 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
5
5
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
-
import { L1PublishedData
|
|
8
|
+
import { L1PublishedData } from '../checkpoint/published_checkpoint.js';
|
|
9
|
+
import { MAX_BLOCK_HASH_STRING_LENGTH, MAX_COMMITTEE_SIZE } from '../deserialization/index.js';
|
|
9
10
|
import { L2Block } from './l2_block.js';
|
|
10
|
-
import { L2BlockNew } from './l2_block_new.js';
|
|
11
11
|
import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -16,7 +16,7 @@ import { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
|
16
16
|
export class CheckpointedL2Block {
|
|
17
17
|
constructor(
|
|
18
18
|
public checkpointNumber: CheckpointNumber,
|
|
19
|
-
public block:
|
|
19
|
+
public block: L2Block,
|
|
20
20
|
public l1: L1PublishedData,
|
|
21
21
|
public attestations: CommitteeAttestation[],
|
|
22
22
|
) {}
|
|
@@ -24,7 +24,7 @@ export class CheckpointedL2Block {
|
|
|
24
24
|
return z
|
|
25
25
|
.object({
|
|
26
26
|
checkpointNumber: CheckpointNumberSchema,
|
|
27
|
-
block:
|
|
27
|
+
block: L2Block.schema,
|
|
28
28
|
l1: L1PublishedData.schema,
|
|
29
29
|
attestations: z.array(CommitteeAttestation.schema),
|
|
30
30
|
})
|
|
@@ -34,11 +34,11 @@ export class CheckpointedL2Block {
|
|
|
34
34
|
static fromBuffer(bufferOrReader: Buffer | BufferReader): CheckpointedL2Block {
|
|
35
35
|
const reader = BufferReader.asReader(bufferOrReader);
|
|
36
36
|
const checkpointNumber = reader.readNumber();
|
|
37
|
-
const block = reader.readObject(
|
|
37
|
+
const block = reader.readObject(L2Block);
|
|
38
38
|
const l1BlockNumber = reader.readBigInt();
|
|
39
|
-
const l1BlockHash = reader.readString();
|
|
39
|
+
const l1BlockHash = reader.readString(MAX_BLOCK_HASH_STRING_LENGTH);
|
|
40
40
|
const l1Timestamp = reader.readBigInt();
|
|
41
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
41
|
+
const attestations = reader.readVector(CommitteeAttestation, MAX_COMMITTEE_SIZE);
|
|
42
42
|
return new CheckpointedL2Block(
|
|
43
43
|
CheckpointNumber(checkpointNumber),
|
|
44
44
|
block,
|
|
@@ -58,6 +58,7 @@ export class CheckpointedL2Block {
|
|
|
58
58
|
|
|
59
59
|
public toBuffer(): Buffer {
|
|
60
60
|
return serializeToBuffer(
|
|
61
|
+
this.checkpointNumber,
|
|
61
62
|
this.block,
|
|
62
63
|
this.l1.blockNumber,
|
|
63
64
|
this.l1.blockHash,
|
|
@@ -67,54 +68,3 @@ export class CheckpointedL2Block {
|
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
|
|
71
|
-
export class PublishedL2Block {
|
|
72
|
-
constructor(
|
|
73
|
-
public block: L2Block,
|
|
74
|
-
public l1: L1PublishedData,
|
|
75
|
-
public attestations: CommitteeAttestation[],
|
|
76
|
-
) {}
|
|
77
|
-
|
|
78
|
-
static get schema() {
|
|
79
|
-
return z
|
|
80
|
-
.object({
|
|
81
|
-
block: L2Block.schema,
|
|
82
|
-
l1: L1PublishedData.schema,
|
|
83
|
-
attestations: z.array(CommitteeAttestation.schema),
|
|
84
|
-
})
|
|
85
|
-
.transform(obj => PublishedL2Block.fromFields(obj));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
static fromBuffer(bufferOrReader: Buffer | BufferReader): PublishedL2Block {
|
|
89
|
-
const reader = BufferReader.asReader(bufferOrReader);
|
|
90
|
-
const block = reader.readObject(L2Block);
|
|
91
|
-
const l1BlockNumber = reader.readBigInt();
|
|
92
|
-
const l1BlockHash = reader.readString();
|
|
93
|
-
const l1Timestamp = reader.readBigInt();
|
|
94
|
-
const attestations = reader.readVector(CommitteeAttestation);
|
|
95
|
-
return new PublishedL2Block(block, new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash), attestations);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
static fromFields(fields: FieldsOf<PublishedL2Block>) {
|
|
99
|
-
return new PublishedL2Block(fields.block, fields.l1, fields.attestations);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
public toBuffer(): Buffer {
|
|
103
|
-
return serializeToBuffer(
|
|
104
|
-
this.block,
|
|
105
|
-
this.l1.blockNumber,
|
|
106
|
-
this.l1.blockHash,
|
|
107
|
-
this.l1.timestamp,
|
|
108
|
-
this.attestations.length,
|
|
109
|
-
this.attestations,
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public toPublishedCheckpoint() {
|
|
114
|
-
return new PublishedCheckpoint(this.block.toCheckpoint(), this.l1, this.attestations);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
static fromPublishedCheckpoint(checkpoint: PublishedCheckpoint) {
|
|
118
|
-
return new PublishedL2Block(L2Block.fromCheckpoint(checkpoint.checkpoint), checkpoint.l1, checkpoint.attestations);
|
|
119
|
-
}
|
|
120
|
-
}
|
package/src/block/in_block.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types'
|
|
|
2
2
|
|
|
3
3
|
import { type ZodTypeAny, z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { BlockHash } from './block_hash.js';
|
|
6
6
|
import type { L2Block } from './l2_block.js';
|
|
7
7
|
|
|
8
8
|
export type InBlock = {
|
|
9
9
|
l2BlockNumber: BlockNumber;
|
|
10
|
-
l2BlockHash:
|
|
10
|
+
l2BlockHash: BlockHash;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// Note: If you expand this type with indexInBlock, then delete `IndexedTxEffect` and use this type instead.
|
|
@@ -17,8 +17,8 @@ export type DataInBlock<T> = {
|
|
|
17
17
|
|
|
18
18
|
export function randomInBlock(): InBlock {
|
|
19
19
|
return {
|
|
20
|
-
l2BlockNumber: BlockNumber(Math.floor(Math.random() * 1000)),
|
|
21
|
-
l2BlockHash:
|
|
20
|
+
l2BlockNumber: BlockNumber(Math.floor(Math.random() * 1000) + 1),
|
|
21
|
+
l2BlockHash: BlockHash.random(),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -33,14 +33,14 @@ export async function wrapDataInBlock<T>(data: T, block: L2Block): Promise<DataI
|
|
|
33
33
|
return {
|
|
34
34
|
data,
|
|
35
35
|
l2BlockNumber: block.number,
|
|
36
|
-
l2BlockHash:
|
|
36
|
+
l2BlockHash: await block.hash(),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function inBlockSchema() {
|
|
41
41
|
return z.object({
|
|
42
42
|
l2BlockNumber: BlockNumberSchema,
|
|
43
|
-
l2BlockHash:
|
|
43
|
+
l2BlockHash: BlockHash.schema,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
|
package/src/block/index.ts
CHANGED
package/src/block/l2_block.ts
CHANGED
|
@@ -1,44 +1,66 @@
|
|
|
1
|
-
import { type BlockBlobData, encodeBlockBlobData
|
|
2
|
-
import {
|
|
1
|
+
import { type BlockBlobData, encodeBlockBlobData } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import {
|
|
3
|
+
BlockNumber,
|
|
4
|
+
CheckpointNumber,
|
|
5
|
+
CheckpointNumberSchema,
|
|
6
|
+
IndexWithinCheckpoint,
|
|
7
|
+
IndexWithinCheckpointSchema,
|
|
8
|
+
SlotNumber,
|
|
9
|
+
} from '@aztec/foundation/branded-types';
|
|
3
10
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
11
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
12
|
|
|
7
13
|
import { z } from 'zod';
|
|
8
14
|
|
|
9
|
-
import {
|
|
15
|
+
import type { PrivateLog } from '../logs/private_log.js';
|
|
10
16
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
|
-
import
|
|
17
|
+
import { BlockHeader } from '../tx/block_header.js';
|
|
18
|
+
import type { BlockHash } from './block_hash.js';
|
|
12
19
|
import { Body } from './body.js';
|
|
13
|
-
import { makeAppendOnlyTreeSnapshot, makeL2BlockHeader } from './l2_block_code_to_purge.js';
|
|
14
|
-
import { L2BlockHeader } from './l2_block_header.js';
|
|
15
20
|
import type { L2BlockInfo } from './l2_block_info.js';
|
|
16
|
-
import { L2BlockNew } from './l2_block_new.js';
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @deprecated Use `L2BlockNew` instead.
|
|
23
|
+
* An L2 block with a header and a body.
|
|
22
24
|
*/
|
|
23
25
|
export class L2Block {
|
|
24
26
|
constructor(
|
|
25
27
|
/** Snapshot of archive tree after the block is applied. */
|
|
26
28
|
public archive: AppendOnlyTreeSnapshot,
|
|
27
|
-
/**
|
|
28
|
-
public header:
|
|
29
|
+
/** Header of the block. */
|
|
30
|
+
public header: BlockHeader,
|
|
29
31
|
/** L2 block body. */
|
|
30
32
|
public body: Body,
|
|
31
|
-
|
|
33
|
+
/** Number of the checkpoint that the block belongs to. */
|
|
34
|
+
public checkpointNumber: CheckpointNumber,
|
|
35
|
+
/** Index of the block within the checkpoint. */
|
|
36
|
+
public indexWithinCheckpoint: IndexWithinCheckpoint,
|
|
32
37
|
) {}
|
|
33
38
|
|
|
39
|
+
get number(): BlockNumber {
|
|
40
|
+
return this.header.globalVariables.blockNumber;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get slot(): SlotNumber {
|
|
44
|
+
return this.header.globalVariables.slotNumber;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get timestamp(): bigint {
|
|
48
|
+
return this.header.globalVariables.timestamp;
|
|
49
|
+
}
|
|
50
|
+
|
|
34
51
|
static get schema() {
|
|
35
52
|
return z
|
|
36
53
|
.object({
|
|
37
54
|
archive: AppendOnlyTreeSnapshot.schema,
|
|
38
|
-
header:
|
|
55
|
+
header: BlockHeader.schema,
|
|
39
56
|
body: Body.schema,
|
|
57
|
+
checkpointNumber: CheckpointNumberSchema,
|
|
58
|
+
indexWithinCheckpoint: IndexWithinCheckpointSchema,
|
|
40
59
|
})
|
|
41
|
-
.transform(
|
|
60
|
+
.transform(
|
|
61
|
+
({ archive, header, body, checkpointNumber, indexWithinCheckpoint }) =>
|
|
62
|
+
new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint),
|
|
63
|
+
);
|
|
42
64
|
}
|
|
43
65
|
|
|
44
66
|
/**
|
|
@@ -47,11 +69,13 @@ export class L2Block {
|
|
|
47
69
|
*/
|
|
48
70
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
49
71
|
const reader = BufferReader.asReader(buf);
|
|
50
|
-
const header = reader.readObject(
|
|
72
|
+
const header = reader.readObject(BlockHeader);
|
|
51
73
|
const archive = reader.readObject(AppendOnlyTreeSnapshot);
|
|
52
74
|
const body = reader.readObject(Body);
|
|
75
|
+
const checkpointNumber = CheckpointNumber(reader.readNumber());
|
|
76
|
+
const indexWithinCheckpoint = IndexWithinCheckpoint(reader.readNumber());
|
|
53
77
|
|
|
54
|
-
return new L2Block(archive, header, body);
|
|
78
|
+
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
55
79
|
}
|
|
56
80
|
|
|
57
81
|
/**
|
|
@@ -59,152 +83,39 @@ export class L2Block {
|
|
|
59
83
|
* @returns A serialized L2 block as a Buffer.
|
|
60
84
|
*/
|
|
61
85
|
toBuffer() {
|
|
62
|
-
return serializeToBuffer(this.header, this.archive, this.body);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Deserializes L2 block from a buffer.
|
|
67
|
-
* @param str - A serialized L2 block.
|
|
68
|
-
* @returns Deserialized L2 block.
|
|
69
|
-
*/
|
|
70
|
-
static fromString(str: string): L2Block {
|
|
71
|
-
return L2Block.fromBuffer(hexToBuffer(str));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Serializes a block to a string.
|
|
76
|
-
* @returns A serialized L2 block as a string.
|
|
77
|
-
*/
|
|
78
|
-
toString(): string {
|
|
79
|
-
return bufferToHex(this.toBuffer());
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates an L2 block containing random data.
|
|
84
|
-
* @param l2BlockNum - The number of the L2 block.
|
|
85
|
-
* @param txsPerBlock - The number of transactions to include in the block.
|
|
86
|
-
* @param numPublicCallsPerTx - The number of public function calls to include in each transaction.
|
|
87
|
-
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
88
|
-
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
89
|
-
* @returns The L2 block.
|
|
90
|
-
*/
|
|
91
|
-
static async random(
|
|
92
|
-
l2BlockNum: BlockNumber,
|
|
93
|
-
txsPerBlock = 4,
|
|
94
|
-
numPublicCallsPerTx = 3,
|
|
95
|
-
numPublicLogsPerCall = 1,
|
|
96
|
-
inHash: Fr | undefined = undefined,
|
|
97
|
-
slotNumber: number | undefined = undefined,
|
|
98
|
-
maxEffects: number | undefined = undefined,
|
|
99
|
-
): Promise<L2Block> {
|
|
100
|
-
const body = await Body.random({ txsPerBlock, numPublicCallsPerTx, numPublicLogsPerCall, maxEffects });
|
|
101
|
-
|
|
102
|
-
return new L2Block(
|
|
103
|
-
makeAppendOnlyTreeSnapshot(l2BlockNum + 1),
|
|
104
|
-
makeL2BlockHeader(0, l2BlockNum, slotNumber ?? l2BlockNum, { inHash }),
|
|
105
|
-
body,
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Creates an L2 block containing empty data.
|
|
111
|
-
* @returns The L2 block.
|
|
112
|
-
*/
|
|
113
|
-
static empty(): L2Block {
|
|
114
|
-
return new L2Block(AppendOnlyTreeSnapshot.empty(), L2BlockHeader.empty(), Body.empty());
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
get number(): BlockNumber {
|
|
118
|
-
return this.header.getBlockNumber();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
get slot(): SlotNumber {
|
|
122
|
-
return this.header.getSlot();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
get timestamp(): bigint {
|
|
126
|
-
return this.header.globalVariables.timestamp;
|
|
86
|
+
return serializeToBuffer(this.header, this.archive, this.body, this.checkpointNumber, this.indexWithinCheckpoint);
|
|
127
87
|
}
|
|
128
88
|
|
|
129
89
|
/**
|
|
130
90
|
* Returns the block's hash (hash of block header).
|
|
131
91
|
* @returns The block's hash.
|
|
132
92
|
*/
|
|
133
|
-
public
|
|
134
|
-
|
|
135
|
-
this.blockHash = await this.getBlockHeader().hash();
|
|
136
|
-
}
|
|
137
|
-
return this.blockHash;
|
|
93
|
+
public hash(): Promise<BlockHash> {
|
|
94
|
+
return this.header.hash();
|
|
138
95
|
}
|
|
139
96
|
|
|
140
97
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
98
|
+
* Checks if this block equals another block.
|
|
99
|
+
* @param other - The other block to compare with.
|
|
100
|
+
* @returns True if both blocks are equal.
|
|
144
101
|
*/
|
|
145
|
-
public
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public toL2Block(args: { checkpointNumber?: CheckpointNumber; indexWithinCheckpoint?: number } = {}): L2BlockNew {
|
|
155
|
-
return new L2BlockNew(
|
|
156
|
-
this.archive,
|
|
157
|
-
this.getBlockHeader(),
|
|
158
|
-
this.body,
|
|
159
|
-
args?.checkpointNumber ?? CheckpointNumber.fromBlockNumber(this.number),
|
|
160
|
-
args?.indexWithinCheckpoint ?? 0,
|
|
102
|
+
public equals(other: this): boolean {
|
|
103
|
+
return (
|
|
104
|
+
this.archive.equals(other.archive) &&
|
|
105
|
+
this.header.equals(other.header) &&
|
|
106
|
+
this.body.equals(other.body) &&
|
|
107
|
+
this.checkpointNumber === other.checkpointNumber &&
|
|
108
|
+
this.indexWithinCheckpoint === other.indexWithinCheckpoint
|
|
161
109
|
);
|
|
162
110
|
}
|
|
163
111
|
|
|
164
|
-
public toCheckpoint() {
|
|
165
|
-
return new Checkpoint(
|
|
166
|
-
this.archive,
|
|
167
|
-
this.getCheckpointHeader(),
|
|
168
|
-
[this.toL2Block()],
|
|
169
|
-
CheckpointNumber.fromBlockNumber(this.number),
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
static fromCheckpoint(checkpoint: Checkpoint) {
|
|
174
|
-
const checkpointHeader = checkpoint.header;
|
|
175
|
-
const block = checkpoint.blocks.at(-1)!;
|
|
176
|
-
const header = new L2BlockHeader(
|
|
177
|
-
new AppendOnlyTreeSnapshot(checkpointHeader.lastArchiveRoot, block.number),
|
|
178
|
-
checkpointHeader.blobsHash,
|
|
179
|
-
checkpointHeader.inHash,
|
|
180
|
-
block.header.state,
|
|
181
|
-
block.header.globalVariables,
|
|
182
|
-
block.header.totalFees,
|
|
183
|
-
checkpointHeader.totalManaUsed,
|
|
184
|
-
block.header.spongeBlobHash,
|
|
185
|
-
checkpointHeader.blockHeadersHash,
|
|
186
|
-
);
|
|
187
|
-
return new L2Block(checkpoint.archive, header, block.body);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* @deprecated
|
|
192
|
-
* This only works when there's one block per checkpoint.
|
|
193
|
-
* TODO(#17027): Remove this method from L2Block and create a dedicated Checkpoint class.
|
|
194
|
-
*/
|
|
195
|
-
public getCheckpointBlobFields() {
|
|
196
|
-
const blockBlobData = this.toBlockBlobData();
|
|
197
|
-
return encodeCheckpointBlobDataFromBlocks([blockBlobData]);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
112
|
public toBlobFields(): Fr[] {
|
|
201
113
|
const blockBlobData = this.toBlockBlobData();
|
|
202
114
|
return encodeBlockBlobData(blockBlobData);
|
|
203
115
|
}
|
|
204
116
|
|
|
205
117
|
public toBlockBlobData(): BlockBlobData {
|
|
206
|
-
|
|
207
|
-
const isFirstBlock = true;
|
|
118
|
+
const isFirstBlock = this.indexWithinCheckpoint === 0;
|
|
208
119
|
return {
|
|
209
120
|
blockEndMarker: {
|
|
210
121
|
numTxs: this.body.txEffects.length,
|
|
@@ -227,6 +138,48 @@ export class L2Block {
|
|
|
227
138
|
};
|
|
228
139
|
}
|
|
229
140
|
|
|
141
|
+
static empty(header?: BlockHeader) {
|
|
142
|
+
return new L2Block(
|
|
143
|
+
AppendOnlyTreeSnapshot.empty(),
|
|
144
|
+
header ?? BlockHeader.empty(),
|
|
145
|
+
Body.empty(),
|
|
146
|
+
CheckpointNumber(0),
|
|
147
|
+
IndexWithinCheckpoint(0),
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Creates an L2 block containing random data.
|
|
153
|
+
* @param l2BlockNum - The number of the L2 block.
|
|
154
|
+
* @param txsPerBlock - The number of transactions to include in the block.
|
|
155
|
+
* @param numPublicCallsPerTx - The number of public function calls to include in each transaction.
|
|
156
|
+
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
157
|
+
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
158
|
+
* @returns The L2 block.
|
|
159
|
+
*/
|
|
160
|
+
static async random(
|
|
161
|
+
blockNumber: BlockNumber,
|
|
162
|
+
{
|
|
163
|
+
checkpointNumber = CheckpointNumber(Number(blockNumber)),
|
|
164
|
+
indexWithinCheckpoint = IndexWithinCheckpoint(0),
|
|
165
|
+
txsPerBlock = 1,
|
|
166
|
+
txOptions = {},
|
|
167
|
+
makeTxOptions,
|
|
168
|
+
...blockHeaderOverrides
|
|
169
|
+
}: {
|
|
170
|
+
checkpointNumber?: CheckpointNumber;
|
|
171
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
172
|
+
txsPerBlock?: number;
|
|
173
|
+
txOptions?: Partial<Parameters<typeof Body.random>[0]>;
|
|
174
|
+
makeTxOptions?: (txIndex: number) => Partial<Parameters<typeof Body.random>[0]>;
|
|
175
|
+
} & Partial<Parameters<typeof BlockHeader.random>[0]> = {},
|
|
176
|
+
): Promise<L2Block> {
|
|
177
|
+
const archive = new AppendOnlyTreeSnapshot(Fr.random(), blockNumber + 1);
|
|
178
|
+
const header = BlockHeader.random({ blockNumber, ...blockHeaderOverrides });
|
|
179
|
+
const body = await Body.random({ txsPerBlock, makeTxOptions, ...txOptions });
|
|
180
|
+
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
181
|
+
}
|
|
182
|
+
|
|
230
183
|
/**
|
|
231
184
|
* Returns stats used for logging.
|
|
232
185
|
* @returns Stats on tx count, number, and log size and count.
|
|
@@ -254,9 +207,12 @@ export class L2Block {
|
|
|
254
207
|
};
|
|
255
208
|
}
|
|
256
209
|
|
|
210
|
+
getPrivateLogs(): PrivateLog[] {
|
|
211
|
+
return this.body.txEffects.map(txEffect => txEffect.privateLogs).flat();
|
|
212
|
+
}
|
|
213
|
+
|
|
257
214
|
toBlockInfo(): L2BlockInfo {
|
|
258
215
|
return {
|
|
259
|
-
blockHash: this.blockHash,
|
|
260
216
|
archive: this.archive.root,
|
|
261
217
|
lastArchive: this.header.lastArchive.root,
|
|
262
218
|
blockNumber: this.number,
|
|
@@ -265,8 +221,4 @@ export class L2Block {
|
|
|
265
221
|
timestamp: this.header.globalVariables.timestamp,
|
|
266
222
|
};
|
|
267
223
|
}
|
|
268
|
-
|
|
269
|
-
equals(other: L2Block) {
|
|
270
|
-
return this.archive.equals(other.archive) && this.header.equals(other.header) && this.body.equals(other.body);
|
|
271
|
-
}
|
|
272
224
|
}
|