@aztec/stdlib 0.0.1-commit.d1f2d6c → 0.0.1-commit.d20b825a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/abi/abi.d.ts +138 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +10 -2
- package/dest/abi/authorization_selector.d.ts +3 -6
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +14 -4
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +25 -4
- package/dest/abi/decoder.d.ts +6 -45
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +17 -70
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +64 -7
- package/dest/abi/event_metadata_definition.d.ts +3 -1
- package/dest/abi/event_metadata_definition.d.ts.map +1 -1
- package/dest/abi/event_metadata_definition.js +1 -1
- package/dest/abi/event_selector.d.ts +3 -6
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_call.d.ts +39 -9
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +20 -3
- package/dest/abi/function_selector.d.ts +3 -6
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +2 -4
- package/dest/abi/function_signature_decoder.d.ts +43 -0
- package/dest/abi/function_signature_decoder.d.ts.map +1 -0
- package/dest/abi/function_signature_decoder.js +66 -0
- package/dest/abi/index.d.ts +2 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/abi/note_selector.d.ts +3 -6
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -3
- package/dest/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/abi/utils.d.ts +14 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +15 -0
- package/dest/auth_witness/auth_witness.js +3 -3
- package/dest/avm/avm.d.ts +300 -300
- package/dest/avm/avm_proving_request.d.ts +166 -166
- package/dest/avm/revert_code.d.ts +9 -4
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +16 -21
- package/dest/aztec-address/index.d.ts +3 -6
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +2 -4
- package/dest/block/block_data.d.ts +52 -0
- package/dest/block/block_data.d.ts.map +1 -0
- package/dest/block/block_data.js +12 -0
- package/dest/block/block_hash.d.ts +20 -21
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +22 -31
- package/dest/block/block_parameter.d.ts +4 -4
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +2 -2
- package/dest/block/in_block.d.ts +9 -9
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/in_block.js +5 -5
- package/dest/block/index.d.ts +2 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +11 -2
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +12 -2
- package/dest/block/l2_block_info.d.ts +6 -5
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_info.js +6 -5
- package/dest/block/l2_block_source.d.ts +117 -12
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +6 -3
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +10 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +18 -5
- 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 +4 -3
- package/dest/checkpoint/checkpoint.d.ts +28 -7
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +41 -17
- package/dest/checkpoint/checkpoint_data.d.ts +186 -0
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_data.js +36 -0
- package/dest/checkpoint/index.d.ts +3 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +2 -0
- package/dest/checkpoint/published_checkpoint.d.ts +17 -2
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +1 -2
- package/dest/checkpoint/validate.d.ts +36 -0
- package/dest/checkpoint/validate.d.ts.map +1 -0
- package/dest/checkpoint/validate.js +120 -0
- package/dest/config/chain-config.d.ts +1 -1
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +7 -1
- package/dest/config/index.d.ts +3 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +2 -0
- package/dest/config/pipelining-config.d.ts +19 -0
- package/dest/config/pipelining-config.d.ts.map +1 -0
- package/dest/config/pipelining-config.js +18 -0
- package/dest/config/sequencer-config.d.ts +12 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +31 -0
- package/dest/contract/contract_address.d.ts +3 -3
- package/dest/contract/contract_address.js +7 -7
- package/dest/contract/contract_class.d.ts +2 -3
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class_id.d.ts +3 -3
- package/dest/contract/contract_class_id.d.ts.map +1 -1
- package/dest/contract/contract_class_id.js +7 -6
- 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_class.d.ts +3 -156
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +1 -28
- package/dest/contract/interfaces/node-info.d.ts +3 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +2 -1
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +4 -6
- package/dest/database-version/database_version.d.ts +58 -0
- package/dest/database-version/database_version.d.ts.map +1 -0
- package/dest/database-version/database_version.js +69 -0
- package/dest/database-version/version_manager.d.ts +2 -50
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +1 -66
- package/dest/epoch-helpers/index.d.ts +17 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +22 -2
- package/dest/file-store/factory.d.ts +4 -3
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +2 -2
- package/dest/file-store/http.d.ts +9 -2
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +20 -9
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/file-store/local.d.ts +3 -3
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/file-store/local.js +13 -4
- package/dest/file-store/s3.d.ts +1 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/file-store/s3.js +11 -3
- package/dest/gas/fee_math.d.ts +49 -0
- package/dest/gas/fee_math.d.ts.map +1 -0
- package/dest/gas/fee_math.js +80 -0
- package/dest/gas/gas_fees.d.ts +5 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +13 -1
- package/dest/gas/gas_settings.d.ts +40 -3
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +50 -6
- package/dest/gas/index.d.ts +2 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +1 -0
- package/dest/ha-signing/config.d.ts +136 -0
- package/dest/ha-signing/config.d.ts.map +1 -0
- package/dest/ha-signing/config.js +98 -0
- package/dest/ha-signing/index.d.ts +4 -0
- package/dest/ha-signing/index.d.ts.map +1 -0
- package/dest/ha-signing/index.js +3 -0
- package/dest/ha-signing/local_config.d.ts +63 -0
- package/dest/ha-signing/local_config.d.ts.map +1 -0
- package/dest/ha-signing/local_config.js +24 -0
- package/dest/ha-signing/types.d.ts +90 -0
- package/dest/ha-signing/types.d.ts.map +1 -0
- package/dest/ha-signing/types.js +39 -0
- package/dest/hash/hash.d.ts +35 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +77 -10
- package/dest/hash/map_slot.d.ts +1 -1
- package/dest/hash/map_slot.d.ts.map +1 -1
- package/dest/hash/map_slot.js +4 -3
- package/dest/interfaces/allowed_element.d.ts +26 -20
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +8 -8
- package/dest/interfaces/archiver.d.ts +11 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +17 -6
- package/dest/interfaces/aztec-node-admin.d.ts +129 -48
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +15 -7
- package/dest/interfaces/aztec-node-debug.d.ts +21 -0
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-debug.js +18 -0
- package/dest/interfaces/aztec-node.d.ts +54 -60
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +13 -12
- package/dest/interfaces/block-builder.d.ts +44 -11
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +16 -2
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/configs.d.ts +77 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +10 -3
- package/dest/interfaces/get_logs_response.d.ts +15 -8
- package/dest/interfaces/get_logs_response.d.ts.map +1 -1
- package/dest/interfaces/l2_logs_source.d.ts +5 -3
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +13 -22
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +4 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.d.ts +16 -1
- package/dest/interfaces/prover-broker.d.ts.map +1 -1
- package/dest/interfaces/prover-broker.js +4 -1
- package/dest/interfaces/prover-client.d.ts +11 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +12 -4
- package/dest/interfaces/proving-job.d.ts +36 -36
- package/dest/interfaces/slasher.d.ts +9 -10
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +2 -2
- package/dest/interfaces/validator.d.ts +162 -65
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +11 -5
- package/dest/interfaces/world_state.d.ts +5 -4
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +3 -3
- 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 +13 -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 +13 -10
- package/dest/kernel/hints/build_transient_data_hints.d.ts +5 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -3
- package/dest/kernel/hints/index.d.ts +2 -2
- package/dest/kernel/hints/index.js +2 -2
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts +24 -0
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts.map +1 -0
- package/dest/kernel/hints/{key_validation_request_and_generator.js → key_validation_request_and_separator.js} +12 -15
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts → scoped_key_validation_request_and_separator.d.ts} +8 -8
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts.map → scoped_key_validation_request_and_separator.d.ts.map} +1 -1
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.js → scoped_key_validation_request_and_separator.js} +6 -6
- package/dest/kernel/private_circuit_public_inputs.d.ts +9 -9
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +16 -16
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +3 -3
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -3
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +11 -7
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +3 -3
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_validation_requests.d.ts +3 -3
- package/dest/kernel/private_validation_requests.js +9 -9
- package/dest/keys/derivation.d.ts +3 -3
- package/dest/keys/derivation.js +15 -15
- package/dest/keys/key_types.d.ts +3 -3
- package/dest/keys/key_types.d.ts.map +1 -1
- package/dest/keys/public_keys.js +2 -2
- package/dest/keys/utils.d.ts +1 -1
- package/dest/keys/utils.d.ts.map +1 -1
- package/dest/keys/utils.js +8 -4
- package/dest/kv-store/config.d.ts +17 -0
- package/dest/kv-store/config.d.ts.map +1 -0
- package/dest/kv-store/config.js +26 -0
- package/dest/kv-store/index.d.ts +2 -0
- package/dest/kv-store/index.d.ts.map +1 -0
- package/dest/kv-store/index.js +1 -0
- package/dest/l1-contracts/index.d.ts +2 -2
- package/dest/l1-contracts/index.d.ts.map +1 -1
- package/dest/l1-contracts/index.js +1 -1
- package/dest/logs/debug_log_store.d.ts +30 -0
- package/dest/logs/debug_log_store.d.ts.map +1 -0
- package/dest/logs/debug_log_store.js +30 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +35 -20
- package/dest/logs/extended_public_log.d.ts +13 -7
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/index.d.ts +4 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +3 -1
- package/dest/logs/log_filter.d.ts +4 -1
- package/dest/logs/log_filter.d.ts.map +1 -1
- package/dest/logs/log_filter.js +2 -1
- package/dest/logs/log_id.d.ts +17 -14
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +19 -17
- package/dest/logs/message_context.d.ts +4 -7
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +23 -9
- package/dest/logs/pending_tagged_log.d.ts +2 -3
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +2 -2
- package/dest/logs/pre_tag.d.ts +16 -11
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/private_log.d.ts +2 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/public_log.d.ts +4 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +2 -1
- package/dest/logs/shared_secret_derivation.d.ts +11 -10
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +15 -9
- package/dest/logs/siloed_tag.d.ts +12 -9
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +16 -6
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +5 -1
- package/dest/logs/tagging_index_range.d.ts +40 -0
- package/dest/logs/tagging_index_range.d.ts.map +1 -0
- package/dest/logs/tagging_index_range.js +8 -0
- package/dest/logs/tx_scoped_l2_log.d.ts +3 -1
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +7 -0
- package/dest/messaging/l1_to_l2_message.d.ts +3 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +11 -13
- package/dest/messaging/l1_to_l2_message_source.d.ts +4 -2
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +34 -8
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +72 -29
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/index.d.ts +1 -2
- package/dest/note/index.d.ts.map +1 -1
- package/dest/note/index.js +0 -1
- package/dest/note/note_dao.d.ts +1 -1
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +1 -4
- package/dest/p2p/attestation_utils.d.ts +11 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +45 -0
- package/dest/p2p/block_proposal.d.ts +16 -11
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +6 -13
- package/dest/p2p/checkpoint_attestation.d.ts +5 -6
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +3 -8
- package/dest/p2p/checkpoint_proposal.d.ts +32 -20
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +32 -47
- package/dest/p2p/client_type.d.ts +2 -5
- package/dest/p2p/client_type.d.ts.map +1 -1
- package/dest/p2p/client_type.js +0 -7
- package/dest/p2p/consensus_payload.d.ts +12 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +22 -15
- package/dest/p2p/constants.d.ts +3 -1
- package/dest/p2p/constants.d.ts.map +1 -1
- package/dest/p2p/constants.js +1 -0
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -1
- package/dest/p2p/peer_error.d.ts +3 -1
- package/dest/p2p/peer_error.d.ts.map +1 -1
- package/dest/p2p/peer_error.js +5 -0
- package/dest/p2p/topic_type.d.ts +3 -4
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +7 -24
- package/dest/parity/parity_base_private_inputs.d.ts +7 -3
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +7 -5
- package/dest/parity/parity_public_inputs.d.ts +7 -3
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +6 -3
- package/dest/proofs/chonk_proof.d.ts +46 -2
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +85 -10
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_headers_hash.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +8 -2
- package/dest/rollup/checkpoint_header.d.ts +2 -2
- package/dest/rollup/checkpoint_header.js +2 -2
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +6 -6
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +2 -2
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +6 -6
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +3 -3
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +6 -0
- package/dest/slashing/index.d.ts +2 -3
- package/dest/slashing/index.d.ts.map +1 -1
- package/dest/slashing/index.js +1 -2
- package/dest/slashing/serialization.d.ts +2 -6
- package/dest/slashing/serialization.d.ts.map +1 -1
- package/dest/slashing/serialization.js +0 -60
- package/dest/slashing/types.d.ts +10 -92
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +13 -15
- package/dest/slashing/{tally.d.ts → votes.d.ts} +8 -2
- package/dest/slashing/votes.d.ts.map +1 -0
- package/dest/slashing/{tally.js → votes.js} +35 -3
- package/dest/stats/stats.d.ts +1 -3
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +5 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +37 -56
- package/dest/tests/mocks.d.ts +12 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +47 -41
- package/dest/timetable/index.d.ts +87 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +229 -0
- package/dest/trees/nullifier_leaf.d.ts +2 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +3 -0
- package/dest/trees/public_data_leaf.d.ts +2 -1
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +7 -6
- package/dest/tx/block_header.d.ts +6 -3
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +7 -2
- package/dest/tx/capsule.d.ts +6 -2
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +9 -3
- package/dest/tx/fee_provider.d.ts +10 -0
- package/dest/tx/fee_provider.d.ts.map +1 -0
- package/dest/tx/fee_provider.js +1 -0
- package/dest/tx/global_variable_builder.d.ts +3 -4
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +4 -4
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/in_tx.d.ts +3 -3
- package/dest/tx/index.d.ts +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/indexed_tx_effect.d.ts +5 -5
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +2 -2
- package/dest/tx/private_execution_result.d.ts +6 -6
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +6 -6
- package/dest/tx/profiling.d.ts +17 -5
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +15 -5
- package/dest/tx/protocol_contracts.d.ts +1 -1
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/public_simulation_output.d.ts +4 -2
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +7 -3
- package/dest/tx/simulated_tx.d.ts +116 -5
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +7 -4
- package/dest/tx/tx.d.ts +8 -7
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -6
- package/dest/tx/tx_receipt.d.ts +33 -10
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +25 -21
- package/dest/tx/tx_request.js +2 -2
- package/dest/tx/validator/empty_validator.d.ts +2 -2
- package/dest/tx/validator/empty_validator.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +10 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +11 -1
- package/dest/tx/validator/tx_validator.d.ts +2 -2
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/types/shared.d.ts +1 -10
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +0 -9
- package/dest/update-checker/index.d.ts +3 -2
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +2 -1
- package/dest/update-checker/package_version.d.ts +3 -0
- package/dest/update-checker/package_version.d.ts.map +1 -0
- package/dest/update-checker/package_version.js +24 -0
- package/dest/update-checker/version_checker.d.ts +25 -0
- package/dest/update-checker/version_checker.d.ts.map +1 -0
- package/dest/update-checker/version_checker.js +50 -0
- package/dest/validators/errors.d.ts +6 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +7 -0
- package/dest/validators/schemas.d.ts +30 -30
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +4 -3
- package/dest/validators/types.d.ts +3 -3
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/versioning.d.ts +4 -2
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +4 -1
- package/dest/vks/verification_key.d.ts +2 -137
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +5 -126
- package/dest/world-state/genesis_data.d.ts +11 -0
- package/dest/world-state/genesis_data.d.ts.map +1 -0
- package/dest/world-state/genesis_data.js +4 -0
- package/dest/world-state/index.d.ts +2 -1
- package/dest/world-state/index.d.ts.map +1 -1
- package/dest/world-state/index.js +1 -0
- package/dest/world-state/world_state_revision.d.ts +8 -1
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +7 -1
- package/package.json +26 -13
- package/src/abi/abi.ts +25 -2
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/buffer.ts +25 -4
- package/src/abi/decoder.ts +36 -82
- package/src/abi/encoder.ts +85 -6
- package/src/abi/event_metadata_definition.ts +2 -0
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_call.ts +25 -3
- package/src/abi/function_selector.ts +4 -13
- package/src/abi/function_signature_decoder.ts +77 -0
- package/src/abi/index.ts +1 -0
- package/src/abi/note_selector.ts +3 -12
- package/src/abi/selector.ts +1 -1
- package/src/abi/utils.ts +25 -0
- package/src/auth_witness/auth_witness.ts +3 -3
- package/src/avm/revert_code.ts +26 -25
- package/src/aztec-address/index.ts +4 -10
- package/src/block/block_data.ts +25 -0
- package/src/block/block_hash.ts +32 -46
- package/src/block/block_parameter.ts +3 -3
- package/src/block/in_block.ts +6 -6
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +15 -2
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +51 -11
- package/src/block/l2_block_stream/interfaces.ts +6 -2
- package/src/block/l2_block_stream/l2_block_stream.ts +21 -0
- package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
- package/src/block/test/l2_tips_store_test_suite.ts +9 -2
- package/src/checkpoint/checkpoint.ts +54 -17
- package/src/checkpoint/checkpoint_data.ts +87 -0
- package/src/checkpoint/index.ts +2 -0
- package/src/checkpoint/published_checkpoint.ts +3 -1
- package/src/checkpoint/validate.ts +230 -0
- package/src/config/chain-config.ts +7 -1
- package/src/config/index.ts +2 -0
- package/src/config/pipelining-config.ts +31 -0
- package/src/config/sequencer-config.ts +47 -0
- package/src/contract/contract_address.ts +7 -7
- package/src/contract/contract_class.ts +3 -3
- package/src/contract/contract_class_id.ts +7 -6
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/contract/interfaces/node-info.ts +3 -0
- package/src/contract/private_function.ts +5 -3
- package/src/database-version/database_version.ts +87 -0
- package/src/database-version/version_manager.ts +1 -77
- package/src/epoch-helpers/index.ts +39 -0
- package/src/file-store/factory.ts +13 -4
- package/src/file-store/http.ts +29 -10
- package/src/file-store/index.ts +1 -0
- package/src/file-store/local.ts +15 -5
- package/src/file-store/s3.ts +12 -3
- package/src/gas/README.md +154 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas_fees.ts +20 -1
- package/src/gas/gas_settings.ts +65 -12
- package/src/gas/index.ts +1 -0
- package/src/ha-signing/config.ts +159 -0
- package/src/ha-signing/index.ts +29 -0
- package/src/ha-signing/local_config.ts +46 -0
- package/src/ha-signing/types.ts +126 -0
- package/src/hash/hash.ts +75 -10
- package/src/hash/map_slot.ts +3 -2
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +22 -5
- package/src/interfaces/aztec-node-admin.ts +31 -9
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/aztec-node.ts +82 -99
- package/src/interfaces/block-builder.ts +68 -11
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/configs.ts +36 -8
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +12 -21
- package/src/interfaces/p2p.ts +3 -14
- package/src/interfaces/prover-broker.ts +22 -0
- package/src/interfaces/prover-client.ts +17 -5
- package/src/interfaces/slasher.ts +4 -6
- package/src/interfaces/validator.ts +71 -37
- package/src/interfaces/world_state.ts +4 -3
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +14 -18
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +15 -18
- package/src/kernel/hints/build_transient_data_hints.ts +17 -2
- package/src/kernel/hints/index.ts +2 -2
- package/src/kernel/hints/{key_validation_request_and_generator.ts → key_validation_request_and_separator.ts} +12 -15
- package/src/kernel/hints/{scoped_key_validation_request_and_generator.ts → scoped_key_validation_request_and_separator.ts} +10 -10
- package/src/kernel/private_circuit_public_inputs.ts +14 -14
- package/src/kernel/private_kernel_circuit_public_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +14 -5
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_validation_requests.ts +8 -8
- package/src/keys/derivation.ts +15 -15
- package/src/keys/key_types.ts +6 -2
- package/src/keys/public_keys.ts +2 -2
- package/src/keys/utils.ts +8 -4
- package/src/kv-store/config.ts +36 -0
- package/src/kv-store/index.ts +1 -0
- package/src/l1-contracts/index.ts +1 -1
- package/src/logs/debug_log_store.ts +54 -0
- package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +41 -22
- package/src/logs/index.ts +3 -1
- package/src/logs/log_filter.ts +5 -0
- package/src/logs/log_id.ts +21 -18
- package/src/logs/message_context.ts +17 -7
- package/src/logs/pending_tagged_log.ts +1 -3
- package/src/logs/pre_tag.ts +5 -5
- package/src/logs/public_log.ts +4 -2
- package/src/logs/shared_secret_derivation.ts +21 -10
- package/src/logs/siloed_tag.ts +23 -13
- package/src/logs/tag.ts +9 -9
- package/src/logs/tagging_index_range.ts +24 -0
- package/src/logs/tx_scoped_l2_log.ts +16 -0
- package/src/messaging/l1_to_l2_message.ts +12 -9
- package/src/messaging/l1_to_l2_message_source.ts +3 -1
- package/src/messaging/l2_to_l1_membership.ts +101 -36
- package/src/noir/index.ts +2 -2
- package/src/note/index.ts +0 -1
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/attestation_utils.ts +56 -0
- package/src/p2p/block_proposal.ts +23 -14
- package/src/p2p/checkpoint_attestation.ts +11 -10
- package/src/p2p/checkpoint_proposal.ts +72 -62
- package/src/p2p/client_type.ts +0 -6
- package/src/p2p/consensus_payload.ts +25 -12
- package/src/p2p/constants.ts +3 -0
- package/src/p2p/gossipable.ts +4 -4
- package/src/p2p/index.ts +0 -1
- package/src/p2p/peer_error.ts +7 -0
- package/src/p2p/topic_type.ts +8 -15
- package/src/parity/parity_base_private_inputs.ts +10 -4
- package/src/parity/parity_public_inputs.ts +9 -2
- package/src/proofs/chonk_proof.ts +91 -5
- package/src/rollup/block_headers_hash.ts +11 -2
- package/src/rollup/checkpoint_header.ts +2 -2
- package/src/rollup/checkpoint_rollup_public_inputs.ts +5 -5
- package/src/rollup/root_rollup_public_inputs.ts +7 -7
- package/src/slashing/helpers.ts +8 -0
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +17 -35
- package/src/slashing/{tally.ts → votes.ts} +41 -2
- package/src/stats/stats.ts +0 -2
- package/src/tests/factories.ts +42 -68
- package/src/tests/mocks.ts +65 -33
- package/src/timetable/index.ts +346 -0
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/trees/public_data_leaf.ts +11 -5
- package/src/tx/block_header.ts +14 -5
- package/src/tx/capsule.ts +10 -2
- package/src/tx/fee_provider.ts +10 -0
- package/src/tx/global_variable_builder.ts +2 -3
- package/src/tx/global_variables.ts +3 -3
- package/src/tx/index.ts +1 -0
- package/src/tx/indexed_tx_effect.ts +2 -2
- package/src/tx/private_execution_result.ts +5 -5
- package/src/tx/profiling.ts +14 -5
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/public_simulation_output.ts +4 -0
- package/src/tx/simulated_tx.ts +14 -3
- package/src/tx/tx.ts +22 -13
- package/src/tx/tx_receipt.ts +32 -20
- package/src/tx/tx_request.ts +2 -2
- package/src/tx/validator/empty_validator.ts +1 -1
- package/src/tx/validator/error_texts.ts +13 -1
- package/src/tx/validator/tx_validator.ts +1 -1
- package/src/types/shared.ts +0 -10
- package/src/update-checker/index.ts +2 -1
- package/src/update-checker/package_version.ts +30 -0
- package/src/update-checker/version_checker.ts +65 -0
- package/src/validators/errors.ts +9 -0
- package/src/validators/schemas.ts +8 -1
- package/src/validators/types.ts +5 -4
- package/src/versioning/versioning.ts +4 -1
- package/src/vks/verification_key.ts +5 -184
- package/src/world-state/genesis_data.ts +15 -0
- package/src/world-state/index.ts +1 -0
- package/src/world-state/world_state_revision.ts +9 -1
- package/dest/abi/mocked_keys.d.ts +0 -2
- package/dest/abi/mocked_keys.d.ts.map +0 -1
- package/dest/abi/mocked_keys.js +0 -1
- package/dest/contract/private_function_membership_proof.d.ts +0 -32
- package/dest/contract/private_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/private_function_membership_proof.js +0 -124
- package/dest/contract/utility_function_membership_proof.d.ts +0 -27
- package/dest/contract/utility_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/utility_function_membership_proof.js +0 -87
- package/dest/database-version/index.d.ts +0 -2
- package/dest/database-version/index.d.ts.map +0 -1
- package/dest/database-version/index.js +0 -1
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +0 -30
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +0 -1
- package/dest/l1-contracts/slash_factory.d.ts +0 -45
- package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
- package/dest/l1-contracts/slash_factory.js +0 -157
- package/dest/logs/directional_app_tagging_secret.d.ts +0 -40
- package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
- package/dest/note/notes_filter.d.ts +0 -27
- package/dest/note/notes_filter.d.ts.map +0 -1
- package/dest/note/notes_filter.js +0 -11
- package/dest/slashing/empire.d.ts +0 -31
- package/dest/slashing/empire.d.ts.map +0 -1
- package/dest/slashing/empire.js +0 -85
- package/dest/slashing/tally.d.ts.map +0 -1
- package/dest/update-checker/update-checker.d.ts +0 -49
- package/dest/update-checker/update-checker.d.ts.map +0 -1
- package/dest/update-checker/update-checker.js +0 -130
- package/src/abi/mocked_keys.ts +0 -2
- package/src/contract/private_function_membership_proof.ts +0 -167
- package/src/contract/utility_function_membership_proof.ts +0 -118
- package/src/database-version/index.ts +0 -1
- package/src/l1-contracts/slash_factory.ts +0 -179
- package/src/note/notes_filter.ts +0 -38
- package/src/slashing/empire.ts +0 -102
- package/src/update-checker/update-checker.ts +0 -166
package/src/block/block_hash.ts
CHANGED
|
@@ -1,66 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import {
|
|
1
|
+
import { GENESIS_BLOCK_HEADER_HASH as GENESIS_BLOCK_HEADER_HASH_FR } from '@aztec/constants';
|
|
2
|
+
import { BaseFr, Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
4
|
+
import type { BufferReader } from '@aztec/foundation/serialize';
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { inspect } from 'util';
|
|
7
|
+
|
|
8
|
+
import { hexSchemaFor } from '../schemas/schemas.js';
|
|
6
9
|
|
|
7
10
|
/** Hash of an L2 block. */
|
|
8
|
-
export class
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
13
|
-
super(hash);
|
|
14
|
-
}
|
|
11
|
+
export class BlockHash extends BaseFr {
|
|
12
|
+
/** Branding for nominal typing. */
|
|
13
|
+
declare private readonly _branding: 'BlockHash';
|
|
14
|
+
|
|
15
|
+
static ZERO = new BlockHash(Fr.ZERO);
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
);
|
|
17
|
+
constructor(hash: Fr) {
|
|
18
|
+
super(hash);
|
|
36
19
|
}
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
return
|
|
21
|
+
[inspect.custom]() {
|
|
22
|
+
return `BlockHash<${this.toString()}>`;
|
|
40
23
|
}
|
|
41
24
|
|
|
42
|
-
|
|
43
|
-
return new
|
|
25
|
+
toFr(): Fr {
|
|
26
|
+
return new Fr(this.toBigInt());
|
|
44
27
|
}
|
|
45
28
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return
|
|
29
|
+
/** Type guard that checks if a value is a BlockHash instance. */
|
|
30
|
+
static isBlockHash(value: unknown): value is BlockHash {
|
|
31
|
+
return value instanceof BlockHash;
|
|
49
32
|
}
|
|
50
33
|
|
|
51
|
-
static
|
|
52
|
-
return new
|
|
34
|
+
static random() {
|
|
35
|
+
return new BlockHash(Fr.random());
|
|
53
36
|
}
|
|
54
37
|
|
|
55
|
-
static
|
|
56
|
-
return
|
|
38
|
+
static fromBuffer(buffer: Buffer | BufferReader): BlockHash {
|
|
39
|
+
return new BlockHash(Fr.fromBuffer(buffer));
|
|
57
40
|
}
|
|
58
41
|
|
|
59
|
-
static
|
|
60
|
-
return new
|
|
42
|
+
static fromString(str: string): BlockHash {
|
|
43
|
+
return new BlockHash(Fr.fromString(str));
|
|
61
44
|
}
|
|
62
45
|
|
|
63
|
-
static
|
|
64
|
-
return
|
|
46
|
+
static get schema() {
|
|
47
|
+
return hexSchemaFor(BlockHash) as ZodFor<BlockHash>;
|
|
65
48
|
}
|
|
66
49
|
}
|
|
50
|
+
|
|
51
|
+
/** The block header hash for the genesis block (block 0). */
|
|
52
|
+
export const GENESIS_BLOCK_HEADER_HASH: BlockHash = new BlockHash(GENESIS_BLOCK_HEADER_HASH_FR);
|
|
@@ -2,9 +2,9 @@ import { BlockNumberSchema } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { BlockHash } from './block_hash.js';
|
|
6
6
|
|
|
7
|
-
export const BlockParameterSchema = z.union([
|
|
7
|
+
export const BlockParameterSchema = z.union([BlockHash.schema, BlockNumberSchema, z.literal('latest')]);
|
|
8
8
|
|
|
9
|
-
/** Block parameter - either a specific BlockNumber, block hash (
|
|
9
|
+
/** Block parameter - either a specific BlockNumber, block hash (BlockHash), or 'latest' */
|
|
10
10
|
export type BlockParameter = z.infer<typeof BlockParameterSchema>;
|
package/src/block/in_block.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { BlockNumber, BlockNumberSchema } from '@aztec/foundation/branded-types'
|
|
|
2
2
|
|
|
3
3
|
import { type ZodTypeAny, z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { BlockHash } from './block_hash.js';
|
|
6
6
|
import type { L2Block } from './l2_block.js';
|
|
7
7
|
|
|
8
8
|
export type InBlock = {
|
|
9
9
|
l2BlockNumber: BlockNumber;
|
|
10
|
-
l2BlockHash:
|
|
10
|
+
l2BlockHash: BlockHash;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// Note: If you expand this type with indexInBlock, then delete `IndexedTxEffect` and use this type instead.
|
|
@@ -17,8 +17,8 @@ export type DataInBlock<T> = {
|
|
|
17
17
|
|
|
18
18
|
export function randomInBlock(): InBlock {
|
|
19
19
|
return {
|
|
20
|
-
l2BlockNumber: BlockNumber(Math.floor(Math.random() * 1000)),
|
|
21
|
-
l2BlockHash:
|
|
20
|
+
l2BlockNumber: BlockNumber(Math.floor(Math.random() * 1000) + 1),
|
|
21
|
+
l2BlockHash: BlockHash.random(),
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -33,14 +33,14 @@ export async function wrapDataInBlock<T>(data: T, block: L2Block): Promise<DataI
|
|
|
33
33
|
return {
|
|
34
34
|
data,
|
|
35
35
|
l2BlockNumber: block.number,
|
|
36
|
-
l2BlockHash:
|
|
36
|
+
l2BlockHash: await block.hash(),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export function inBlockSchema() {
|
|
41
41
|
return z.object({
|
|
42
42
|
l2BlockNumber: BlockNumberSchema,
|
|
43
|
-
l2BlockHash:
|
|
43
|
+
l2BlockHash: BlockHash.schema,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
|
package/src/block/index.ts
CHANGED
package/src/block/l2_block.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BlockBlobData, encodeBlockBlobData } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { DA_GAS_PER_FIELD } from '@aztec/constants';
|
|
2
3
|
import {
|
|
3
4
|
BlockNumber,
|
|
4
5
|
CheckpointNumber,
|
|
@@ -15,6 +16,7 @@ import { z } from 'zod';
|
|
|
15
16
|
import type { PrivateLog } from '../logs/private_log.js';
|
|
16
17
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
17
18
|
import { BlockHeader } from '../tx/block_header.js';
|
|
19
|
+
import type { BlockHash } from './block_hash.js';
|
|
18
20
|
import { Body } from './body.js';
|
|
19
21
|
import type { L2BlockInfo } from './l2_block_info.js';
|
|
20
22
|
|
|
@@ -89,7 +91,7 @@ export class L2Block {
|
|
|
89
91
|
* Returns the block's hash (hash of block header).
|
|
90
92
|
* @returns The block's hash.
|
|
91
93
|
*/
|
|
92
|
-
public hash(): Promise<
|
|
94
|
+
public hash(): Promise<BlockHash> {
|
|
93
95
|
return this.header.hash();
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -174,7 +176,7 @@ export class L2Block {
|
|
|
174
176
|
} & Partial<Parameters<typeof BlockHeader.random>[0]> = {},
|
|
175
177
|
): Promise<L2Block> {
|
|
176
178
|
const archive = new AppendOnlyTreeSnapshot(Fr.random(), blockNumber + 1);
|
|
177
|
-
const header = BlockHeader.random({
|
|
179
|
+
const header = BlockHeader.random({ ...blockHeaderOverrides, blockNumber });
|
|
178
180
|
const body = await Body.random({ txsPerBlock, makeTxOptions, ...txOptions });
|
|
179
181
|
return new L2Block(archive, header, body, checkpointNumber, indexWithinCheckpoint);
|
|
180
182
|
}
|
|
@@ -220,4 +222,15 @@ export class L2Block {
|
|
|
220
222
|
timestamp: this.header.globalVariables.timestamp,
|
|
221
223
|
};
|
|
222
224
|
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Compute how much DA gas this block uses.
|
|
228
|
+
*
|
|
229
|
+
* @remarks This assumes DA gas is computed solely based on the number of blob fields in transactions.
|
|
230
|
+
* This may change in the future, but we cannot access the actual DA gas used in a block since it's not exposed
|
|
231
|
+
* in the L2BlockHeader, so we have to rely on recomputing it.
|
|
232
|
+
*/
|
|
233
|
+
computeDAGasUsed(): number {
|
|
234
|
+
return this.body.txEffects.reduce((total, txEffect) => total + txEffect.getNumBlobFields(), 0) * DA_GAS_PER_FIELD;
|
|
235
|
+
}
|
|
223
236
|
}
|
|
@@ -5,8 +5,10 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
5
5
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
|
+
import { BlockHash } from './block_hash.js';
|
|
9
|
+
|
|
8
10
|
export type L2BlockInfo = {
|
|
9
|
-
blockHash?:
|
|
11
|
+
blockHash?: BlockHash;
|
|
10
12
|
archive: Fr;
|
|
11
13
|
lastArchive: Fr;
|
|
12
14
|
blockNumber: BlockNumber;
|
|
@@ -17,7 +19,7 @@ export type L2BlockInfo = {
|
|
|
17
19
|
|
|
18
20
|
export function randomBlockInfo(blockNumber?: BlockNumber | number): L2BlockInfo {
|
|
19
21
|
return {
|
|
20
|
-
blockHash:
|
|
22
|
+
blockHash: BlockHash.random(),
|
|
21
23
|
archive: Fr.random(),
|
|
22
24
|
lastArchive: Fr.random(),
|
|
23
25
|
blockNumber: BlockNumber(blockNumber ?? Math.floor(Math.random() * 100000) + 1),
|
|
@@ -28,7 +30,7 @@ export function randomBlockInfo(blockNumber?: BlockNumber | number): L2BlockInfo
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
export const BlockInfoSchema = z.object({
|
|
31
|
-
blockHash:
|
|
33
|
+
blockHash: BlockHash.schema.optional(),
|
|
32
34
|
archive: schemas.Fr,
|
|
33
35
|
lastArchive: schemas.Fr,
|
|
34
36
|
blockNumber: BlockNumberSchema,
|
|
@@ -39,7 +41,7 @@ export const BlockInfoSchema = z.object({
|
|
|
39
41
|
|
|
40
42
|
export function serializeBlockInfo(blockInfo: L2BlockInfo): Buffer {
|
|
41
43
|
return serializeToBuffer(
|
|
42
|
-
blockInfo.blockHash ??
|
|
44
|
+
blockInfo.blockHash ?? BlockHash.ZERO,
|
|
43
45
|
blockInfo.archive,
|
|
44
46
|
blockInfo.lastArchive,
|
|
45
47
|
blockInfo.blockNumber,
|
|
@@ -51,9 +53,9 @@ export function serializeBlockInfo(blockInfo: L2BlockInfo): Buffer {
|
|
|
51
53
|
|
|
52
54
|
export function deserializeBlockInfo(buffer: Buffer | BufferReader): L2BlockInfo {
|
|
53
55
|
const reader = BufferReader.asReader(buffer);
|
|
54
|
-
const blockHash =
|
|
56
|
+
const blockHash = BlockHash.fromBuffer(reader);
|
|
55
57
|
return {
|
|
56
|
-
blockHash: blockHash.equals(
|
|
58
|
+
blockHash: blockHash.equals(BlockHash.ZERO) ? undefined : blockHash,
|
|
57
59
|
archive: reader.readObject(Fr),
|
|
58
60
|
lastArchive: reader.readObject(Fr),
|
|
59
61
|
blockNumber: BlockNumber(reader.readNumber()),
|
|
@@ -13,6 +13,7 @@ import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
|
|
15
15
|
import type { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
16
|
+
import type { CheckpointData, CommonCheckpointData, ProposedCheckpointData } from '../checkpoint/checkpoint_data.js';
|
|
16
17
|
import type { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
17
18
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
18
19
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
@@ -20,6 +21,8 @@ import type { BlockHeader } from '../tx/block_header.js';
|
|
|
20
21
|
import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
|
|
21
22
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
22
23
|
import type { TxReceipt } from '../tx/tx_receipt.js';
|
|
24
|
+
import type { BlockData } from './block_data.js';
|
|
25
|
+
import type { BlockHash } from './block_hash.js';
|
|
23
26
|
import type { CheckpointedL2Block } from './checkpointed_l2_block.js';
|
|
24
27
|
import type { L2Block } from './l2_block.js';
|
|
25
28
|
import type { ValidateCheckpointNegativeResult, ValidateCheckpointResult } from './validate_block_result.js';
|
|
@@ -46,6 +49,12 @@ export interface L2BlockSource {
|
|
|
46
49
|
*/
|
|
47
50
|
getBlockNumber(): Promise<BlockNumber>;
|
|
48
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Gets the number of the latest L2 checkpoint processed by the block source implementation.
|
|
54
|
+
* @returns The number of the latest L2 checkpoint processed by the block source implementation.
|
|
55
|
+
*/
|
|
56
|
+
getCheckpointNumber(): Promise<CheckpointNumber>;
|
|
57
|
+
|
|
49
58
|
/**
|
|
50
59
|
* Gets the number of the latest L2 block proven seen by the block source implementation.
|
|
51
60
|
* @returns The number of the latest L2 block proven seen by the block source implementation.
|
|
@@ -59,9 +68,8 @@ export interface L2BlockSource {
|
|
|
59
68
|
getCheckpointedL2BlockNumber(): Promise<BlockNumber>;
|
|
60
69
|
|
|
61
70
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* TODO(#13569): Compute proper finalized block number based on L1 finalized block.
|
|
71
|
+
* Returns the finalized L2 block number. A block is finalized when it was proven
|
|
72
|
+
* in an L1 block that has itself been finalized on Ethereum.
|
|
65
73
|
* @returns The finalized block number.
|
|
66
74
|
*/
|
|
67
75
|
getFinalizedL2BlockNumber(): Promise<BlockNumber>;
|
|
@@ -97,12 +105,18 @@ export interface L2BlockSource {
|
|
|
97
105
|
*/
|
|
98
106
|
getCheckpointsForEpoch(epochNumber: EpochNumber): Promise<Checkpoint[]>;
|
|
99
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Gets lightweight checkpoint metadata for a given epoch, without fetching full block data.
|
|
110
|
+
* @param epochNumber - Epoch for which we want checkpoint data
|
|
111
|
+
*/
|
|
112
|
+
getCheckpointsDataForEpoch(epochNumber: EpochNumber): Promise<CheckpointData[]>;
|
|
113
|
+
|
|
100
114
|
/**
|
|
101
115
|
* Gets a block header by its hash.
|
|
102
116
|
* @param blockHash - The block hash to retrieve.
|
|
103
117
|
* @returns The requested block header (or undefined if not found).
|
|
104
118
|
*/
|
|
105
|
-
getBlockHeaderByHash(blockHash:
|
|
119
|
+
getBlockHeaderByHash(blockHash: BlockHash): Promise<BlockHeader | undefined>;
|
|
106
120
|
|
|
107
121
|
/**
|
|
108
122
|
* Gets a block header by its archive root.
|
|
@@ -111,6 +125,20 @@ export interface L2BlockSource {
|
|
|
111
125
|
*/
|
|
112
126
|
getBlockHeaderByArchive(archive: Fr): Promise<BlockHeader | undefined>;
|
|
113
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Gets block metadata (without tx data) by block number.
|
|
130
|
+
* @param number - The block number to retrieve.
|
|
131
|
+
* @returns The requested block data (or undefined if not found).
|
|
132
|
+
*/
|
|
133
|
+
getBlockData(number: BlockNumber): Promise<BlockData | undefined>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Gets block metadata (without tx data) by archive root.
|
|
137
|
+
* @param archive - The archive root to retrieve.
|
|
138
|
+
* @returns The requested block data (or undefined if not found).
|
|
139
|
+
*/
|
|
140
|
+
getBlockDataByArchive(archive: Fr): Promise<BlockData | undefined>;
|
|
141
|
+
|
|
114
142
|
/**
|
|
115
143
|
* Gets an L2 block by block number.
|
|
116
144
|
* @param number - The block number to return.
|
|
@@ -123,7 +151,7 @@ export interface L2BlockSource {
|
|
|
123
151
|
* @param blockHash - The block hash to retrieve.
|
|
124
152
|
* @returns The requested L2 block (or undefined if not found).
|
|
125
153
|
*/
|
|
126
|
-
getL2BlockByHash(blockHash:
|
|
154
|
+
getL2BlockByHash(blockHash: BlockHash): Promise<L2Block | undefined>;
|
|
127
155
|
|
|
128
156
|
/**
|
|
129
157
|
* Gets an L2 block by its archive root.
|
|
@@ -147,14 +175,18 @@ export interface L2BlockSource {
|
|
|
147
175
|
getSettledTxReceipt(txHash: TxHash): Promise<TxReceipt | undefined>;
|
|
148
176
|
|
|
149
177
|
/**
|
|
150
|
-
* Returns the
|
|
178
|
+
* Returns the last L2 slot number for which we have all L1 data needed to build the next checkpoint.
|
|
179
|
+
* Determined by the max of two signals: L1 block sync progress and latest synced checkpoint slot.
|
|
180
|
+
* The checkpoint signal handles missed L1 blocks, since a published checkpoint seals the message tree
|
|
181
|
+
* for the next checkpoint via the inbox LAG mechanism.
|
|
151
182
|
*/
|
|
152
|
-
|
|
183
|
+
getSyncedL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
153
184
|
|
|
154
185
|
/**
|
|
155
|
-
* Returns the
|
|
186
|
+
* Returns the last L2 epoch number that has been fully synchronized from L1.
|
|
187
|
+
* An epoch is fully synced when all its L2 slots have been fully synced.
|
|
156
188
|
*/
|
|
157
|
-
|
|
189
|
+
getSyncedL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
158
190
|
|
|
159
191
|
/**
|
|
160
192
|
* Returns all checkpointed block headers for a given epoch.
|
|
@@ -197,6 +229,12 @@ export interface L2BlockSource {
|
|
|
197
229
|
*/
|
|
198
230
|
getPendingChainValidationStatus(): Promise<ValidateCheckpointResult>;
|
|
199
231
|
|
|
232
|
+
/** Returns the checkpoint at the proposed chain tip. */
|
|
233
|
+
getProposedCheckpoint(): Promise<CommonCheckpointData | undefined>;
|
|
234
|
+
|
|
235
|
+
/** Returns proposed checkpoint, if set, undefined if not*/
|
|
236
|
+
getProposedCheckpointOnly(): Promise<ProposedCheckpointData | undefined>;
|
|
237
|
+
|
|
200
238
|
/** Force a sync. */
|
|
201
239
|
syncImmediate(): Promise<void>;
|
|
202
240
|
|
|
@@ -228,7 +266,7 @@ export interface L2BlockSource {
|
|
|
228
266
|
* @param blockHash - The block hash to retrieve.
|
|
229
267
|
* @returns The requested block (or undefined if not found).
|
|
230
268
|
*/
|
|
231
|
-
getCheckpointedBlockByHash(blockHash:
|
|
269
|
+
getCheckpointedBlockByHash(blockHash: BlockHash): Promise<CheckpointedL2Block | undefined>;
|
|
232
270
|
|
|
233
271
|
/**
|
|
234
272
|
* Gets a checkpointed block by its archive root.
|
|
@@ -280,12 +318,13 @@ export interface L2BlockSourceEventEmitter extends L2BlockSource {
|
|
|
280
318
|
* - proven: Proven block on L1.
|
|
281
319
|
* - finalized: Proven block on a finalized L1 block (not implemented, set to proven for now).
|
|
282
320
|
*/
|
|
283
|
-
export type L2BlockTag = 'proposed' | 'checkpointed' | 'proven' | 'finalized';
|
|
321
|
+
export type L2BlockTag = 'proposed' | 'proposedCheckpoint' | 'checkpointed' | 'proven' | 'finalized';
|
|
284
322
|
|
|
285
323
|
/** Tips of the L2 chain. */
|
|
286
324
|
export type L2Tips = {
|
|
287
325
|
proposed: L2BlockId;
|
|
288
326
|
checkpointed: L2TipId;
|
|
327
|
+
proposedCheckpoint: L2TipId;
|
|
289
328
|
proven: L2TipId;
|
|
290
329
|
finalized: L2TipId;
|
|
291
330
|
};
|
|
@@ -330,6 +369,7 @@ const L2TipIdSchema = z.object({
|
|
|
330
369
|
export const L2TipsSchema = z.object({
|
|
331
370
|
proposed: L2BlockIdSchema,
|
|
332
371
|
checkpointed: L2TipIdSchema,
|
|
372
|
+
proposedCheckpoint: L2TipIdSchema,
|
|
333
373
|
proven: L2TipIdSchema,
|
|
334
374
|
finalized: L2TipIdSchema,
|
|
335
375
|
});
|
|
@@ -2,10 +2,14 @@ import type { PublishedCheckpoint } from '../../checkpoint/published_checkpoint.
|
|
|
2
2
|
import type { L2Block } from '../l2_block.js';
|
|
3
3
|
import type { CheckpointId, L2BlockId, L2Tips } from '../l2_block_source.js';
|
|
4
4
|
|
|
5
|
+
/** Provides the current chain tips. Implemented by world-state, l2-tips-store, and AztecNode. */
|
|
6
|
+
export interface L2TipsProvider {
|
|
7
|
+
getL2Tips(): Promise<L2Tips>;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
/** Interface to the local view of the chain. Implemented by world-state and l2-tips-store. */
|
|
6
|
-
export interface L2BlockStreamLocalDataProvider {
|
|
11
|
+
export interface L2BlockStreamLocalDataProvider extends L2TipsProvider {
|
|
7
12
|
getL2BlockHash(number: number): Promise<string | undefined>;
|
|
8
|
-
getL2Tips(): Promise<L2Tips>;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
/** Interface to a handler of events emitted. */
|
|
@@ -109,6 +109,27 @@ export class L2BlockStream {
|
|
|
109
109
|
|
|
110
110
|
let nextBlockNumber = latestBlockNumber + 1;
|
|
111
111
|
let nextCheckpointToEmit = CheckpointNumber(localTips.checkpointed.checkpoint.number + 1);
|
|
112
|
+
|
|
113
|
+
// When startingBlock is set, also skip ahead for checkpoints.
|
|
114
|
+
if (
|
|
115
|
+
this.opts.startingBlock !== undefined &&
|
|
116
|
+
this.opts.startingBlock >= 1 &&
|
|
117
|
+
nextCheckpointToEmit <= sourceTips.checkpointed.checkpoint.number
|
|
118
|
+
) {
|
|
119
|
+
const startingBlockCheckpoints = await this.l2BlockSource.getCheckpointedBlocks(
|
|
120
|
+
BlockNumber(this.opts.startingBlock),
|
|
121
|
+
1,
|
|
122
|
+
);
|
|
123
|
+
if (startingBlockCheckpoints.length > 0) {
|
|
124
|
+
nextCheckpointToEmit = CheckpointNumber(
|
|
125
|
+
Math.max(nextCheckpointToEmit, startingBlockCheckpoints[0].checkpointNumber),
|
|
126
|
+
);
|
|
127
|
+
} else {
|
|
128
|
+
// startingBlock is past all checkpointed blocks; skip Loop 1 entirely.
|
|
129
|
+
nextCheckpointToEmit = CheckpointNumber(sourceTips.checkpointed.checkpoint.number + 1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
112
133
|
if (this.opts.skipFinalized) {
|
|
113
134
|
// When skipping finalized blocks we need to provide reliable reorg detection while fetching as few blocks as
|
|
114
135
|
// possible. Finalized blocks cannot be reorged by definition, so we can skip most of them. We do need the very
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
|
|
2
1
|
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
3
2
|
|
|
4
3
|
import type { PublishedCheckpoint } from '../../checkpoint/published_checkpoint.js';
|
|
4
|
+
import { GENESIS_BLOCK_HEADER_HASH } from '../block_hash.js';
|
|
5
5
|
import type { L2Block } from '../l2_block.js';
|
|
6
6
|
import {
|
|
7
7
|
type CheckpointId,
|
|
@@ -66,24 +66,29 @@ export abstract class L2TipsStoreBase implements L2BlockStreamEventHandler, L2Bl
|
|
|
66
66
|
|
|
67
67
|
public getL2Tips(): Promise<L2Tips> {
|
|
68
68
|
return this.runInTransaction(async () => {
|
|
69
|
-
const [proposedBlockId, finalizedBlockId, provenBlockId, checkpointedBlockId] =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
const [proposedBlockId, finalizedBlockId, provenBlockId, checkpointedBlockId, proposedCheckpointBlockId] =
|
|
70
|
+
await Promise.all([
|
|
71
|
+
this.getBlockId('proposed'),
|
|
72
|
+
this.getBlockId('finalized'),
|
|
73
|
+
this.getBlockId('proven'),
|
|
74
|
+
this.getBlockId('checkpointed'),
|
|
75
|
+
this.getBlockId('proposedCheckpoint'),
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
const [finalizedCheckpointId, provenCheckpointId, checkpointedCheckpointId, proposedCheckpointId] =
|
|
79
|
+
await Promise.all([
|
|
80
|
+
this.getCheckpointId('finalized'),
|
|
81
|
+
this.getCheckpointId('proven'),
|
|
82
|
+
this.getCheckpointId('checkpointed'),
|
|
83
|
+
this.getCheckpointId('proposedCheckpoint'),
|
|
84
|
+
]);
|
|
81
85
|
|
|
82
86
|
return {
|
|
83
87
|
proposed: proposedBlockId,
|
|
84
88
|
finalized: { block: finalizedBlockId, checkpoint: finalizedCheckpointId },
|
|
85
89
|
proven: { block: provenBlockId, checkpoint: provenCheckpointId },
|
|
86
90
|
checkpointed: { block: checkpointedBlockId, checkpoint: checkpointedCheckpointId },
|
|
91
|
+
proposedCheckpoint: { block: proposedCheckpointBlockId, checkpoint: proposedCheckpointId },
|
|
87
92
|
};
|
|
88
93
|
});
|
|
89
94
|
}
|
|
@@ -164,6 +169,12 @@ export abstract class L2TipsStoreBase implements L2BlockStreamEventHandler, L2Bl
|
|
|
164
169
|
await this.runInTransaction(async () => {
|
|
165
170
|
await this.saveTag('checkpointed', event.block);
|
|
166
171
|
await this.saveCheckpoint(event.checkpoint);
|
|
172
|
+
// proposedCheckpoint is always >= checkpointed. If checkpointed has caught up
|
|
173
|
+
// or surpassed it, advance proposedCheckpoint to match.
|
|
174
|
+
const proposedCheckpointBlock = await this.getBlockId('proposedCheckpoint');
|
|
175
|
+
if (event.block.number > proposedCheckpointBlock.number) {
|
|
176
|
+
await this.saveTag('proposedCheckpoint', event.block);
|
|
177
|
+
}
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
|
|
@@ -174,6 +185,7 @@ export abstract class L2TipsStoreBase implements L2BlockStreamEventHandler, L2Bl
|
|
|
174
185
|
await this.runInTransaction(async () => {
|
|
175
186
|
await this.saveTag('proposed', event.block);
|
|
176
187
|
await this.saveTag('checkpointed', event.block);
|
|
188
|
+
await this.saveTag('proposedCheckpoint', event.block);
|
|
177
189
|
const storeProven = await this.getBlockId('proven');
|
|
178
190
|
if (storeProven.number > event.block.number) {
|
|
179
191
|
await this.saveTag('proven', event.block);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { GENESIS_BLOCK_HEADER_HASH } from '@aztec/constants';
|
|
2
1
|
import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
3
2
|
import { times } from '@aztec/foundation/collection';
|
|
4
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -13,6 +12,7 @@ import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/
|
|
|
13
12
|
|
|
14
13
|
import { jestExpect as expect } from '@jest/expect';
|
|
15
14
|
|
|
15
|
+
import { GENESIS_BLOCK_HEADER_HASH } from '../block_hash.js';
|
|
16
16
|
import type { L2TipsStore } from '../l2_block_stream/index.js';
|
|
17
17
|
|
|
18
18
|
export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
@@ -67,11 +67,18 @@ export function testL2TipsStore(makeTipsStore: () => Promise<L2TipsStore>) {
|
|
|
67
67
|
checkpoint: makeCheckpointIdForBlock(blockNumber),
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
const makeTips = (
|
|
70
|
+
const makeTips = (
|
|
71
|
+
proposed: number,
|
|
72
|
+
proven: number,
|
|
73
|
+
finalized: number,
|
|
74
|
+
checkpointed: number = 0,
|
|
75
|
+
proposedCheckpoint: number = 0,
|
|
76
|
+
) => ({
|
|
71
77
|
proposed: makeTip(proposed),
|
|
72
78
|
proven: makeTipId(proven),
|
|
73
79
|
finalized: makeTipId(finalized),
|
|
74
80
|
checkpointed: makeTipId(checkpointed),
|
|
81
|
+
proposedCheckpoint: makeTipId(proposedCheckpoint),
|
|
75
82
|
});
|
|
76
83
|
|
|
77
84
|
const makeCheckpoint = async (checkpointNumber: number, blocks: L2Block[]): Promise<PublishedCheckpoint> => {
|