@aztec/stdlib 0.0.1-commit.2f68f620 → 0.0.1-commit.321f6a9
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 +8 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +6 -2
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +13 -1
- package/dest/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +26 -8
- package/dest/avm/avm.js +1 -1
- package/dest/aztec-address/index.d.ts +35 -5
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +32 -8
- package/dest/block/attestation_info.d.ts +1 -1
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -4
- package/dest/block/l2_block_source.d.ts +46 -23
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +15 -1
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +39 -0
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -0
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +165 -0
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +81 -11
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/interfaces.js +25 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +23 -15
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +149 -152
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +6 -12
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +8 -32
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +17 -18
- 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 +70 -58
- package/dest/block/proposal/attestations_and_signers.d.ts +19 -1
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +47 -7
- 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 +296 -37
- package/dest/block/validate_block_result.d.ts +16 -1
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -3
- package/dest/checkpoint/checkpoint.js +2 -2
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/simulation_overrides.d.ts +61 -0
- package/dest/checkpoint/simulation_overrides.d.ts.map +1 -0
- package/dest/checkpoint/simulation_overrides.js +98 -0
- package/dest/checkpoint/validate.d.ts +11 -3
- package/dest/checkpoint/validate.d.ts.map +1 -1
- package/dest/checkpoint/validate.js +9 -6
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/network-consensus-config.d.ts +72 -0
- package/dest/config/network-consensus-config.d.ts.map +1 -0
- package/dest/config/network-consensus-config.js +223 -0
- package/dest/config/sequencer-config.d.ts +4 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +22 -3
- package/dest/contract/contract_address.d.ts +5 -4
- package/dest/contract/contract_address.d.ts.map +1 -1
- package/dest/contract/contract_class.d.ts +1 -1
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class.js +3 -2
- package/dest/contract/contract_instance.d.ts +16 -2
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +45 -0
- package/dest/contract/interfaces/contract_data_source.d.ts +3 -5
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +71 -10
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +7 -2
- package/dest/contract/interfaces/node-info.d.ts +11 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +7 -1
- package/dest/contract/partial_address.d.ts +9 -3
- package/dest/contract/partial_address.d.ts.map +1 -1
- package/dest/contract/partial_address.js +8 -2
- package/dest/database-version/version_manager.d.ts +18 -4
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +76 -6
- package/dest/deserialization/index.d.ts +35 -3
- package/dest/deserialization/index.d.ts.map +1 -1
- package/dest/deserialization/index.js +32 -1
- package/dest/file-store/factory.d.ts +1 -1
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +7 -0
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/file-store/index.js +1 -0
- package/dest/file-store/memory.d.ts +24 -0
- package/dest/file-store/memory.d.ts.map +1 -0
- package/dest/file-store/memory.js +80 -0
- package/dest/gas/gas_settings.d.ts +7 -13
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +9 -16
- 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/gas/tx_gas_limits.d.ts +72 -0
- package/dest/gas/tx_gas_limits.d.ts.map +1 -0
- package/dest/gas/tx_gas_limits.js +85 -0
- package/dest/ha-signing/config.d.ts +19 -5
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +9 -3
- package/dest/ha-signing/local_config.d.ts +10 -2
- package/dest/ha-signing/local_config.d.ts.map +1 -1
- package/dest/ha-signing/local_config.js +8 -2
- package/dest/hash/hash.d.ts +1 -2
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +0 -7
- package/dest/interfaces/archiver.d.ts +12 -7
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +4 -2
- package/dest/interfaces/aztec-node-admin.d.ts +24 -17
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +1 -1
- package/dest/interfaces/aztec-node-debug.d.ts +40 -2
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-debug.js +29 -1
- package/dest/interfaces/aztec-node.d.ts +69 -28
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +56 -20
- package/dest/interfaces/block-builder.d.ts +9 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/chain_tips.d.ts +8 -47
- package/dest/interfaces/chain_tips.d.ts.map +1 -1
- package/dest/interfaces/chain_tips.js +1 -6
- package/dest/interfaces/checkpoint_parameter.d.ts +3 -3
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -1
- package/dest/interfaces/checkpoint_parameter.js +3 -3
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +27 -6
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +5 -1
- package/dest/interfaces/get_tx_by_hash_options.d.ts +9 -0
- package/dest/interfaces/get_tx_by_hash_options.d.ts.map +1 -0
- package/dest/interfaces/get_tx_by_hash_options.js +4 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +3 -4
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +38 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +14 -2
- package/dest/interfaces/private_kernel_prover.d.ts +71 -12
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +2 -3
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-node.d.ts +12 -8
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +24 -17
- package/dest/interfaces/proving-job.d.ts +87 -74
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +13 -4
- package/dest/interfaces/server.d.ts +1 -2
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +0 -1
- package/dest/interfaces/server_circuit_prover.d.ts +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +15 -4
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +3 -1
- package/dest/interfaces/world_state.d.ts +14 -1
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
- package/dest/kernel/hints/read_request.js +1 -1
- package/dest/kernel/index.d.ts +6 -2
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +5 -1
- package/dest/kernel/log_hash.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +2 -2
- package/dest/kernel/note_hash.js +1 -1
- package/dest/kernel/nullifier.js +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +14 -7
- package/dest/kernel/private_context_inputs.d.ts +4 -3
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +7 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -9
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +10 -7
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts +24 -0
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.js +37 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts +25 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.js +39 -0
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts +18 -0
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.js +27 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts +19 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.js +29 -0
- package/dest/kernel/private_kernel_prover_output.d.ts +4 -1
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.js +4 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
- package/dest/kernel/private_log_data.d.ts +1 -1
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_log_data.js +1 -1
- package/dest/keys/derivation.d.ts +41 -6
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +49 -26
- package/dest/logs/app_tagging_secret.d.ts +30 -7
- package/dest/logs/app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/app_tagging_secret.js +46 -39
- package/dest/logs/app_tagging_secret_kind.js +1 -1
- package/dest/logs/contract_class_log.d.ts +1 -2
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +0 -4
- package/dest/logs/message_context.d.ts +5 -15
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +1 -66
- package/dest/logs/pending_tagged_log.d.ts +6 -8
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +1 -31
- package/dest/logs/shared_secret_derivation.d.ts +29 -6
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +44 -11
- package/dest/messaging/l1_to_l2_message.d.ts +23 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +36 -11
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.d.ts +1 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +8 -1
- package/dest/p2p/checkpoint_attestation.d.ts +10 -1
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +10 -0
- package/dest/p2p/checkpoint_proposal.d.ts +2 -1
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.d.ts +2 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/signature_utils.d.ts +10 -1
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +9 -1
- package/dest/rollup/avm_proof_data.d.ts +3 -3
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +8 -3
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +20 -10
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -1
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +1 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +10 -15
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -2
- package/dest/timetable/budgets.d.ts +57 -0
- package/dest/timetable/budgets.d.ts.map +1 -0
- package/dest/timetable/budgets.js +56 -0
- package/dest/timetable/build_proposer_timetable.d.ts +21 -0
- package/dest/timetable/build_proposer_timetable.d.ts.map +1 -0
- package/dest/timetable/build_proposer_timetable.js +17 -0
- package/dest/timetable/consensus_timetable.d.ts +70 -0
- package/dest/timetable/consensus_timetable.d.ts.map +1 -0
- package/dest/timetable/consensus_timetable.js +89 -0
- package/dest/timetable/index.d.ts +5 -84
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +4 -209
- package/dest/timetable/proposer_timetable.d.ts +106 -0
- package/dest/timetable/proposer_timetable.d.ts.map +1 -0
- package/dest/timetable/proposer_timetable.js +132 -0
- package/dest/trees/nullifier_membership_witness.d.ts +5 -8
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +0 -9
- package/dest/trees/public_data_witness.d.ts +7 -17
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +0 -27
- package/dest/tx/execution_payload.d.ts +1 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/execution_payload.js +1 -1
- package/dest/tx/fee_provider.d.ts +2 -2
- package/dest/tx/fee_provider.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +2 -12
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.js +2 -2
- package/dest/tx/private_tx_constant_data.d.ts +18 -2
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/private_tx_constant_data.js +13 -4
- package/dest/tx/profiling.d.ts +1 -1
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +2 -0
- package/dest/tx/simulated_tx.d.ts +10 -6
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/tx.d.ts +9 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +15 -0
- package/dest/tx/validator/error_texts.d.ts +2 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/dest/world-state/genesis_data.d.ts +9 -1
- package/dest/world-state/genesis_data.d.ts.map +1 -1
- package/dest/world-state/genesis_data.js +1 -0
- package/package.json +8 -8
- package/src/abi/abi.ts +8 -0
- package/src/abi/buffer.ts +13 -1
- package/src/abi/contract_artifact.ts +33 -9
- package/src/avm/avm.ts +1 -1
- package/src/aztec-address/index.ts +36 -6
- package/src/block/attestation_info.ts +7 -2
- package/src/block/l2_block_source.ts +67 -13
- package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +207 -0
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +96 -10
- package/src/block/l2_block_stream/l2_block_stream.ts +216 -175
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +12 -41
- package/src/block/l2_block_stream/l2_tips_store_base.ts +84 -93
- package/src/block/proposal/attestations_and_signers.ts +53 -7
- package/src/block/test/l2_tips_store_test_suite.ts +270 -28
- package/src/block/validate_block_result.ts +48 -2
- package/src/checkpoint/checkpoint.ts +2 -2
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/simulation_overrides.ts +171 -0
- package/src/checkpoint/validate.ts +16 -6
- package/src/config/index.ts +1 -0
- package/src/config/network-consensus-config.ts +291 -0
- package/src/config/sequencer-config.ts +36 -5
- package/src/contract/contract_address.ts +4 -3
- package/src/contract/contract_class.ts +3 -2
- package/src/contract/contract_instance.ts +62 -1
- package/src/contract/interfaces/contract_data_source.ts +2 -4
- package/src/contract/interfaces/contract_instance.ts +26 -8
- package/src/contract/interfaces/node-info.ts +11 -0
- package/src/contract/partial_address.ts +8 -2
- package/src/database-version/version_manager.ts +96 -6
- package/src/deserialization/index.ts +35 -2
- package/src/file-store/factory.ts +7 -0
- package/src/file-store/index.ts +1 -0
- package/src/file-store/memory.ts +94 -0
- package/src/gas/README.md +199 -35
- package/src/gas/gas_settings.ts +11 -21
- package/src/gas/index.ts +1 -0
- package/src/gas/tx_gas_limits.ts +123 -0
- package/src/ha-signing/config.ts +23 -5
- package/src/ha-signing/local_config.ts +20 -1
- package/src/hash/hash.ts +0 -8
- package/src/interfaces/archiver.ts +14 -7
- package/src/interfaces/aztec-node-admin.ts +1 -1
- package/src/interfaces/aztec-node-debug.ts +54 -2
- package/src/interfaces/aztec-node.ts +121 -43
- package/src/interfaces/block-builder.ts +8 -1
- package/src/interfaces/chain_tips.ts +8 -16
- package/src/interfaces/checkpoint_parameter.ts +3 -3
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/configs.ts +27 -6
- package/src/interfaces/get_tx_by_hash_options.ts +14 -0
- package/src/interfaces/merkle_tree_operations.ts +2 -3
- package/src/interfaces/p2p.ts +29 -9
- package/src/interfaces/private_kernel_prover.ts +104 -13
- package/src/interfaces/prover-client.ts +1 -3
- package/src/interfaces/prover-node.ts +32 -17
- package/src/interfaces/proving-job.ts +15 -3
- package/src/interfaces/server.ts +0 -1
- package/src/interfaces/server_circuit_prover.ts +2 -2
- package/src/interfaces/validator.ts +11 -0
- package/src/interfaces/world_state.ts +14 -0
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
- package/src/kernel/hints/read_request.ts +1 -1
- package/src/kernel/index.ts +5 -1
- package/src/kernel/log_hash.ts +5 -2
- package/src/kernel/note_hash.ts +1 -1
- package/src/kernel/nullifier.ts +1 -1
- package/src/kernel/private_circuit_public_inputs.ts +12 -1
- package/src/kernel/private_context_inputs.ts +10 -3
- package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -7
- package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_4_circuit_private_inputs.ts +52 -0
- package/src/kernel/private_kernel_init_5_circuit_private_inputs.ts +55 -0
- package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
- package/src/kernel/private_kernel_inner_4_circuit_private_inputs.ts +39 -0
- package/src/kernel/private_kernel_inner_5_circuit_private_inputs.ts +42 -0
- package/src/kernel/private_kernel_prover_output.ts +4 -0
- package/src/kernel/private_kernel_reset_dimensions.ts +15 -5
- package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
- package/src/kernel/private_log_data.ts +4 -1
- package/src/keys/derivation.ts +69 -24
- package/src/logs/app_tagging_secret.ts +62 -39
- package/src/logs/app_tagging_secret_kind.ts +1 -1
- package/src/logs/contract_class_log.ts +0 -9
- package/src/logs/message_context.ts +7 -65
- package/src/logs/pending_tagged_log.ts +6 -33
- package/src/logs/shared_secret_derivation.ts +47 -14
- package/src/messaging/l1_to_l2_message.ts +51 -13
- package/src/noir/index.ts +2 -1
- package/src/p2p/attestation_utils.ts +8 -1
- package/src/p2p/checkpoint_attestation.ts +12 -0
- package/src/p2p/signature_utils.ts +9 -0
- package/src/rollup/avm_proof_data.ts +2 -2
- package/src/rollup/checkpoint_header.ts +16 -2
- package/src/stats/stats.ts +6 -2
- package/src/tests/factories.ts +13 -13
- package/src/tests/mocks.ts +7 -2
- package/src/timetable/README.md +609 -0
- package/src/timetable/budgets.ts +87 -0
- package/src/timetable/build_proposer_timetable.ts +42 -0
- package/src/timetable/consensus_timetable.ts +126 -0
- package/src/timetable/index.ts +4 -304
- package/src/timetable/proposer_timetable.ts +190 -0
- package/src/timetable/timetable-example.svg +108 -0
- package/src/trees/nullifier_membership_witness.ts +0 -11
- package/src/trees/public_data_witness.ts +0 -31
- package/src/tx/execution_payload.ts +2 -1
- package/src/tx/fee_provider.ts +1 -1
- package/src/tx/global_variable_builder.ts +1 -17
- package/src/tx/global_variables.ts +2 -2
- package/src/tx/private_tx_constant_data.ts +25 -2
- package/src/tx/profiling.ts +2 -0
- package/src/tx/tx.ts +17 -0
- package/src/tx/validator/error_texts.ts +2 -1
- package/src/world-state/genesis_data.ts +10 -0
- package/dest/interfaces/epoch-prover.d.ts +0 -57
- package/dest/interfaces/epoch-prover.d.ts.map +0 -1
- package/dest/interfaces/epoch-prover.js +0 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
- package/src/interfaces/epoch-prover.ts +0 -72
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import type { ZodFor } from '../schemas/schemas.js';
|
|
4
|
+
|
|
5
|
+
/** Options for retrieving txs via {@link AztecNode.getTxByHash} and {@link AztecNode.getTxsByHash}. */
|
|
6
|
+
export type GetTxByHashOptions = {
|
|
7
|
+
/** Keep the proof on the returned tx; stripped by default. */
|
|
8
|
+
includeProof?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** Zod schema for {@link GetTxByHashOptions}. */
|
|
12
|
+
export const GetTxByHashOptionsSchema: ZodFor<GetTxByHashOptions> = z.object({
|
|
13
|
+
includeProof: z.boolean().optional(),
|
|
14
|
+
});
|
|
@@ -141,9 +141,8 @@ export interface MerkleTreeReadOperations {
|
|
|
141
141
|
getRevision(): WorldStateRevision;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* Returns the IPC path of the underlying aztec-wsdb process.
|
|
145
|
-
* connect to the same world state instance that the TS layer is using
|
|
146
|
-
* the AVM must point at the same WSDB process for the simulation to see consistent state.
|
|
144
|
+
* Returns the IPC path of the underlying aztec-wsdb process. External AVM simulators use this to
|
|
145
|
+
* connect to the same world state instance that the TS layer is using.
|
|
147
146
|
*/
|
|
148
147
|
getIpcPath(): string;
|
|
149
148
|
|
package/src/interfaces/p2p.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import type { CheckpointProposalHash, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
6
7
|
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
7
|
-
import type
|
|
8
|
+
import { CheckpointProposal, type CheckpointProposalCore } from '../p2p/checkpoint_proposal.js';
|
|
8
9
|
import { type ApiSchemaFor, optional, schemas } from '../schemas/index.js';
|
|
9
10
|
import { Tx } from '../tx/tx.js';
|
|
10
11
|
import { TxHash } from '../tx/tx_hash.js';
|
|
11
12
|
import { MAX_RPC_TXS_LEN } from './api_limit.js';
|
|
13
|
+
import { type GetTxByHashOptions, GetTxByHashOptionsSchema } from './get_tx_by_hash_options.js';
|
|
12
14
|
|
|
13
15
|
export type PeerInfo =
|
|
14
16
|
| { status: 'connected'; score: number; id: string }
|
|
15
17
|
| { status: 'dialing'; dialStatus: string; id: string; addresses: string[] }
|
|
16
18
|
| { status: 'cached'; id: string; addresses: string[]; enr: string; dialAttempts: number };
|
|
17
19
|
|
|
18
|
-
const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
20
|
+
export const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
19
21
|
z.object({ status: z.literal('connected'), score: z.number(), id: z.string() }),
|
|
20
22
|
z.object({ status: z.literal('dialing'), dialStatus: z.string(), id: z.string(), addresses: z.array(z.string()) }),
|
|
21
23
|
z.object({
|
|
@@ -30,12 +32,14 @@ const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
|
30
32
|
/** Exposed API to the P2P module. */
|
|
31
33
|
export interface P2PApi {
|
|
32
34
|
/**
|
|
33
|
-
* Returns all pending transactions in the transaction pool.
|
|
35
|
+
* Returns all pending transactions in the transaction pool. The txs' proofs are stripped unless
|
|
36
|
+
* `includeProof` is set.
|
|
34
37
|
* @param limit - The number of items to returns
|
|
35
38
|
* @param after - The last known pending tx. Used for pagination
|
|
39
|
+
* @param options - Options for the returned txs (eg whether to include their proofs).
|
|
36
40
|
* @returns An array of Txs.
|
|
37
41
|
*/
|
|
38
|
-
getPendingTxs(limit?: number, after?: TxHash): Promise<Tx[]>;
|
|
42
|
+
getPendingTxs(limit?: number, after?: TxHash, options?: GetTxByHashOptions): Promise<Tx[]>;
|
|
39
43
|
|
|
40
44
|
/** Returns the number of pending txs in the p2p tx pool. */
|
|
41
45
|
getPendingTxCount(): Promise<number>;
|
|
@@ -66,17 +70,32 @@ export interface P2PApi {
|
|
|
66
70
|
): Promise<CheckpointAttestation[]>;
|
|
67
71
|
}
|
|
68
72
|
|
|
73
|
+
export type ProposalsForSlot = {
|
|
74
|
+
blockProposals: BlockProposal[];
|
|
75
|
+
checkpointProposals: CheckpointProposalCore[];
|
|
76
|
+
};
|
|
77
|
+
|
|
69
78
|
export interface P2PClient extends P2PApi {
|
|
70
79
|
/** Manually adds checkpoint attestations to the p2p client attestation pool. */
|
|
71
80
|
addOwnCheckpointAttestations(attestations: CheckpointAttestation[]): Promise<void>;
|
|
72
81
|
|
|
73
82
|
/** Returns retained signed proposals for a slot. */
|
|
74
|
-
getProposalsForSlot(slot: SlotNumber): Promise<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
getProposalsForSlot(slot: SlotNumber): Promise<ProposalsForSlot>;
|
|
84
|
+
|
|
85
|
+
/** Returns whether a checkpoint proposal was retained for a slot. */
|
|
86
|
+
hasCheckpointProposalForSlot(slot: SlotNumber): Promise<boolean>;
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
const MAX_PROPOSALS_FOR_SLOT_RPC_LEN = 256;
|
|
90
|
+
|
|
91
|
+
export const BlockProposalSchema = bufferSchemaFor(BlockProposal);
|
|
92
|
+
export const CheckpointProposalSchema = bufferSchemaFor(CheckpointProposal);
|
|
93
|
+
|
|
94
|
+
export const ProposalsForSlotSchema = z.object({
|
|
95
|
+
blockProposals: z.array(BlockProposalSchema).max(MAX_PROPOSALS_FOR_SLOT_RPC_LEN),
|
|
96
|
+
checkpointProposals: z.array(CheckpointProposalSchema).max(MAX_PROPOSALS_FOR_SLOT_RPC_LEN),
|
|
97
|
+
});
|
|
98
|
+
|
|
80
99
|
export const P2PApiSchema: ApiSchemaFor<P2PApi> = {
|
|
81
100
|
getCheckpointAttestationsForSlot: z.function({
|
|
82
101
|
input: z.tuple([
|
|
@@ -89,6 +108,7 @@ export const P2PApiSchema: ApiSchemaFor<P2PApi> = {
|
|
|
89
108
|
input: z.tuple([
|
|
90
109
|
optional(z.number().gte(1).lte(MAX_RPC_TXS_LEN).default(MAX_RPC_TXS_LEN)),
|
|
91
110
|
optional(TxHash.schema),
|
|
111
|
+
optional(GetTxByHashOptionsSchema),
|
|
92
112
|
]),
|
|
93
113
|
output: z.array(Tx.schema),
|
|
94
114
|
}),
|
|
@@ -5,13 +5,17 @@ import type {
|
|
|
5
5
|
PrivateKernelCircuitPublicInputs,
|
|
6
6
|
PrivateKernelInit2CircuitPrivateInputs,
|
|
7
7
|
PrivateKernelInit3CircuitPrivateInputs,
|
|
8
|
+
PrivateKernelInit4CircuitPrivateInputs,
|
|
9
|
+
PrivateKernelInit5CircuitPrivateInputs,
|
|
8
10
|
PrivateKernelInitCircuitPrivateInputs,
|
|
9
11
|
PrivateKernelInner2CircuitPrivateInputs,
|
|
10
12
|
PrivateKernelInner3CircuitPrivateInputs,
|
|
13
|
+
PrivateKernelInner4CircuitPrivateInputs,
|
|
14
|
+
PrivateKernelInner5CircuitPrivateInputs,
|
|
11
15
|
PrivateKernelInnerCircuitPrivateInputs,
|
|
12
16
|
PrivateKernelResetCircuitPrivateInputs,
|
|
17
|
+
PrivateKernelResetTailCircuitPrivateInputs,
|
|
13
18
|
PrivateKernelSimulateOutput,
|
|
14
|
-
PrivateKernelTailCircuitPrivateInputs,
|
|
15
19
|
PrivateKernelTailCircuitPublicInputs,
|
|
16
20
|
} from '../kernel/index.js';
|
|
17
21
|
import type { ChonkProofWithPublicInputs } from '../proofs/chonk_proof.js';
|
|
@@ -83,6 +87,48 @@ export interface PrivateKernelProver {
|
|
|
83
87
|
privateKernelInputsInit3: PrivateKernelInit3CircuitPrivateInputs,
|
|
84
88
|
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
85
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Creates a proof output for a batched first iteration that processes four app calls in a single
|
|
92
|
+
* private kernel circuit.
|
|
93
|
+
*
|
|
94
|
+
* @param privateKernelInputsInit4 - The batched private data structure for the initial iteration.
|
|
95
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
|
|
96
|
+
*/
|
|
97
|
+
generateInit4Output(
|
|
98
|
+
privateKernelInputsInit4: PrivateKernelInit4CircuitPrivateInputs,
|
|
99
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Executes the batched first kernel iteration (four app calls) without generating a proof.
|
|
103
|
+
*
|
|
104
|
+
* @param privateKernelInputsInit4 - The batched private data structure for the initial iteration.
|
|
105
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
|
|
106
|
+
*/
|
|
107
|
+
simulateInit4(
|
|
108
|
+
privateKernelInputsInit4: PrivateKernelInit4CircuitPrivateInputs,
|
|
109
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Creates a proof output for a batched first iteration that processes five app calls in a single
|
|
113
|
+
* private kernel circuit.
|
|
114
|
+
*
|
|
115
|
+
* @param privateKernelInputsInit5 - The batched private data structure for the initial iteration.
|
|
116
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
|
|
117
|
+
*/
|
|
118
|
+
generateInit5Output(
|
|
119
|
+
privateKernelInputsInit5: PrivateKernelInit5CircuitPrivateInputs,
|
|
120
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Executes the batched first kernel iteration (five app calls) without generating a proof.
|
|
124
|
+
*
|
|
125
|
+
* @param privateKernelInputsInit5 - The batched private data structure for the initial iteration.
|
|
126
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
|
|
127
|
+
*/
|
|
128
|
+
simulateInit5(
|
|
129
|
+
privateKernelInputsInit5: PrivateKernelInit5CircuitPrivateInputs,
|
|
130
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
131
|
+
|
|
86
132
|
/**
|
|
87
133
|
* Creates a proof output for a given previous kernel data and private call data for an inner iteration.
|
|
88
134
|
*
|
|
@@ -145,6 +191,48 @@ export interface PrivateKernelProver {
|
|
|
145
191
|
privateKernelInputsInner3: PrivateKernelInner3CircuitPrivateInputs,
|
|
146
192
|
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
147
193
|
|
|
194
|
+
/**
|
|
195
|
+
* Creates a proof output for a batched inner iteration that processes four app calls in a single
|
|
196
|
+
* private kernel circuit.
|
|
197
|
+
*
|
|
198
|
+
* @param privateKernelInputsInner4 - The batched private data structure for the inner iteration.
|
|
199
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
|
|
200
|
+
*/
|
|
201
|
+
generateInner4Output(
|
|
202
|
+
privateKernelInputsInner4: PrivateKernelInner4CircuitPrivateInputs,
|
|
203
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Executes the batched inner kernel iteration (four app calls) without generating a proof.
|
|
207
|
+
*
|
|
208
|
+
* @param privateKernelInputsInner4 - The batched private data structure for the inner iteration.
|
|
209
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
|
|
210
|
+
*/
|
|
211
|
+
simulateInner4(
|
|
212
|
+
privateKernelInputsInner4: PrivateKernelInner4CircuitPrivateInputs,
|
|
213
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Creates a proof output for a batched inner iteration that processes five app calls in a single
|
|
217
|
+
* private kernel circuit.
|
|
218
|
+
*
|
|
219
|
+
* @param privateKernelInputsInner5 - The batched private data structure for the inner iteration.
|
|
220
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof.
|
|
221
|
+
*/
|
|
222
|
+
generateInner5Output(
|
|
223
|
+
privateKernelInputsInner5: PrivateKernelInner5CircuitPrivateInputs,
|
|
224
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Executes the batched inner kernel iteration (five app calls) without generating a proof.
|
|
228
|
+
*
|
|
229
|
+
* @param privateKernelInputsInner5 - The batched private data structure for the inner iteration.
|
|
230
|
+
* @returns A Promise resolving to a ProofOutput object containing public inputs and an empty kernel proof.
|
|
231
|
+
*/
|
|
232
|
+
simulateInner5(
|
|
233
|
+
privateKernelInputsInner5: PrivateKernelInner5CircuitPrivateInputs,
|
|
234
|
+
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
235
|
+
|
|
148
236
|
/**
|
|
149
237
|
* Creates a proof output by resetting the arrays using the reset circuit.
|
|
150
238
|
*
|
|
@@ -166,23 +254,21 @@ export interface PrivateKernelProver {
|
|
|
166
254
|
): Promise<PrivateKernelSimulateOutput<PrivateKernelCircuitPublicInputs>>;
|
|
167
255
|
|
|
168
256
|
/**
|
|
169
|
-
* Creates a proof output
|
|
257
|
+
* Creates a proof output for the terminal reset+tail step. Dispatches to the rollup-bound or
|
|
258
|
+
* public-bound family based on `inputs.isForPublic()`.
|
|
170
259
|
*
|
|
171
|
-
* @param
|
|
172
|
-
* @returns A Promise resolving to a ProofOutput
|
|
260
|
+
* @param privateKernelInputs - Reset hints, dimensions, and tail params.
|
|
261
|
+
* @returns A Promise resolving to a ProofOutput containing the tail-shaped public inputs.
|
|
173
262
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
263
|
+
generateResetTailOutput(
|
|
264
|
+
privateKernelInputs: PrivateKernelResetTailCircuitPrivateInputs,
|
|
176
265
|
): Promise<PrivateKernelSimulateOutput<PrivateKernelTailCircuitPublicInputs>>;
|
|
177
266
|
|
|
178
267
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* @param privateKernelInputsTail - The private input data structure for the final ordering iteration.
|
|
182
|
-
* @returns A Promise resolving to a ProofOutput object containing public inputs an empty kernel proof.
|
|
268
|
+
* Simulates the terminal reset+tail step without generating a proof.
|
|
183
269
|
*/
|
|
184
|
-
|
|
185
|
-
|
|
270
|
+
simulateResetTail(
|
|
271
|
+
privateKernelInputs: PrivateKernelResetTailCircuitPrivateInputs,
|
|
186
272
|
): Promise<PrivateKernelSimulateOutput<PrivateKernelTailCircuitPublicInputs>>;
|
|
187
273
|
|
|
188
274
|
generateHidingToRollupOutput(
|
|
@@ -204,7 +290,12 @@ export interface PrivateKernelProver {
|
|
|
204
290
|
* Compute the gate count for a given circuit.
|
|
205
291
|
* @param bytecode - The circuit bytecode in gzipped bincode format
|
|
206
292
|
* @param circuitName - The name of the circuit
|
|
293
|
+
* @param circuitKind - The circuit kind expected by the Chonk backend
|
|
207
294
|
* @returns A Promise resolving to the gate count
|
|
208
295
|
*/
|
|
209
|
-
computeGateCountForCircuit(
|
|
296
|
+
computeGateCountForCircuit(
|
|
297
|
+
bytecode: Buffer,
|
|
298
|
+
circuitName: string,
|
|
299
|
+
circuitKind: PrivateExecutionStep['kind'],
|
|
300
|
+
): Promise<number>;
|
|
210
301
|
}
|
|
@@ -5,7 +5,6 @@ import { z } from 'zod';
|
|
|
5
5
|
|
|
6
6
|
import { schemas, zodFor } from '../schemas/index.js';
|
|
7
7
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
8
|
-
import type { EpochProver } from './epoch-prover.js';
|
|
9
8
|
import type { ProvingJobConsumer } from './prover-broker.js';
|
|
10
9
|
|
|
11
10
|
export type ActualProverConfig = {
|
|
@@ -124,10 +123,9 @@ function parseProverId(str: string) {
|
|
|
124
123
|
/**
|
|
125
124
|
* The interface to the prover client.
|
|
126
125
|
* Provides the ability to generate proofs and build rollups.
|
|
126
|
+
*
|
|
127
127
|
*/
|
|
128
128
|
export interface EpochProverManager {
|
|
129
|
-
createEpochProver(): EpochProver;
|
|
130
|
-
|
|
131
129
|
start(): Promise<void>;
|
|
132
130
|
|
|
133
131
|
stop(): Promise<void>;
|
|
@@ -1,42 +1,47 @@
|
|
|
1
|
+
import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client';
|
|
2
|
+
|
|
1
3
|
import { z } from 'zod';
|
|
2
4
|
|
|
3
|
-
import { type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
|
|
4
5
|
import { type ApiSchemaFor, schemas } from '../schemas/index.js';
|
|
5
|
-
import { type
|
|
6
|
+
import { type ComponentsVersions, getVersioningResponseHandler } from '../versioning/index.js';
|
|
6
7
|
|
|
7
8
|
const EpochProvingJobState = [
|
|
8
9
|
'initialized',
|
|
9
|
-
'
|
|
10
|
-
'awaiting-
|
|
10
|
+
'awaiting-checkpoints',
|
|
11
|
+
'awaiting-root',
|
|
12
|
+
'awaiting-predecessor',
|
|
11
13
|
'publishing-proof',
|
|
12
14
|
'completed',
|
|
15
|
+
'superseded',
|
|
13
16
|
'failed',
|
|
14
17
|
'stopped',
|
|
18
|
+
'cancelled',
|
|
15
19
|
'timed-out',
|
|
16
|
-
'reorg',
|
|
17
20
|
] as const;
|
|
18
21
|
|
|
19
22
|
export type EpochProvingJobState = (typeof EpochProvingJobState)[number];
|
|
20
23
|
|
|
21
24
|
export const EpochProvingJobTerminalState: EpochProvingJobState[] = [
|
|
22
25
|
'completed',
|
|
26
|
+
'superseded',
|
|
23
27
|
'failed',
|
|
24
28
|
'stopped',
|
|
29
|
+
'cancelled',
|
|
25
30
|
'timed-out',
|
|
26
|
-
'reorg',
|
|
27
31
|
] as const;
|
|
28
32
|
|
|
29
33
|
export type EpochProvingJobTerminalState = (typeof EpochProvingJobTerminalState)[number];
|
|
30
34
|
|
|
31
|
-
/** JSON RPC
|
|
35
|
+
/** JSON RPC admin interface to a prover node. */
|
|
32
36
|
export interface ProverNodeApi {
|
|
33
37
|
getJobs(): Promise<{ uuid: string; status: EpochProvingJobState; epochNumber: number }[]>;
|
|
34
38
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Schedules proving for the given epoch and returns the job id immediately, without waiting for
|
|
41
|
+
* the proof to complete (proving can take far longer than an HTTP request). Poll `getJobs()` to
|
|
42
|
+
* track the returned job's progress.
|
|
43
|
+
*/
|
|
44
|
+
startProof(epochNumber: number): Promise<string>;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
/** Schemas for prover node API functions. */
|
|
@@ -46,9 +51,19 @@ export const ProverNodeApiSchema: ApiSchemaFor<ProverNodeApi> = {
|
|
|
46
51
|
output: z.array(z.object({ uuid: z.string(), status: z.enum(EpochProvingJobState), epochNumber: z.number() })),
|
|
47
52
|
}),
|
|
48
53
|
|
|
49
|
-
startProof: z.function({ input: z.tuple([schemas.Integer]), output: z.
|
|
50
|
-
|
|
51
|
-
getL2Tips: z.function({ input: z.tuple([]), output: L2TipsSchema }),
|
|
52
|
-
|
|
53
|
-
getWorldStateSyncStatus: z.function({ input: z.tuple([]), output: WorldStateSyncStatusSchema }),
|
|
54
|
+
startProof: z.function({ input: z.tuple([schemas.Integer]), output: z.string() }),
|
|
54
55
|
};
|
|
56
|
+
|
|
57
|
+
export function createProverNodeAdminClient(
|
|
58
|
+
url: string,
|
|
59
|
+
versions: Partial<ComponentsVersions> = {},
|
|
60
|
+
fetch = defaultFetch,
|
|
61
|
+
apiKey?: string,
|
|
62
|
+
): ProverNodeApi {
|
|
63
|
+
return createSafeJsonRpcClient<ProverNodeApi>(url, ProverNodeApiSchema, {
|
|
64
|
+
namespaceMethods: 'prover',
|
|
65
|
+
fetch,
|
|
66
|
+
onResponse: getVersioningResponseHandler(versions),
|
|
67
|
+
...(apiKey ? { extraHeaders: { 'x-api-key': apiKey } } : {}),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
AVM_V2_PROOF_LENGTH_IN_FIELDS,
|
|
3
3
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
4
4
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
5
|
RECURSIVE_PROOF_LENGTH,
|
|
@@ -204,7 +204,7 @@ export type ProvingJobInputsMap = {
|
|
|
204
204
|
export const ProvingJobResult = z.discriminatedUnion('type', [
|
|
205
205
|
z.object({
|
|
206
206
|
type: z.literal(ProvingRequestType.PUBLIC_VM),
|
|
207
|
-
result: RecursiveProof.schemaFor(
|
|
207
|
+
result: RecursiveProof.schemaFor(AVM_V2_PROOF_LENGTH_IN_FIELDS),
|
|
208
208
|
}),
|
|
209
209
|
z.object({
|
|
210
210
|
type: z.literal(ProvingRequestType.PUBLIC_CHONK_VERIFIER),
|
|
@@ -319,7 +319,7 @@ export const ProvingJobResult = z.discriminatedUnion('type', [
|
|
|
319
319
|
]);
|
|
320
320
|
export type ProvingJobResult = z.infer<typeof ProvingJobResult>;
|
|
321
321
|
export type ProvingJobResultsMap = {
|
|
322
|
-
[ProvingRequestType.PUBLIC_VM]: RecursiveProof<typeof
|
|
322
|
+
[ProvingRequestType.PUBLIC_VM]: RecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS>;
|
|
323
323
|
[ProvingRequestType.PUBLIC_CHONK_VERIFIER]: PublicInputsAndRecursiveProof<
|
|
324
324
|
PublicChonkVerifierPublicInputs,
|
|
325
325
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
@@ -441,9 +441,20 @@ export const ProvingJobRejectedResult = z.object({
|
|
|
441
441
|
});
|
|
442
442
|
export type ProvingJobRejectedResult = z.infer<typeof ProvingJobRejectedResult>;
|
|
443
443
|
|
|
444
|
+
/**
|
|
445
|
+
* The result of a job that was cancelled by its producer. Unlike a fulfilled or rejected result it
|
|
446
|
+
* is not truly terminal: re-enqueuing the same job id revives it, so an abort never permanently
|
|
447
|
+
* blocks a proof from being produced.
|
|
448
|
+
*/
|
|
449
|
+
export const ProvingJobAbortedResult = z.object({
|
|
450
|
+
status: z.literal('aborted'),
|
|
451
|
+
});
|
|
452
|
+
export type ProvingJobAbortedResult = z.infer<typeof ProvingJobAbortedResult>;
|
|
453
|
+
|
|
444
454
|
export const ProvingJobSettledResult = z.discriminatedUnion('status', [
|
|
445
455
|
ProvingJobFulfilledResult,
|
|
446
456
|
ProvingJobRejectedResult,
|
|
457
|
+
ProvingJobAbortedResult,
|
|
447
458
|
]);
|
|
448
459
|
export type ProvingJobSettledResult = z.infer<typeof ProvingJobSettledResult>;
|
|
449
460
|
|
|
@@ -453,5 +464,6 @@ export const ProvingJobStatus = z.discriminatedUnion('status', [
|
|
|
453
464
|
z.object({ status: z.literal('not-found') }),
|
|
454
465
|
ProvingJobFulfilledResult,
|
|
455
466
|
ProvingJobRejectedResult,
|
|
467
|
+
ProvingJobAbortedResult,
|
|
456
468
|
]);
|
|
457
469
|
export type ProvingJobStatus = z.infer<typeof ProvingJobStatus>;
|
package/src/interfaces/server.ts
CHANGED
|
@@ -9,7 +9,6 @@ export * from './checkpoint_response.js';
|
|
|
9
9
|
export * from './l1_publish_info.js';
|
|
10
10
|
export * from './block-builder.js';
|
|
11
11
|
export * from './configs.js';
|
|
12
|
-
export * from './epoch-prover.js';
|
|
13
12
|
export * from './l2_logs_source.js';
|
|
14
13
|
export * from './merkle_tree_operations.js';
|
|
15
14
|
export * from './p2p-bootstrap.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
2
|
+
AVM_V2_PROOF_LENGTH_IN_FIELDS,
|
|
3
3
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
4
4
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
5
5
|
RECURSIVE_PROOF_LENGTH,
|
|
@@ -189,7 +189,7 @@ export interface ServerCircuitProver {
|
|
|
189
189
|
inputs: AvmCircuitInputs,
|
|
190
190
|
signal?: AbortSignal,
|
|
191
191
|
epochNumber?: number,
|
|
192
|
-
): Promise<RecursiveProof<typeof
|
|
192
|
+
): Promise<RecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS>>;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
export type IVCProofVerificationResult = {
|
|
@@ -84,6 +84,9 @@ export type ValidatorClientConfig = ValidatorHASignerConfig &
|
|
|
84
84
|
|
|
85
85
|
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
86
86
|
Pick<SequencerConfig, 'txPublicSetupAllowListExtend' | 'broadcastInvalidBlockProposal' | 'maxBlocksPerCheckpoint'> &
|
|
87
|
+
// `blockDurationMs` is optional on the loose `SequencerConfig` but is always populated via the shared
|
|
88
|
+
// `numberConfigHelper(3000)` mapping, so it is required on the fully-resolved validator config.
|
|
89
|
+
Required<Pick<SequencerConfig, 'blockDurationMs'>> &
|
|
87
90
|
Pick<
|
|
88
91
|
SlasherConfig,
|
|
89
92
|
| 'slashBroadcastedInvalidBlockPenalty'
|
|
@@ -97,6 +100,12 @@ export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
|
97
100
|
* @remarks This should match the property in P2PConfig. It's not picked from there to avoid circular dependencies.
|
|
98
101
|
*/
|
|
99
102
|
disableTransactions?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Maximum clock-disparity tolerance (ms) applied to proposal/attestation receive windows.
|
|
106
|
+
* @remarks Mirrors the property in P2PConfig. It's not picked from there to avoid circular dependencies.
|
|
107
|
+
*/
|
|
108
|
+
maxGossipClockDisparityMs?: number;
|
|
100
109
|
};
|
|
101
110
|
|
|
102
111
|
export const ValidatorClientConfigSchema = zodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>()(
|
|
@@ -123,6 +132,7 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
|
|
|
123
132
|
ValidatorClientConfigSchema.extend({
|
|
124
133
|
txPublicSetupAllowListExtend: z.array(AllowedElementSchema).optional(),
|
|
125
134
|
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
135
|
+
blockDurationMs: z.number().positive(),
|
|
126
136
|
maxBlocksPerCheckpoint: z.number().positive().optional(),
|
|
127
137
|
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
128
138
|
slashBroadcastedInvalidCheckpointProposalPenalty: schemas.BigInt,
|
|
@@ -130,6 +140,7 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
|
|
|
130
140
|
slashDuplicateAttestationPenalty: schemas.BigInt,
|
|
131
141
|
slashAttestInvalidCheckpointProposalPenalty: schemas.BigInt,
|
|
132
142
|
disableTransactions: z.boolean().optional(),
|
|
143
|
+
maxGossipClockDisparityMs: z.number().optional(),
|
|
133
144
|
}),
|
|
134
145
|
);
|
|
135
146
|
|
|
@@ -65,6 +65,20 @@ export interface ReadonlyWorldStateAccess {
|
|
|
65
65
|
|
|
66
66
|
/** Defines the interface for a world state synchronizer. */
|
|
67
67
|
export interface WorldStateSynchronizer extends ReadonlyWorldStateAccess, ForkMerkleTreeOperations {
|
|
68
|
+
/**
|
|
69
|
+
* Returns a read handle to the world state at `blockNumber`, but only after verifying that the block at that
|
|
70
|
+
* height is on the fork identified by `blockHash`. This pins the returned view to a specific fork so a reorg
|
|
71
|
+
* that replaced the block at `blockNumber` cannot be served silently, closing the gap between resolving a query
|
|
72
|
+
* and reading its snapshot.
|
|
73
|
+
*
|
|
74
|
+
* Rejects if the block at `blockNumber` does not match `blockHash` (a reorg), or if the block's hash cannot be
|
|
75
|
+
* read from the requested view. Both are transient from a caller's perspective: re-resolving the query against
|
|
76
|
+
* the current chain and retrying may succeed or produce a more precise error. However, if the block's history
|
|
77
|
+
* has been pruned away (it predates the oldest historical block kept by world state), the rejection is terminal:
|
|
78
|
+
* retrying cannot bring the data back.
|
|
79
|
+
*/
|
|
80
|
+
getVerifiedSnapshot(blockNumber: BlockNumber, blockHash: BlockHash): Promise<MerkleTreeReadOperations>;
|
|
81
|
+
|
|
68
82
|
/** Starts the synchronizer. */
|
|
69
83
|
start(): Promise<void | PromiseWithResolvers<void>>;
|
|
70
84
|
|