@aztec/stdlib 0.0.1-commit.fcb71a6 → 0.0.1-commit.fffb133c
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 +9 -2
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +15 -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 -107
- 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 +14 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +8 -2
- 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 +27 -1
- 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 -148
- 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 +11 -3
- 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
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
3
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
|
+
|
|
7
|
+
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
8
|
+
import { Tx } from '../tx/tx.js';
|
|
9
|
+
import {
|
|
10
|
+
SignatureDomainSeparator,
|
|
11
|
+
getHashedSignaturePayload,
|
|
12
|
+
getHashedSignaturePayloadEthSignedMessage,
|
|
13
|
+
} from './signature_utils.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A signed collection of transactions.
|
|
17
|
+
* The signature is over the transaction objects themselves, providing
|
|
18
|
+
* data availability guarantees beyond just the transaction hashes.
|
|
19
|
+
*/
|
|
20
|
+
export class SignedTxs {
|
|
21
|
+
private sender: EthAddress | undefined;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
/** The transactions */
|
|
25
|
+
public readonly txs: Tx[],
|
|
26
|
+
/** The proposer's signature over the transactions */
|
|
27
|
+
public readonly signature: Signature,
|
|
28
|
+
) {}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get the payload to sign for this signed txs.
|
|
32
|
+
*/
|
|
33
|
+
getPayloadToSign(domainSeparator: SignatureDomainSeparator): Buffer {
|
|
34
|
+
return serializeToBuffer([domainSeparator, this.txs.length, this.txs]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Lazily evaluate the sender of the signed txs; result is cached
|
|
39
|
+
* @returns The sender address, or undefined if signature recovery fails
|
|
40
|
+
*/
|
|
41
|
+
getSender(): EthAddress | undefined {
|
|
42
|
+
if (!this.sender) {
|
|
43
|
+
const hashed = getHashedSignaturePayloadEthSignedMessage(this, SignatureDomainSeparator.signedTxs);
|
|
44
|
+
this.sender = tryRecoverAddress(hashed, this.signature);
|
|
45
|
+
}
|
|
46
|
+
return this.sender;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Create SignedTxs from a signer function
|
|
51
|
+
*/
|
|
52
|
+
static async createFromSigner(
|
|
53
|
+
txs: Tx[],
|
|
54
|
+
payloadSigner: (payload: Buffer32) => Promise<Signature>,
|
|
55
|
+
): Promise<SignedTxs> {
|
|
56
|
+
const tempSignedTxs = new SignedTxs(txs, Signature.empty());
|
|
57
|
+
const hashed = getHashedSignaturePayload(tempSignedTxs, SignatureDomainSeparator.signedTxs);
|
|
58
|
+
const signature = await payloadSigner(hashed);
|
|
59
|
+
return new SignedTxs(txs, signature);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
toBuffer(): Buffer {
|
|
63
|
+
return serializeToBuffer([this.txs.length, this.txs, this.signature]);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static fromBuffer(buf: Buffer | BufferReader): SignedTxs {
|
|
67
|
+
const reader = BufferReader.asReader(buf);
|
|
68
|
+
const txCount = reader.readNumber();
|
|
69
|
+
if (txCount > MAX_TXS_PER_BLOCK) {
|
|
70
|
+
throw new Error(`txs count ${txCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
|
|
71
|
+
}
|
|
72
|
+
const txs = reader.readArray(txCount, Tx);
|
|
73
|
+
const signature = reader.readObject(Signature);
|
|
74
|
+
return new SignedTxs(txs, signature);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
getSize(): number {
|
|
78
|
+
return 4 /* txs.length */ + this.txs.reduce((acc, tx) => acc + tx.getSize(), 0) + this.signature.getSize();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static empty(): SignedTxs {
|
|
82
|
+
return new SignedTxs([], Signature.empty());
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static random(): SignedTxs {
|
|
86
|
+
return new SignedTxs([Tx.random(), Tx.random()], Signature.random());
|
|
87
|
+
}
|
|
88
|
+
}
|
package/src/p2p/topic_type.ts
CHANGED
|
@@ -23,14 +23,15 @@ export function getTopicFromString(topicStr: string): TopicType | undefined {
|
|
|
23
23
|
export enum TopicType {
|
|
24
24
|
tx = 'tx',
|
|
25
25
|
block_proposal = 'block_proposal',
|
|
26
|
-
|
|
26
|
+
checkpoint_proposal = 'checkpoint_proposal',
|
|
27
|
+
checkpoint_attestation = 'checkpoint_attestation',
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export function getTopicTypeForClientType(clientType: P2PClientType) {
|
|
30
31
|
if (clientType === P2PClientType.Full) {
|
|
31
|
-
return
|
|
32
|
+
return [TopicType.tx, TopicType.block_proposal, TopicType.checkpoint_proposal, TopicType.checkpoint_attestation];
|
|
32
33
|
} else if (clientType === P2PClientType.Prover) {
|
|
33
|
-
return [TopicType.tx, TopicType.block_proposal];
|
|
34
|
+
return [TopicType.tx, TopicType.block_proposal, TopicType.checkpoint_proposal];
|
|
34
35
|
} else {
|
|
35
36
|
const _: never = clientType;
|
|
36
37
|
return [TopicType.tx];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CHONK_PROOF_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { times } from '@aztec/foundation/collection';
|
|
2
3
|
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
3
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -31,12 +32,15 @@ export class ChonkProof {
|
|
|
31
32
|
|
|
32
33
|
static random() {
|
|
33
34
|
// NB: Not using Fr.random here because it slows down some tests that require a large number of txs significantly.
|
|
35
|
+
// NB2: generate one fewer random bytes to not have to deal with buffers representing numbers greater than the field modulus
|
|
36
|
+
// NB3: a chonk proof can be compressed. Simulate this by filling 1/4 of the proof with zero data
|
|
34
37
|
const reducedFrSize = Fr.SIZE_IN_BYTES - 1;
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
38
|
+
const nonZeroFields = Math.floor((3 * CHONK_PROOF_LENGTH) / 4);
|
|
39
|
+
const randomFields = randomBytes(nonZeroFields * Fr.SIZE_IN_BYTES);
|
|
40
|
+
const proof = [
|
|
41
|
+
...times(nonZeroFields, i => new Fr(randomFields.subarray(i * reducedFrSize, (i + 1) * reducedFrSize))),
|
|
42
|
+
...times(CHONK_PROOF_LENGTH - nonZeroFields, () => Fr.ZERO),
|
|
43
|
+
];
|
|
40
44
|
return new ChonkProof(proof);
|
|
41
45
|
}
|
|
42
46
|
|
|
@@ -5,7 +5,7 @@ import type { BlockHeader } from '../tx/block_header.js';
|
|
|
5
5
|
|
|
6
6
|
export async function computeBlockHeadersHash(blockHeaders: BlockHeader[]): Promise<Fr> {
|
|
7
7
|
const blockHeaderHashes = await Promise.all(blockHeaders.map(header => header.hash()));
|
|
8
|
-
// Must match the implementation in merge_block_rollups.nr, with the **
|
|
8
|
+
// Must match the implementation in merge_block_rollups.nr, with the **unbalanced** rollup structure
|
|
9
9
|
// (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
|
|
10
10
|
const blockHeadersHash = await computeUnbalancedPoseidonRoot(blockHeaderHashes.map(hash => hash.toBuffer()));
|
|
11
11
|
return Fr.fromBuffer(blockHeadersHash);
|
|
@@ -43,17 +43,13 @@ export class BlockRollupPublicInputs {
|
|
|
43
43
|
*/
|
|
44
44
|
public endSpongeBlob: SpongeBlob,
|
|
45
45
|
/**
|
|
46
|
-
* Timestamp of the
|
|
46
|
+
* Timestamp of the blocks in this block range.
|
|
47
47
|
*/
|
|
48
|
-
public
|
|
49
|
-
/**
|
|
50
|
-
* Timestamp of the last block in this block range.
|
|
51
|
-
*/
|
|
52
|
-
public endTimestamp: UInt64,
|
|
48
|
+
public timestamp: UInt64,
|
|
53
49
|
/**
|
|
54
50
|
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
55
|
-
* other blocks in the same checkpoint to form
|
|
56
|
-
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
51
|
+
* other blocks in the same checkpoint to form an unbalanced tree. The root of that tree becomes the final hash
|
|
52
|
+
* stored in the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
57
53
|
*/
|
|
58
54
|
public blockHeadersHash: Fr,
|
|
59
55
|
/**
|
|
@@ -85,7 +81,6 @@ export class BlockRollupPublicInputs {
|
|
|
85
81
|
reader.readObject(SpongeBlob),
|
|
86
82
|
reader.readObject(SpongeBlob),
|
|
87
83
|
reader.readUInt64(),
|
|
88
|
-
reader.readUInt64(),
|
|
89
84
|
Fr.fromBuffer(reader),
|
|
90
85
|
Fr.fromBuffer(reader),
|
|
91
86
|
Fr.fromBuffer(reader),
|
|
@@ -103,8 +98,7 @@ export class BlockRollupPublicInputs {
|
|
|
103
98
|
this.endState,
|
|
104
99
|
this.startSpongeBlob,
|
|
105
100
|
this.endSpongeBlob,
|
|
106
|
-
bigintToUInt64BE(this.
|
|
107
|
-
bigintToUInt64BE(this.endTimestamp),
|
|
101
|
+
bigintToUInt64BE(this.timestamp),
|
|
108
102
|
this.blockHeadersHash,
|
|
109
103
|
this.inHash,
|
|
110
104
|
this.outHash,
|
|
@@ -14,12 +14,13 @@ import { z } from 'zod';
|
|
|
14
14
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
15
15
|
import { GasFees } from '../gas/index.js';
|
|
16
16
|
import { schemas } from '../schemas/index.js';
|
|
17
|
-
import {
|
|
17
|
+
import type { GlobalVariables } from '../tx/global_variables.js';
|
|
18
18
|
import type { UInt64 } from '../types/shared.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Header of a checkpoint. A checkpoint is a collection of blocks submitted to L1 all within the same slot.
|
|
22
22
|
* TODO(palla/mbps): Should this include chainId and version as well? Is this used just in circuits?
|
|
23
|
+
* TODO(palla/mbps): What about CheckpointNumber?
|
|
23
24
|
*/
|
|
24
25
|
export class CheckpointHeader {
|
|
25
26
|
constructor(
|
|
@@ -27,8 +28,18 @@ export class CheckpointHeader {
|
|
|
27
28
|
public lastArchiveRoot: Fr,
|
|
28
29
|
/** Hash of the headers of all blocks in this checkpoint. */
|
|
29
30
|
public blockHeadersHash: Fr,
|
|
30
|
-
/**
|
|
31
|
-
public
|
|
31
|
+
/** Hash of the blobs in the checkpoint. */
|
|
32
|
+
public blobsHash: Fr,
|
|
33
|
+
/** Root of the l1 to l2 messages subtree. */
|
|
34
|
+
public inHash: Fr,
|
|
35
|
+
/**
|
|
36
|
+
* The root of the epoch out hash balanced tree. The out hash of the first checkpoint in the epoch is inserted at
|
|
37
|
+
* index 0, the second at index 1, and so on.
|
|
38
|
+
* Note: This is not necessarily the final epoch out hash. It includes only the out hashes of checkpoints up to and
|
|
39
|
+
* including the current checkpoint. Any subsequent checkpoints added to the same epoch are not reflected in this
|
|
40
|
+
* value.
|
|
41
|
+
*/
|
|
42
|
+
public epochOutHash: Fr,
|
|
32
43
|
/** Slot number of the L2 block */
|
|
33
44
|
public slotNumber: SlotNumber,
|
|
34
45
|
/** Timestamp of the L2 block. */
|
|
@@ -48,7 +59,9 @@ export class CheckpointHeader {
|
|
|
48
59
|
.object({
|
|
49
60
|
lastArchiveRoot: schemas.Fr,
|
|
50
61
|
blockHeadersHash: schemas.Fr,
|
|
51
|
-
|
|
62
|
+
blobsHash: schemas.Fr,
|
|
63
|
+
inHash: schemas.Fr,
|
|
64
|
+
epochOutHash: schemas.Fr,
|
|
52
65
|
slotNumber: schemas.SlotNumber,
|
|
53
66
|
timestamp: schemas.BigInt,
|
|
54
67
|
coinbase: schemas.EthAddress,
|
|
@@ -63,7 +76,9 @@ export class CheckpointHeader {
|
|
|
63
76
|
return [
|
|
64
77
|
fields.lastArchiveRoot,
|
|
65
78
|
fields.blockHeadersHash,
|
|
66
|
-
fields.
|
|
79
|
+
fields.blobsHash,
|
|
80
|
+
fields.inHash,
|
|
81
|
+
fields.epochOutHash,
|
|
67
82
|
fields.slotNumber,
|
|
68
83
|
fields.timestamp,
|
|
69
84
|
fields.coinbase,
|
|
@@ -83,7 +98,9 @@ export class CheckpointHeader {
|
|
|
83
98
|
return new CheckpointHeader(
|
|
84
99
|
reader.readObject(Fr),
|
|
85
100
|
reader.readObject(Fr),
|
|
86
|
-
reader.readObject(
|
|
101
|
+
reader.readObject(Fr),
|
|
102
|
+
reader.readObject(Fr),
|
|
103
|
+
reader.readObject(Fr),
|
|
87
104
|
SlotNumber(Fr.fromBuffer(reader).toNumber()),
|
|
88
105
|
reader.readUInt64(),
|
|
89
106
|
reader.readObject(EthAddress),
|
|
@@ -97,7 +114,9 @@ export class CheckpointHeader {
|
|
|
97
114
|
return (
|
|
98
115
|
this.lastArchiveRoot.equals(other.lastArchiveRoot) &&
|
|
99
116
|
this.blockHeadersHash.equals(other.blockHeadersHash) &&
|
|
100
|
-
this.
|
|
117
|
+
this.blobsHash.equals(other.blobsHash) &&
|
|
118
|
+
this.inHash.equals(other.inHash) &&
|
|
119
|
+
this.epochOutHash.equals(other.epochOutHash) &&
|
|
101
120
|
this.slotNumber === other.slotNumber &&
|
|
102
121
|
this.timestamp === other.timestamp &&
|
|
103
122
|
this.coinbase.equals(other.coinbase) &&
|
|
@@ -107,12 +126,25 @@ export class CheckpointHeader {
|
|
|
107
126
|
);
|
|
108
127
|
}
|
|
109
128
|
|
|
129
|
+
/** Returns true if the global variables match those in the checkpoint header. */
|
|
130
|
+
matchesGlobalVariables(other: GlobalVariables) {
|
|
131
|
+
return (
|
|
132
|
+
this.coinbase.equals(other.coinbase) &&
|
|
133
|
+
this.feeRecipient.equals(other.feeRecipient) &&
|
|
134
|
+
this.gasFees.equals(other.gasFees) &&
|
|
135
|
+
this.slotNumber === other.slotNumber &&
|
|
136
|
+
this.timestamp === other.timestamp
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
110
140
|
toBuffer() {
|
|
111
141
|
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
112
142
|
return serializeToBuffer([
|
|
113
143
|
this.lastArchiveRoot,
|
|
114
144
|
this.blockHeadersHash,
|
|
115
|
-
this.
|
|
145
|
+
this.blobsHash,
|
|
146
|
+
this.inHash,
|
|
147
|
+
this.epochOutHash,
|
|
116
148
|
new Fr(this.slotNumber),
|
|
117
149
|
bigintToUInt64BE(this.timestamp),
|
|
118
150
|
this.coinbase,
|
|
@@ -130,7 +162,9 @@ export class CheckpointHeader {
|
|
|
130
162
|
return CheckpointHeader.from({
|
|
131
163
|
lastArchiveRoot: Fr.ZERO,
|
|
132
164
|
blockHeadersHash: Fr.ZERO,
|
|
133
|
-
|
|
165
|
+
blobsHash: Fr.ZERO,
|
|
166
|
+
inHash: Fr.ZERO,
|
|
167
|
+
epochOutHash: Fr.ZERO,
|
|
134
168
|
slotNumber: SlotNumber.ZERO,
|
|
135
169
|
timestamp: 0n,
|
|
136
170
|
coinbase: EthAddress.ZERO,
|
|
@@ -141,13 +175,13 @@ export class CheckpointHeader {
|
|
|
141
175
|
});
|
|
142
176
|
}
|
|
143
177
|
|
|
144
|
-
static random(
|
|
145
|
-
overrides: Partial<FieldsOf<CheckpointHeader>> & Partial<FieldsOf<ContentCommitment>> = {},
|
|
146
|
-
): CheckpointHeader {
|
|
178
|
+
static random(overrides: Partial<FieldsOf<CheckpointHeader>> = {}): CheckpointHeader {
|
|
147
179
|
return CheckpointHeader.from({
|
|
148
180
|
lastArchiveRoot: Fr.random(),
|
|
149
181
|
blockHeadersHash: Fr.random(),
|
|
150
|
-
|
|
182
|
+
blobsHash: Fr.random(),
|
|
183
|
+
inHash: Fr.random(),
|
|
184
|
+
epochOutHash: Fr.random(),
|
|
151
185
|
slotNumber: SlotNumber(Math.floor(Math.random() * 1000) + 1),
|
|
152
186
|
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
153
187
|
coinbase: EthAddress.random(),
|
|
@@ -162,7 +196,9 @@ export class CheckpointHeader {
|
|
|
162
196
|
return (
|
|
163
197
|
this.lastArchiveRoot.isZero() &&
|
|
164
198
|
this.blockHeadersHash.isZero() &&
|
|
165
|
-
this.
|
|
199
|
+
this.blobsHash.isZero() &&
|
|
200
|
+
this.inHash.isZero() &&
|
|
201
|
+
this.epochOutHash.isZero() &&
|
|
166
202
|
this.slotNumber === 0 &&
|
|
167
203
|
this.timestamp === 0n &&
|
|
168
204
|
this.coinbase.isZero() &&
|
|
@@ -188,7 +224,9 @@ export class CheckpointHeader {
|
|
|
188
224
|
return new CheckpointHeader(
|
|
189
225
|
Fr.fromString(header.lastArchiveRoot),
|
|
190
226
|
Fr.fromString(header.blockHeadersHash),
|
|
191
|
-
|
|
227
|
+
Fr.fromString(header.blobsHash),
|
|
228
|
+
Fr.fromString(header.inHash),
|
|
229
|
+
Fr.fromString(header.outHash),
|
|
192
230
|
SlotNumber.fromBigInt(header.slotNumber),
|
|
193
231
|
header.timestamp,
|
|
194
232
|
new EthAddress(hexToBuffer(header.coinbase)),
|
|
@@ -210,7 +248,9 @@ export class CheckpointHeader {
|
|
|
210
248
|
return {
|
|
211
249
|
lastArchiveRoot: this.lastArchiveRoot.toString(),
|
|
212
250
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
213
|
-
|
|
251
|
+
blobsHash: this.blobsHash.toString(),
|
|
252
|
+
inHash: this.inHash.toString(),
|
|
253
|
+
outHash: this.epochOutHash.toString(),
|
|
214
254
|
slotNumber: BigInt(this.slotNumber),
|
|
215
255
|
timestamp: this.timestamp,
|
|
216
256
|
coinbase: this.coinbase.toString(),
|
|
@@ -227,7 +267,9 @@ export class CheckpointHeader {
|
|
|
227
267
|
return {
|
|
228
268
|
lastArchive: this.lastArchiveRoot.toString(),
|
|
229
269
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
230
|
-
|
|
270
|
+
blobsHash: this.blobsHash.toString(),
|
|
271
|
+
inHash: this.inHash.toString(),
|
|
272
|
+
epochOutHash: this.epochOutHash.toString(),
|
|
231
273
|
slotNumber: this.slotNumber,
|
|
232
274
|
timestamp: this.timestamp,
|
|
233
275
|
coinbase: this.coinbase.toString(),
|
|
@@ -238,16 +280,17 @@ export class CheckpointHeader {
|
|
|
238
280
|
}
|
|
239
281
|
|
|
240
282
|
[inspect.custom]() {
|
|
241
|
-
const gasfees = `da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas}`;
|
|
242
283
|
return `Header {
|
|
243
284
|
lastArchiveRoot: ${this.lastArchiveRoot.toString()},
|
|
244
285
|
blockHeadersHash: ${this.blockHeadersHash.toString()},
|
|
245
|
-
|
|
286
|
+
blobsHash: ${inspect(this.blobsHash)},
|
|
287
|
+
inHash: ${inspect(this.inHash)},
|
|
288
|
+
epochOutHash: ${inspect(this.epochOutHash)},
|
|
246
289
|
slotNumber: ${this.slotNumber},
|
|
247
290
|
timestamp: ${this.timestamp},
|
|
248
291
|
coinbase: ${this.coinbase.toString()},
|
|
249
292
|
feeRecipient: ${this.feeRecipient.toString()},
|
|
250
|
-
gasFees:
|
|
293
|
+
gasFees: { da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas} },
|
|
251
294
|
totalManaUsed: ${this.totalManaUsed.toBigInt()},
|
|
252
295
|
}`;
|
|
253
296
|
}
|
|
@@ -27,6 +27,14 @@ export class CheckpointRollupPublicInputs {
|
|
|
27
27
|
* Archive tree after adding this checkpoint range.
|
|
28
28
|
*/
|
|
29
29
|
public newArchive: AppendOnlyTreeSnapshot,
|
|
30
|
+
/**
|
|
31
|
+
* The out hash tree snapshot immediately before this checkpoint range.
|
|
32
|
+
*/
|
|
33
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
34
|
+
/**
|
|
35
|
+
* The out hash tree snapshot after applying this checkpoint range.
|
|
36
|
+
*/
|
|
37
|
+
public newOutHash: AppendOnlyTreeSnapshot,
|
|
30
38
|
/**
|
|
31
39
|
* The hashes of the headers of the constituent checkpoints.
|
|
32
40
|
*/
|
|
@@ -55,6 +63,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
55
63
|
reader.readObject(EpochConstantData),
|
|
56
64
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
57
65
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
66
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
58
68
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
59
69
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
|
|
60
70
|
reader.readObject(BlobAccumulator),
|
|
@@ -68,6 +78,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
68
78
|
this.constants,
|
|
69
79
|
this.previousArchive,
|
|
70
80
|
this.newArchive,
|
|
81
|
+
this.previousOutHash,
|
|
82
|
+
this.newOutHash,
|
|
71
83
|
this.checkpointHeaderHashes,
|
|
72
84
|
this.fees,
|
|
73
85
|
this.startBlobAccumulator,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec/blob-lib/types';
|
|
2
|
-
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
|
+
import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, OUT_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
3
3
|
import { BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -8,6 +8,7 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
10
|
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
11
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
12
|
import { BlockHeader } from '../tx/block_header.js';
|
|
12
13
|
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
13
14
|
|
|
@@ -21,6 +22,14 @@ export class CheckpointRootRollupHints {
|
|
|
21
22
|
* Hint for checking the hash of previous_block_header is the last leaf of the previous archive.
|
|
22
23
|
*/
|
|
23
24
|
public previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
25
|
+
/**
|
|
26
|
+
* The out hash tree snapshot immediately before this checkpoint.
|
|
27
|
+
*/
|
|
28
|
+
public previousOutHash: AppendOnlyTreeSnapshot,
|
|
29
|
+
/**
|
|
30
|
+
* Hint for inserting the new out hash into the out hash tree.
|
|
31
|
+
*/
|
|
32
|
+
public newOutHashSiblingPath: Tuple<Fr, typeof OUT_HASH_TREE_HEIGHT>,
|
|
24
33
|
/**
|
|
25
34
|
* The current blob accumulation state across the epoch.
|
|
26
35
|
*/
|
|
@@ -54,6 +63,8 @@ export class CheckpointRootRollupHints {
|
|
|
54
63
|
return [
|
|
55
64
|
fields.previousBlockHeader,
|
|
56
65
|
fields.previousArchiveSiblingPath,
|
|
66
|
+
fields.previousOutHash,
|
|
67
|
+
fields.newOutHashSiblingPath,
|
|
57
68
|
fields.startBlobAccumulator,
|
|
58
69
|
fields.finalBlobChallenges,
|
|
59
70
|
fields.blobFields,
|
|
@@ -71,6 +82,8 @@ export class CheckpointRootRollupHints {
|
|
|
71
82
|
return new CheckpointRootRollupHints(
|
|
72
83
|
BlockHeader.fromBuffer(reader),
|
|
73
84
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
85
|
+
reader.readObject(AppendOnlyTreeSnapshot),
|
|
86
|
+
reader.readArray(OUT_HASH_TREE_HEIGHT, Fr),
|
|
74
87
|
reader.readObject(BlobAccumulator),
|
|
75
88
|
reader.readObject(FinalBlobBatchingChallenges),
|
|
76
89
|
// Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
@@ -21,6 +21,12 @@ export class RootRollupPublicInputs {
|
|
|
21
21
|
public previousArchiveRoot: Fr,
|
|
22
22
|
/** Root of the archive tree after this rollup is processed */
|
|
23
23
|
public endArchiveRoot: Fr,
|
|
24
|
+
/**
|
|
25
|
+
* Root of the balanced merkle tree consisting of the out hashes of all checkpoints in this epoch.
|
|
26
|
+
* The out hash of the first checkpoint in the epoch is inserted at index 0, the second at index 1, and so on.
|
|
27
|
+
*/
|
|
28
|
+
public outHash: Fr,
|
|
29
|
+
/** Hashes of checkpoint headers for this rollup. */
|
|
24
30
|
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
25
31
|
public fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
26
32
|
public constants: EpochConstantData,
|
|
@@ -31,6 +37,7 @@ export class RootRollupPublicInputs {
|
|
|
31
37
|
return [
|
|
32
38
|
fields.previousArchiveRoot,
|
|
33
39
|
fields.endArchiveRoot,
|
|
40
|
+
fields.outHash,
|
|
34
41
|
fields.checkpointHeaderHashes,
|
|
35
42
|
fields.fees,
|
|
36
43
|
fields.constants,
|
|
@@ -58,6 +65,7 @@ export class RootRollupPublicInputs {
|
|
|
58
65
|
public static fromBuffer(buffer: Buffer | BufferReader): RootRollupPublicInputs {
|
|
59
66
|
const reader = BufferReader.asReader(buffer);
|
|
60
67
|
return new RootRollupPublicInputs(
|
|
68
|
+
Fr.fromBuffer(reader),
|
|
61
69
|
Fr.fromBuffer(reader),
|
|
62
70
|
Fr.fromBuffer(reader),
|
|
63
71
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
@@ -88,6 +96,7 @@ export class RootRollupPublicInputs {
|
|
|
88
96
|
/** Creates a random instance. Used for testing only - will not prove/verify. */
|
|
89
97
|
static random() {
|
|
90
98
|
return new RootRollupPublicInputs(
|
|
99
|
+
Fr.random(),
|
|
91
100
|
Fr.random(),
|
|
92
101
|
Fr.random(),
|
|
93
102
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random),
|
package/src/tests/factories.ts
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
VK_TREE_HEIGHT,
|
|
44
44
|
} from '@aztec/constants';
|
|
45
45
|
import { type FieldsOf, makeTuple } from '@aztec/foundation/array';
|
|
46
|
-
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
46
|
+
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
47
47
|
import { compact } from '@aztec/foundation/collection';
|
|
48
48
|
import { Grumpkin } from '@aztec/foundation/crypto/grumpkin';
|
|
49
49
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
88
88
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
89
89
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
90
|
-
import {
|
|
90
|
+
import type { L2Tips } from '../block/l2_block_source.js';
|
|
91
91
|
import {
|
|
92
92
|
type ContractClassPublic,
|
|
93
93
|
ContractDeploymentData,
|
|
@@ -164,7 +164,6 @@ import { NullifierLeaf, NullifierLeafPreimage } from '../trees/nullifier_leaf.js
|
|
|
164
164
|
import { PublicDataTreeLeaf, PublicDataTreeLeafPreimage } from '../trees/public_data_leaf.js';
|
|
165
165
|
import { BlockHeader } from '../tx/block_header.js';
|
|
166
166
|
import { CallContext } from '../tx/call_context.js';
|
|
167
|
-
import { ContentCommitment } from '../tx/content_commitment.js';
|
|
168
167
|
import { FunctionData } from '../tx/function_data.js';
|
|
169
168
|
import { GlobalVariables } from '../tx/global_variables.js';
|
|
170
169
|
import { PartialStateReference } from '../tx/partial_state_reference.js';
|
|
@@ -837,7 +836,6 @@ export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
|
837
836
|
makeSpongeBlob(seed + 0x600),
|
|
838
837
|
makeSpongeBlob(seed + 0x700),
|
|
839
838
|
BigInt(seed + 0x800),
|
|
840
|
-
BigInt(seed + 0x810),
|
|
841
839
|
fr(seed + 0x820),
|
|
842
840
|
fr(seed + 0x830),
|
|
843
841
|
fr(seed + 0x840),
|
|
@@ -851,11 +849,13 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
851
849
|
makeEpochConstantData(seed),
|
|
852
850
|
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
853
851
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
852
|
+
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
853
|
+
makeAppendOnlyTreeSnapshot(seed + 0x350),
|
|
854
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x400),
|
|
855
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
857
856
|
makeBlobAccumulator(seed + 0x600),
|
|
858
|
-
|
|
857
|
+
makeBlobAccumulator(seed + 0x700),
|
|
858
|
+
makeFinalBlobBatchingChallenges(seed + 0x800),
|
|
859
859
|
);
|
|
860
860
|
}
|
|
861
861
|
|
|
@@ -887,20 +887,14 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
887
887
|
return new RootRollupPublicInputs(
|
|
888
888
|
fr(seed + 0x100),
|
|
889
889
|
fr(seed + 0x200),
|
|
890
|
-
|
|
890
|
+
fr(seed + 0x300),
|
|
891
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x400),
|
|
891
892
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
892
893
|
makeEpochConstantData(seed + 0x600),
|
|
893
894
|
makeFinalBlobAccumulator(seed + 0x700),
|
|
894
895
|
);
|
|
895
896
|
}
|
|
896
897
|
|
|
897
|
-
/**
|
|
898
|
-
* Makes content commitment
|
|
899
|
-
*/
|
|
900
|
-
export function makeContentCommitment(seed = 0): ContentCommitment {
|
|
901
|
-
return new ContentCommitment(fr(seed + 0x100), fr(seed + 0x200), fr(seed + 0x300));
|
|
902
|
-
}
|
|
903
|
-
|
|
904
898
|
export function makeBlockHeader(
|
|
905
899
|
seed = 0,
|
|
906
900
|
overrides: Partial<FieldsOf<Omit<BlockHeader, 'globalVariables'>>> & Partial<FieldsOf<GlobalVariables>> = {},
|
|
@@ -916,38 +910,20 @@ export function makeBlockHeader(
|
|
|
916
910
|
});
|
|
917
911
|
}
|
|
918
912
|
|
|
919
|
-
export function
|
|
920
|
-
seed = 0,
|
|
921
|
-
blockNumber?: number,
|
|
922
|
-
slotNumber?: number,
|
|
923
|
-
overrides: Partial<FieldsOf<L2BlockHeader>> = {},
|
|
924
|
-
) {
|
|
925
|
-
return new L2BlockHeader(
|
|
926
|
-
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
927
|
-
overrides?.contentCommitment ?? makeContentCommitment(seed + 0x200),
|
|
928
|
-
overrides?.state ?? makeStateReference(seed + 0x600),
|
|
929
|
-
makeGlobalVariables((seed += 0x700), {
|
|
930
|
-
...(blockNumber !== undefined ? { blockNumber: BlockNumber(blockNumber) } : {}),
|
|
931
|
-
...(slotNumber !== undefined ? { slotNumber: SlotNumber(slotNumber) } : {}),
|
|
932
|
-
}),
|
|
933
|
-
new Fr(seed + 0x800),
|
|
934
|
-
new Fr(seed + 0x900),
|
|
935
|
-
new Fr(seed + 0xa00),
|
|
936
|
-
new Fr(seed + 0xb00),
|
|
937
|
-
);
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
export function makeCheckpointHeader(seed = 0) {
|
|
913
|
+
export function makeCheckpointHeader(seed = 0, overrides: Partial<FieldsOf<CheckpointHeader>> = {}) {
|
|
941
914
|
return CheckpointHeader.from({
|
|
942
915
|
lastArchiveRoot: fr(seed + 0x100),
|
|
943
916
|
blockHeadersHash: fr(seed + 0x150),
|
|
944
|
-
|
|
917
|
+
blobsHash: fr(seed + 0x200),
|
|
918
|
+
inHash: fr(seed + 0x210),
|
|
919
|
+
epochOutHash: fr(seed + 0x220),
|
|
945
920
|
slotNumber: SlotNumber(seed + 0x300),
|
|
946
921
|
timestamp: BigInt(seed + 0x400),
|
|
947
922
|
coinbase: makeEthAddress(seed + 0x500),
|
|
948
923
|
feeRecipient: makeAztecAddress(seed + 0x600),
|
|
949
924
|
gasFees: makeGasFees(seed + 0x700),
|
|
950
925
|
totalManaUsed: fr(seed + 0x800),
|
|
926
|
+
...overrides,
|
|
951
927
|
});
|
|
952
928
|
}
|
|
953
929
|
|
|
@@ -988,7 +964,7 @@ function makeCountedL2ToL1Message(seed = 0) {
|
|
|
988
964
|
return new CountedL2ToL1Message(makeL2ToL1Message(seed), seed + 2);
|
|
989
965
|
}
|
|
990
966
|
|
|
991
|
-
function makeScopedL2ToL1Message(seed = 1) {
|
|
967
|
+
export function makeScopedL2ToL1Message(seed = 1) {
|
|
992
968
|
return new ScopedL2ToL1Message(makeL2ToL1Message(seed), makeAztecAddress(seed + 3));
|
|
993
969
|
}
|
|
994
970
|
|
|
@@ -1741,3 +1717,43 @@ export async function randomTxScopedPublicL2Log(opts?: {
|
|
|
1741
1717
|
opts?.firstNullifier ?? Fr.random(),
|
|
1742
1718
|
);
|
|
1743
1719
|
}
|
|
1720
|
+
|
|
1721
|
+
/**
|
|
1722
|
+
* Creates L2Tips with all tips pointing to the same block number.
|
|
1723
|
+
* Useful for mocking aztecNode.getL2Tips() in tests.
|
|
1724
|
+
* @param blockNumber - The block number to use for all tips.
|
|
1725
|
+
* @param hash - Optional hash for the block (defaults to empty string).
|
|
1726
|
+
* @param checkpointNumber - Optional checkpoint number (defaults to blockNumber).
|
|
1727
|
+
* @param checkpointHash - Optional checkpoint hash (defaults to block hash).
|
|
1728
|
+
* @returns L2Tips object with all tips at the same block.
|
|
1729
|
+
*/
|
|
1730
|
+
export function makeL2Tips(
|
|
1731
|
+
blockNumber: number | BlockNumber,
|
|
1732
|
+
hash = '',
|
|
1733
|
+
checkpointNumber?: number | CheckpointNumber,
|
|
1734
|
+
checkpointHash?: string,
|
|
1735
|
+
): L2Tips {
|
|
1736
|
+
const bn = typeof blockNumber === 'number' ? BlockNumber(blockNumber) : blockNumber;
|
|
1737
|
+
const cpn =
|
|
1738
|
+
checkpointNumber !== undefined
|
|
1739
|
+
? typeof checkpointNumber === 'number'
|
|
1740
|
+
? CheckpointNumber(checkpointNumber)
|
|
1741
|
+
: checkpointNumber
|
|
1742
|
+
: CheckpointNumber.fromBlockNumber(bn);
|
|
1743
|
+
const cph = checkpointHash ?? hash;
|
|
1744
|
+
return {
|
|
1745
|
+
proposed: { number: bn, hash },
|
|
1746
|
+
checkpointed: {
|
|
1747
|
+
block: { number: bn, hash },
|
|
1748
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1749
|
+
},
|
|
1750
|
+
proven: {
|
|
1751
|
+
block: { number: bn, hash },
|
|
1752
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1753
|
+
},
|
|
1754
|
+
finalized: {
|
|
1755
|
+
block: { number: bn, hash },
|
|
1756
|
+
checkpoint: { number: cpn, hash: cph },
|
|
1757
|
+
},
|
|
1758
|
+
};
|
|
1759
|
+
}
|