@aztec/stdlib 0.0.1-commit.c7c42ec → 0.0.1-commit.d1f2d6c
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/contract_artifact.d.ts +2 -2
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +1 -1
- package/dest/abi/function_call.d.ts +9 -1
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/selector.js +3 -1
- 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_accumulated_data.js +5 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +9 -9
- package/dest/avm/avm_circuit_public_inputs.js +3 -1
- 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_update_request.js +3 -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/public_inner_call_request.js +3 -1
- package/dest/avm/revert_code.d.ts +4 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +3 -1
- package/dest/aztec-address/index.js +4 -2
- package/dest/block/attestation_info.d.ts +5 -5
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +4 -4
- package/dest/block/block_hash.d.ts +7 -1
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +12 -0
- 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 +5 -2
- 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/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 -57
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +64 -108
- package/dest/block/l2_block_source.d.ts +296 -67
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +25 -6
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +15 -5
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +8 -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 +106 -31
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +24 -16
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +55 -61
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +49 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.js +179 -0
- 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 +478 -38
- package/dest/block/validate_block_result.d.ts +24 -24
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -17
- package/dest/checkpoint/checkpoint.d.ts +30 -20
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +19 -6
- package/dest/checkpoint/checkpoint_info.d.ts +32 -3
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_info.js +34 -1
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/published_checkpoint.d.ts +17 -15
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +4 -3
- package/dest/config/node-rpc-config.js +1 -1
- package/dest/contract/complete_address.d.ts +4 -1
- package/dest/contract/complete_address.d.ts.map +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/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +1 -2
- package/dest/database-version/version_manager.d.ts +4 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +3 -1
- 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.js +1 -1
- package/dest/errors/proving_error.d.ts +2 -2
- package/dest/errors/proving_error.d.ts.map +1 -1
- package/dest/gas/gas.js +3 -1
- package/dest/gas/gas_fees.js +3 -1
- package/dest/interfaces/api_limit.d.ts +3 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +2 -0
- package/dest/interfaces/archiver.d.ts +6 -6
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +20 -16
- package/dest/interfaces/aztec-node-admin.d.ts +67 -31
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -2
- package/dest/interfaces/aztec-node.d.ts +70 -51
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +12 -9
- package/dest/interfaces/block-builder.d.ts +16 -14
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +12 -7
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/get_logs_response.d.ts +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 +7 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +3 -4
- package/dest/interfaces/prover-client.d.ts +10 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -1
- package/dest/interfaces/proving-job.d.ts +184 -184
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +1 -7
- package/dest/interfaces/server_circuit_prover.d.ts +4 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- 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 +108 -18
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +5 -3
- package/dest/kernel/claimed_length_array.js +3 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -5
- 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 +19 -10
- 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/hints/transient_data_squashing_hint.js +3 -1
- package/dest/kernel/log_hash.js +3 -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_log_data.js +5 -2
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +2 -2
- package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
- package/dest/kernel/private_to_public_accumulated_data.js +3 -1
- 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_accumulated_data.js +3 -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/private_validation_requests.js +3 -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/public_call_request.js +5 -2
- package/dest/kernel/utils/optional_number.d.ts +7 -1
- package/dest/kernel/utils/optional_number.d.ts.map +1 -1
- package/dest/keys/public_keys.d.ts +5 -1
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +3 -1
- 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 +5 -3
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/log_id.d.ts +5 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/private_log.js +3 -1
- package/dest/logs/public_log.js +3 -1
- package/dest/messaging/in_hash.d.ts +4 -2
- package/dest/messaging/in_hash.d.ts.map +1 -1
- package/dest/messaging/in_hash.js +3 -1
- 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 +88 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +160 -42
- package/dest/messaging/out_hash.d.ts +41 -3
- package/dest/messaging/out_hash.d.ts.map +1 -1
- package/dest/messaging/out_hash.js +54 -19
- 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/attestation_utils.d.ts +3 -3
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +1 -1
- package/dest/p2p/block_proposal.d.ts +93 -21
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +140 -39
- package/dest/p2p/checkpoint_attestation.d.ts +81 -0
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -0
- package/dest/p2p/{block_attestation.js → checkpoint_attestation.js} +22 -19
- package/dest/p2p/checkpoint_proposal.d.ts +160 -0
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -0
- package/dest/p2p/checkpoint_proposal.js +229 -0
- package/dest/p2p/consensus_payload.d.ts +9 -9
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -5
- package/dest/p2p/constants.d.ts +3 -0
- package/dest/p2p/constants.d.ts.map +1 -0
- package/dest/p2p/constants.js +2 -0
- package/dest/p2p/gossipable.d.ts +4 -3
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +16 -5
- package/dest/p2p/index.d.ts +5 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +4 -1
- 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/signature_utils.d.ts +5 -3
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +3 -1
- package/dest/p2p/signed_txs.d.ts +42 -0
- package/dest/p2p/signed_txs.d.ts.map +1 -0
- package/dest/p2p/signed_txs.js +75 -0
- package/dest/p2p/topic_type.d.ts +3 -2
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +10 -3
- 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 +47 -11
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -12
- 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_constant_data.js +3 -1
- package/dest/rollup/checkpoint_header.d.ts +42 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +49 -19
- 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 +41 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +10 -2
- 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 +18 -3
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +9 -3
- 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/tests/factories.d.ts +16 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +60 -25
- package/dest/tests/jest.js +1 -1
- package/dest/tests/mocks.d.ts +69 -18
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +119 -54
- 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/append_only_tree_snapshot.js +3 -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 +16 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- 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 +12 -1
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +6 -1
- package/dest/tx/call_context.d.ts +13 -1
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/call_context.js +3 -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_variable_builder.d.ts +2 -2
- package/dest/tx/global_variable_builder.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/global_variables.js +3 -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 +1 -1
- package/dest/tx/index.d.ts +1 -2
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- 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 -6
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +4 -21
- 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/public_call_request_with_calldata.js +3 -1
- package/dest/tx/state_reference.d.ts +3 -1
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -1
- package/dest/tx/tree_snapshots.js +3 -1
- package/dest/tx/tx.d.ts +24 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +9 -4
- 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 +3 -8
- 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_execution_request.js +6 -2
- 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 +44 -10
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +44 -13
- package/dest/tx/tx_request.d.ts +6 -1
- package/dest/tx/tx_request.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/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 +12 -10
- package/src/abi/contract_artifact.ts +10 -10
- package/src/abi/utils.ts +17 -0
- package/src/block/attestation_info.ts +9 -6
- package/src/block/block_hash.ts +22 -0
- 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/index.ts +0 -2
- package/src/block/l2_block.ts +101 -149
- package/src/block/l2_block_source.ts +121 -43
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +15 -4
- package/src/block/l2_block_stream/l2_block_stream.ts +130 -39
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +62 -56
- package/src/block/l2_block_stream/l2_tips_store_base.ts +226 -0
- package/src/block/test/l2_tips_store_test_suite.ts +480 -36
- package/src/block/validate_block_result.ts +40 -35
- package/src/checkpoint/checkpoint.ts +34 -11
- package/src/checkpoint/checkpoint_info.ts +45 -2
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +4 -3
- package/src/config/node-rpc-config.ts +1 -1
- package/src/contract/index.ts +0 -2
- package/src/contract/private_function.ts +1 -2
- 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 +1 -1
- package/src/interfaces/api_limit.ts +2 -0
- package/src/interfaces/archiver.ts +24 -23
- package/src/interfaces/aztec-node-admin.ts +5 -2
- package/src/interfaces/aztec-node.ts +100 -68
- package/src/interfaces/block-builder.ts +31 -24
- package/src/interfaces/configs.ts +3 -0
- package/src/interfaces/l2_logs_source.ts +17 -4
- package/src/interfaces/p2p.ts +8 -12
- package/src/interfaces/prover-client.ts +15 -0
- package/src/interfaces/proving-job.ts +2 -11
- package/src/interfaces/server_circuit_prover.ts +3 -2
- package/src/interfaces/tx_provider.ts +2 -2
- package/src/interfaces/validator.ts +63 -14
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +20 -12
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +17 -14
- package/src/messaging/in_hash.ts +3 -1
- package/src/messaging/l2_to_l1_membership.ts +178 -52
- package/src/messaging/out_hash.ts +62 -21
- package/src/note/note_dao.ts +18 -13
- package/src/p2p/attestation_utils.ts +3 -3
- package/src/p2p/block_proposal.ts +204 -44
- package/src/p2p/{block_attestation.ts → checkpoint_attestation.ts} +31 -25
- package/src/p2p/checkpoint_proposal.ts +348 -0
- package/src/p2p/consensus_payload.ts +5 -7
- package/src/p2p/constants.ts +3 -0
- package/src/p2p/gossipable.ts +14 -4
- package/src/p2p/index.ts +4 -1
- package/src/p2p/message_validator.ts +14 -2
- package/src/p2p/signature_utils.ts +3 -1
- package/src/p2p/signed_txs.ts +88 -0
- package/src/p2p/topic_type.ts +4 -3
- 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 +5 -11
- package/src/rollup/checkpoint_header.ts +63 -20
- package/src/rollup/checkpoint_rollup_public_inputs.ts +12 -0
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +14 -1
- package/src/rollup/root_rollup_public_inputs.ts +9 -0
- package/src/tests/factories.ts +56 -40
- package/src/tests/jest.ts +1 -1
- package/src/tests/mocks.ts +207 -87
- package/src/tx/block_header.ts +5 -0
- package/src/tx/global_variable_builder.ts +1 -1
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +1 -16
- package/src/tx/profiling.ts +46 -4
- package/src/tx/tx.ts +10 -9
- package/src/tx/tx_effect.ts +0 -9
- package/src/tx/tx_execution_request.ts +2 -0
- package/src/tx/tx_receipt.ts +72 -15
- package/src/tx/validator/error_texts.ts +3 -0
- package/src/zkpassport/index.ts +11 -12
- package/dest/block/l2_block_code_to_purge.d.ts +0 -12
- package/dest/block/l2_block_code_to_purge.d.ts.map +0 -1
- package/dest/block/l2_block_code_to_purge.js +0 -61
- package/dest/block/l2_block_header.d.ts +0 -98
- package/dest/block/l2_block_header.d.ts.map +0 -1
- package/dest/block/l2_block_header.js +0 -153
- package/dest/block/l2_block_new.d.ts +0 -135
- package/dest/block/l2_block_new.d.ts.map +0 -1
- package/dest/block/l2_block_new.js +0 -152
- 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/p2p/block_attestation.d.ts +0 -80
- package/dest/p2p/block_attestation.d.ts.map +0 -1
- package/dest/tx/content_commitment.d.ts +0 -49
- package/dest/tx/content_commitment.d.ts.map +0 -1
- package/dest/tx/content_commitment.js +0 -90
- package/src/block/l2_block_code_to_purge.ts +0 -88
- package/src/block/l2_block_header.ts +0 -246
- package/src/block/l2_block_new.ts +0 -207
- package/src/contract/contract_class_metadata.ts +0 -8
- package/src/contract/contract_metadata.ts +0 -7
- package/src/tx/content_commitment.ts +0 -113
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.d1f2d6c",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
7
7
|
"./package.local.json"
|
|
8
8
|
],
|
|
9
9
|
"exports": {
|
|
10
|
+
"./deserialization": "./dest/deserialization/index.js",
|
|
10
11
|
"./aztec-address": "./dest/aztec-address/index.js",
|
|
11
12
|
"./abi": "./dest/abi/index.js",
|
|
12
13
|
"./abi/function-selector": "./dest/abi/function_selector.js",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"tsconfig": "./tsconfig.json"
|
|
70
71
|
},
|
|
71
72
|
"scripts": {
|
|
72
|
-
"build": "yarn clean && yarn generate &&
|
|
73
|
+
"build": "yarn clean && yarn generate && ../scripts/tsc.sh",
|
|
73
74
|
"generate": "./scripts/copy-contracts.sh",
|
|
74
75
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
75
76
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
@@ -77,13 +78,14 @@
|
|
|
77
78
|
},
|
|
78
79
|
"dependencies": {
|
|
79
80
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
80
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
81
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
82
|
-
"@aztec/constants": "0.0.1-commit.
|
|
83
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
84
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
85
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
86
|
-
"@aztec/noir-noirc_abi": "0.0.1-commit.
|
|
81
|
+
"@aztec/bb.js": "0.0.1-commit.d1f2d6c",
|
|
82
|
+
"@aztec/blob-lib": "0.0.1-commit.d1f2d6c",
|
|
83
|
+
"@aztec/constants": "0.0.1-commit.d1f2d6c",
|
|
84
|
+
"@aztec/ethereum": "0.0.1-commit.d1f2d6c",
|
|
85
|
+
"@aztec/foundation": "0.0.1-commit.d1f2d6c",
|
|
86
|
+
"@aztec/l1-artifacts": "0.0.1-commit.d1f2d6c",
|
|
87
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.d1f2d6c",
|
|
88
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.d1f2d6c",
|
|
87
89
|
"@google-cloud/storage": "^7.15.0",
|
|
88
90
|
"axios": "^1.12.0",
|
|
89
91
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -108,7 +110,7 @@
|
|
|
108
110
|
"@types/lodash.times": "^4.3.9",
|
|
109
111
|
"@types/node": "^22.15.17",
|
|
110
112
|
"@types/pako": "^2.0.3",
|
|
111
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
113
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
112
114
|
"eslint": "^9.26.0",
|
|
113
115
|
"jest": "^30.0.0",
|
|
114
116
|
"jest-mock-extended": "^4.0.0",
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
2
|
|
|
3
|
+
import {
|
|
4
|
+
AZTEC_INITIALIZER_ATTRIBUTE,
|
|
5
|
+
AZTEC_ONLY_SELF_ATTRIBUTE,
|
|
6
|
+
AZTEC_PRIVATE_ATTRIBUTE,
|
|
7
|
+
AZTEC_PUBLIC_ATTRIBUTE,
|
|
8
|
+
AZTEC_UTILITY_ATTRIBUTE,
|
|
9
|
+
AZTEC_VIEW_ATTRIBUTE,
|
|
10
|
+
type NoirCompiledContract,
|
|
11
|
+
} from '../noir/index.js';
|
|
3
12
|
import {
|
|
4
13
|
type ABIParameter,
|
|
5
14
|
type ABIParameterVisibility,
|
|
@@ -14,16 +23,7 @@ import {
|
|
|
14
23
|
type IntegerValue,
|
|
15
24
|
type StructValue,
|
|
16
25
|
type TypedStructFieldValue,
|
|
17
|
-
} from '
|
|
18
|
-
import {
|
|
19
|
-
AZTEC_INITIALIZER_ATTRIBUTE,
|
|
20
|
-
AZTEC_ONLY_SELF_ATTRIBUTE,
|
|
21
|
-
AZTEC_PRIVATE_ATTRIBUTE,
|
|
22
|
-
AZTEC_PUBLIC_ATTRIBUTE,
|
|
23
|
-
AZTEC_UTILITY_ATTRIBUTE,
|
|
24
|
-
AZTEC_VIEW_ATTRIBUTE,
|
|
25
|
-
type NoirCompiledContract,
|
|
26
|
-
} from '../noir/index.js';
|
|
26
|
+
} from './abi.js';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Serializes a contract artifact to a buffer for storage.
|
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.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { recoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
|
|
4
|
+
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
4
5
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
5
6
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
6
|
-
import type { L2Block } from './l2_block.js';
|
|
7
7
|
import type { CommitteeAttestation } from './proposal/committee_attestation.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -29,14 +29,14 @@ export type AttestationInfo =
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Extracts attestation information from a published
|
|
32
|
+
* Extracts attestation information from a published checkpoint.
|
|
33
33
|
* Returns info for each attestation, preserving array indices.
|
|
34
34
|
*/
|
|
35
|
-
export function
|
|
35
|
+
export function getAttestationInfoFromPublishedCheckpoint(block: {
|
|
36
36
|
attestations: CommitteeAttestation[];
|
|
37
|
-
|
|
37
|
+
checkpoint: Checkpoint;
|
|
38
38
|
}): AttestationInfo[] {
|
|
39
|
-
const payload = ConsensusPayload.
|
|
39
|
+
const payload = ConsensusPayload.fromCheckpoint(block.checkpoint);
|
|
40
40
|
return getAttestationInfoFromPayload(payload, block.attestations);
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -44,7 +44,10 @@ export function getAttestationInfoFromPayload(
|
|
|
44
44
|
payload: ConsensusPayload,
|
|
45
45
|
attestations: CommitteeAttestation[],
|
|
46
46
|
): AttestationInfo[] {
|
|
47
|
-
const hashedPayload = getHashedSignaturePayloadEthSignedMessage(
|
|
47
|
+
const hashedPayload = getHashedSignaturePayloadEthSignedMessage(
|
|
48
|
+
payload,
|
|
49
|
+
SignatureDomainSeparator.checkpointAttestation,
|
|
50
|
+
);
|
|
48
51
|
|
|
49
52
|
return attestations.map(attestation => {
|
|
50
53
|
// If signature is empty, check if we have an address directly
|
package/src/block/block_hash.ts
CHANGED
|
@@ -13,6 +13,28 @@ export class L2BlockHash extends Buffer32 {
|
|
|
13
13
|
super(hash);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Type guard that checks if a value is an L2BlockHash instance.
|
|
18
|
+
* Uses duck typing to handle cases where instanceof fails due to module duplication.
|
|
19
|
+
* Checks for Buffer32-like structure with a 32-byte buffer.
|
|
20
|
+
*/
|
|
21
|
+
static isL2BlockHash(value: unknown): value is L2BlockHash {
|
|
22
|
+
if (value instanceof L2BlockHash) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
// Duck typing fallback: check if it looks like a Buffer32 with a 32-byte buffer
|
|
26
|
+
// This helps when instanceof fails due to module duplication
|
|
27
|
+
return (
|
|
28
|
+
typeof value === 'object' &&
|
|
29
|
+
value !== null &&
|
|
30
|
+
'buffer' in value &&
|
|
31
|
+
Buffer.isBuffer((value as Buffer32).buffer) &&
|
|
32
|
+
(value as Buffer32).buffer.length === 32 &&
|
|
33
|
+
'toBuffer' in value &&
|
|
34
|
+
typeof (value as Buffer32).toBuffer === 'function'
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
16
38
|
static override random() {
|
|
17
39
|
return new L2BlockHash(Fr.random().toBuffer());
|
|
18
40
|
}
|
|
@@ -2,7 +2,9 @@ import { BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { L2BlockHash } from './block_hash.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
export const BlockParameterSchema = z.union([L2BlockHash.schema, BlockNumberSchema, z.literal('latest')]);
|
|
8
|
+
|
|
9
|
+
/** Block parameter - either a specific BlockNumber, block hash (L2BlockHash), 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/index.ts
CHANGED
package/src/block/l2_block.ts
CHANGED
|
@@ -1,44 +1,65 @@
|
|
|
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';
|
|
12
18
|
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
19
|
import type { L2BlockInfo } from './l2_block_info.js';
|
|
16
|
-
import { L2BlockNew } from './l2_block_new.js';
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @deprecated Use `L2BlockNew` instead.
|
|
22
|
+
* An L2 block with a header and a body.
|
|
22
23
|
*/
|
|
23
24
|
export class L2Block {
|
|
24
25
|
constructor(
|
|
25
26
|
/** Snapshot of archive tree after the block is applied. */
|
|
26
27
|
public archive: AppendOnlyTreeSnapshot,
|
|
27
|
-
/**
|
|
28
|
-
public header:
|
|
28
|
+
/** Header of the block. */
|
|
29
|
+
public header: BlockHeader,
|
|
29
30
|
/** L2 block body. */
|
|
30
31
|
public body: Body,
|
|
31
|
-
|
|
32
|
+
/** Number of the checkpoint that the block belongs to. */
|
|
33
|
+
public checkpointNumber: CheckpointNumber,
|
|
34
|
+
/** Index of the block within the checkpoint. */
|
|
35
|
+
public indexWithinCheckpoint: IndexWithinCheckpoint,
|
|
32
36
|
) {}
|
|
33
37
|
|
|
38
|
+
get number(): BlockNumber {
|
|
39
|
+
return this.header.globalVariables.blockNumber;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get slot(): SlotNumber {
|
|
43
|
+
return this.header.globalVariables.slotNumber;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get timestamp(): bigint {
|
|
47
|
+
return this.header.globalVariables.timestamp;
|
|
48
|
+
}
|
|
49
|
+
|
|
34
50
|
static get schema() {
|
|
35
51
|
return z
|
|
36
52
|
.object({
|
|
37
53
|
archive: AppendOnlyTreeSnapshot.schema,
|
|
38
|
-
header:
|
|
54
|
+
header: BlockHeader.schema,
|
|
39
55
|
body: Body.schema,
|
|
56
|
+
checkpointNumber: CheckpointNumberSchema,
|
|
57
|
+
indexWithinCheckpoint: IndexWithinCheckpointSchema,
|
|
40
58
|
})
|
|
41
|
-
.transform(
|
|
59
|
+
.transform(
|
|
60
|
+
({ archive, header, body, checkpointNumber, indexWithinCheckpoint }) =>
|
|
61
|
+
new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint),
|
|
62
|
+
);
|
|
42
63
|
}
|
|
43
64
|
|
|
44
65
|
/**
|
|
@@ -47,11 +68,13 @@ export class L2Block {
|
|
|
47
68
|
*/
|
|
48
69
|
static fromBuffer(buf: Buffer | BufferReader) {
|
|
49
70
|
const reader = BufferReader.asReader(buf);
|
|
50
|
-
const header = reader.readObject(
|
|
71
|
+
const header = reader.readObject(BlockHeader);
|
|
51
72
|
const archive = reader.readObject(AppendOnlyTreeSnapshot);
|
|
52
73
|
const body = reader.readObject(Body);
|
|
74
|
+
const checkpointNumber = CheckpointNumber(reader.readNumber());
|
|
75
|
+
const indexWithinCheckpoint = IndexWithinCheckpoint(reader.readNumber());
|
|
53
76
|
|
|
54
|
-
return new L2Block(archive, header, body);
|
|
77
|
+
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
55
78
|
}
|
|
56
79
|
|
|
57
80
|
/**
|
|
@@ -59,151 +82,39 @@ export class L2Block {
|
|
|
59
82
|
* @returns A serialized L2 block as a Buffer.
|
|
60
83
|
*/
|
|
61
84
|
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;
|
|
85
|
+
return serializeToBuffer(this.header, this.archive, this.body, this.checkpointNumber, this.indexWithinCheckpoint);
|
|
127
86
|
}
|
|
128
87
|
|
|
129
88
|
/**
|
|
130
89
|
* Returns the block's hash (hash of block header).
|
|
131
90
|
* @returns The block's hash.
|
|
132
91
|
*/
|
|
133
|
-
public
|
|
134
|
-
|
|
135
|
-
this.blockHash = await this.getBlockHeader().hash();
|
|
136
|
-
}
|
|
137
|
-
return this.blockHash;
|
|
92
|
+
public hash(): Promise<Fr> {
|
|
93
|
+
return this.header.hash();
|
|
138
94
|
}
|
|
139
95
|
|
|
140
96
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
97
|
+
* Checks if this block equals another block.
|
|
98
|
+
* @param other - The other block to compare with.
|
|
99
|
+
* @returns True if both blocks are equal.
|
|
144
100
|
*/
|
|
145
|
-
public
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public toL2Block() {
|
|
155
|
-
return new L2BlockNew(
|
|
156
|
-
this.archive,
|
|
157
|
-
this.getBlockHeader(),
|
|
158
|
-
this.body,
|
|
159
|
-
CheckpointNumber.fromBlockNumber(this.number),
|
|
160
|
-
0, // indexWithinCheckpoint
|
|
101
|
+
public equals(other: this): boolean {
|
|
102
|
+
return (
|
|
103
|
+
this.archive.equals(other.archive) &&
|
|
104
|
+
this.header.equals(other.header) &&
|
|
105
|
+
this.body.equals(other.body) &&
|
|
106
|
+
this.checkpointNumber === other.checkpointNumber &&
|
|
107
|
+
this.indexWithinCheckpoint === other.indexWithinCheckpoint
|
|
161
108
|
);
|
|
162
109
|
}
|
|
163
110
|
|
|
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.contentCommitment,
|
|
179
|
-
block.header.state,
|
|
180
|
-
block.header.globalVariables,
|
|
181
|
-
block.header.totalFees,
|
|
182
|
-
checkpointHeader.totalManaUsed,
|
|
183
|
-
block.header.spongeBlobHash,
|
|
184
|
-
checkpointHeader.blockHeadersHash,
|
|
185
|
-
);
|
|
186
|
-
return new L2Block(checkpoint.archive, header, block.body);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* @deprecated
|
|
191
|
-
* This only works when there's one block per checkpoint.
|
|
192
|
-
* TODO(#17027): Remove this method from L2Block and create a dedicated Checkpoint class.
|
|
193
|
-
*/
|
|
194
|
-
public getCheckpointBlobFields() {
|
|
195
|
-
const blockBlobData = this.toBlockBlobData();
|
|
196
|
-
return encodeCheckpointBlobDataFromBlocks([blockBlobData]);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
111
|
public toBlobFields(): Fr[] {
|
|
200
112
|
const blockBlobData = this.toBlockBlobData();
|
|
201
113
|
return encodeBlockBlobData(blockBlobData);
|
|
202
114
|
}
|
|
203
115
|
|
|
204
116
|
public toBlockBlobData(): BlockBlobData {
|
|
205
|
-
|
|
206
|
-
const isFirstBlock = true;
|
|
117
|
+
const isFirstBlock = this.indexWithinCheckpoint === 0;
|
|
207
118
|
return {
|
|
208
119
|
blockEndMarker: {
|
|
209
120
|
numTxs: this.body.txEffects.length,
|
|
@@ -226,6 +137,48 @@ export class L2Block {
|
|
|
226
137
|
};
|
|
227
138
|
}
|
|
228
139
|
|
|
140
|
+
static empty(header?: BlockHeader) {
|
|
141
|
+
return new L2Block(
|
|
142
|
+
AppendOnlyTreeSnapshot.empty(),
|
|
143
|
+
header ?? BlockHeader.empty(),
|
|
144
|
+
Body.empty(),
|
|
145
|
+
CheckpointNumber(0),
|
|
146
|
+
IndexWithinCheckpoint(0),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Creates an L2 block containing random data.
|
|
152
|
+
* @param l2BlockNum - The number of the L2 block.
|
|
153
|
+
* @param txsPerBlock - The number of transactions to include in the block.
|
|
154
|
+
* @param numPublicCallsPerTx - The number of public function calls to include in each transaction.
|
|
155
|
+
* @param numPublicLogsPerCall - The number of public logs per 1 public function invocation.
|
|
156
|
+
* @param inHash - The hash of the L1 to L2 messages subtree which got inserted in this block.
|
|
157
|
+
* @returns The L2 block.
|
|
158
|
+
*/
|
|
159
|
+
static async random(
|
|
160
|
+
blockNumber: BlockNumber,
|
|
161
|
+
{
|
|
162
|
+
checkpointNumber = CheckpointNumber(Number(blockNumber)),
|
|
163
|
+
indexWithinCheckpoint = IndexWithinCheckpoint(0),
|
|
164
|
+
txsPerBlock = 1,
|
|
165
|
+
txOptions = {},
|
|
166
|
+
makeTxOptions,
|
|
167
|
+
...blockHeaderOverrides
|
|
168
|
+
}: {
|
|
169
|
+
checkpointNumber?: CheckpointNumber;
|
|
170
|
+
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
171
|
+
txsPerBlock?: number;
|
|
172
|
+
txOptions?: Partial<Parameters<typeof Body.random>[0]>;
|
|
173
|
+
makeTxOptions?: (txIndex: number) => Partial<Parameters<typeof Body.random>[0]>;
|
|
174
|
+
} & Partial<Parameters<typeof BlockHeader.random>[0]> = {},
|
|
175
|
+
): Promise<L2Block> {
|
|
176
|
+
const archive = new AppendOnlyTreeSnapshot(Fr.random(), blockNumber + 1);
|
|
177
|
+
const header = BlockHeader.random({ blockNumber, ...blockHeaderOverrides });
|
|
178
|
+
const body = await Body.random({ txsPerBlock, makeTxOptions, ...txOptions });
|
|
179
|
+
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
180
|
+
}
|
|
181
|
+
|
|
229
182
|
/**
|
|
230
183
|
* Returns stats used for logging.
|
|
231
184
|
* @returns Stats on tx count, number, and log size and count.
|
|
@@ -253,9 +206,12 @@ export class L2Block {
|
|
|
253
206
|
};
|
|
254
207
|
}
|
|
255
208
|
|
|
209
|
+
getPrivateLogs(): PrivateLog[] {
|
|
210
|
+
return this.body.txEffects.map(txEffect => txEffect.privateLogs).flat();
|
|
211
|
+
}
|
|
212
|
+
|
|
256
213
|
toBlockInfo(): L2BlockInfo {
|
|
257
214
|
return {
|
|
258
|
-
blockHash: this.blockHash,
|
|
259
215
|
archive: this.archive.root,
|
|
260
216
|
lastArchive: this.header.lastArchive.root,
|
|
261
217
|
blockNumber: this.number,
|
|
@@ -264,8 +220,4 @@ export class L2Block {
|
|
|
264
220
|
timestamp: this.header.globalVariables.timestamp,
|
|
265
221
|
};
|
|
266
222
|
}
|
|
267
|
-
|
|
268
|
-
equals(other: L2Block) {
|
|
269
|
-
return this.archive.equals(other.archive) && this.header.equals(other.header) && this.body.equals(other.body);
|
|
270
|
-
}
|
|
271
223
|
}
|