@aztec/stdlib 0.0.1-commit.e558bd1c → 0.0.1-commit.e5a3663dd
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_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/attestation_info.d.ts +3 -2
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -5
- package/dest/block/block_data.d.ts +341 -0
- package/dest/block/block_data.d.ts.map +1 -0
- package/dest/block/block_data.js +26 -0
- package/dest/block/block_hash.d.ts +11 -10
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +10 -9
- package/dest/block/block_parameter.d.ts +30 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +36 -2
- 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 +9 -1
- 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 +149 -10
- 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/proposal/attestations_and_signers.d.ts +13 -6
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +26 -18
- 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 +192 -0
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_data.js +38 -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 +2 -2
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +9 -3
- 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 +14 -0
- package/dest/config/sequencer-config.d.ts.map +1 -0
- package/dest/config/sequencer-config.js +38 -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/epoch-helpers/index.d.ts +15 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +18 -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.js +2 -2
- 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 -3
- package/dest/interfaces/aztec-node-admin.d.ts +132 -47
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +14 -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 +59 -54
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +23 -16
- package/dest/interfaces/block-builder.d.ts +39 -12
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +13 -6
- package/dest/interfaces/block_response.d.ts +156 -0
- package/dest/interfaces/block_response.d.ts.map +1 -0
- package/dest/interfaces/block_response.js +24 -0
- package/dest/interfaces/chain_tips.d.ts +304 -0
- package/dest/interfaces/chain_tips.d.ts.map +1 -0
- package/dest/interfaces/chain_tips.js +11 -0
- package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_parameter.js +20 -0
- package/dest/interfaces/checkpoint_response.d.ts +312 -0
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_response.js +26 -0
- package/dest/interfaces/client.d.ts +7 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +6 -0
- package/dest/interfaces/configs.d.ts +87 -32
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +12 -3
- package/dest/interfaces/l1_publish_info.d.ts +43 -0
- package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
- package/dest/interfaces/l1_publish_info.js +26 -0
- 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 +3 -8
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +6 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -4
- package/dest/interfaces/proving-job.d.ts +202 -202
- package/dest/interfaces/server.d.ts +6 -1
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +5 -0
- package/dest/interfaces/slasher.d.ts +5 -10
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -2
- package/dest/interfaces/validator.d.ts +138 -64
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +12 -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.js +8 -8
- 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.js +5 -5
- 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/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 +1 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +1 -2
- 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 -7
- 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 +23 -15
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +46 -43
- package/dest/p2p/checkpoint_attestation.d.ts +11 -8
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +17 -24
- package/dest/p2p/checkpoint_proposal.d.ts +29 -23
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +43 -65
- 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 +27 -7
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +40 -21
- 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/signature_utils.d.ts +28 -19
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +118 -21
- package/dest/p2p/signed_txs.d.ts +15 -13
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +26 -24
- 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 +3 -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 +8 -92
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +7 -15
- package/dest/slashing/{tally.d.ts → votes.d.ts} +7 -2
- package/dest/slashing/votes.d.ts.map +1 -0
- package/dest/slashing/{tally.js → votes.js} +30 -2
- 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 +14 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +65 -46
- package/dest/timetable/index.d.ts +87 -0
- package/dest/timetable/index.d.ts.map +1 -0
- package/dest/timetable/index.js +243 -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 +4 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +7 -3
- 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/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 +1 -1
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +1 -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 +19 -9
- 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 +29 -6
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +23 -19
- 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 +13 -11
- 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/attestation_info.ts +11 -11
- package/src/block/block_data.ts +42 -0
- package/src/block/block_hash.ts +21 -14
- package/src/block/block_parameter.ts +35 -2
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +13 -1
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +88 -9
- 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/proposal/attestations_and_signers.ts +32 -17
- 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 +91 -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 +9 -4
- package/src/config/index.ts +2 -0
- package/src/config/pipelining-config.ts +31 -0
- package/src/config/sequencer-config.ts +65 -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/epoch-helpers/index.ts +30 -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 +2 -2
- package/src/interfaces/allowed_element.ts +29 -9
- package/src/interfaces/archiver.ts +28 -2
- package/src/interfaces/aztec-node-admin.ts +31 -8
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/aztec-node.ts +129 -85
- package/src/interfaces/block-builder.ts +61 -14
- package/src/interfaces/block_response.ts +79 -0
- package/src/interfaces/chain_tips.ts +24 -0
- package/src/interfaces/checkpoint_parameter.ts +22 -0
- package/src/interfaces/checkpoint_response.ts +84 -0
- package/src/interfaces/client.ts +6 -0
- package/src/interfaces/configs.ts +43 -8
- package/src/interfaces/l1_publish_info.ts +40 -0
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +12 -21
- package/src/interfaces/p2p.ts +2 -13
- package/src/interfaces/prover-client.ts +10 -5
- package/src/interfaces/server.ts +5 -0
- package/src/interfaces/slasher.ts +2 -6
- package/src/interfaces/validator.ts +76 -36
- 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 +8 -8
- package/src/keys/key_types.ts +6 -2
- package/src/keys/public_keys.ts +2 -2
- package/src/keys/utils.ts +5 -5
- 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 +1 -2
- 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 -14
- 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 +97 -39
- package/src/p2p/checkpoint_attestation.ts +26 -30
- package/src/p2p/checkpoint_proposal.ts +109 -84
- package/src/p2p/client_type.ts +0 -6
- package/src/p2p/consensus_payload.ts +59 -24
- 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/signature_utils.ts +110 -25
- package/src/p2p/signed_txs.ts +46 -28
- 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 +4 -0
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +10 -35
- package/src/slashing/{tally.ts → votes.ts} +34 -1
- package/src/tests/factories.ts +42 -68
- package/src/tests/mocks.ts +103 -53
- package/src/timetable/index.ts +361 -0
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/trees/public_data_leaf.ts +11 -5
- package/src/tx/block_header.ts +10 -4
- 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 +1 -2
- package/src/tx/private_execution_result.ts +5 -5
- package/src/tx/profiling.ts +18 -9
- 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 +28 -16
- 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/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 -158
- 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 -86
- 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/l1-contracts/slash_factory.ts +0 -180
- package/src/note/notes_filter.ts +0 -38
- package/src/slashing/empire.ts +0 -103
- package/src/update-checker/update-checker.ts +0 -166
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import { type L1ContractAddresses, L1ContractAddressesSchema } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import {
|
|
4
|
-
BlockNumber,
|
|
4
|
+
type BlockNumber,
|
|
5
5
|
BlockNumberPositiveSchema,
|
|
6
6
|
BlockNumberSchema,
|
|
7
|
+
type CheckpointNumber,
|
|
7
8
|
CheckpointNumberPositiveSchema,
|
|
8
|
-
|
|
9
|
+
CheckpointNumberSchema,
|
|
10
|
+
type EpochNumber,
|
|
9
11
|
EpochNumberSchema,
|
|
10
12
|
type SlotNumber,
|
|
11
13
|
} from '@aztec/foundation/branded-types';
|
|
@@ -21,9 +23,8 @@ import { BlockHash } from '../block/block_hash.js';
|
|
|
21
23
|
import { type BlockParameter, BlockParameterSchema } from '../block/block_parameter.js';
|
|
22
24
|
import { CheckpointedL2Block } from '../block/checkpointed_l2_block.js';
|
|
23
25
|
import { type DataInBlock, dataInBlockSchemaFor } from '../block/in_block.js';
|
|
24
|
-
import {
|
|
25
|
-
import { type
|
|
26
|
-
import { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
26
|
+
import { type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
|
|
27
|
+
import { type CheckpointData, CheckpointDataSchema } from '../checkpoint/checkpoint_data.js';
|
|
27
28
|
import {
|
|
28
29
|
type ContractClassPublic,
|
|
29
30
|
ContractClassPublicSchema,
|
|
@@ -34,6 +35,7 @@ import {
|
|
|
34
35
|
type ProtocolContractAddresses,
|
|
35
36
|
ProtocolContractAddressesSchema,
|
|
36
37
|
} from '../contract/index.js';
|
|
38
|
+
import { ManaUsageEstimate } from '../gas/fee_math.js';
|
|
37
39
|
import { GasFees } from '../gas/gas_fees.js';
|
|
38
40
|
import { SiloedTag, Tag, TxScopedL2Log } from '../logs/index.js';
|
|
39
41
|
import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
|
|
@@ -57,6 +59,20 @@ import type { SingleValidatorStats, ValidatorsStats } from '../validators/types.
|
|
|
57
59
|
import { type ComponentsVersions, getVersioningResponseHandler } from '../versioning/index.js';
|
|
58
60
|
import { type AllowedElement, AllowedElementSchema } from './allowed_element.js';
|
|
59
61
|
import { MAX_RPC_BLOCKS_LEN, MAX_RPC_CHECKPOINTS_LEN, MAX_RPC_LEN, MAX_RPC_TXS_LEN } from './api_limit.js';
|
|
62
|
+
import {
|
|
63
|
+
type BlockIncludeOptions,
|
|
64
|
+
BlockIncludeOptionsSchema,
|
|
65
|
+
type BlockResponse,
|
|
66
|
+
BlockResponseSchema,
|
|
67
|
+
} from './block_response.js';
|
|
68
|
+
import { type ChainTip, ChainTipSchema, type ChainTips, ChainTipsSchema } from './chain_tips.js';
|
|
69
|
+
import { type CheckpointParameter, CheckpointParameterSchema } from './checkpoint_parameter.js';
|
|
70
|
+
import {
|
|
71
|
+
type CheckpointIncludeOptions,
|
|
72
|
+
CheckpointIncludeOptionsSchema,
|
|
73
|
+
type CheckpointResponse,
|
|
74
|
+
CheckpointResponseSchema,
|
|
75
|
+
} from './checkpoint_response.js';
|
|
60
76
|
import {
|
|
61
77
|
type GetContractClassLogsResponse,
|
|
62
78
|
GetContractClassLogsResponseSchema,
|
|
@@ -69,16 +85,7 @@ import { type WorldStateSyncStatus, WorldStateSyncStatusSchema } from './world_s
|
|
|
69
85
|
* The aztec node.
|
|
70
86
|
* We will probably implement the additional interfaces by means other than Aztec Node as it's currently a privacy leak
|
|
71
87
|
*/
|
|
72
|
-
export interface AztecNode
|
|
73
|
-
extends Pick<
|
|
74
|
-
L2BlockSource,
|
|
75
|
-
'getBlocks' | 'getCheckpoints' | 'getBlockHeader' | 'getL2Tips' | 'getCheckpointedBlocks'
|
|
76
|
-
> {
|
|
77
|
-
/**
|
|
78
|
-
* Returns the tips of the L2 chain.
|
|
79
|
-
*/
|
|
80
|
-
getL2Tips(): Promise<L2Tips>;
|
|
81
|
-
|
|
88
|
+
export interface AztecNode {
|
|
82
89
|
/**
|
|
83
90
|
* Returns the sync status of the node's world state
|
|
84
91
|
*/
|
|
@@ -114,6 +121,7 @@ export interface AztecNode
|
|
|
114
121
|
* @param referenceBlock - The block parameter (block number, block hash, or 'latest') at which to get the data.
|
|
115
122
|
* @param nullifier - Nullifier we try to find the low nullifier witness for.
|
|
116
123
|
* @returns The low nullifier membership witness (if found).
|
|
124
|
+
* @throws If the nullifier already exists in the tree, since non-inclusion cannot be proven.
|
|
117
125
|
* @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
|
|
118
126
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
119
127
|
* we are trying to prove non-inclusion for.
|
|
@@ -172,14 +180,14 @@ export interface AztecNode
|
|
|
172
180
|
l1ToL2Message: Fr,
|
|
173
181
|
): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>] | undefined>;
|
|
174
182
|
|
|
175
|
-
/** Returns the L2
|
|
176
|
-
|
|
183
|
+
/** Returns the L2 checkpoint number in which this L1 to L2 message becomes available, or undefined if not found. */
|
|
184
|
+
getL1ToL2MessageCheckpoint(l1ToL2Message: Fr): Promise<CheckpointNumber | undefined>;
|
|
177
185
|
|
|
178
186
|
/**
|
|
179
187
|
* Returns whether an L1 to L2 message is synced by archiver.
|
|
180
188
|
* @param l1ToL2Message - The L1 to L2 message to check.
|
|
181
189
|
* @returns Whether the message is synced.
|
|
182
|
-
* @deprecated Use `
|
|
190
|
+
* @deprecated Use `getL1ToL2MessageCheckpoint` instead. This method may return true even if the message is not ready to use.
|
|
183
191
|
*/
|
|
184
192
|
isL1ToL2MessageSynced(l1ToL2Message: Fr): Promise<boolean>;
|
|
185
193
|
|
|
@@ -192,43 +200,76 @@ export interface AztecNode
|
|
|
192
200
|
getL2ToL1Messages(epoch: EpochNumber): Promise<Fr[][][][]>;
|
|
193
201
|
|
|
194
202
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
* @returns The requested block.
|
|
203
|
+
* Returns the block number at a given chain tip, or the latest proposed block number when
|
|
204
|
+
* `tip` is omitted.
|
|
198
205
|
*/
|
|
199
|
-
|
|
206
|
+
getBlockNumber(tip?: ChainTip): Promise<BlockNumber>;
|
|
200
207
|
|
|
201
208
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
209
|
+
* Returns the checkpoint number at a given chain tip, or the latest checkpoint number when
|
|
210
|
+
* `tip` is omitted.
|
|
211
|
+
*
|
|
212
|
+
* @remarks **Semantic foot-gun**: block-side `'proposed'` means "latest proposed block" (chain
|
|
213
|
+
* head), but checkpoint-side `'proposed'` means "latest confirmed checkpoint" — pre-L1-confirm
|
|
214
|
+
* checkpoints are not exposed over RPC. `'checkpointed'` on the checkpoint side is equivalent.
|
|
205
215
|
*/
|
|
206
|
-
|
|
216
|
+
getCheckpointNumber(tip?: ChainTip): Promise<CheckpointNumber>;
|
|
217
|
+
|
|
218
|
+
/** Returns the tips of the L2 chain. */
|
|
219
|
+
getChainTips(): Promise<ChainTips>;
|
|
220
|
+
|
|
221
|
+
// TODO(spl/new-rpc-api): the following methods are kept on the interface as a stop-gap because
|
|
222
|
+
// `L2BlockStream` (used by PXE's block synchronizer) and `computeL2ToL1MembershipWitness` (used
|
|
223
|
+
// by end-to-end tests) still consume the internal archiver shapes. Remove them when those
|
|
224
|
+
// consumers are rewired to the unified `BlockResponse` / `CheckpointResponse` API.
|
|
225
|
+
/** @deprecated Scheduled for removal; use `getChainTips` for public callers. */
|
|
226
|
+
getL2Tips(): Promise<L2Tips>;
|
|
227
|
+
/** @deprecated Scheduled for removal; use `getBlock(param).then(r => r?.header)`. */
|
|
228
|
+
getBlockHeader(number: BlockNumber | 'latest'): Promise<BlockHeader | undefined>;
|
|
229
|
+
/** @deprecated Scheduled for removal; use `getBlocks(from, limit, { includeL1PublishInfo: true, includeAttestations: true })`. */
|
|
230
|
+
getCheckpointedBlocks(from: BlockNumber, limit: number): Promise<CheckpointedL2Block[]>;
|
|
231
|
+
/** @deprecated Scheduled for removal; use `getCheckpoints(from, limit)` over an explicit checkpoint range. */
|
|
232
|
+
getCheckpointsDataForEpoch(epoch: EpochNumber): Promise<CheckpointData[]>;
|
|
207
233
|
|
|
208
234
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* @
|
|
235
|
+
* Unified block fetch. Returns the block identified by `param`, with optional fields controlled
|
|
236
|
+
* by `options`.
|
|
237
|
+
* @param param - A block number, block hash, archive root, chain-tip name, or object variant.
|
|
238
|
+
* @param options - Narrowing options: `includeTransactions`, `includeL1PublishInfo`, `includeAttestations`.
|
|
212
239
|
*/
|
|
213
|
-
|
|
240
|
+
getBlock<Opts extends BlockIncludeOptions = {}>(
|
|
241
|
+
param: BlockParameter,
|
|
242
|
+
options?: Opts,
|
|
243
|
+
): Promise<BlockResponse<Opts> | undefined>;
|
|
214
244
|
|
|
215
245
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
246
|
+
* Returns up to `limit` blocks starting from `from`, projected to the {@link BlockResponse}
|
|
247
|
+
* shape determined by `options`.
|
|
218
248
|
*/
|
|
219
|
-
|
|
249
|
+
getBlocks<Opts extends BlockIncludeOptions = {}>(
|
|
250
|
+
from: BlockNumber,
|
|
251
|
+
limit: number,
|
|
252
|
+
options?: Opts,
|
|
253
|
+
): Promise<BlockResponse<Opts>[]>;
|
|
220
254
|
|
|
221
255
|
/**
|
|
222
|
-
*
|
|
223
|
-
*
|
|
256
|
+
* Unified checkpoint fetch. Returns the checkpoint identified by `param`, with optional fields
|
|
257
|
+
* controlled by `options`.
|
|
224
258
|
*/
|
|
225
|
-
|
|
259
|
+
getCheckpoint<Opts extends CheckpointIncludeOptions = {}>(
|
|
260
|
+
param: CheckpointParameter,
|
|
261
|
+
options?: Opts,
|
|
262
|
+
): Promise<CheckpointResponse<Opts> | undefined>;
|
|
226
263
|
|
|
227
264
|
/**
|
|
228
|
-
*
|
|
229
|
-
* @
|
|
265
|
+
* Returns up to `limit` checkpoints starting from `from`, projected to the
|
|
266
|
+
* {@link CheckpointResponse} shape determined by `options`.
|
|
230
267
|
*/
|
|
231
|
-
|
|
268
|
+
getCheckpoints<Opts extends CheckpointIncludeOptions = {}>(
|
|
269
|
+
from: CheckpointNumber,
|
|
270
|
+
limit: number,
|
|
271
|
+
options?: Opts,
|
|
272
|
+
): Promise<CheckpointResponse<Opts>[]>;
|
|
232
273
|
|
|
233
274
|
/**
|
|
234
275
|
* Method to determine if the node is ready to accept transactions.
|
|
@@ -243,20 +284,21 @@ export interface AztecNode
|
|
|
243
284
|
*/
|
|
244
285
|
getNodeInfo(): Promise<NodeInfo>;
|
|
245
286
|
|
|
246
|
-
/**
|
|
247
|
-
* Method to request blocks. Will attempt to return all requested blocks but will return only those available.
|
|
248
|
-
* @param from - The start of the range of blocks to return.
|
|
249
|
-
* @param limit - The maximum number of blocks to return.
|
|
250
|
-
* @returns The blocks requested.
|
|
251
|
-
*/
|
|
252
|
-
getBlocks(from: BlockNumber, limit: number): Promise<L2Block[]>;
|
|
253
|
-
|
|
254
287
|
/**
|
|
255
288
|
* Method to fetch the current min fees.
|
|
256
289
|
* @returns The current min fees.
|
|
257
290
|
*/
|
|
258
291
|
getCurrentMinFees(): Promise<GasFees>;
|
|
259
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Returns predicted min fees for the current slot and next N slots.
|
|
295
|
+
* Each entry accounts for the L1 gas oracle transition and congestion growth based on the
|
|
296
|
+
* given mana usage estimate. Defaults to target usage (steady state).
|
|
297
|
+
* @param manaUsage - Expected mana usage per checkpoint (none, target, or limit).
|
|
298
|
+
* @returns An array of GasFees, one per slot in the prediction window.
|
|
299
|
+
*/
|
|
300
|
+
getPredictedMinFees(manaUsage?: ManaUsageEstimate): Promise<GasFees[]>;
|
|
301
|
+
|
|
260
302
|
/**
|
|
261
303
|
* Method to fetch the current max priority fee of txs in the mempool.
|
|
262
304
|
* @returns The current max priority fees.
|
|
@@ -409,20 +451,6 @@ export interface AztecNode
|
|
|
409
451
|
*/
|
|
410
452
|
getPublicStorageAt(referenceBlock: BlockParameter, contract: AztecAddress, slot: Fr): Promise<Fr>;
|
|
411
453
|
|
|
412
|
-
/**
|
|
413
|
-
* Returns the block header for a given block number, block hash, or 'latest'.
|
|
414
|
-
* @param block - The block parameter (block number, block hash, or 'latest'). Defaults to 'latest'.
|
|
415
|
-
* @returns The requested block header.
|
|
416
|
-
*/
|
|
417
|
-
getBlockHeader(block?: BlockParameter): Promise<BlockHeader | undefined>;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Get a block header specified by its archive root.
|
|
421
|
-
* @param archive - The archive root being requested.
|
|
422
|
-
* @returns The requested block header.
|
|
423
|
-
*/
|
|
424
|
-
getBlockHeaderByArchive(archive: Fr): Promise<BlockHeader | undefined>;
|
|
425
|
-
|
|
426
454
|
/** Returns stats for validators if enabled. */
|
|
427
455
|
getValidatorsStats(): Promise<ValidatorsStats>;
|
|
428
456
|
|
|
@@ -443,7 +471,7 @@ export interface AztecNode
|
|
|
443
471
|
/**
|
|
444
472
|
* Returns true if the transaction is valid for inclusion at the current state. Valid transactions can be
|
|
445
473
|
* made invalid by *other* transactions if e.g. they emit the same nullifiers, or come become invalid
|
|
446
|
-
* due to e.g. the
|
|
474
|
+
* due to e.g. the expiration_timestamp property.
|
|
447
475
|
* @param tx - The transaction to validate for correctness.
|
|
448
476
|
* @param isSimulation - True if the transaction is a simulated one without generated proofs. (Optional)
|
|
449
477
|
* @param skipFeeEnforcement - True if the validation of the fee should be skipped. Useful when the simulation is for estimating fee (Optional)
|
|
@@ -478,8 +506,6 @@ const MAX_SIGNATURES_PER_REGISTER_CALL = 100;
|
|
|
478
506
|
const MAX_SIGNATURE_LEN = 10000;
|
|
479
507
|
|
|
480
508
|
export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
481
|
-
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
482
|
-
|
|
483
509
|
getWorldStateSyncStatus: z.function().args().returns(WorldStateSyncStatusSchema),
|
|
484
510
|
|
|
485
511
|
findLeavesIndexes: z
|
|
@@ -517,7 +543,7 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
517
543
|
.args(BlockParameterSchema, schemas.Fr)
|
|
518
544
|
.returns(z.tuple([schemas.BigInt, SiblingPath.schemaFor(L1_TO_L2_MSG_TREE_HEIGHT)]).optional()),
|
|
519
545
|
|
|
520
|
-
|
|
546
|
+
getL1ToL2MessageCheckpoint: z.function().args(schemas.Fr).returns(CheckpointNumberSchema.optional()),
|
|
521
547
|
|
|
522
548
|
isL1ToL2MessageSynced: z.function().args(schemas.Fr).returns(z.boolean()),
|
|
523
549
|
|
|
@@ -526,39 +552,61 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
526
552
|
.args(EpochNumberSchema)
|
|
527
553
|
.returns(z.array(z.array(z.array(z.array(schemas.Fr))))),
|
|
528
554
|
|
|
529
|
-
|
|
555
|
+
getBlockNumber: z.function().args(optional(ChainTipSchema)).returns(BlockNumberSchema),
|
|
530
556
|
|
|
531
|
-
|
|
557
|
+
getCheckpointNumber: z.function().args(optional(ChainTipSchema)).returns(CheckpointNumberSchema),
|
|
532
558
|
|
|
533
|
-
|
|
559
|
+
getChainTips: z.function().args().returns(ChainTipsSchema),
|
|
534
560
|
|
|
535
|
-
|
|
561
|
+
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
536
562
|
|
|
537
|
-
|
|
563
|
+
getBlockHeader: z
|
|
564
|
+
.function()
|
|
565
|
+
.args(z.union([BlockNumberSchema, z.literal('latest')]))
|
|
566
|
+
.returns(BlockHeader.schema.optional()),
|
|
538
567
|
|
|
539
|
-
|
|
568
|
+
getCheckpointedBlocks: z
|
|
569
|
+
.function()
|
|
570
|
+
.args(BlockNumberPositiveSchema, z.number().gt(0).lte(MAX_RPC_BLOCKS_LEN))
|
|
571
|
+
.returns(z.array(CheckpointedL2Block.schema)),
|
|
540
572
|
|
|
541
|
-
|
|
573
|
+
getCheckpointsDataForEpoch: z.function().args(EpochNumberSchema).returns(z.array(CheckpointDataSchema)),
|
|
542
574
|
|
|
543
|
-
|
|
575
|
+
getBlock: z
|
|
576
|
+
.function()
|
|
577
|
+
.args(BlockParameterSchema, optional(BlockIncludeOptionsSchema))
|
|
578
|
+
.returns(BlockResponseSchema.optional()),
|
|
544
579
|
|
|
545
580
|
getBlocks: z
|
|
546
581
|
.function()
|
|
547
|
-
.args(BlockNumberPositiveSchema, z.number().gt(0).lte(MAX_RPC_BLOCKS_LEN))
|
|
548
|
-
.returns(z.array(
|
|
582
|
+
.args(BlockNumberPositiveSchema, z.number().gt(0).lte(MAX_RPC_BLOCKS_LEN), optional(BlockIncludeOptionsSchema))
|
|
583
|
+
.returns(z.array(BlockResponseSchema)),
|
|
549
584
|
|
|
550
|
-
|
|
585
|
+
getCheckpoint: z
|
|
551
586
|
.function()
|
|
552
|
-
.args(
|
|
553
|
-
.returns(
|
|
587
|
+
.args(CheckpointParameterSchema, optional(CheckpointIncludeOptionsSchema))
|
|
588
|
+
.returns(CheckpointResponseSchema.optional()),
|
|
554
589
|
|
|
555
|
-
|
|
590
|
+
getCheckpoints: z
|
|
556
591
|
.function()
|
|
557
|
-
.args(
|
|
558
|
-
|
|
592
|
+
.args(
|
|
593
|
+
CheckpointNumberPositiveSchema,
|
|
594
|
+
z.number().gt(0).lte(MAX_RPC_CHECKPOINTS_LEN),
|
|
595
|
+
optional(CheckpointIncludeOptionsSchema),
|
|
596
|
+
)
|
|
597
|
+
.returns(z.array(CheckpointResponseSchema)),
|
|
598
|
+
|
|
599
|
+
isReady: z.function().returns(z.boolean()),
|
|
600
|
+
|
|
601
|
+
getNodeInfo: z.function().returns(NodeInfoSchema),
|
|
559
602
|
|
|
560
603
|
getCurrentMinFees: z.function().returns(GasFees.schema),
|
|
561
604
|
|
|
605
|
+
getPredictedMinFees: z
|
|
606
|
+
.function()
|
|
607
|
+
.args(optional(z.nativeEnum(ManaUsageEstimate)))
|
|
608
|
+
.returns(z.array(GasFees.schema)),
|
|
609
|
+
|
|
562
610
|
getMaxPriorityFees: z.function().returns(GasFees.schema),
|
|
563
611
|
|
|
564
612
|
getNodeVersion: z.function().returns(z.string()),
|
|
@@ -614,10 +662,6 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
614
662
|
|
|
615
663
|
getPublicStorageAt: z.function().args(BlockParameterSchema, schemas.AztecAddress, schemas.Fr).returns(schemas.Fr),
|
|
616
664
|
|
|
617
|
-
getBlockHeader: z.function().args(optional(BlockParameterSchema)).returns(BlockHeader.schema.optional()),
|
|
618
|
-
|
|
619
|
-
getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
620
|
-
|
|
621
665
|
getValidatorsStats: z.function().returns(ValidatorsStatsSchema),
|
|
622
666
|
|
|
623
667
|
getValidatorStats: z
|
|
@@ -35,59 +35,105 @@ export interface IBlockFactory extends ProcessedTxHandler {
|
|
|
35
35
|
setBlockCompleted(expectedBlockHeader?: BlockHeader): Promise<L2Block>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/** Limits passed to the public processor for tx processing within a block. */
|
|
39
|
+
export type PublicProcessorLimits = {
|
|
40
|
+
/** Maximum number of txs to process. */
|
|
39
41
|
maxTransactions?: number;
|
|
40
|
-
|
|
42
|
+
/** L2 and DA gas limits. */
|
|
41
43
|
maxBlockGas?: Gas;
|
|
44
|
+
/** Maximum number of blob fields allowed. */
|
|
42
45
|
maxBlobFields?: number;
|
|
46
|
+
/** Deadline for processing the txs. Processor will stop as soon as it hits this time. */
|
|
43
47
|
deadline?: Date;
|
|
44
|
-
|
|
48
|
+
/** Whether this processor is building a proposal (as opposed to re-executing one). Skipping txs due to gas or blob limits is only done during proposal building. */
|
|
49
|
+
isBuildingProposal?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Base fields shared by both proposer and validator block builder options. */
|
|
53
|
+
type BlockBuilderOptionsBase = PublicProcessorLimits & {
|
|
54
|
+
/** Minimum number of successfully processed txs required. Block is rejected if fewer succeed. */
|
|
55
|
+
minValidTxs: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Proposer mode: redistribution params are required. */
|
|
59
|
+
type ProposerBlockBuilderOptions = BlockBuilderOptionsBase & {
|
|
60
|
+
isBuildingProposal: true;
|
|
61
|
+
/** Maximum number of blocks per checkpoint, derived from the timetable. */
|
|
62
|
+
maxBlocksPerCheckpoint: number;
|
|
63
|
+
/** Per-block gas budget multiplier. Budget = (remaining / remainingBlocks) * multiplier. */
|
|
64
|
+
perBlockAllocationMultiplier: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Validator mode: no redistribution params needed. */
|
|
68
|
+
type ValidatorBlockBuilderOptions = BlockBuilderOptionsBase & {
|
|
69
|
+
isBuildingProposal: false;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Options for building a block within a checkpoint. When proposing, redistribution params are required. */
|
|
73
|
+
export type BlockBuilderOptions = ProposerBlockBuilderOptions | ValidatorBlockBuilderOptions;
|
|
45
74
|
|
|
46
75
|
export interface PublicProcessorValidator {
|
|
47
76
|
preprocessValidator?: TxValidator<Tx>;
|
|
48
77
|
nullifierCache?: { addNullifiers: (nullifiers: Buffer[]) => void };
|
|
49
78
|
}
|
|
50
79
|
|
|
51
|
-
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'> &
|
|
80
|
+
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit'> &
|
|
52
81
|
Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
|
|
53
|
-
Pick<
|
|
82
|
+
Pick<
|
|
83
|
+
SequencerConfig,
|
|
84
|
+
| 'txPublicSetupAllowListExtend'
|
|
85
|
+
| 'fakeProcessingDelayPerTxMs'
|
|
86
|
+
| 'fakeThrowAfterProcessingTxCount'
|
|
87
|
+
| 'maxTxsPerBlock'
|
|
88
|
+
| 'maxTxsPerCheckpoint'
|
|
89
|
+
| 'maxL2BlockGas'
|
|
90
|
+
| 'maxDABlockGas'
|
|
91
|
+
>;
|
|
54
92
|
|
|
55
93
|
export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[] = [
|
|
56
94
|
'l1GenesisTime',
|
|
57
95
|
'slotDuration',
|
|
58
96
|
'l1ChainId',
|
|
59
97
|
'rollupVersion',
|
|
60
|
-
'
|
|
98
|
+
'txPublicSetupAllowListExtend',
|
|
61
99
|
'fakeProcessingDelayPerTxMs',
|
|
62
100
|
'fakeThrowAfterProcessingTxCount',
|
|
101
|
+
'maxTxsPerBlock',
|
|
102
|
+
'maxTxsPerCheckpoint',
|
|
103
|
+
'maxL2BlockGas',
|
|
104
|
+
'maxDABlockGas',
|
|
105
|
+
'rollupManaLimit',
|
|
63
106
|
] as const;
|
|
64
107
|
|
|
65
|
-
/** Thrown when
|
|
66
|
-
export class
|
|
67
|
-
constructor(
|
|
68
|
-
|
|
69
|
-
|
|
108
|
+
/** Thrown when the number of successfully processed transactions is below the required minimum. */
|
|
109
|
+
export class InsufficientValidTxsError extends Error {
|
|
110
|
+
constructor(
|
|
111
|
+
public readonly processedCount: number,
|
|
112
|
+
public readonly minRequired: number,
|
|
113
|
+
public readonly failedTxs: FailedTx[],
|
|
114
|
+
) {
|
|
115
|
+
super(`Insufficient valid txs: got ${processedCount} but need ${minRequired}`);
|
|
116
|
+
this.name = 'InsufficientValidTxsError';
|
|
70
117
|
}
|
|
71
118
|
}
|
|
72
119
|
|
|
73
120
|
/** Result of building a block within a checkpoint. */
|
|
74
121
|
export type BuildBlockInCheckpointResult = {
|
|
75
122
|
block: L2Block;
|
|
76
|
-
publicGas: Gas;
|
|
77
123
|
publicProcessorDuration: number;
|
|
78
124
|
numTxs: number;
|
|
79
125
|
failedTxs: FailedTx[];
|
|
80
126
|
usedTxs: Tx[];
|
|
81
|
-
usedTxBlobFields: number;
|
|
82
127
|
};
|
|
83
128
|
|
|
84
129
|
/** Interface for building blocks within a checkpoint context. */
|
|
85
130
|
export interface ICheckpointBlockBuilder {
|
|
131
|
+
/** Builds a single block within this checkpoint. Throws InsufficientValidTxsError if fewer than minValidTxs succeed. */
|
|
86
132
|
buildBlock(
|
|
87
133
|
pendingTxs: Iterable<Tx> | AsyncIterable<Tx>,
|
|
88
134
|
blockNumber: BlockNumber,
|
|
89
135
|
timestamp: bigint,
|
|
90
|
-
opts:
|
|
136
|
+
opts: BlockBuilderOptions,
|
|
91
137
|
): Promise<BuildBlockInCheckpointResult>;
|
|
92
138
|
}
|
|
93
139
|
|
|
@@ -98,6 +144,7 @@ export interface ICheckpointsBuilder {
|
|
|
98
144
|
startCheckpoint(
|
|
99
145
|
checkpointNumber: CheckpointNumber,
|
|
100
146
|
constants: CheckpointGlobalVariables,
|
|
147
|
+
feeAssetPriceModifier: bigint,
|
|
101
148
|
l1ToL2Messages: Fr[],
|
|
102
149
|
previousCheckpointOutHashes: Fr[],
|
|
103
150
|
fork: MerkleTreeWriteOperations,
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockNumberSchema,
|
|
3
|
+
CheckpointNumberSchema,
|
|
4
|
+
IndexWithinCheckpointSchema,
|
|
5
|
+
} from '@aztec/foundation/branded-types';
|
|
6
|
+
import type { BlockNumber, CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
7
|
+
import type { IfFlag, Prettify } from '@aztec/foundation/types';
|
|
8
|
+
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
|
|
11
|
+
import { BlockHash } from '../block/block_hash.js';
|
|
12
|
+
import { Body } from '../block/body.js';
|
|
13
|
+
import { CommitteeAttestation } from '../block/proposal/committee_attestation.js';
|
|
14
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
15
|
+
import { BlockHeader } from '../tx/block_header.js';
|
|
16
|
+
import { type L1PublishInfo, L1PublishInfoSchema } from './l1_publish_info.js';
|
|
17
|
+
|
|
18
|
+
/** Options for narrowing the response of `getBlock` / `getBlocks`. */
|
|
19
|
+
export type BlockIncludeOptions = {
|
|
20
|
+
/** Include the block body (tx effects). Off by default. */
|
|
21
|
+
includeTransactions?: boolean;
|
|
22
|
+
/** Include L1 publish info (populated with `published: false` if not yet on L1). Off by default. */
|
|
23
|
+
includeL1PublishInfo?: boolean;
|
|
24
|
+
/** Include committee attestations. Empty array until the block's checkpoint is published. Off by default. */
|
|
25
|
+
includeAttestations?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const BlockIncludeOptionsSchema: z.ZodType<BlockIncludeOptions> = z.object({
|
|
29
|
+
includeTransactions: z.boolean().optional(),
|
|
30
|
+
includeL1PublishInfo: z.boolean().optional(),
|
|
31
|
+
includeAttestations: z.boolean().optional(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/** Required metadata always present on a {@link BlockResponse}. */
|
|
35
|
+
export type BlockResponseBase = {
|
|
36
|
+
/** Block header. */
|
|
37
|
+
header: BlockHeader;
|
|
38
|
+
/** Archive tree snapshot after this block. */
|
|
39
|
+
archive: AppendOnlyTreeSnapshot;
|
|
40
|
+
/** Hash of the block header. */
|
|
41
|
+
hash: BlockHash;
|
|
42
|
+
/** Checkpoint number this block belongs to. */
|
|
43
|
+
checkpointNumber: CheckpointNumber;
|
|
44
|
+
/** Position of the block within its checkpoint. */
|
|
45
|
+
indexWithinCheckpoint: IndexWithinCheckpoint;
|
|
46
|
+
/** L2 block number. */
|
|
47
|
+
number: BlockNumber;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* RPC-surface representation of an L2 block.
|
|
52
|
+
*
|
|
53
|
+
* Generic over the include-options so that flagged fields become required when the caller passes a
|
|
54
|
+
* literal `true`. The default type argument ({@link BlockIncludeOptions}) yields the widest shape
|
|
55
|
+
* (all include-fields optional) — this is what the JSON-RPC wire layer validates against.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* const b: BlockResponse<{ includeTransactions: true }> = await node.getBlock(1, { includeTransactions: true });
|
|
59
|
+
* b.body; // required, not optional
|
|
60
|
+
*/
|
|
61
|
+
export type BlockResponse<Opts extends BlockIncludeOptions = BlockIncludeOptions> = Prettify<
|
|
62
|
+
BlockResponseBase &
|
|
63
|
+
IfFlag<BlockIncludeOptions, Opts, 'includeTransactions', { body: Body }> &
|
|
64
|
+
IfFlag<BlockIncludeOptions, Opts, 'includeL1PublishInfo', { l1: L1PublishInfo }> &
|
|
65
|
+
IfFlag<BlockIncludeOptions, Opts, 'includeAttestations', { attestations: CommitteeAttestation[] }>
|
|
66
|
+
>;
|
|
67
|
+
|
|
68
|
+
/** Zod schema for the widest {@link BlockResponse} shape (all include-gated fields optional). */
|
|
69
|
+
export const BlockResponseSchema = z.object({
|
|
70
|
+
header: BlockHeader.schema,
|
|
71
|
+
archive: AppendOnlyTreeSnapshot.schema,
|
|
72
|
+
hash: BlockHash.schema,
|
|
73
|
+
checkpointNumber: CheckpointNumberSchema,
|
|
74
|
+
indexWithinCheckpoint: IndexWithinCheckpointSchema,
|
|
75
|
+
number: BlockNumberSchema,
|
|
76
|
+
body: Body.schema.optional(),
|
|
77
|
+
l1: L1PublishInfoSchema.optional(),
|
|
78
|
+
attestations: z.array(CommitteeAttestation.schema).optional(),
|
|
79
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { type L2BlockTag, type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Public chain-tip selectors usable in RPC requests.
|
|
7
|
+
* Omits internal-only tags (e.g. `proposedCheckpoint`) from {@link L2BlockTag}.
|
|
8
|
+
*/
|
|
9
|
+
export type ChainTip = Exclude<L2BlockTag, 'proposedCheckpoint'>;
|
|
10
|
+
|
|
11
|
+
export const ChainTipSchema = z.union([
|
|
12
|
+
z.literal('proposed'),
|
|
13
|
+
z.literal('checkpointed'),
|
|
14
|
+
z.literal('proven'),
|
|
15
|
+
z.literal('finalized'),
|
|
16
|
+
]) satisfies z.ZodType<ChainTip>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tips of the L2 chain.
|
|
20
|
+
* Omits the sequencer-internal `proposedCheckpoint` from the public RPC surface.
|
|
21
|
+
*/
|
|
22
|
+
export type ChainTips = Omit<L2Tips, 'proposedCheckpoint'>;
|
|
23
|
+
|
|
24
|
+
export const ChainTipsSchema = L2TipsSchema.omit({ proposedCheckpoint: true });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CheckpointNumberSchema, SlotNumberSchema } from '@aztec/foundation/branded-types';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import { ChainTipSchema } from './chain_tips.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Selector for a checkpoint in RPC calls.
|
|
9
|
+
*
|
|
10
|
+
* Accepts a numeric checkpoint number (or `{ number }`), a slot number (`{ slot }`), a chain-tip
|
|
11
|
+
* name (e.g. `'proven'`), or `'latest'` (alias for `'proposed'` — on the checkpoint side, this
|
|
12
|
+
* means the most recent confirmed checkpoint).
|
|
13
|
+
*/
|
|
14
|
+
export const CheckpointParameterSchema = z.union([
|
|
15
|
+
CheckpointNumberSchema,
|
|
16
|
+
ChainTipSchema,
|
|
17
|
+
z.literal('latest'),
|
|
18
|
+
z.object({ number: CheckpointNumberSchema }),
|
|
19
|
+
z.object({ slot: SlotNumberSchema }),
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
export type CheckpointParameter = z.infer<typeof CheckpointParameterSchema>;
|