@aztec/stdlib 0.0.1-commit.b9865e97 → 0.0.1-commit.be03c316
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/avm/avm_proving_request.d.ts +70 -70
- package/dest/avm/index.d.ts +1 -6
- package/dest/avm/index.d.ts.map +1 -1
- package/dest/avm/index.js +0 -5
- 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/index.d.ts +1 -2
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -1
- 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 +7 -9
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +3 -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 +3 -1
- 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 +4 -4
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server.d.ts +1 -3
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +0 -2
- 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/index.d.ts +1 -2
- package/dest/kernel/hints/index.d.ts.map +1 -1
- package/dest/kernel/hints/index.js +0 -1
- 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_kernel_simulated_output.d.ts +1 -7
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_simulated_output.js +2 -1
- 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/kernel/utils/index.d.ts +1 -2
- package/dest/kernel/utils/index.d.ts.map +1 -1
- package/dest/kernel/utils/index.js +0 -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/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -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 -27
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +10 -45
- 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/index.d.ts +1 -2
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- 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/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/avm/index.ts +0 -5
- 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/index.ts +0 -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 +8 -9
- 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 +2 -0
- 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 +3 -3
- package/src/interfaces/server.ts +0 -2
- 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/index.ts +0 -1
- 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_kernel_simulated_output.ts +0 -7
- package/src/kernel/private_log_data.ts +4 -1
- package/src/kernel/utils/index.ts +0 -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/index.ts +0 -1
- 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 -51
- 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/index.ts +0 -1
- 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/dest/avm/contract_storage_read.d.ts +0 -58
- package/dest/avm/contract_storage_read.d.ts.map +0 -1
- package/dest/avm/contract_storage_read.js +0 -65
- package/dest/avm/contract_storage_update_request.d.ts +0 -65
- package/dest/avm/contract_storage_update_request.d.ts.map +0 -1
- package/dest/avm/contract_storage_update_request.js +0 -80
- package/dest/avm/public_call_stack_item_compressed.d.ts +0 -43
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +0 -1
- package/dest/avm/public_call_stack_item_compressed.js +0 -70
- package/dest/avm/public_data_update_request.d.ts +0 -62
- package/dest/avm/public_data_update_request.d.ts.map +0 -1
- package/dest/avm/public_data_update_request.js +0 -67
- package/dest/avm/public_inner_call_request.d.ts +0 -50
- package/dest/avm/public_inner_call_request.d.ts.map +0 -1
- package/dest/avm/public_inner_call_request.js +0 -74
- package/dest/contract/deployment_info.d.ts +0 -24
- package/dest/contract/deployment_info.d.ts.map +0 -1
- package/dest/contract/deployment_info.js +0 -3
- 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/interfaces/prover-coordination.d.ts +0 -15
- package/dest/interfaces/prover-coordination.d.ts.map +0 -1
- package/dest/interfaces/prover-coordination.js +0 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts +0 -14
- package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +0 -1
- package/dest/kernel/hints/tree_leaf_read_request.js +0 -33
- 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/dest/kernel/utils/optional_number.d.ts +0 -31
- package/dest/kernel/utils/optional_number.d.ts.map +0 -1
- package/dest/kernel/utils/optional_number.js +0 -42
- package/dest/p2p/interface.d.ts +0 -5
- package/dest/p2p/interface.d.ts.map +0 -1
- package/dest/p2p/interface.js +0 -1
- package/dest/tx/validator/empty_validator.d.ts +0 -5
- package/dest/tx/validator/empty_validator.d.ts.map +0 -1
- package/dest/tx/validator/empty_validator.js +0 -7
- package/src/avm/contract_storage_read.ts +0 -77
- package/src/avm/contract_storage_update_request.ts +0 -93
- package/src/avm/public_call_stack_item_compressed.ts +0 -113
- package/src/avm/public_data_update_request.ts +0 -106
- package/src/avm/public_inner_call_request.ts +0 -85
- package/src/contract/deployment_info.ts +0 -25
- package/src/interfaces/epoch-prover.ts +0 -72
- package/src/interfaces/prover-coordination.ts +0 -17
- package/src/kernel/hints/tree_leaf_read_request.ts +0 -35
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
- package/src/kernel/utils/optional_number.ts +0 -50
- package/src/p2p/interface.ts +0 -4
- package/src/tx/validator/empty_validator.ts +0 -7
package/src/gas/README.md
CHANGED
|
@@ -1,47 +1,69 @@
|
|
|
1
1
|
# Aztec Gas and Fee Model
|
|
2
2
|
|
|
3
3
|
The minimum fee per mana and its components are computed on L1 in
|
|
4
|
-
`l1-contracts/src/core/libraries/rollup/FeeLib.sol
|
|
5
|
-
|
|
4
|
+
`l1-contracts/src/core/libraries/rollup/FeeLib.sol` (`fee_math.ts` in this directory is a
|
|
5
|
+
TypeScript port of those formulas, used to predict fees a few slots ahead). This document
|
|
6
|
+
describes the formulas, the oracle lag/lifetime mechanism, how a transaction's fee is
|
|
7
|
+
derived from them, the gas and data limits, and the TypeScript types in this directory.
|
|
6
8
|
|
|
7
9
|
## Mana
|
|
8
10
|
|
|
9
|
-
Aztec
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
Aztec meters work as gas in two dimensions: **DA** (data availability, i.e. blob data
|
|
12
|
+
published to L1) and **L2** (execution). The L2 dimension is called **mana** (analogous to
|
|
13
|
+
Ethereum gas): block headers track `totalManaUsed`, and the fee model below prices one unit
|
|
14
|
+
of mana. The total fee is `gasUsed * feePerGas` summed across both dimensions.
|
|
15
|
+
|
|
16
|
+
### The DA dimension is priced at zero
|
|
17
|
+
|
|
18
|
+
Only the L2 dimension currently carries a price. When building checkpoint global variables,
|
|
19
|
+
the sequencer sets `feePerDaGas = 0` and sets `feePerL2Gas` to the L1-computed minimum fee
|
|
20
|
+
per mana (`sequencer-client/src/global_variable_builder/global_builder.ts` and
|
|
21
|
+
`fee_provider.ts` in the same directory). The cost of publishing data is still recovered:
|
|
22
|
+
the blob gas a checkpoint pays on L1 is part of the *sequencer cost* component of the mana
|
|
23
|
+
fee below. DA gas remains fully metered and limited (see
|
|
24
|
+
[Gas and Data Limits](#gas-and-data-limits)) — it bounds how much data a tx or checkpoint
|
|
25
|
+
may publish — it just contributes nothing to the fee today.
|
|
12
26
|
|
|
13
27
|
## Fee Components
|
|
14
28
|
|
|
15
|
-
The minimum fee per mana has four components
|
|
29
|
+
The minimum fee per mana has four components. All are computed in ETH (wei) per mana and
|
|
30
|
+
converted to the fee asset at the end (see [Fee Asset Price](#fee-asset-price)).
|
|
16
31
|
|
|
17
32
|
### Sequencer Cost
|
|
18
33
|
|
|
19
34
|
L1 cost to propose a checkpoint (calldata gas + blob data), amortized over `manaTarget`:
|
|
20
35
|
|
|
21
36
|
```
|
|
22
|
-
sequencerCost = ((L1_GAS_PER_CHECKPOINT_PROPOSED * baseFee)
|
|
37
|
+
sequencerCost = ceil(((L1_GAS_PER_CHECKPOINT_PROPOSED * baseFee)
|
|
23
38
|
+ (BLOBS_PER_CHECKPOINT * BLOB_GAS_PER_BLOB * blobFee))
|
|
24
|
-
/ manaTarget
|
|
39
|
+
/ manaTarget)
|
|
25
40
|
```
|
|
26
41
|
|
|
42
|
+
Note that `BLOBS_PER_CHECKPOINT` here is FeeLib's own constant (3), not the protocol blob
|
|
43
|
+
capacity of the same name (6) — see the note under [Key Constants](#key-constants).
|
|
44
|
+
|
|
27
45
|
### Prover Cost
|
|
28
46
|
|
|
29
47
|
L1 cost to verify an epoch proof, amortized over epoch duration and `manaTarget`, plus a
|
|
30
48
|
governance-set proving cost that compensates for off-chain proof generation:
|
|
31
49
|
|
|
32
50
|
```
|
|
33
|
-
proverCost = (L1_GAS_PER_EPOCH_VERIFIED * baseFee / epochDuration) / manaTarget
|
|
51
|
+
proverCost = ceil(ceil((L1_GAS_PER_EPOCH_VERIFIED * baseFee) / epochDuration) / manaTarget)
|
|
34
52
|
+ provingCostPerMana
|
|
35
53
|
```
|
|
36
54
|
|
|
55
|
+
Updates to `provingCostPerMana` are rate-limited on L1 (`FeeLib.updateProvingCostPerMana`):
|
|
56
|
+
at most one update every 30 days, each moving the value by at most ×1.5 (or ÷1.5), with a
|
|
57
|
+
floor of 2 wei per mana.
|
|
58
|
+
|
|
37
59
|
### Congestion Cost
|
|
38
60
|
|
|
39
61
|
An exponential surcharge when the network is congested (inspired by EIP-1559; the
|
|
40
62
|
implementation uses the `fakeExponential` Taylor series approximation from EIP-4844):
|
|
41
63
|
|
|
42
64
|
```
|
|
43
|
-
baseCost
|
|
44
|
-
congestionCost
|
|
65
|
+
baseCost = sequencerCost + proverCost
|
|
66
|
+
congestionCost = floor(baseCost * congestionMultiplier / MINIMUM_CONGESTION_MULTIPLIER) - baseCost
|
|
45
67
|
```
|
|
46
68
|
|
|
47
69
|
When there is no congestion the multiplier equals `MINIMUM_CONGESTION_MULTIPLIER` (1e9)
|
|
@@ -50,11 +72,15 @@ and congestion cost is zero.
|
|
|
50
72
|
### Congestion Multiplier
|
|
51
73
|
|
|
52
74
|
```
|
|
53
|
-
excessMana
|
|
54
|
-
|
|
75
|
+
excessMana = max(0, prevExcessMana + prevManaUsed - manaTarget)
|
|
76
|
+
denominator = manaTarget * 854,700,854 / 1e8 ≈ 8.547 * manaTarget
|
|
77
|
+
congestionMultiplier = fakeExponential(MINIMUM_CONGESTION_MULTIPLIER,
|
|
78
|
+
min(excessMana, 100 * denominator), denominator)
|
|
55
79
|
```
|
|
56
80
|
|
|
57
|
-
Each additional `manaTarget` of excess mana
|
|
81
|
+
Each additional `manaTarget` of excess mana multiplies the fee by `e^(1/8.547) ≈ 1.124`,
|
|
82
|
+
i.e. ~12.5%. The exponent is capped at 100 (multiplier ≤ ~2.7e43 × the minimum) to keep
|
|
83
|
+
the Taylor series from overflowing.
|
|
58
84
|
|
|
59
85
|
### Total
|
|
60
86
|
|
|
@@ -62,6 +88,11 @@ Each additional `manaTarget` of excess mana increases the multiplier by ~12.5%.
|
|
|
62
88
|
minFeePerMana = sequencerCost + proverCost + congestionCost
|
|
63
89
|
```
|
|
64
90
|
|
|
91
|
+
Each component is converted from ETH to the fee asset individually (rounding up) before
|
|
92
|
+
summing. The sum is capped at `type(uint128).max` (`FeeLib.summedMinFee`) so it always fits
|
|
93
|
+
the proposal header's `feePerL2Gas` field — without the cap, extreme congestion could
|
|
94
|
+
produce a fee no valid header can represent, halting the chain.
|
|
95
|
+
|
|
65
96
|
## L1 Gas Oracle: Lag and Lifetime
|
|
66
97
|
|
|
67
98
|
The oracle feeds Ethereum's `baseFee` and `blobFee` into the fee model using a two-phase
|
|
@@ -70,9 +101,9 @@ The oracle feeds Ethereum's `baseFee` and `blobFee` into the fee model using a t
|
|
|
70
101
|
- **LAG = 2 slots** — when new L1 fees are observed, they activate `LAG` slots later
|
|
71
102
|
(`slotOfChange = currentSlot + LAG`). This gives mempool transactions time to land
|
|
72
103
|
before fees change.
|
|
73
|
-
- **LIFETIME = 5 slots** — after an oracle update,
|
|
74
|
-
`slotOfChange + (LIFETIME - LAG)`
|
|
75
|
-
frequently L1 fee data can change.
|
|
104
|
+
- **LIFETIME = 5 slots** — after an oracle update, further updates are ignored
|
|
105
|
+
(`updateL1GasFeeOracle` returns without effect) until `slotOfChange + (LIFETIME - LAG)`
|
|
106
|
+
= 3 more slots have passed. This rate-limits how frequently L1 fee data can change.
|
|
76
107
|
|
|
77
108
|
Fee resolution at a given timestamp:
|
|
78
109
|
|
|
@@ -84,6 +115,12 @@ else → use post (new fees)
|
|
|
84
115
|
**Net effect**: L1 fee changes reach L2 with a 2-slot delay and can update at most once
|
|
85
116
|
every 5 slots.
|
|
86
117
|
|
|
118
|
+
Because queued values only activate `LAG` slots later, the min fee for the next `LAG`
|
|
119
|
+
slots is fully determined by current on-chain state. `fee_math.ts` ports the FeeLib
|
|
120
|
+
formulas so the sequencer can predict min fees over that window (`FeePredictor` in
|
|
121
|
+
`sequencer-client/src/global_variable_builder`), under a configurable mana-usage
|
|
122
|
+
assumption (`ManaUsageEstimate`: none / target / limit).
|
|
123
|
+
|
|
87
124
|
### Worked Example
|
|
88
125
|
|
|
89
126
|
Suppose the oracle is updated at slot 10 with new L1 fees. Here is the timeline:
|
|
@@ -117,38 +154,165 @@ Key observations:
|
|
|
117
154
|
|
|
118
155
|
## Fee Asset Price
|
|
119
156
|
|
|
120
|
-
Fees are computed in ETH internally
|
|
121
|
-
`ethPerFeeAsset` (1e12 precision)
|
|
122
|
-
|
|
157
|
+
Fees are computed in ETH (wei) internally and converted to the fee asset (Fee Juice) via
|
|
158
|
+
`ethPerFeeAsset` (1e12 precision), rounding up (`PriceLib.toFeeAsset` in
|
|
159
|
+
`l1-contracts/src/core/libraries/compressed-data/fees/FeeConfig.sol`).
|
|
160
|
+
|
|
161
|
+
Each checkpoint proposal carries a fee-asset price modifier (`OracleInput`) chosen by the
|
|
162
|
+
proposer, bounded to ±1% (±100 bps) per checkpoint:
|
|
123
163
|
|
|
124
164
|
```
|
|
125
165
|
newPrice = currentPrice * (10000 + modifierBps) / 10000
|
|
126
166
|
```
|
|
127
167
|
|
|
168
|
+
The result is clamped to [`MIN_ETH_PER_FEE_ASSET` = 100, `MAX_ETH_PER_FEE_ASSET` = 1e14],
|
|
169
|
+
i.e. 1e-10 to 100 ETH per fee asset. The floor of 100 guarantees a ±1% step always moves
|
|
170
|
+
the integer price by at least 1.
|
|
171
|
+
|
|
172
|
+
## Transaction Fees
|
|
173
|
+
|
|
174
|
+
The checkpoint's `gasFees` (the L1-computed min fee per mana, with DA priced at zero) act
|
|
175
|
+
as a base fee. Senders declare `GasSettings`: gas limits, teardown gas limits,
|
|
176
|
+
`maxFeesPerGas`, and `maxPriorityFeesPerGas`. A tx is only includable if `maxFeesPerGas`
|
|
177
|
+
covers the checkpoint's `gasFees` in both dimensions. The effective fee adds an
|
|
178
|
+
EIP-1559-style priority fee on top of the base, capped by the max
|
|
179
|
+
(`computeEffectiveGasFees` in `stdlib/src/fees/transaction_fee.ts`):
|
|
180
|
+
|
|
181
|
+
```
|
|
182
|
+
effectiveFeePerGas = gasFees + min(maxPriorityFeePerGas, maxFeesPerGas - gasFees) (per dimension)
|
|
183
|
+
transactionFee = billedGas.daGas * effectiveFeePerDaGas + billedGas.l2Gas * effectiveFeePerL2Gas
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`billedGas` is actual consumption except for the teardown phase, which is billed at the
|
|
187
|
+
declared `teardownGasLimits` rather than actual usage — the fee is charged during teardown
|
|
188
|
+
itself, before actual teardown consumption is known.
|
|
189
|
+
|
|
128
190
|
## Maximum Fee Change Rate
|
|
129
191
|
|
|
130
|
-
| Component | Bound
|
|
131
|
-
| ---------------------- |
|
|
132
|
-
| L1 base fee / blob fee | At most once every 5 slots (oracle LIFETIME)
|
|
133
|
-
| Fee asset price | ±1% per checkpoint
|
|
192
|
+
| Component | Bound |
|
|
193
|
+
| ---------------------- | -------------------------------------------------------- |
|
|
194
|
+
| L1 base fee / blob fee | At most once every 5 slots (oracle LIFETIME) |
|
|
195
|
+
| Fee asset price | ±1% per checkpoint |
|
|
196
|
+
| Proving cost per mana | At most ×1.5 (or ÷1.5) per update, one update per 30 days |
|
|
134
197
|
| Congestion multiplier | Depends on excess mana accumulation/drain per checkpoint |
|
|
135
|
-
| Sequencer/prover costs | Scale linearly with L1 fees
|
|
198
|
+
| Sequencer/prover costs | Scale linearly with L1 fees |
|
|
136
199
|
|
|
137
200
|
## Key Constants
|
|
138
201
|
|
|
139
|
-
| Constant
|
|
140
|
-
|
|
|
141
|
-
| `L1_GAS_PER_CHECKPOINT_PROPOSED` | 300,000
|
|
142
|
-
| `L1_GAS_PER_EPOCH_VERIFIED` | 3,600,000
|
|
143
|
-
| `BLOBS_PER_CHECKPOINT`
|
|
144
|
-
| `BLOB_GAS_PER_BLOB` | 2^17
|
|
145
|
-
| `MINIMUM_CONGESTION_MULTIPLIER` | 1e9
|
|
146
|
-
| `LAG` | 2 slots
|
|
147
|
-
| `LIFETIME` | 5 slots
|
|
202
|
+
| Constant | Value |
|
|
203
|
+
| ------------------------------- | -------------- |
|
|
204
|
+
| `L1_GAS_PER_CHECKPOINT_PROPOSED` | 300,000 |
|
|
205
|
+
| `L1_GAS_PER_EPOCH_VERIFIED` | 3,600,000 |
|
|
206
|
+
| `BLOBS_PER_CHECKPOINT` (FeeLib) | 3 |
|
|
207
|
+
| `BLOB_GAS_PER_BLOB` | 2^17 |
|
|
208
|
+
| `MINIMUM_CONGESTION_MULTIPLIER` | 1e9 |
|
|
209
|
+
| `LAG` | 2 slots |
|
|
210
|
+
| `LIFETIME` | 5 slots |
|
|
211
|
+
| `MIN_ETH_PER_FEE_ASSET` | 100 (1e-10 ETH) |
|
|
212
|
+
| `MAX_ETH_PER_FEE_ASSET` | 1e14 (100 ETH) |
|
|
213
|
+
|
|
214
|
+
⚠️ Name clash: `FeeLib.sol` (and its port `fee_math.ts`) defines `BLOBS_PER_CHECKPOINT = 3`,
|
|
215
|
+
used only to price the sequencer's blob costs. The protocol constant of the same name in
|
|
216
|
+
`@aztec/constants` is **6** — the actual blob capacity of a checkpoint, used throughout the
|
|
217
|
+
limits section below. The FeeLib value is a holdover from the pre-checkpoint
|
|
218
|
+
`BLOBS_PER_BLOCK`, so the fee model prices half of a full checkpoint's blobs.
|
|
219
|
+
|
|
220
|
+
## Gas and Data Limits
|
|
221
|
+
|
|
222
|
+
The fee model above is *how much you pay* per unit of gas; this section is *how much you may use*. Limits
|
|
223
|
+
form a hierarchy from a single transaction up to a whole checkpoint, and a tx that is admissible for relay
|
|
224
|
+
must also be buildable into a block and fit a valid checkpoint.
|
|
225
|
+
|
|
226
|
+
### Per-tx protocol maxima
|
|
227
|
+
|
|
228
|
+
Hard ceilings on what any single tx may declare, independent of network configuration. Declaring more is
|
|
229
|
+
rejected everywhere a tx is validated.
|
|
230
|
+
|
|
231
|
+
- **`MAX_TX_DA_GAS`** (271,200) — `MAX_TX_BLOB_DATA_SIZE_IN_FIELDS` (8,475) × `DA_GAS_PER_FIELD` (32). This
|
|
232
|
+
is the most DA a single tx's effects can encode into a blob, so it is the most DA gas a tx could ever use.
|
|
233
|
+
Defined in `constants/src/constants.ts`.
|
|
234
|
+
- **`MAX_PROCESSABLE_L2_GAS`** (6,540,000) — the AVM's maximum processable L2 gas, derived in Noir as
|
|
235
|
+
`PUBLIC_TX_L2_GAS_OVERHEAD + AVM_MAX_PROCESSABLE_L2_GAS` (`constants/src/constants.gen.ts`).
|
|
236
|
+
|
|
237
|
+
### Network admission limits
|
|
238
|
+
|
|
239
|
+
The most a single tx may *declare* and still be relayed across the network. Computed by
|
|
240
|
+
`computeNetworkTxGasLimits` in `tx_gas_limits.ts` per dimension as:
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
min(per-tx max, ceil(checkpointBudget / blocksPerCheckpoint * minMultiplier))
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The per-block share mirrors what a proposer grants the first block of a checkpoint
|
|
247
|
+
(`CheckpointBuilder.capLimitsByCheckpointBudgets`), so a tx declaring this much is packable into a block.
|
|
248
|
+
The network-minimum multipliers are `MIN_PER_BLOCK_ALLOCATION_MULTIPLIER` (1.2, L2 and tx count) and
|
|
249
|
+
`MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER` (1.5, DA). DA's is higher so a maximal contract class
|
|
250
|
+
registration (~97k DA gas) fits a single block at mainnet geometry (72s slots, 6s blocks → 10 blocks per
|
|
251
|
+
checkpoint).
|
|
252
|
+
|
|
253
|
+
The DA budget is `getDaCheckpointBudgetForTxs(maxBlocksPerCheckpoint)`, not the raw
|
|
254
|
+
`MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` (786,432). Blob encoding spends overhead fields that no tx pays DA
|
|
255
|
+
gas for — one checkpoint-end marker field and the per-block block-end fields (7 for the first block, 6 for
|
|
256
|
+
each subsequent block, `blob-lib/src/encoding/block_blob_data.ts`) — so the raw constant is unattainable. The
|
|
257
|
+
getter nets out the full overhead for a checkpoint of `maxBlocksPerCheckpoint` blocks: at mainnet geometry
|
|
258
|
+
(10 blocks) that is `(24,576 − 1 − 7 − 9×6) × 32 = 24,514 × 32 = 784,448` DA gas. Subtracting every block's
|
|
259
|
+
overhead (not just the first) keeps admission at or below the builder's first-block blob-field cap at every
|
|
260
|
+
geometry — the builder is the most generous for the first block (it only reserves that block's own block-end
|
|
261
|
+
overhead), so being conservative here is what guarantees admitted ⇒ buildable. Without this netting a tx
|
|
262
|
+
near the raw limit would be admitted but never buildable.
|
|
263
|
+
|
|
264
|
+
These limits depend on network-wide inputs only (timetable-derived blocks-per-checkpoint, checkpoint
|
|
265
|
+
budgets, the network-minimum multipliers), never on a node's local restrictiveness. Every node always
|
|
266
|
+
advertises them in `NodeInfo.txsLimits` (a required field); wallets read it and pass `txsLimits.gas` to
|
|
267
|
+
`GasSettings.fallback` as the default gas limits when sending without explicit limits, and they are enforced
|
|
268
|
+
by `GasLimitsValidator` (clamped to the per-tx protocol maxima) at three points: RPC tx acceptance
|
|
269
|
+
(`aztec-node/src/aztec-node/server.ts`), gossip validation (`p2p/src/services/libp2p/libp2p_service.ts`),
|
|
270
|
+
and pending-pool admission (`p2p/src/client/factory.ts`). They are deliberately *not* enforced at req/resp or
|
|
271
|
+
block-proposal validation — admission is relay policy, not block validity.
|
|
272
|
+
|
|
273
|
+
### Per-block builder budgets
|
|
274
|
+
|
|
275
|
+
While packing a checkpoint, `CheckpointBuilder.capLimitsByCheckpointBudgets`
|
|
276
|
+
(`validator-client/src/checkpoint_builder.ts`) computes each block's budget as a fair share of the remaining
|
|
277
|
+
checkpoint budget across the remaining blocks, scaled by the configured multipliers. Operators may raise the
|
|
278
|
+
multipliers above the network minimums but not lower them — the sequencer fails startup otherwise
|
|
279
|
+
(`assertConfigMeetsNetworkTxLimits` in `sequencer-client/src/sequencer/sequencer.ts`), since a node that
|
|
280
|
+
allocates less than it admits would accept txs over RPC/gossip that its builder can never pack.
|
|
281
|
+
|
|
282
|
+
The fair share is then min'ed with the operator's absolute per-block caps `maxL2BlockGas` / `maxDABlockGas`
|
|
283
|
+
and the blob-field cap (checkpoint capacity net of the checkpoint-end marker and this block's block-end
|
|
284
|
+
overhead). The absolute caps are allowed to be restrictive: a cap below the network admission limit only
|
|
285
|
+
produces a startup warning, not a failure, because such txs simply stay in the pool for other proposers to
|
|
286
|
+
include.
|
|
287
|
+
|
|
288
|
+
### Per-checkpoint budgets
|
|
289
|
+
|
|
290
|
+
The outermost limits, enforced as proposal validity in `validateCheckpointLimits`
|
|
291
|
+
(`stdlib/src/checkpoint/validate.ts`) and physically by blob encoding:
|
|
292
|
+
|
|
293
|
+
- **Mana** — total L2 gas across all blocks ≤ `rollupManaLimit` (= `manaTarget × 2` on L1,
|
|
294
|
+
`l1-contracts/src/core/libraries/rollup/FeeLib.sol`).
|
|
295
|
+
- **DA gas** — total DA gas ≤ raw `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` (786,432).
|
|
296
|
+
- **Blob fields** — total ≤ `BLOBS_PER_CHECKPOINT × FIELDS_PER_BLOB` (6 × 4,096 = 24,576).
|
|
297
|
+
- **Tx counts** — total txs ≤ `maxTxsPerCheckpoint` when configured.
|
|
298
|
+
|
|
299
|
+
### Summary
|
|
300
|
+
|
|
301
|
+
| Limit | Value (mainnet defaults) | Scope | Where enforced |
|
|
302
|
+
| --------------------------------------- | ------------------------------- | ------------- | ----------------------------------------------------------- |
|
|
303
|
+
| `MAX_TX_DA_GAS` | 271,200 | per-tx | every gas validator (hard ceiling) |
|
|
304
|
+
| `MAX_PROCESSABLE_L2_GAS` | 6,540,000 | per-tx | every gas validator (hard ceiling) |
|
|
305
|
+
| Network DA admission limit | min(271,200, ceil(784,448/10×1.5)) = 117,668 | per-tx (relay) | RPC, gossip, pending pool (`GasLimitsValidator`) |
|
|
306
|
+
| Network L2 admission limit | min(6,540,000, ceil(manaLimit/10×1.2)) | per-tx (relay) | RPC, gossip, pending pool (`GasLimitsValidator`) |
|
|
307
|
+
| Per-block fair share + caps | remaining budget / blocks × multiplier, min absolute caps & blob-field cap | per-block | `CheckpointBuilder.capLimitsByCheckpointBudgets` |
|
|
308
|
+
| `rollupManaLimit` | `manaTarget × 2` | per-checkpoint | `validateCheckpointLimits` |
|
|
309
|
+
| `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` | 786,432 | per-checkpoint | `validateCheckpointLimits` + blob encoding |
|
|
310
|
+
| `BLOBS_PER_CHECKPOINT × FIELDS_PER_BLOB`| 24,576 | per-checkpoint | `validateCheckpointLimits` + blob encoding |
|
|
148
311
|
|
|
149
312
|
## TypeScript Types
|
|
150
313
|
|
|
151
|
-
- **`Gas`** —
|
|
314
|
+
- **`Gas`** — gas quantity in two dimensions (`daGas`, `l2Gas`).
|
|
152
315
|
- **`GasFees`** — per-unit price in each dimension (`feePerDaGas`, `feePerL2Gas`).
|
|
153
316
|
- **`GasSettings`** — sender-chosen fee parameters: gas limits, teardown limits, max fees, priority fees.
|
|
154
317
|
- **`GasUsed`** — actual consumption after execution. Note: `billedGas` uses the teardown gas *limit*, not actual usage.
|
|
318
|
+
- **`fee_math.ts`** — TypeScript port of the FeeLib formulas, used for fee prediction over the oracle LAG window.
|
package/src/gas/gas_settings.ts
CHANGED
|
@@ -8,13 +8,6 @@ import { z } from 'zod';
|
|
|
8
8
|
import { Gas, GasDimensions } from './gas.js';
|
|
9
9
|
import { GasFees } from './gas_fees.js';
|
|
10
10
|
|
|
11
|
-
/** Approximate max DA gas limit. Arbitrary, assuming 4 blocks per checkpoint — users should use gas estimation. */
|
|
12
|
-
export const APPROXIMATE_MAX_DA_GAS_PER_BLOCK = Math.floor(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT / 4);
|
|
13
|
-
/** Fallback teardown L2 gas limit. Arbitrary — users should use gas estimation. */
|
|
14
|
-
export const FALLBACK_TEARDOWN_L2_GAS_LIMIT = Math.floor(MAX_PROCESSABLE_L2_GAS / 8);
|
|
15
|
-
/** Fallback teardown DA gas limit. Arbitrary — users should use gas estimation. */
|
|
16
|
-
export const FALLBACK_TEARDOWN_DA_GAS_LIMIT = Math.floor(APPROXIMATE_MAX_DA_GAS_PER_BLOCK / 2);
|
|
17
|
-
|
|
18
11
|
// For gas estimation, we use intentionally high limits above what the network can process,
|
|
19
12
|
// so the simulation runs without hitting gas caps. Since teardown gas is counted towards total,
|
|
20
13
|
// the total estimation limit is teardown + max processable.
|
|
@@ -106,31 +99,28 @@ export class GasSettings {
|
|
|
106
99
|
|
|
107
100
|
/**
|
|
108
101
|
* Fills in gas limits high enough for transactions to be included in most cases.
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
102
|
+
* Callers must supply `gasLimits` — typically the most a single tx may declare on the network
|
|
103
|
+
* (`min(per-tx max, per-block allocation)`), i.e. a node's advertised `txsLimits.gas`. Since teardown gas
|
|
104
|
+
* is reserved from gasLimits during private execution (see gas_meter.nr), the effective gas available for
|
|
105
|
+
* app logic is gasLimits - teardownGasLimits - privateOverhead; the teardown default is derived from the
|
|
106
|
+
* effective total so it always stays below it.
|
|
114
107
|
* These values won't work if:
|
|
115
108
|
* - Teardown consumes more than the arbitrarily assigned fallback limits
|
|
116
109
|
* - The rest of the transaction consumes more than the remaining gas after teardown
|
|
117
110
|
* - The DA gas limit is too low for the transaction, while still within the checkpoint limit
|
|
118
111
|
*/
|
|
119
112
|
static fallback(overrides: {
|
|
120
|
-
gasLimits
|
|
113
|
+
gasLimits: Gas;
|
|
121
114
|
teardownGasLimits?: Gas;
|
|
122
115
|
maxFeesPerGas: GasFees;
|
|
123
116
|
maxPriorityFeesPerGas?: GasFees;
|
|
124
117
|
}) {
|
|
118
|
+
const gasLimits = overrides.gasLimits;
|
|
119
|
+
const teardownGasLimits =
|
|
120
|
+
overrides.teardownGasLimits ?? new Gas(Math.floor(gasLimits.daGas / 2), Math.floor(gasLimits.l2Gas / 8));
|
|
125
121
|
return GasSettings.from({
|
|
126
|
-
gasLimits
|
|
127
|
-
|
|
128
|
-
daGas: APPROXIMATE_MAX_DA_GAS_PER_BLOCK,
|
|
129
|
-
},
|
|
130
|
-
teardownGasLimits: overrides.teardownGasLimits ?? {
|
|
131
|
-
l2Gas: FALLBACK_TEARDOWN_L2_GAS_LIMIT,
|
|
132
|
-
daGas: FALLBACK_TEARDOWN_DA_GAS_LIMIT,
|
|
133
|
-
},
|
|
122
|
+
gasLimits,
|
|
123
|
+
teardownGasLimits,
|
|
134
124
|
maxFeesPerGas: overrides.maxFeesPerGas,
|
|
135
125
|
maxPriorityFeesPerGas: overrides.maxPriorityFeesPerGas ?? GasFees.empty(),
|
|
136
126
|
});
|
package/src/gas/index.ts
CHANGED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NUM_BLOCK_END_BLOB_FIELDS,
|
|
3
|
+
NUM_CHECKPOINT_END_MARKER_FIELDS,
|
|
4
|
+
NUM_FIRST_BLOCK_END_BLOB_FIELDS,
|
|
5
|
+
} from '@aztec/blob-lib/encoding';
|
|
6
|
+
import {
|
|
7
|
+
BLOBS_PER_CHECKPOINT,
|
|
8
|
+
DA_GAS_PER_FIELD,
|
|
9
|
+
FIELDS_PER_BLOB,
|
|
10
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
11
|
+
MAX_TX_DA_GAS,
|
|
12
|
+
} from '@aztec/constants';
|
|
13
|
+
|
|
14
|
+
import { type ProposerTimetableConfig, buildProposerTimetable } from '../timetable/build_proposer_timetable.js';
|
|
15
|
+
import type { SlotTimingConstants } from '../timetable/consensus_timetable.js';
|
|
16
|
+
import { Gas } from './gas.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Network-minimum per-block budget multiplier for L2 gas and tx-count allocation. A block packer must
|
|
20
|
+
* grant at least this share of the even per-block split to a single tx; operators may configure a higher
|
|
21
|
+
* multiplier (more generous), but not a lower one — enforced at sequencer startup. Also used as the default
|
|
22
|
+
* for `SequencerConfig.perBlockAllocationMultiplier`.
|
|
23
|
+
*/
|
|
24
|
+
export const MIN_PER_BLOCK_ALLOCATION_MULTIPLIER = 1.2;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Network-minimum per-block budget multiplier for DA gas, applied in place of the general
|
|
28
|
+
* {@link MIN_PER_BLOCK_ALLOCATION_MULTIPLIER}. Higher than the general multiplier so the largest tx we
|
|
29
|
+
* want to support — a maximal contract class registration (~97k DA gas) — fits a single block under v5
|
|
30
|
+
* mainnet geometry (72s slots, 6s blocks → 10 blocks per checkpoint). A builder may configure a higher
|
|
31
|
+
* multiplier but never a lower one. Also used as the default for
|
|
32
|
+
* `SequencerConfig.perBlockDAAllocationMultiplier`.
|
|
33
|
+
*/
|
|
34
|
+
export const MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER = 1.5;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The DA gas budget available to tx data within a checkpoint of `maxBlocksPerCheckpoint` blocks. This is the
|
|
38
|
+
* raw blob capacity (`BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB * DA_GAS_PER_FIELD`) minus the fields the blob
|
|
39
|
+
* encoding reserves for overhead that no tx pays DA gas for:
|
|
40
|
+
*
|
|
41
|
+
* - one checkpoint-end marker field (`NUM_CHECKPOINT_END_MARKER_FIELDS`),
|
|
42
|
+
* - the first block's block-end fields (`NUM_FIRST_BLOCK_END_BLOB_FIELDS`, 7), and
|
|
43
|
+
* - `NUM_BLOCK_END_BLOB_FIELDS` (6) for each of the `blocks - 1` subsequent blocks.
|
|
44
|
+
*
|
|
45
|
+
* Subtracting the overhead for every block (not just the first) keeps the network DA admission limit at or
|
|
46
|
+
* below the builder's first-block blob-field cap at every geometry. The builder is the MOST generous for the
|
|
47
|
+
* first block — it only reserves that block's own block-end overhead — so being conservative here (assuming
|
|
48
|
+
* the checkpoint is full of blocks, each spending its share) is what guarantees admitted ⇒ buildable: a tx
|
|
49
|
+
* admitted under this budget always fits the first block's blob-field cap, regardless of how many blocks the
|
|
50
|
+
* builder ends up packing.
|
|
51
|
+
*
|
|
52
|
+
* @param maxBlocksPerCheckpoint - Number of blocks the checkpoint may contain; clamped to at least 1.
|
|
53
|
+
*/
|
|
54
|
+
export function getDaCheckpointBudgetForTxs(maxBlocksPerCheckpoint: number): number {
|
|
55
|
+
const blocks = Math.max(1, maxBlocksPerCheckpoint);
|
|
56
|
+
// Clamp at zero: for absurd geometries (blocks greater than ~4094) the per-block overhead alone exceeds the
|
|
57
|
+
// raw blob capacity, which would otherwise yield a negative advertised DA budget.
|
|
58
|
+
const fields = Math.max(
|
|
59
|
+
0,
|
|
60
|
+
BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB -
|
|
61
|
+
NUM_CHECKPOINT_END_MARKER_FIELDS -
|
|
62
|
+
NUM_FIRST_BLOCK_END_BLOB_FIELDS -
|
|
63
|
+
(blocks - 1) * NUM_BLOCK_END_BLOB_FIELDS,
|
|
64
|
+
);
|
|
65
|
+
return fields * DA_GAS_PER_FIELD;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Computes the maximum gas a single tx may declare on a network: the smaller of the per-tx protocol
|
|
70
|
+
* maximum and the per-block allocation a proposer grants to the first block of a checkpoint. The per-block
|
|
71
|
+
* allocation mirrors `CheckpointBuilder.capLimitsByCheckpointBudgets`
|
|
72
|
+
* (`ceil(checkpointBudget / maxBlocksPerCheckpoint * multiplier)`) using the network-minimum multipliers, so
|
|
73
|
+
* a tx declaring this much is admissible into a block under that geometry.
|
|
74
|
+
*
|
|
75
|
+
* This is a *network* limit: a function of network-wide constants only (timetable-derived
|
|
76
|
+
* blocks-per-checkpoint, checkpoint budgets, the network-minimum multipliers). It must NOT depend on a
|
|
77
|
+
* node's local restrictiveness — its multipliers configured above the network minimum, or its
|
|
78
|
+
* `maxDABlockGas` / `validateMaxDABlockGas` caps — because those make a node stricter at block-building
|
|
79
|
+
* time but cannot define what the network considers a valid tx for relay. The same value is advertised by
|
|
80
|
+
* `getNodeInfo` and enforced by the RPC/gossip/pool gas validators.
|
|
81
|
+
*
|
|
82
|
+
* The DA budget is {@link getDaCheckpointBudgetForTxs} evaluated at the clamped blocks-per-checkpoint — the
|
|
83
|
+
* raw blob capacity net of encoding overhead for every block — so the admission limit is consistent with the
|
|
84
|
+
* builder's blob-field cap.
|
|
85
|
+
*
|
|
86
|
+
* @param manaCheckpointBudget - L2 (mana) budget per checkpoint (`rollupManaLimit`).
|
|
87
|
+
*/
|
|
88
|
+
export function computeNetworkTxGasLimits(opts: { maxBlocksPerCheckpoint: number; manaCheckpointBudget: number }): Gas {
|
|
89
|
+
const blocks = Math.max(1, opts.maxBlocksPerCheckpoint);
|
|
90
|
+
const daBudget = getDaCheckpointBudgetForTxs(blocks);
|
|
91
|
+
|
|
92
|
+
// Clamp by the whole-checkpoint budget too: at small block counts the per-block share scaled by the
|
|
93
|
+
// multiplier can exceed the checkpoint budget itself (e.g. at blocks=1 a >1 multiplier overshoots), which
|
|
94
|
+
// would admit a tx no builder can ever pack — the builder caps each block by the remaining budget. Clamping
|
|
95
|
+
// by the budget makes "admitted ⇒ buildable" unconditional. (For DA the per-tx maximum always binds first,
|
|
96
|
+
// so the budget clamp is currently moot, but it keeps the invariant explicit.)
|
|
97
|
+
const daGas = Math.min(
|
|
98
|
+
MAX_TX_DA_GAS,
|
|
99
|
+
daBudget,
|
|
100
|
+
Math.ceil((daBudget / blocks) * MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER),
|
|
101
|
+
);
|
|
102
|
+
const l2Gas = Math.min(
|
|
103
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
104
|
+
opts.manaCheckpointBudget,
|
|
105
|
+
Math.ceil((opts.manaCheckpointBudget / blocks) * MIN_PER_BLOCK_ALLOCATION_MULTIPLIER),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
return new Gas(daGas, l2Gas);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Network tx gas limits derived from a sequencer/p2p config and the L1 slot-timing + mana constants. The
|
|
113
|
+
* single source of truth shared by `getNodeInfo` (advertising) and the RPC/gossip/pool gas validators
|
|
114
|
+
* (enforcing), so a node never rejects a tx it advertised as admissible. Always uses the network-minimum
|
|
115
|
+
* multipliers, never the node's (possibly higher) configured multipliers.
|
|
116
|
+
*/
|
|
117
|
+
export function getNetworkTxGasLimits(
|
|
118
|
+
config: ProposerTimetableConfig,
|
|
119
|
+
l1Constants: SlotTimingConstants & { rollupManaLimit: number },
|
|
120
|
+
): Gas {
|
|
121
|
+
const maxBlocksPerCheckpoint = buildProposerTimetable(config, l1Constants).getMaxBlocksPerCheckpoint();
|
|
122
|
+
return computeNetworkTxGasLimits({ maxBlocksPerCheckpoint, manaCheckpointBudget: l1Constants.rollupManaLimit });
|
|
123
|
+
}
|
package/src/ha-signing/config.ts
CHANGED
|
@@ -25,8 +25,20 @@ export type BaseSignerConfig = {
|
|
|
25
25
|
nodeId: string;
|
|
26
26
|
/** How long to wait between polls when a duty is being signed (ms) */
|
|
27
27
|
pollingIntervalMs: number;
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* How long (ms) to wait for a peer node's in-progress signing before giving up and treating the
|
|
30
|
+
* duty as already handled. This is the cross-node wait/poll timeout, distinct from
|
|
31
|
+
* signerCallTimeoutMs (the hard upper bound on this node's own signer call).
|
|
32
|
+
*/
|
|
33
|
+
peerSigningTimeoutMs: number;
|
|
34
|
+
/**
|
|
35
|
+
* Hard upper bound (ms) on a single signer call made by this node. If the (possibly remote)
|
|
36
|
+
* signer does not return within this time, the call is aborted, the duty lock is released, and
|
|
37
|
+
* signing fails so it can be safely retried. The effective value is clamped to
|
|
38
|
+
* maxStuckDutiesAgeMs / 2 at construction, so a slow signer's lock is always released before
|
|
39
|
+
* stuck-duty cleanup could reclaim it. Defaults to 30_000 when unset.
|
|
40
|
+
*/
|
|
41
|
+
signerCallTimeoutMs?: number;
|
|
30
42
|
/** Maximum age of a stuck duty in ms (defaults to 2x hardcoded Aztec slot duration if not set) */
|
|
31
43
|
maxStuckDutiesAgeMs?: number;
|
|
32
44
|
/** Optional: clean up old duties after this many hours (disabled if not set) */
|
|
@@ -44,11 +56,16 @@ export const baseSignerConfigMappings: ConfigMappingsType<BaseSignerConfig> = {
|
|
|
44
56
|
description: 'The number of ms to wait between polls when a duty is being signed',
|
|
45
57
|
...numberConfigHelper(100),
|
|
46
58
|
},
|
|
47
|
-
|
|
59
|
+
peerSigningTimeoutMs: {
|
|
48
60
|
env: 'VALIDATOR_HA_SIGNING_TIMEOUT_MS',
|
|
49
|
-
description:
|
|
61
|
+
description: "How long to wait for a peer node's in-progress signing before giving up",
|
|
50
62
|
...numberConfigHelper(3_000),
|
|
51
63
|
},
|
|
64
|
+
signerCallTimeoutMs: {
|
|
65
|
+
env: 'VALIDATOR_SIGNER_CALL_TIMEOUT_MS',
|
|
66
|
+
description: 'Hard upper bound in ms on a single signer call before it is aborted (default 30000)',
|
|
67
|
+
...numberConfigHelper(30_000),
|
|
68
|
+
},
|
|
52
69
|
maxStuckDutiesAgeMs: {
|
|
53
70
|
env: 'VALIDATOR_HA_MAX_STUCK_DUTIES_AGE_MS',
|
|
54
71
|
description: 'The maximum age of a stuck duty in ms (defaults to 2x Aztec slot duration)',
|
|
@@ -65,7 +82,8 @@ export const baseSignerConfigMappings: ConfigMappingsType<BaseSignerConfig> = {
|
|
|
65
82
|
export const BaseSignerConfigSchema = z.object({
|
|
66
83
|
nodeId: z.string(),
|
|
67
84
|
pollingIntervalMs: z.number().min(0),
|
|
68
|
-
|
|
85
|
+
peerSigningTimeoutMs: z.number().min(0),
|
|
86
|
+
signerCallTimeoutMs: z.number().min(0).optional(),
|
|
69
87
|
maxStuckDutiesAgeMs: z.number().min(0).optional(),
|
|
70
88
|
cleanupOldDutiesAfterHours: z.number().min(0).optional(),
|
|
71
89
|
...pickL1ContractAddressesSchema('rollupAddress'),
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ConfigMappingsType,
|
|
3
|
+
booleanConfigHelper,
|
|
4
|
+
getConfigFromMappings,
|
|
5
|
+
optionalNumberConfigHelper,
|
|
6
|
+
} from '@aztec/foundation/config';
|
|
2
7
|
import { zodFor } from '@aztec/foundation/schemas';
|
|
3
8
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/stdlib/kv-store';
|
|
4
9
|
|
|
@@ -17,6 +22,12 @@ export type LocalSignerConfig = BaseSignerConfig &
|
|
|
17
22
|
DataStoreConfig & {
|
|
18
23
|
/** Maximum size of the local signing-protection LMDB store in KB. Overwrites the general dataStoreMapSizeKb. */
|
|
19
24
|
signingProtectionMapSizeKb?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Allow local signing protection to run against an ephemeral store when no data directory is set.
|
|
27
|
+
* Without this, a missing data directory fails startup, since ephemeral protection does not survive
|
|
28
|
+
* restarts. Intended for dev/test networks only; production validators must persist to disk.
|
|
29
|
+
*/
|
|
30
|
+
allowEphemeralSigningProtection?: boolean;
|
|
20
31
|
};
|
|
21
32
|
|
|
22
33
|
export const localSignerConfigMappings: ConfigMappingsType<LocalSignerConfig> = {
|
|
@@ -28,6 +39,13 @@ export const localSignerConfigMappings: ConfigMappingsType<LocalSignerConfig> =
|
|
|
28
39
|
'Maximum size of the local signing-protection LMDB store in KB. Overwrites the general dataStoreMapSizeKb.',
|
|
29
40
|
...optionalNumberConfigHelper(),
|
|
30
41
|
},
|
|
42
|
+
allowEphemeralSigningProtection: {
|
|
43
|
+
env: 'VALIDATOR_ALLOW_EPHEMERAL_SIGNING_PROTECTION',
|
|
44
|
+
description:
|
|
45
|
+
'Allow local signing protection to run against an ephemeral store when no data directory is set (dev/test only). ' +
|
|
46
|
+
'Ephemeral protection does not survive restarts, so this is unsafe for production validators.',
|
|
47
|
+
...booleanConfigHelper(false),
|
|
48
|
+
},
|
|
31
49
|
};
|
|
32
50
|
|
|
33
51
|
export const LocalSignerConfigSchema = zodFor<LocalSignerConfig>()(
|
|
@@ -35,6 +53,7 @@ export const LocalSignerConfigSchema = zodFor<LocalSignerConfig>()(
|
|
|
35
53
|
dataDirectory: z.string().optional(),
|
|
36
54
|
dataStoreMapSizeKb: z.number(),
|
|
37
55
|
signingProtectionMapSizeKb: z.number().optional(),
|
|
56
|
+
allowEphemeralSigningProtection: z.boolean().optional(),
|
|
38
57
|
}),
|
|
39
58
|
);
|
|
40
59
|
|
package/src/hash/hash.ts
CHANGED
|
@@ -188,14 +188,6 @@ export function computeSecretHash(secret: Fr): Promise<Fr> {
|
|
|
188
188
|
return poseidon2HashWithSeparator([secret], DomainSeparator.SECRET_HASH);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
export async function computeL1ToL2MessageNullifier(contract: AztecAddress, messageHash: Fr, secret: Fr) {
|
|
192
|
-
const innerMessageNullifier = await poseidon2HashWithSeparator(
|
|
193
|
-
[messageHash, secret],
|
|
194
|
-
DomainSeparator.MESSAGE_NULLIFIER,
|
|
195
|
-
);
|
|
196
|
-
return siloNullifier(contract, innerMessageNullifier);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
191
|
/**
|
|
200
192
|
* Calculates a siloed hash of a scoped l2 to l1 message.
|
|
201
193
|
* @returns Fr containing 248 bits of information of sha256 hash.
|