@aztec/stdlib 6.0.0-nightly.20260604 → 6.0.0-nightly.20260721
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/buffer.d.ts +6 -2
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +13 -1
- 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/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 +8 -3
- 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 -5
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +53 -23
- 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 +44 -28
- 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 +19 -6
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +26 -11
- 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/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/dest/world-state/world_state_revision.d.ts +1 -18
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +0 -20
- package/package.json +8 -8
- package/src/abi/buffer.ts +13 -1
- 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 +92 -0
- 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/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 +8 -2
- 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 +71 -21
- package/src/logs/app_tagging_secret.ts +56 -24
- 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 +31 -15
- 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/src/world-state/world_state_revision.ts +0 -33
- 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
|
@@ -18,7 +18,12 @@ import {
|
|
|
18
18
|
computeInitializationHash,
|
|
19
19
|
computeInitializationHashFromEncodedArgs,
|
|
20
20
|
} from './contract_address.js';
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
ContractInstance,
|
|
23
|
+
ContractInstancePreimage,
|
|
24
|
+
ContractInstancePreimageWithAddress,
|
|
25
|
+
ContractInstanceWithAddress,
|
|
26
|
+
} from './interfaces/contract_instance.js';
|
|
22
27
|
|
|
23
28
|
const VERSION = 2 as const;
|
|
24
29
|
|
|
@@ -115,6 +120,62 @@ export class SerializableContractInstance {
|
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
|
|
123
|
+
export class SerializableContractInstancePreimage {
|
|
124
|
+
public readonly version = VERSION;
|
|
125
|
+
public readonly salt: Fr;
|
|
126
|
+
public readonly deployer: AztecAddress;
|
|
127
|
+
public readonly originalContractClassId: Fr;
|
|
128
|
+
public readonly initializationHash: Fr;
|
|
129
|
+
public readonly immutablesHash: Fr;
|
|
130
|
+
public readonly publicKeys: PublicKeys;
|
|
131
|
+
|
|
132
|
+
constructor(instance: ContractInstancePreimage) {
|
|
133
|
+
if (instance.version !== VERSION) {
|
|
134
|
+
throw new Error(`Unexpected contract class version ${instance.version}`);
|
|
135
|
+
}
|
|
136
|
+
this.salt = instance.salt;
|
|
137
|
+
this.deployer = instance.deployer;
|
|
138
|
+
this.originalContractClassId = instance.originalContractClassId;
|
|
139
|
+
this.initializationHash = instance.initializationHash;
|
|
140
|
+
this.immutablesHash = instance.immutablesHash;
|
|
141
|
+
this.publicKeys = instance.publicKeys;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public toBuffer() {
|
|
145
|
+
return serializeToBuffer(
|
|
146
|
+
numToUInt8(this.version),
|
|
147
|
+
this.salt,
|
|
148
|
+
this.deployer,
|
|
149
|
+
this.originalContractClassId,
|
|
150
|
+
this.initializationHash,
|
|
151
|
+
this.immutablesHash,
|
|
152
|
+
this.publicKeys,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Returns a copy of this object with its address included. */
|
|
157
|
+
withAddress(address: AztecAddress): ContractInstancePreimageWithAddress {
|
|
158
|
+
return { ...this, address };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static fromBuffer(bufferOrReader: Buffer | BufferReader): SerializableContractInstancePreimage {
|
|
162
|
+
const reader = BufferReader.asReader(bufferOrReader);
|
|
163
|
+
const version = reader.readUInt8();
|
|
164
|
+
if (version !== VERSION) {
|
|
165
|
+
throw new Error(`Unexpected contract instance preimage version ${version}`);
|
|
166
|
+
}
|
|
167
|
+
return new SerializableContractInstancePreimage({
|
|
168
|
+
version: VERSION,
|
|
169
|
+
salt: reader.readObject(Fr),
|
|
170
|
+
deployer: reader.readObject(AztecAddress),
|
|
171
|
+
originalContractClassId: reader.readObject(Fr),
|
|
172
|
+
initializationHash: reader.readObject(Fr),
|
|
173
|
+
immutablesHash: reader.readObject(Fr),
|
|
174
|
+
publicKeys: reader.readObject(PublicKeys),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
118
179
|
/**
|
|
119
180
|
* Generates a Contract Instance from some instantiation params.
|
|
120
181
|
* @param artifact - The account contract build artifact.
|
package/src/contract/index.ts
CHANGED
|
@@ -25,11 +25,9 @@ export interface ContractDataSource {
|
|
|
25
25
|
/**
|
|
26
26
|
* Returns a publicly deployed contract instance given its address.
|
|
27
27
|
* @param address - Address of the deployed contract.
|
|
28
|
-
* @param timestamp - Timestamp at which to
|
|
29
|
-
* be used.
|
|
30
|
-
* TODO(#15170): Fix the implementations ignoring the timestamp param and make timestamp required.
|
|
28
|
+
* @param timestamp - Timestamp at which to resolve the contract instance's current class id.
|
|
31
29
|
*/
|
|
32
|
-
getContract(address: AztecAddress, timestamp
|
|
30
|
+
getContract(address: AztecAddress, timestamp: UInt64): Promise<ContractInstanceWithAddress | undefined>;
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
33
|
* Returns the list of all class ids known.
|
|
@@ -9,19 +9,19 @@ import { schemas, zodFor } from '../../schemas/index.js';
|
|
|
9
9
|
const VERSION = 2 as const;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* The address preimage of a contract instance: the immutable data that hashes to its address, i.e. everything a
|
|
13
|
+
* contract deployment commits to.
|
|
14
|
+
*
|
|
15
|
+
* Note that `originaContractClassId` is not necessarily the instance's _current_ class id, in case of upgrades: that
|
|
16
|
+
* one is not part of the preimage and is instead derived from chain state.
|
|
15
17
|
*/
|
|
16
|
-
export interface
|
|
18
|
+
export interface ContractInstancePreimage {
|
|
17
19
|
/** Version identifier. Initially one, bumped for any changes to the contract instance struct. */
|
|
18
20
|
version: typeof VERSION;
|
|
19
21
|
/** User-generated pseudorandom value for uniqueness. */
|
|
20
22
|
salt: Fr;
|
|
21
23
|
/** Optional deployer address or zero if this was a universal deploy. */
|
|
22
24
|
deployer: AztecAddress;
|
|
23
|
-
/** Identifier of the contract class for this instance. */
|
|
24
|
-
currentContractClassId: Fr;
|
|
25
25
|
/** Identifier of the original (at deployment) contract class for this instance */
|
|
26
26
|
originalContractClassId: Fr;
|
|
27
27
|
/** Hash of the selector and arguments to the constructor. */
|
|
@@ -32,14 +32,24 @@ export interface ContractInstance {
|
|
|
32
32
|
publicKeys: PublicKeys;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The address preimage plus the current contract class id, which is chain-tracked state derived from the
|
|
37
|
+
* ContractInstanceRegistry (it equals the original class id unless the contract has been upgraded).
|
|
38
|
+
*/
|
|
39
|
+
export interface ContractInstance extends ContractInstancePreimage {
|
|
40
|
+
/** Identifier of the contract class this instance currently runs (as of some block). */
|
|
41
|
+
currentContractClassId: Fr;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type ContractInstancePreimageWithAddress = ContractInstancePreimage & { address: AztecAddress };
|
|
45
|
+
|
|
35
46
|
export type ContractInstanceWithAddress = ContractInstance & { address: AztecAddress };
|
|
36
47
|
|
|
37
|
-
export const
|
|
48
|
+
export const ContractInstancePreimageSchema = zodFor<ContractInstancePreimage>()(
|
|
38
49
|
z.object({
|
|
39
50
|
version: z.literal(VERSION),
|
|
40
51
|
salt: schemas.Fr,
|
|
41
52
|
deployer: schemas.AztecAddress,
|
|
42
|
-
currentContractClassId: schemas.Fr,
|
|
43
53
|
originalContractClassId: schemas.Fr,
|
|
44
54
|
initializationHash: schemas.Fr,
|
|
45
55
|
immutablesHash: schemas.Fr,
|
|
@@ -47,6 +57,14 @@ export const ContractInstanceSchema = zodFor<ContractInstance>()(
|
|
|
47
57
|
}),
|
|
48
58
|
);
|
|
49
59
|
|
|
60
|
+
export const ContractInstanceSchema = zodFor<ContractInstance>()(
|
|
61
|
+
ContractInstancePreimageSchema.and(z.object({ currentContractClassId: schemas.Fr })),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export const ContractInstancePreimageWithAddressSchema = zodFor<ContractInstancePreimageWithAddress>()(
|
|
65
|
+
ContractInstancePreimageSchema.and(z.object({ address: schemas.AztecAddress })),
|
|
66
|
+
);
|
|
67
|
+
|
|
50
68
|
export const ContractInstanceWithAddressSchema = zodFor<ContractInstanceWithAddress>()(
|
|
51
69
|
ContractInstanceSchema.and(z.object({ address: schemas.AztecAddress })),
|
|
52
70
|
);
|
|
@@ -5,6 +5,12 @@ import { z } from 'zod';
|
|
|
5
5
|
|
|
6
6
|
import { type ProtocolContractAddresses, ProtocolContractAddressesSchema } from './protocol_contract_addresses.js';
|
|
7
7
|
|
|
8
|
+
/** Limits a single transaction may declare on a network. */
|
|
9
|
+
export interface TxsLimits {
|
|
10
|
+
/** Maximum gas limits a single tx may declare: the smaller of the per-tx maximum and the per-block allocation. */
|
|
11
|
+
gas: { daGas: number; l2Gas: number };
|
|
12
|
+
}
|
|
13
|
+
|
|
8
14
|
/** Provides basic information about the running node. */
|
|
9
15
|
export interface NodeInfo {
|
|
10
16
|
/** Version as tracked in the aztec-packages repository. */
|
|
@@ -21,6 +27,8 @@ export interface NodeInfo {
|
|
|
21
27
|
protocolContractAddresses: ProtocolContractAddresses;
|
|
22
28
|
/** Whether the node requires real proofs for transaction submission. */
|
|
23
29
|
realProofs: boolean;
|
|
30
|
+
/** Limits a single tx may declare on this network. Clients rely on this to set fallback gas limits. */
|
|
31
|
+
txsLimits: TxsLimits;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
export const NodeInfoSchema: ZodFor<NodeInfo> = z
|
|
@@ -32,5 +40,8 @@ export const NodeInfoSchema: ZodFor<NodeInfo> = z
|
|
|
32
40
|
l1ContractAddresses: L1ContractAddressesSchema,
|
|
33
41
|
protocolContractAddresses: ProtocolContractAddressesSchema,
|
|
34
42
|
realProofs: z.boolean(),
|
|
43
|
+
txsLimits: z.object({
|
|
44
|
+
gas: z.object({ daGas: z.number().int().nonnegative(), l2Gas: z.number().int().nonnegative() }),
|
|
45
|
+
}),
|
|
35
46
|
})
|
|
36
47
|
.transform(obj => ({ enr: undefined, ...obj }));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The contract-side preimage of an Aztec address, i.e. the commitment to a specific contract instance.
|
|
5
|
+
*
|
|
6
|
+
* A partial address commits to a contract's code and initialization
|
|
7
|
+
* (`hash(contract_class_id, salted_initialization_hash)`) but not to its keys. Combined with an account's `PublicKeys`,
|
|
8
|
+
* it fully determines the address: `address = (hash(public_keys_hash, partial_address) * G + Ivpk_m).x`. Two accounts
|
|
9
|
+
* therefore share an address only if they share both their public keys and their partial address.
|
|
10
|
+
*
|
|
11
|
+
* See `computePartialAddress` for the derivation.
|
|
6
12
|
*/
|
|
7
13
|
export type PartialAddress = Fr;
|
|
@@ -6,11 +6,20 @@ import { join } from 'path';
|
|
|
6
6
|
|
|
7
7
|
import { DatabaseVersion } from './database_version.js';
|
|
8
8
|
|
|
9
|
-
export type DatabaseVersionManagerFs = Pick<typeof fs, 'readFile' | '
|
|
9
|
+
export type DatabaseVersionManagerFs = Pick<typeof fs, 'readFile' | 'rm' | 'mkdir' | 'rename' | 'open'>;
|
|
10
10
|
|
|
11
11
|
export const DATABASE_VERSION_FILE_NAME = 'db_version';
|
|
12
12
|
export type SchemaVersionMismatchPolicy = 'reset' | 'throw';
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* How to react when the version file exists but cannot be read (permissions, IO error, truncation).
|
|
16
|
+
* `'reset'` (default) treats the store as unversioned and lets the reset path run — safe for stores
|
|
17
|
+
* where an empty state is legitimate. `'throw'` refuses to open, leaving data untouched — required
|
|
18
|
+
* for protection stores (e.g. signing protection) that must never be silently wiped by a transient
|
|
19
|
+
* filesystem error. A genuinely missing file (ENOENT) is a first boot and is never affected by this.
|
|
20
|
+
*/
|
|
21
|
+
export type VersionFileReadFailurePolicy = 'reset' | 'throw';
|
|
22
|
+
|
|
14
23
|
export type DatabaseVersionManagerOptions<T> = {
|
|
15
24
|
schemaVersion: number;
|
|
16
25
|
rollupAddress: EthAddress;
|
|
@@ -18,6 +27,7 @@ export type DatabaseVersionManagerOptions<T> = {
|
|
|
18
27
|
onOpen: (dataDir: string) => Promise<T>;
|
|
19
28
|
onUpgrade?: (dataDir: string, currentVersion: number, latestVersion: number) => Promise<void>;
|
|
20
29
|
schemaVersionMismatchPolicy?: SchemaVersionMismatchPolicy;
|
|
30
|
+
versionFileReadFailurePolicy?: VersionFileReadFailurePolicy;
|
|
21
31
|
fileSystem?: DatabaseVersionManagerFs;
|
|
22
32
|
log?: Logger;
|
|
23
33
|
};
|
|
@@ -37,6 +47,7 @@ export class DatabaseVersionManager<T> {
|
|
|
37
47
|
private onOpen: (dataDir: string) => Promise<T>;
|
|
38
48
|
private onUpgrade?: (dataDir: string, currentVersion: number, latestVersion: number) => Promise<void>;
|
|
39
49
|
private schemaVersionMismatchPolicy: SchemaVersionMismatchPolicy;
|
|
50
|
+
private versionFileReadFailurePolicy: VersionFileReadFailurePolicy;
|
|
40
51
|
private fileSystem: DatabaseVersionManagerFs;
|
|
41
52
|
private log: Logger;
|
|
42
53
|
|
|
@@ -47,8 +58,11 @@ export class DatabaseVersionManager<T> {
|
|
|
47
58
|
* @param rollupAddress - The rollup contract address
|
|
48
59
|
* @param dataDirectory - The directory where version information will be stored
|
|
49
60
|
* @param onOpen - A callback to the open the database at the given location
|
|
50
|
-
* @param onUpgrade - An optional callback to upgrade the database before opening. If not provided it will reset the
|
|
61
|
+
* @param onUpgrade - An optional callback to upgrade the database before opening. If not provided it will reset the
|
|
62
|
+
* database. Must be idempotent: since the version marker is written only after a successful open, a crash after
|
|
63
|
+
* onUpgrade but before the marker is written re-runs onUpgrade on the next start.
|
|
51
64
|
* @param schemaVersionMismatchPolicy - Whether schema mismatches should reset data or throw
|
|
65
|
+
* @param versionFileReadFailurePolicy - Whether an unreadable (non-missing) version file should reset data or throw
|
|
52
66
|
* @param fileSystem - An interface to access the filesystem
|
|
53
67
|
* @param log - Optional custom logger
|
|
54
68
|
* @param options - Configuration options
|
|
@@ -60,6 +74,7 @@ export class DatabaseVersionManager<T> {
|
|
|
60
74
|
onOpen,
|
|
61
75
|
onUpgrade,
|
|
62
76
|
schemaVersionMismatchPolicy = 'reset',
|
|
77
|
+
versionFileReadFailurePolicy = 'reset',
|
|
63
78
|
fileSystem = fs,
|
|
64
79
|
log = createLogger(`foundation:version-manager`),
|
|
65
80
|
}: DatabaseVersionManagerOptions<T>) {
|
|
@@ -74,13 +89,40 @@ export class DatabaseVersionManager<T> {
|
|
|
74
89
|
this.onOpen = onOpen;
|
|
75
90
|
this.onUpgrade = onUpgrade;
|
|
76
91
|
this.schemaVersionMismatchPolicy = schemaVersionMismatchPolicy;
|
|
92
|
+
this.versionFileReadFailurePolicy = versionFileReadFailurePolicy;
|
|
77
93
|
this.fileSystem = fileSystem;
|
|
78
94
|
this.log = log;
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
static async writeVersion(version: DatabaseVersion, dataDir: string, fileSystem: DatabaseVersionManagerFs = fs) {
|
|
82
98
|
await fileSystem.mkdir(dataDir, { recursive: true });
|
|
83
|
-
|
|
99
|
+
const finalPath = join(dataDir, DatabaseVersionManager.VERSION_FILE);
|
|
100
|
+
const tmpPath = `${finalPath}.tmp`;
|
|
101
|
+
|
|
102
|
+
// Atomic durable write: fill a temp file, fsync it, then rename it into place. The marker only
|
|
103
|
+
// becomes visible under its final name once its bytes are durably on disk, so a crash mid-write
|
|
104
|
+
// can never leave a "valid" version file sitting over an empty or partially-populated data dir.
|
|
105
|
+
const handle = await fileSystem.open(tmpPath, 'w');
|
|
106
|
+
try {
|
|
107
|
+
await handle.writeFile(version.toBuffer());
|
|
108
|
+
await handle.sync();
|
|
109
|
+
} finally {
|
|
110
|
+
await handle.close();
|
|
111
|
+
}
|
|
112
|
+
await fileSystem.rename(tmpPath, finalPath);
|
|
113
|
+
|
|
114
|
+
// Best-effort fsync of the containing directory so the rename itself survives a crash. Not all
|
|
115
|
+
// filesystems support directory fsync, so a failure here is non-fatal.
|
|
116
|
+
try {
|
|
117
|
+
const dirHandle = await fileSystem.open(dataDir, 'r');
|
|
118
|
+
try {
|
|
119
|
+
await dirHandle.sync();
|
|
120
|
+
} finally {
|
|
121
|
+
await dirHandle.close();
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
// directory fsync is best-effort
|
|
125
|
+
}
|
|
84
126
|
}
|
|
85
127
|
|
|
86
128
|
/**
|
|
@@ -105,6 +147,17 @@ export class DatabaseVersionManager<T> {
|
|
|
105
147
|
storedVersion = DatabaseVersion.empty();
|
|
106
148
|
// only turn off these logs if the data dir didn't exist before
|
|
107
149
|
shouldLogDataReset = false;
|
|
150
|
+
} else if (this.versionFileReadFailurePolicy === 'throw') {
|
|
151
|
+
// The version file exists but could not be read/parsed (permissions, IO error, truncation).
|
|
152
|
+
// Treating this as "unversioned" would reset the data directory, silently wiping a store that
|
|
153
|
+
// must fail closed. Refuse to open instead, leaving the data untouched for the operator.
|
|
154
|
+
const code = (err as Error & { code?: string })?.code;
|
|
155
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
156
|
+
throw new Error(
|
|
157
|
+
`Failed to read database version file at ${this.versionFile} (${code ?? 'unknown error'}: ${message}). ` +
|
|
158
|
+
`Refusing to open the database; data was NOT reset. Resolve the underlying filesystem error and retry.`,
|
|
159
|
+
{ cause: err },
|
|
160
|
+
);
|
|
108
161
|
} else {
|
|
109
162
|
this.log.warn(`Failed to read stored version information: ${err}. Defaulting to empty version`);
|
|
110
163
|
storedVersion = DatabaseVersion.empty();
|
|
@@ -159,10 +212,47 @@ export class DatabaseVersionManager<T> {
|
|
|
159
212
|
await this.resetDataDirectory();
|
|
160
213
|
}
|
|
161
214
|
|
|
162
|
-
//
|
|
163
|
-
|
|
215
|
+
// Open the database first, then record the version marker. Writing the marker only after a
|
|
216
|
+
// successful open makes it a post-commit record: if the process crashes between the reset and a
|
|
217
|
+
// durable open, no marker is left behind, so the next startup re-runs the reset instead of
|
|
218
|
+
// trusting a marker that sits over empty or partially-initialized data.
|
|
219
|
+
const instance = await this.onOpen(this.dataDirectory);
|
|
164
220
|
|
|
165
|
-
|
|
221
|
+
// Only (re)write the marker when it would actually change — first boot, reset, or upgrade. On a
|
|
222
|
+
// normal boot it already matches, so skipping avoids an unnecessary fsync (and the directory
|
|
223
|
+
// write permission the temp-file+rename needs) and, more importantly, any window where a
|
|
224
|
+
// marker-write failure would orphan the database we just opened.
|
|
225
|
+
if (!storedVersion.equals(this.currentVersion)) {
|
|
226
|
+
try {
|
|
227
|
+
await this.writeVersion();
|
|
228
|
+
} catch (err) {
|
|
229
|
+
// The database opened but recording the marker failed; close the freshly opened instance so
|
|
230
|
+
// we do not leak its file handles / locks before propagating the failure.
|
|
231
|
+
await this.closeQuietly(instance);
|
|
232
|
+
throw err;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return [instance, needsReset];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Best-effort close of a just-opened database instance, used to avoid leaking handles/locks when a
|
|
241
|
+
* post-open step fails. Swallows close errors so the original failure is the one that propagates.
|
|
242
|
+
*/
|
|
243
|
+
private async closeQuietly(instance: T): Promise<void> {
|
|
244
|
+
const closable = instance as
|
|
245
|
+
| { close?: () => Promise<void> | void; [Symbol.asyncDispose]?: () => Promise<void> }
|
|
246
|
+
| undefined;
|
|
247
|
+
const dispose = closable?.close ?? closable?.[Symbol.asyncDispose];
|
|
248
|
+
if (typeof dispose !== 'function') {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
try {
|
|
252
|
+
await dispose.call(closable);
|
|
253
|
+
} catch (err) {
|
|
254
|
+
this.log.warn(`Failed to close database after version-write failure: ${err}`);
|
|
255
|
+
}
|
|
166
256
|
}
|
|
167
257
|
|
|
168
258
|
/**
|
|
@@ -11,8 +11,41 @@ export const MAX_TXS_PER_BLOCK = 2 ** 16;
|
|
|
11
11
|
/** Max committee size - theoretical max from bitmap design (256 bytes × 8 bits) */
|
|
12
12
|
export const MAX_COMMITTEE_SIZE = 2048;
|
|
13
13
|
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Maximum number of L2 blocks in a provable checkpoint. Used for deserialization and when ingesting
|
|
16
|
+
* checkpoints already accepted by L1.
|
|
17
|
+
*
|
|
18
|
+
* This MUST be >= the number of blocks the proving system can carry, or a structurally-valid, provable
|
|
19
|
+
* checkpoint that L1 accepts would be rejected on ingest (`validateCheckpoint`) and wedge the archiver.
|
|
20
|
+
* The circuits and L1 impose no explicit per-checkpoint block count; the ceiling comes from the
|
|
21
|
+
* blob-field budget:
|
|
22
|
+
*
|
|
23
|
+
* budget = BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB = 6 * 4096 = 24,576 fields
|
|
24
|
+
*
|
|
25
|
+
* per-block minimal blob footprint:
|
|
26
|
+
* first block (may be empty) = 7 fields (NUM_FIRST_BLOCK_END_BLOB_FIELDS)
|
|
27
|
+
* every other (needs >= 1 tx) = 6 + 4 = 10 fields
|
|
28
|
+
* (NUM_BLOCK_END_BLOB_FIELDS + a 4-field minimal tx:
|
|
29
|
+
* tx start marker + tx hash + fee + 1 mandatory nullifier)
|
|
30
|
+
* + 1 checkpoint-end marker (NUM_CHECKPOINT_END_MARKER_FIELDS)
|
|
31
|
+
*
|
|
32
|
+
* max N: 7 + 10*(N - 1) + 1 <= 24,576 => 10*(N - 1) <= 24,568 => N <= 2,457
|
|
33
|
+
*
|
|
34
|
+
* Only the first block may be empty; every other block needs >= 1 tx (the circuits have no empty-tx
|
|
35
|
+
* variant for non-first blocks), so 2457 is the largest provable checkpoint. The blob format can encode
|
|
36
|
+
* more blocks than this (up to ~4095 with all-empty blocks), but such a checkpoint is unprovable and
|
|
37
|
+
* can only reach L1 with a malicious committee supermajority — a terminal network compromise where a
|
|
38
|
+
* wedged archiver is an acceptable outcome. We therefore bound ingest to the provable maximum.
|
|
39
|
+
* Invariant checked by the unit test in deserialization.test.ts.
|
|
40
|
+
*/
|
|
41
|
+
export const MAX_CAPACITY_BLOCKS_PER_CHECKPOINT = 2457;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Max blocks per checkpoint we are willing to build or attest to (conservative client policy, and the
|
|
45
|
+
* default block-count limit for `validateCheckpoint`). Distinct from {@link MAX_CAPACITY_BLOCKS_PER_CHECKPOINT},
|
|
46
|
+
* which is the higher ceiling we tolerate when deserializing checkpoints already accepted by L1.
|
|
47
|
+
*/
|
|
48
|
+
export const MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT = 72;
|
|
16
49
|
|
|
17
50
|
/** Max tx effects per body (based on blob capacity per checkpoint) */
|
|
18
51
|
export const MAX_TX_EFFECTS_PER_BODY = BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB;
|
|
@@ -4,6 +4,7 @@ import { GoogleCloudFileStore } from './gcs.js';
|
|
|
4
4
|
import { HttpFileStore, type HttpFileStoreOptions } from './http.js';
|
|
5
5
|
import type { FileStore, ReadOnlyFileStore } from './interface.js';
|
|
6
6
|
import { LocalFileStore } from './local.js';
|
|
7
|
+
import { InMemoryFileStore } from './memory.js';
|
|
7
8
|
import { S3FileStore } from './s3.js';
|
|
8
9
|
|
|
9
10
|
const supportedExamples = [
|
|
@@ -21,6 +22,12 @@ export async function createFileStore(
|
|
|
21
22
|
): Promise<FileStore | undefined> {
|
|
22
23
|
if (config === undefined) {
|
|
23
24
|
return undefined;
|
|
25
|
+
} else if (config.startsWith('mem://')) {
|
|
26
|
+
// In-memory store for tests (see InMemoryFileStore). The namespace is everything after the
|
|
27
|
+
// scheme, so `mem://X` and a later `mem://X` share data, like two file:// stores over one dir.
|
|
28
|
+
const namespace = config.slice('mem://'.length).replace(/\/+$/, '');
|
|
29
|
+
logger.info(`Creating in-memory file store at ${namespace}`);
|
|
30
|
+
return new InMemoryFileStore(namespace);
|
|
24
31
|
} else if (config.startsWith('file://')) {
|
|
25
32
|
const url = new URL(config);
|
|
26
33
|
if (url.host) {
|
package/src/file-store/index.ts
CHANGED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { writeFile } from 'fs/promises';
|
|
2
|
+
import { promisify } from 'util';
|
|
3
|
+
import { gunzip as gunzipCb, gzip as gzipCb } from 'zlib';
|
|
4
|
+
|
|
5
|
+
import type { FileStore, FileStoreSaveOptions } from './interface.js';
|
|
6
|
+
|
|
7
|
+
const gzip = promisify(gzipCb);
|
|
8
|
+
const gunzip = promisify(gunzipCb);
|
|
9
|
+
|
|
10
|
+
// Backing data is shared per namespace so that a store created for writing and a (read-only) store
|
|
11
|
+
// created later from the same `mem://` URL observe the same files — mirroring how two `file://`
|
|
12
|
+
// stores over the same directory share state on disk. Without this, `FileStoreTxSource`, which
|
|
13
|
+
// builds its own store from the URL, would never see what a test wrote through a different instance.
|
|
14
|
+
const namespaces = new Map<string, Map<string, Buffer>>();
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* In-memory {@link FileStore}, addressed via `mem://<namespace>/...`. Reads and writes are synchronous
|
|
18
|
+
* map operations with no disk I/O, so it is deterministic — useful for tests that exercise consumers
|
|
19
|
+
* of a file store (e.g. the tx file store) rather than the on-disk store itself, where a real
|
|
20
|
+
* filesystem can introduce timing flakes.
|
|
21
|
+
*/
|
|
22
|
+
export class InMemoryFileStore implements FileStore {
|
|
23
|
+
private readonly files: Map<string, Buffer>;
|
|
24
|
+
|
|
25
|
+
constructor(private readonly namespace: string) {
|
|
26
|
+
let files = namespaces.get(namespace);
|
|
27
|
+
if (!files) {
|
|
28
|
+
files = new Map();
|
|
29
|
+
namespaces.set(namespace, files);
|
|
30
|
+
}
|
|
31
|
+
this.files = files;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Clears all in-memory file store data, or a single namespace. Intended for test isolation. */
|
|
35
|
+
static clear(namespace?: string): void {
|
|
36
|
+
if (namespace === undefined) {
|
|
37
|
+
namespaces.clear();
|
|
38
|
+
} else {
|
|
39
|
+
namespaces.delete(namespace);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public async save(path: string, data: Buffer, opts?: FileStoreSaveOptions): Promise<string> {
|
|
44
|
+
const toStore = opts?.compress ? await gzip(data) : data;
|
|
45
|
+
const key = this.key(path);
|
|
46
|
+
this.files.set(key, Buffer.from(toStore));
|
|
47
|
+
return `mem://${this.namespace}/${key}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async upload(destPath: string, srcPath: string, opts?: FileStoreSaveOptions): Promise<string> {
|
|
51
|
+
const { readFile } = await import('fs/promises');
|
|
52
|
+
return this.save(destPath, await readFile(srcPath), opts);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public async read(pathOrUrl: string): Promise<Buffer> {
|
|
56
|
+
const data = this.files.get(this.key(pathOrUrl));
|
|
57
|
+
if (data === undefined) {
|
|
58
|
+
throw new Error(`File not found in memory store: ${pathOrUrl}`);
|
|
59
|
+
}
|
|
60
|
+
// Match LocalFileStore: transparently gunzip content that was stored compressed.
|
|
61
|
+
if (data.length >= 2 && data[0] === 0x1f && data[1] === 0x8b) {
|
|
62
|
+
return await gunzip(data);
|
|
63
|
+
}
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public async download(pathOrUrl: string, destPath: string): Promise<void> {
|
|
68
|
+
await writeFile(destPath, await this.read(pathOrUrl));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public exists(pathOrUrl: string): Promise<boolean> {
|
|
72
|
+
return Promise.resolve(this.files.has(this.key(pathOrUrl)));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Lists stored file keys, optionally restricted to those under `prefix`. Not part of {@link FileStore}. */
|
|
76
|
+
public listFiles(prefix = ''): string[] {
|
|
77
|
+
const keys = [...this.files.keys()];
|
|
78
|
+
const normalizedPrefix = prefix.replace(/^\/+/, '');
|
|
79
|
+
return normalizedPrefix ? keys.filter(k => k.startsWith(normalizedPrefix)) : keys;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Resolves a relative path or a `mem://` URI (as returned by `save`) to the registry key. */
|
|
83
|
+
private key(pathOrUrl: string): string {
|
|
84
|
+
const ownPrefix = `mem://${this.namespace}/`;
|
|
85
|
+
if (pathOrUrl.startsWith(ownPrefix)) {
|
|
86
|
+
return pathOrUrl.slice(ownPrefix.length);
|
|
87
|
+
}
|
|
88
|
+
if (pathOrUrl.startsWith('mem://')) {
|
|
89
|
+
// A mem:// URI for some namespace: drop the scheme and the leading namespace segment.
|
|
90
|
+
return pathOrUrl.slice('mem://'.length).replace(/^[^/]*\//, '');
|
|
91
|
+
}
|
|
92
|
+
return pathOrUrl.replace(/^\/+/, '');
|
|
93
|
+
}
|
|
94
|
+
}
|
package/src/gas/README.md
CHANGED
|
@@ -146,6 +146,98 @@ newPrice = currentPrice * (10000 + modifierBps) / 10000
|
|
|
146
146
|
| `LAG` | 2 slots |
|
|
147
147
|
| `LIFETIME` | 5 slots |
|
|
148
148
|
|
|
149
|
+
## Gas and Data Limits
|
|
150
|
+
|
|
151
|
+
The fee model above is *how much you pay* per unit of gas; this section is *how much you may use*. Limits
|
|
152
|
+
form a hierarchy from a single transaction up to a whole checkpoint, and a tx that is admissible for relay
|
|
153
|
+
must also be buildable into a block and fit a valid checkpoint.
|
|
154
|
+
|
|
155
|
+
### Per-tx protocol maxima
|
|
156
|
+
|
|
157
|
+
Hard ceilings on what any single tx may declare, independent of network configuration. Declaring more is
|
|
158
|
+
rejected everywhere a tx is validated.
|
|
159
|
+
|
|
160
|
+
- **`MAX_TX_DA_GAS`** (271,200) — `MAX_TX_BLOB_DATA_SIZE_IN_FIELDS` (8,475) × `DA_GAS_PER_FIELD` (32). This
|
|
161
|
+
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.
|
|
162
|
+
Defined in `constants/src/constants.ts`.
|
|
163
|
+
- **`MAX_PROCESSABLE_L2_GAS`** (6,540,000) — the AVM's maximum processable L2 gas, derived in Noir as
|
|
164
|
+
`PUBLIC_TX_L2_GAS_OVERHEAD + AVM_MAX_PROCESSABLE_L2_GAS` (`constants/src/constants.gen.ts`).
|
|
165
|
+
|
|
166
|
+
### Network admission limits
|
|
167
|
+
|
|
168
|
+
The most a single tx may *declare* and still be relayed across the network. Computed by
|
|
169
|
+
`computeNetworkTxGasLimits` in `tx_gas_limits.ts` per dimension as:
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
min(per-tx max, ceil(checkpointBudget / blocksPerCheckpoint * minMultiplier))
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The per-block share mirrors what a proposer grants the first block of a checkpoint
|
|
176
|
+
(`CheckpointBuilder.capLimitsByCheckpointBudgets`), so a tx declaring this much is packable into a block.
|
|
177
|
+
The network-minimum multipliers are `MIN_PER_BLOCK_ALLOCATION_MULTIPLIER` (1.2, L2 and tx count) and
|
|
178
|
+
`MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER` (1.5, DA). DA's is higher so a maximal contract class
|
|
179
|
+
registration (~97k DA gas) fits a single block at mainnet geometry (72s slots, 6s blocks → 10 blocks per
|
|
180
|
+
checkpoint).
|
|
181
|
+
|
|
182
|
+
The DA budget is `getDaCheckpointBudgetForTxs(maxBlocksPerCheckpoint)`, not the raw
|
|
183
|
+
`MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` (786,432). Blob encoding spends overhead fields that no tx pays DA
|
|
184
|
+
gas for — one checkpoint-end marker field and the per-block block-end fields (7 for the first block, 6 for
|
|
185
|
+
each subsequent block, `blob-lib/src/encoding/block_blob_data.ts`) — so the raw constant is unattainable. The
|
|
186
|
+
getter nets out the full overhead for a checkpoint of `maxBlocksPerCheckpoint` blocks: at mainnet geometry
|
|
187
|
+
(10 blocks) that is `(24,576 − 1 − 7 − 9×6) × 32 = 24,514 × 32 = 784,448` DA gas. Subtracting every block's
|
|
188
|
+
overhead (not just the first) keeps admission at or below the builder's first-block blob-field cap at every
|
|
189
|
+
geometry — the builder is the most generous for the first block (it only reserves that block's own block-end
|
|
190
|
+
overhead), so being conservative here is what guarantees admitted ⇒ buildable. Without this netting a tx
|
|
191
|
+
near the raw limit would be admitted but never buildable.
|
|
192
|
+
|
|
193
|
+
These limits depend on network-wide inputs only (timetable-derived blocks-per-checkpoint, checkpoint
|
|
194
|
+
budgets, the network-minimum multipliers), never on a node's local restrictiveness. Every node always
|
|
195
|
+
advertises them in `NodeInfo.txsLimits` (a required field); wallets read it and pass `txsLimits.gas` to
|
|
196
|
+
`GasSettings.fallback` as the default gas limits when sending without explicit limits, and they are enforced
|
|
197
|
+
by `GasLimitsValidator` (clamped to the per-tx protocol maxima) at three points: RPC tx acceptance
|
|
198
|
+
(`aztec-node/src/aztec-node/server.ts`), gossip validation (`p2p/src/services/libp2p/libp2p_service.ts`),
|
|
199
|
+
and pending-pool admission (`p2p/src/client/factory.ts`). They are deliberately *not* enforced at reqresp or
|
|
200
|
+
block-proposal validation — admission is relay policy, not block validity.
|
|
201
|
+
|
|
202
|
+
### Per-block builder budgets
|
|
203
|
+
|
|
204
|
+
While packing a checkpoint, `CheckpointBuilder.capLimitsByCheckpointBudgets`
|
|
205
|
+
(`validator-client/src/checkpoint_builder.ts`) computes each block's budget as a fair share of the remaining
|
|
206
|
+
checkpoint budget across the remaining blocks, scaled by the configured multipliers. Operators may raise the
|
|
207
|
+
multipliers above the network minimums but not lower them — the sequencer fails startup otherwise
|
|
208
|
+
(`assertConfigMeetsNetworkTxLimits` in `sequencer-client/src/sequencer/sequencer.ts`), since a node that
|
|
209
|
+
allocates less than it admits would accept txs over RPC/gossip that its builder can never pack.
|
|
210
|
+
|
|
211
|
+
The fair share is then min'ed with the operator's absolute per-block caps `maxL2BlockGas` / `maxDABlockGas`
|
|
212
|
+
and the blob-field cap (checkpoint capacity net of the checkpoint-end marker and this block's block-end
|
|
213
|
+
overhead). The absolute caps are allowed to be restrictive: a cap below the network admission limit only
|
|
214
|
+
produces a startup warning, not a failure, because such txs simply stay in the pool for other proposers to
|
|
215
|
+
include.
|
|
216
|
+
|
|
217
|
+
### Per-checkpoint budgets
|
|
218
|
+
|
|
219
|
+
The outermost limits, enforced as proposal validity in `validateCheckpointLimits`
|
|
220
|
+
(`stdlib/src/checkpoint/validate.ts`) and physically by blob encoding:
|
|
221
|
+
|
|
222
|
+
- **Mana** — total L2 gas across all blocks ≤ `rollupManaLimit` (= `manaTarget × 2` on L1,
|
|
223
|
+
`l1-contracts/src/core/libraries/rollup/FeeLib.sol`).
|
|
224
|
+
- **DA gas** — total DA gas ≤ raw `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` (786,432).
|
|
225
|
+
- **Blob fields** — total ≤ `BLOBS_PER_CHECKPOINT × FIELDS_PER_BLOB` (6 × 4,096 = 24,576).
|
|
226
|
+
- **Tx counts** — total txs ≤ `maxTxsPerCheckpoint` when configured.
|
|
227
|
+
|
|
228
|
+
### Summary
|
|
229
|
+
|
|
230
|
+
| Limit | Value (mainnet defaults) | Scope | Where enforced |
|
|
231
|
+
| --------------------------------------- | ------------------------------- | ------------- | ----------------------------------------------------------- |
|
|
232
|
+
| `MAX_TX_DA_GAS` | 271,200 | per-tx | every gas validator (hard ceiling) |
|
|
233
|
+
| `MAX_PROCESSABLE_L2_GAS` | 6,540,000 | per-tx | every gas validator (hard ceiling) |
|
|
234
|
+
| Network DA admission limit | min(271,200, ceil(784,448/10×1.5)) = 117,668 | per-tx (relay) | RPC, gossip, pending pool (`GasLimitsValidator`) |
|
|
235
|
+
| Network L2 admission limit | min(6,540,000, ceil(manaLimit/10×1.2)) | per-tx (relay) | RPC, gossip, pending pool (`GasLimitsValidator`) |
|
|
236
|
+
| Per-block fair share + caps | remaining budget / blocks × multiplier, min absolute caps & blob-field cap | per-block | `CheckpointBuilder.capLimitsByCheckpointBudgets` |
|
|
237
|
+
| `rollupManaLimit` | `manaTarget × 2` | per-checkpoint | `validateCheckpointLimits` |
|
|
238
|
+
| `MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT` | 786,432 | per-checkpoint | `validateCheckpointLimits` + blob encoding |
|
|
239
|
+
| `BLOBS_PER_CHECKPOINT × FIELDS_PER_BLOB`| 24,576 | per-checkpoint | `validateCheckpointLimits` + blob encoding |
|
|
240
|
+
|
|
149
241
|
## TypeScript Types
|
|
150
242
|
|
|
151
243
|
- **`Gas`** — mana quantity in two dimensions (`daGas`, `l2Gas`).
|