@aztec/stdlib 5.0.0-private.20260319 → 5.0.0-rc.1
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 +142 -1081
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +41 -18
- package/dest/abi/authorization_selector.d.ts +4 -7
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +14 -4
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +25 -4
- package/dest/abi/contract_artifact.d.ts +14 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +31 -7
- package/dest/abi/decoder.d.ts +5 -44
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +12 -67
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +32 -6
- package/dest/abi/event_selector.d.ts +4 -7
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_call.d.ts +7 -25
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +3 -6
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +2 -4
- package/dest/abi/function_signature_decoder.d.ts +43 -0
- package/dest/abi/function_signature_decoder.d.ts.map +1 -0
- package/dest/abi/function_signature_decoder.js +66 -0
- package/dest/abi/index.d.ts +2 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/abi/note_selector.d.ts +4 -7
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -3
- package/dest/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/abi/utils.d.ts +1 -1
- package/dest/abi/utils.d.ts.map +1 -1
- package/dest/abi/utils.js +1 -1
- package/dest/auth_witness/auth_witness.d.ts +2 -2
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +1756 -10463
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +6 -3
- package/dest/avm/avm_accumulated_data.d.ts +22 -86
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts +180 -932
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_proving_request.d.ts +653 -5446
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/message_pack.js +12 -3
- package/dest/avm/public_data_write.d.ts +6 -12
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/revert_code.d.ts +5 -21
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +12 -30
- package/dest/aztec-address/index.d.ts +8 -8
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +9 -6
- package/dest/block/attestation_info.d.ts +3 -2
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -5
- package/dest/block/block_data.d.ts +13 -38
- package/dest/block/block_data.d.ts.map +1 -1
- package/dest/block/block_data.js +2 -2
- package/dest/block/block_hash.d.ts +11 -10
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +10 -9
- package/dest/block/block_parameter.d.ts +37 -4
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +53 -2
- package/dest/block/in_block.d.ts +5 -24
- package/dest/block/in_block.d.ts.map +1 -1
- package/dest/block/index.d.ts +1 -2
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +0 -1
- package/dest/block/l2_block.d.ts +13 -41
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block_info.d.ts +10 -29
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_info.js +6 -5
- package/dest/block/l2_block_source.d.ts +216 -357
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +67 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +46 -7
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +2 -2
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +57 -21
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +8 -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 +11 -32
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +12 -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 +66 -40
- package/dest/block/proposal/attestations_and_signers.d.ts +19 -30
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +26 -18
- package/dest/block/proposal/committee_attestation.d.ts +6 -12
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- 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 +202 -33
- package/dest/checkpoint/checkpoint.d.ts +30 -96
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +11 -3
- package/dest/checkpoint/checkpoint_data.d.ts +68 -91
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +12 -0
- package/dest/checkpoint/checkpoint_info.d.ts +7 -23
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +60 -0
- package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_reexecution_tracker.js +108 -0
- package/dest/checkpoint/digest.d.ts +18 -0
- package/dest/checkpoint/digest.d.ts.map +1 -0
- package/dest/checkpoint/digest.js +12 -0
- package/dest/checkpoint/index.d.ts +4 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +3 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts +33 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.d.ts.map +1 -0
- package/dest/checkpoint/previous_checkpoint_out_hashes.js +45 -0
- package/dest/checkpoint/published_checkpoint.d.ts +42 -194
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- 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/chain-config.d.ts +4 -9
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +13 -12
- package/dest/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -1
- 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 +231 -0
- package/dest/config/sequencer-config.d.ts +7 -3
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +38 -5
- package/dest/contract/complete_address.d.ts +3 -2
- package/dest/contract/complete_address.d.ts.map +1 -1
- package/dest/contract/complete_address.js +6 -2
- package/dest/contract/contract_address.d.ts +5 -5
- package/dest/contract/contract_address.d.ts.map +1 -1
- package/dest/contract/contract_address.js +5 -4
- package/dest/contract/contract_deployment_data.d.ts +15 -61
- package/dest/contract/contract_deployment_data.d.ts.map +1 -1
- package/dest/contract/contract_instance.d.ts +4 -2
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +10 -3
- package/dest/contract/index.d.ts +1 -3
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -2
- package/dest/contract/interfaces/contract_class.d.ts +17 -241
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +1 -28
- package/dest/contract/interfaces/contract_instance.d.ts +41 -95
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +4 -2
- package/dest/contract/interfaces/contract_instance_update.d.ts +6 -26
- package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
- 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/interfaces/protocol_contract_addresses.d.ts +2 -12
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
- package/dest/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +2 -4
- package/dest/database-version/database_version.d.ts +5 -11
- package/dest/database-version/database_version.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +6 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +12 -1
- 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/epoch-helpers/index.d.ts +10 -22
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +12 -0
- package/dest/file-store/factory.d.ts +4 -3
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +2 -2
- package/dest/file-store/http.d.ts +9 -2
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +20 -9
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/gas/fee_math.d.ts +49 -0
- package/dest/gas/fee_math.d.ts.map +1 -0
- package/dest/gas/fee_math.js +80 -0
- package/dest/gas/gas.d.ts +9 -14
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +6 -3
- package/dest/gas/gas_fees.d.ts +13 -14
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +17 -4
- package/dest/gas/gas_settings.d.ts +60 -86
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +49 -9
- package/dest/gas/index.d.ts +3 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +2 -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 +11 -75
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +9 -18
- package/dest/ha-signing/index.d.ts +2 -2
- package/dest/ha-signing/index.d.ts.map +1 -1
- package/dest/ha-signing/index.js +1 -1
- package/dest/ha-signing/local_config.d.ts +3 -34
- package/dest/ha-signing/local_config.d.ts.map +1 -1
- package/dest/ha-signing/local_config.js +2 -2
- package/dest/ha-signing/types.d.ts +37 -32
- package/dest/ha-signing/types.d.ts.map +1 -1
- package/dest/ha-signing/types.js +13 -6
- package/dest/hash/hash.d.ts +19 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +39 -2
- package/dest/interfaces/allowed_element.d.ts +4 -28
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/api_limit.d.ts +1 -1
- package/dest/interfaces/api_limit.js +1 -1
- package/dest/interfaces/archiver.d.ts +20 -32
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +215 -70
- package/dest/interfaces/aztec-node-admin.d.ts +71 -305
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +60 -17
- package/dest/interfaces/aztec-node-debug.d.ts +34 -0
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-debug.js +29 -0
- package/dest/interfaces/aztec-node.d.ts +156 -112
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +354 -71
- package/dest/interfaces/block-builder.d.ts +5 -1
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block_response.d.ts +90 -0
- package/dest/interfaces/block_response.d.ts.map +1 -0
- package/dest/interfaces/block_response.js +30 -0
- package/dest/interfaces/chain_tips.d.ts +50 -0
- package/dest/interfaces/chain_tips.d.ts.map +1 -0
- package/dest/interfaces/chain_tips.js +11 -0
- package/dest/interfaces/checkpoint_parameter.d.ts +14 -0
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_parameter.js +18 -0
- package/dest/interfaces/checkpoint_response.d.ts +122 -0
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_response.js +26 -0
- package/dest/interfaces/client.d.ts +9 -2
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +7 -1
- package/dest/interfaces/configs.d.ts +63 -134
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +13 -2
- 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/l1_publish_info.d.ts +29 -0
- package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
- package/dest/interfaces/l1_publish_info.js +26 -0
- package/dest/interfaces/l2_logs_source.d.ts +14 -36
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/l2_logs_source.js +5 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p-bootstrap.js +8 -2
- package/dest/interfaces/p2p.d.ts +46 -7
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +41 -6
- package/dest/interfaces/private_kernel_prover.d.ts +62 -2
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.d.ts +5 -23
- package/dest/interfaces/prover-agent.d.ts.map +1 -1
- package/dest/interfaces/prover-agent.js +4 -1
- package/dest/interfaces/prover-client.d.ts +7 -29
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +0 -3
- package/dest/interfaces/prover-node.d.ts +8 -3
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +30 -14
- package/dest/interfaces/proving-job-source.js +24 -4
- package/dest/interfaces/proving-job.d.ts +763 -5814
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +1 -1
- package/dest/interfaces/public_storage_override.d.ts +22 -0
- package/dest/interfaces/public_storage_override.d.ts.map +1 -0
- package/dest/interfaces/public_storage_override.js +7 -0
- package/dest/interfaces/server.d.ts +6 -2
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +5 -1
- package/dest/interfaces/slasher.d.ts +25 -65
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +8 -4
- package/dest/interfaces/tx_provider.d.ts +6 -1
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +55 -248
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +8 -2
- package/dest/interfaces/world_state.d.ts +2 -2
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.d.ts +12 -8
- package/dest/kernel/hints/key_validation_request.d.ts.map +1 -1
- package/dest/kernel/hints/key_validation_request.js +20 -18
- package/dest/kernel/index.d.ts +5 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +4 -0
- package/dest/kernel/log_hash.d.ts +6 -2
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +21 -9
- package/dest/kernel/private_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +23 -0
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +35 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +24 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +37 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts +16 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_2_circuit_private_inputs.js +23 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts +17 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_3_circuit_private_inputs.js +25 -0
- package/dest/kernel/private_kernel_prover_output.d.ts +3 -29
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +9 -6
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +22 -7
- package/dest/kernel/private_to_avm_accumulated_data.d.ts +25 -69
- package/dest/kernel/private_to_avm_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_avm_accumulated_data.js +11 -5
- package/dest/kernel/private_to_public_accumulated_data.d.ts +4 -3
- package/dest/kernel/private_to_public_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_public_accumulated_data.js +6 -3
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +5 -4
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +7 -3
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +5 -4
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +6 -3
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +5 -4
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +7 -3
- package/dest/kernel/public_call_request.d.ts +15 -30
- package/dest/kernel/public_call_request.d.ts.map +1 -1
- package/dest/kernel/public_call_request.js +16 -7
- package/dest/keys/derivation.d.ts +6 -2
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +16 -6
- package/dest/keys/public_key.d.ts +22 -3
- package/dest/keys/public_key.d.ts.map +1 -1
- package/dest/keys/public_key.js +20 -1
- package/dest/keys/public_keys.d.ts +55 -82
- package/dest/keys/public_keys.d.ts.map +1 -1
- package/dest/keys/public_keys.js +102 -74
- package/dest/kv-store/config.d.ts +3 -6
- package/dest/kv-store/config.d.ts.map +1 -1
- package/dest/kv-store/config.js +2 -7
- package/dest/l1-contracts/index.d.ts +2 -2
- package/dest/l1-contracts/index.d.ts.map +1 -1
- package/dest/l1-contracts/index.js +1 -1
- package/dest/logs/app_tagging_secret.d.ts +46 -0
- package/dest/logs/app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/app_tagging_secret.js +109 -0
- package/dest/logs/app_tagging_secret_kind.d.ts +7 -0
- package/dest/logs/app_tagging_secret_kind.d.ts.map +1 -0
- package/dest/logs/app_tagging_secret_kind.js +17 -0
- package/dest/logs/contract_class_log.d.ts +16 -34
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +11 -9
- package/dest/logs/index.d.ts +7 -7
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +6 -6
- package/dest/logs/log_cursor.d.ts +51 -0
- package/dest/logs/log_cursor.d.ts.map +1 -0
- package/dest/logs/log_cursor.js +82 -0
- package/dest/logs/log_result.d.ts +54 -0
- package/dest/logs/log_result.d.ts.map +1 -0
- package/dest/logs/log_result.js +56 -0
- package/dest/logs/logs_query.d.ts +82 -0
- package/dest/logs/logs_query.d.ts.map +1 -0
- package/dest/logs/logs_query.js +50 -0
- package/dest/logs/message_context.d.ts +6 -8
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +27 -9
- package/dest/logs/pending_tagged_log.d.ts +2 -3
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +2 -2
- package/dest/logs/pre_tag.d.ts +11 -24
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/private_log.d.ts +7 -12
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +6 -3
- package/dest/logs/query_all_logs_by_tags.d.ts +24 -0
- package/dest/logs/query_all_logs_by_tags.d.ts.map +1 -0
- package/dest/logs/query_all_logs_by_tags.js +64 -0
- package/dest/logs/shared_secret_derivation.d.ts +11 -10
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +15 -9
- package/dest/logs/siloed_tag.d.ts +8 -7
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +13 -3
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +4 -0
- package/dest/logs/tagging_index_range.d.ts +13 -31
- package/dest/logs/tagging_index_range.d.ts.map +1 -1
- package/dest/logs/tagging_index_range.js +2 -2
- package/dest/messaging/append_l1_to_l2_messages.d.ts +9 -0
- package/dest/messaging/append_l1_to_l2_messages.d.ts.map +1 -0
- package/dest/messaging/append_l1_to_l2_messages.js +12 -0
- package/dest/messaging/index.d.ts +2 -1
- package/dest/messaging/index.d.ts.map +1 -1
- package/dest/messaging/index.js +1 -0
- package/dest/messaging/l1_to_l2_message.d.ts +3 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +11 -13
- package/dest/messaging/l2_to_l1_membership.d.ts +43 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +72 -12
- package/dest/messaging/l2_to_l1_message.d.ts +38 -112
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +21 -12
- package/dest/noir/index.d.ts +3 -1
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/note.d.ts +2 -2
- package/dest/note/note.d.ts.map +1 -1
- package/dest/note/note_dao.d.ts +1 -1
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +1 -4
- package/dest/p2p/block_proposal.d.ts +31 -14
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +57 -39
- package/dest/p2p/checkpoint_attestation.d.ts +15 -9
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +23 -24
- package/dest/p2p/checkpoint_proposal.d.ts +35 -16
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +59 -51
- package/dest/p2p/consensus_payload.d.ts +26 -20
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +38 -19
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/signature_utils.d.ts +28 -19
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +118 -21
- package/dest/p2p/signed_txs.d.ts +15 -13
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +26 -24
- package/dest/parity/parity_base_private_inputs.d.ts +8 -4
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +7 -5
- package/dest/parity/parity_public_inputs.d.ts +8 -4
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +6 -3
- package/dest/parity/parity_root_private_inputs.d.ts +2 -2
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.d.ts +57 -7
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +112 -15
- package/dest/proofs/recursive_proof.d.ts +2 -2
- package/dest/proofs/recursive_proof.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_headers_hash.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +8 -2
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.d.ts +12 -2
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +12 -0
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +6 -6
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +9 -2
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +9 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +5 -5
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +2 -2
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts +2 -2
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.d.ts +2 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts +2 -2
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.d.ts +2 -2
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/schemas/schemas.d.ts +32 -78
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +2 -2
- package/dest/slashing/helpers.d.ts +2 -2
- package/dest/slashing/helpers.d.ts.map +1 -1
- package/dest/slashing/helpers.js +10 -7
- package/dest/slashing/index.d.ts +2 -3
- package/dest/slashing/index.d.ts.map +1 -1
- package/dest/slashing/index.js +1 -2
- package/dest/slashing/serialization.d.ts +2 -6
- package/dest/slashing/serialization.d.ts.map +1 -1
- package/dest/slashing/serialization.js +0 -60
- package/dest/slashing/types.d.ts +18 -112
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +16 -24
- package/dest/slashing/{tally.d.ts → votes.d.ts} +1 -1
- package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
- package/dest/slashing/{tally.js → votes.js} +1 -1
- package/dest/snapshots/types.d.ts +15 -78
- package/dest/snapshots/types.d.ts.map +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 +25 -32
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +85 -82
- package/dest/tests/mocks.d.ts +8 -5
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +45 -56
- 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 -37
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +4 -39
- 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/append_only_tree_snapshot.d.ts +9 -14
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +6 -3
- package/dest/trees/nullifier_leaf.d.ts +19 -42
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +3 -0
- package/dest/trees/nullifier_membership_witness.d.ts +16 -59
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +2 -14
- package/dest/trees/public_data_leaf.d.ts +21 -53
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_witness.d.ts +16 -58
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/tx/block_header.d.ts +5 -4
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +7 -4
- package/dest/tx/call_context.d.ts +4 -14
- package/dest/tx/call_context.d.ts.map +1 -1
- package/dest/tx/capsule.d.ts +7 -3
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +9 -3
- package/dest/tx/fee_provider.d.ts +10 -0
- package/dest/tx/fee_provider.d.ts.map +1 -0
- package/dest/tx/fee_provider.js +1 -0
- package/dest/tx/function_data.d.ts +4 -10
- package/dest/tx/function_data.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +3 -4
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +16 -49
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +8 -12
- package/dest/tx/hashed_values.d.ts +4 -3
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/hashed_values.js +6 -3
- package/dest/tx/in_tx.d.ts +5 -17
- package/dest/tx/in_tx.d.ts.map +1 -1
- package/dest/tx/index.d.ts +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/indexed_tx_effect.d.ts +8 -19
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +9 -6
- package/dest/tx/partial_state_reference.d.ts +22 -65
- package/dest/tx/partial_state_reference.d.ts.map +1 -1
- package/dest/tx/partial_state_reference.js +6 -3
- package/dest/tx/private_execution_result.d.ts +6 -16
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +54 -352
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +4 -4
- package/dest/tx/protocol_contracts.d.ts +5 -9
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/proven_tx.d.ts +30 -74
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +6 -0
- package/dest/tx/public_call_request_with_calldata.d.ts +4 -3
- package/dest/tx/public_call_request_with_calldata.d.ts.map +1 -1
- package/dest/tx/public_call_request_with_calldata.js +6 -3
- package/dest/tx/simulated_tx.d.ts +64 -1143
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +13 -11
- package/dest/tx/state_reference.d.ts +30 -117
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +6 -4
- package/dest/tx/tree_snapshots.d.ts +27 -84
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/tx/tree_snapshots.js +6 -4
- package/dest/tx/tx.d.ts +22 -13
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +44 -22
- package/dest/tx/tx_constant_data.d.ts +4 -3
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +6 -3
- package/dest/tx/tx_context.d.ts +32 -131
- package/dest/tx/tx_context.d.ts.map +1 -1
- package/dest/tx/tx_context.js +6 -6
- package/dest/tx/tx_hash.d.ts +6 -4
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_hash.js +13 -5
- package/dest/tx/tx_receipt.d.ts +144 -63
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +143 -60
- package/dest/tx/validator/error_texts.d.ts +6 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +7 -1
- package/dest/tx/validator/tx_validator.d.ts +5 -27
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +0 -4
- package/dest/types/shared.d.ts +4 -12
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +6 -12
- package/dest/update-checker/dev_version.d.ts +3 -0
- package/dest/update-checker/dev_version.d.ts.map +1 -0
- package/dest/update-checker/dev_version.js +1 -0
- package/dest/update-checker/index.d.ts +2 -1
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +1 -0
- package/dest/update-checker/package_version.d.ts +6 -3
- package/dest/update-checker/package_version.d.ts.map +1 -1
- package/dest/update-checker/package_version.js +8 -19
- package/dest/validators/schemas.d.ts +147 -614
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +6 -4
- package/dest/validators/types.d.ts +20 -3
- package/dest/validators/types.d.ts.map +1 -1
- package/dest/versioning/versioning.js +1 -1
- package/dest/vks/verification_key.d.ts +4 -139
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +5 -126
- package/dest/world-state/genesis_data.d.ts +13 -0
- package/dest/world-state/genesis_data.d.ts.map +1 -0
- package/dest/world-state/genesis_data.js +7 -0
- package/dest/world-state/index.d.ts +2 -1
- package/dest/world-state/index.d.ts.map +1 -1
- package/dest/world-state/index.js +1 -0
- package/dest/world-state/world_state_revision.d.ts +15 -26
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +7 -1
- package/package.json +12 -11
- package/src/abi/abi.ts +78 -21
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/buffer.ts +25 -4
- package/src/abi/contract_artifact.ts +30 -6
- package/src/abi/decoder.ts +23 -78
- package/src/abi/encoder.ts +42 -6
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_selector.ts +4 -13
- package/src/abi/function_signature_decoder.ts +77 -0
- package/src/abi/index.ts +1 -0
- package/src/abi/note_selector.ts +3 -12
- package/src/abi/selector.ts +1 -1
- package/src/abi/utils.ts +6 -4
- package/src/avm/avm.ts +5 -0
- package/src/avm/message_pack.ts +12 -3
- package/src/avm/revert_code.ts +19 -39
- package/src/aztec-address/index.ts +15 -12
- package/src/block/attestation_info.ts +11 -11
- package/src/block/block_data.ts +3 -4
- package/src/block/block_hash.ts +21 -14
- package/src/block/block_parameter.ts +72 -4
- package/src/block/index.ts +0 -1
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +216 -147
- package/src/block/l2_block_stream/interfaces.ts +42 -6
- package/src/block/l2_block_stream/l2_block_stream.ts +60 -31
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +17 -41
- package/src/block/l2_block_stream/l2_tips_store_base.ts +64 -60
- package/src/block/proposal/attestations_and_signers.ts +32 -17
- package/src/block/test/l2_tips_store_test_suite.ts +198 -18
- package/src/checkpoint/checkpoint.ts +13 -3
- package/src/checkpoint/checkpoint_data.ts +44 -4
- package/src/checkpoint/checkpoint_reexecution_tracker.ts +167 -0
- package/src/checkpoint/digest.ts +28 -0
- package/src/checkpoint/index.ts +3 -0
- package/src/checkpoint/previous_checkpoint_out_hashes.ts +61 -0
- package/src/checkpoint/validate.ts +16 -6
- package/src/config/chain-config.ts +13 -16
- package/src/config/index.ts +1 -1
- package/src/config/network-consensus-config.ts +302 -0
- package/src/config/sequencer-config.ts +68 -9
- package/src/contract/complete_address.ts +7 -3
- package/src/contract/contract_address.ts +6 -6
- package/src/contract/contract_instance.ts +11 -2
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/contract/interfaces/contract_instance.ts +6 -2
- package/src/contract/interfaces/node-info.ts +11 -0
- package/src/contract/private_function.ts +3 -1
- package/src/database-version/version_manager.ts +17 -0
- package/src/deserialization/index.ts +35 -2
- package/src/epoch-helpers/index.ts +24 -0
- package/src/file-store/factory.ts +13 -4
- package/src/file-store/http.ts +29 -10
- package/src/file-store/index.ts +1 -0
- package/src/gas/README.md +123 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas.ts +8 -3
- package/src/gas/gas_fees.ts +26 -13
- package/src/gas/gas_settings.ts +63 -15
- package/src/gas/index.ts +2 -0
- package/src/gas/tx_gas_limits.ts +123 -0
- package/src/ha-signing/config.ts +14 -18
- package/src/ha-signing/index.ts +3 -1
- package/src/ha-signing/local_config.ts +2 -2
- package/src/ha-signing/types.ts +48 -34
- package/src/hash/hash.ts +34 -2
- package/src/interfaces/api_limit.ts +1 -1
- package/src/interfaces/archiver.ts +88 -93
- package/src/interfaces/aztec-node-admin.ts +36 -21
- package/src/interfaces/aztec-node-debug.ts +55 -0
- package/src/interfaces/aztec-node.ts +389 -259
- package/src/interfaces/block-builder.ts +4 -0
- package/src/interfaces/block_response.ts +92 -0
- package/src/interfaces/chain_tips.ts +24 -0
- package/src/interfaces/checkpoint_parameter.ts +20 -0
- package/src/interfaces/checkpoint_response.ts +84 -0
- package/src/interfaces/client.ts +8 -1
- package/src/interfaces/configs.ts +64 -7
- package/src/interfaces/get_tx_by_hash_options.ts +14 -0
- package/src/interfaces/l1_publish_info.ts +40 -0
- package/src/interfaces/l2_logs_source.ts +13 -42
- package/src/interfaces/merkle_tree_operations.ts +3 -2
- package/src/interfaces/p2p-bootstrap.ts +2 -2
- package/src/interfaces/p2p.ts +59 -19
- package/src/interfaces/private_kernel_prover.ts +88 -0
- package/src/interfaces/prover-agent.ts +1 -1
- package/src/interfaces/prover-client.ts +3 -8
- package/src/interfaces/prover-node.ts +19 -12
- package/src/interfaces/proving-job-source.ts +4 -4
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/public_storage_override.ts +26 -0
- package/src/interfaces/server.ts +5 -1
- package/src/interfaces/slasher.ts +17 -10
- package/src/interfaces/tx_provider.ts +6 -0
- package/src/interfaces/validator.ts +45 -15
- package/src/interfaces/world_state.ts +1 -1
- package/src/kernel/hints/key_validation_request.ts +18 -16
- package/src/kernel/index.ts +4 -0
- package/src/kernel/log_hash.ts +29 -9
- package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +49 -0
- package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +52 -0
- package/src/kernel/private_kernel_inner_2_circuit_private_inputs.ts +29 -0
- package/src/kernel/private_kernel_inner_3_circuit_private_inputs.ts +31 -0
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +29 -14
- package/src/kernel/private_to_avm_accumulated_data.ts +16 -5
- package/src/kernel/private_to_public_accumulated_data.ts +9 -3
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +10 -4
- package/src/kernel/private_to_rollup_accumulated_data.ts +8 -3
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +9 -9
- package/src/kernel/public_call_request.ts +22 -7
- package/src/keys/derivation.ts +21 -9
- package/src/keys/public_key.ts +26 -2
- package/src/keys/public_keys.ts +124 -110
- package/src/kv-store/config.ts +3 -10
- package/src/l1-contracts/index.ts +1 -1
- package/src/logs/app_tagging_secret.ts +137 -0
- package/src/logs/app_tagging_secret_kind.ts +21 -0
- package/src/logs/contract_class_log.ts +15 -5
- package/src/logs/index.ts +6 -6
- package/src/logs/log_cursor.ts +110 -0
- package/src/logs/log_result.ts +104 -0
- package/src/logs/logs_query.ts +138 -0
- package/src/logs/message_context.ts +22 -8
- package/src/logs/pending_tagged_log.ts +1 -3
- package/src/logs/pre_tag.ts +3 -6
- package/src/logs/private_log.ts +9 -3
- package/src/logs/query_all_logs_by_tags.ts +98 -0
- package/src/logs/shared_secret_derivation.ts +21 -10
- package/src/logs/siloed_tag.ts +20 -11
- package/src/logs/tag.ts +8 -8
- package/src/logs/tagging_index_range.ts +4 -10
- package/src/messaging/append_l1_to_l2_messages.ts +21 -0
- package/src/messaging/index.ts +1 -0
- package/src/messaging/l1_to_l2_message.ts +12 -9
- package/src/messaging/l2_to_l1_membership.ts +108 -19
- package/src/messaging/l2_to_l1_message.ts +29 -9
- package/src/noir/index.ts +2 -0
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/block_proposal.ts +111 -36
- package/src/p2p/checkpoint_attestation.ts +27 -31
- package/src/p2p/checkpoint_proposal.ts +128 -73
- package/src/p2p/consensus_payload.ts +59 -28
- package/src/p2p/gossipable.ts +4 -4
- package/src/p2p/signature_utils.ts +110 -25
- package/src/p2p/signed_txs.ts +46 -28
- package/src/parity/parity_base_private_inputs.ts +10 -4
- package/src/parity/parity_public_inputs.ts +9 -2
- package/src/proofs/chonk_proof.ts +132 -12
- package/src/rollup/block_headers_hash.ts +11 -2
- package/src/rollup/block_rollup_public_inputs.ts +13 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +10 -0
- package/src/schemas/schemas.ts +6 -1
- package/src/slashing/helpers.ts +13 -9
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +24 -49
- package/src/slashing/{tally.ts → votes.ts} +1 -1
- package/src/stats/stats.ts +4 -0
- package/src/tests/factories.ts +109 -111
- package/src/tests/mocks.ts +72 -71
- 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 -66
- package/src/timetable/proposer_timetable.ts +190 -0
- package/src/timetable/timetable-example.svg +108 -0
- package/src/trees/append_only_tree_snapshot.ts +8 -3
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/trees/nullifier_membership_witness.ts +2 -12
- package/src/tx/block_header.ts +10 -5
- package/src/tx/capsule.ts +10 -2
- package/src/tx/fee_provider.ts +10 -0
- package/src/tx/global_variable_builder.ts +2 -3
- package/src/tx/global_variables.ts +10 -18
- package/src/tx/hashed_values.ts +8 -3
- package/src/tx/index.ts +1 -0
- package/src/tx/indexed_tx_effect.ts +18 -6
- package/src/tx/partial_state_reference.ts +8 -3
- package/src/tx/profiling.ts +4 -4
- package/src/tx/proven_tx.ts +6 -0
- package/src/tx/public_call_request_with_calldata.ts +8 -3
- package/src/tx/simulated_tx.ts +22 -21
- package/src/tx/state_reference.ts +9 -4
- package/src/tx/tree_snapshots.ts +9 -4
- package/src/tx/tx.ts +60 -24
- package/src/tx/tx_constant_data.ts +8 -3
- package/src/tx/tx_context.ts +8 -3
- package/src/tx/tx_hash.ts +20 -5
- package/src/tx/tx_receipt.ts +265 -85
- package/src/tx/validator/error_texts.ts +10 -1
- package/src/tx/validator/tx_validator.ts +1 -5
- package/src/types/shared.ts +8 -13
- package/src/update-checker/dev_version.ts +2 -0
- package/src/update-checker/index.ts +1 -0
- package/src/update-checker/package_version.ts +10 -23
- package/src/validators/schemas.ts +6 -4
- package/src/validators/types.ts +21 -2
- package/src/versioning/versioning.ts +1 -1
- package/src/vks/verification_key.ts +5 -184
- package/src/world-state/genesis_data.ts +27 -0
- package/src/world-state/index.ts +1 -0
- package/src/world-state/world_state_revision.ts +9 -1
- package/dest/abi/mocked_keys.d.ts +0 -2
- package/dest/abi/mocked_keys.d.ts.map +0 -1
- package/dest/abi/mocked_keys.js +0 -1
- package/dest/block/checkpointed_l2_block.d.ts +0 -150
- package/dest/block/checkpointed_l2_block.d.ts.map +0 -1
- package/dest/block/checkpointed_l2_block.js +0 -46
- package/dest/config/pipelining-config.d.ts +0 -19
- package/dest/config/pipelining-config.d.ts.map +0 -1
- package/dest/config/pipelining-config.js +0 -18
- package/dest/contract/private_function_membership_proof.d.ts +0 -32
- package/dest/contract/private_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/private_function_membership_proof.js +0 -124
- package/dest/contract/utility_function_membership_proof.d.ts +0 -27
- package/dest/contract/utility_function_membership_proof.d.ts.map +0 -1
- package/dest/contract/utility_function_membership_proof.js +0 -87
- package/dest/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/get_logs_response.d.ts +0 -97
- package/dest/interfaces/get_logs_response.d.ts.map +0 -1
- package/dest/interfaces/get_logs_response.js +0 -12
- package/dest/l1-contracts/slash_factory.d.ts +0 -45
- package/dest/l1-contracts/slash_factory.d.ts.map +0 -1
- package/dest/l1-contracts/slash_factory.js +0 -158
- package/dest/logs/extended_contract_class_log.d.ts +0 -51
- package/dest/logs/extended_contract_class_log.d.ts.map +0 -1
- package/dest/logs/extended_contract_class_log.js +0 -67
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +0 -47
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +0 -1
- package/dest/logs/extended_directional_app_tagging_secret.js +0 -72
- package/dest/logs/extended_public_log.d.ts +0 -106
- package/dest/logs/extended_public_log.d.ts.map +0 -1
- package/dest/logs/extended_public_log.js +0 -73
- package/dest/logs/log_filter.d.ts +0 -25
- package/dest/logs/log_filter.d.ts.map +0 -1
- package/dest/logs/log_filter.js +0 -12
- package/dest/logs/log_id.d.ts +0 -85
- package/dest/logs/log_id.d.ts.map +0 -1
- package/dest/logs/log_id.js +0 -94
- package/dest/logs/tx_scoped_l2_log.d.ts +0 -51
- package/dest/logs/tx_scoped_l2_log.d.ts.map +0 -1
- package/dest/logs/tx_scoped_l2_log.js +0 -77
- package/dest/slashing/empire.d.ts +0 -31
- package/dest/slashing/empire.d.ts.map +0 -1
- package/dest/slashing/empire.js +0 -87
- package/src/abi/mocked_keys.ts +0 -2
- package/src/block/checkpointed_l2_block.ts +0 -70
- package/src/config/pipelining-config.ts +0 -31
- package/src/contract/private_function_membership_proof.ts +0 -167
- package/src/contract/utility_function_membership_proof.ts +0 -118
- package/src/interfaces/epoch-prover.ts +0 -72
- package/src/interfaces/get_logs_response.ts +0 -35
- package/src/l1-contracts/slash_factory.ts +0 -180
- package/src/logs/extended_contract_class_log.ts +0 -87
- package/src/logs/extended_directional_app_tagging_secret.ts +0 -87
- package/src/logs/extended_public_log.ts +0 -94
- package/src/logs/log_filter.ts +0 -36
- package/src/logs/log_id.ts +0 -125
- package/src/logs/tx_scoped_l2_log.ts +0 -114
- package/src/slashing/empire.ts +0 -104
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Default block sub-slot duration (`D`) in seconds, used to derive how many blocks fit in a slot. */
|
|
2
|
+
export const DEFAULT_BLOCK_DURATION = 3;
|
|
3
|
+
|
|
4
|
+
/** Default minimum block-building duration (`min_block_duration`) in seconds. */
|
|
5
|
+
export const DEFAULT_MIN_BLOCK_DURATION = 2;
|
|
6
|
+
|
|
7
|
+
/** Default one-way P2P propagation time (`p2p_propagation_time`) for proposals and attestations in seconds. */
|
|
8
|
+
export const DEFAULT_P2P_PROPAGATION_TIME = 2;
|
|
9
|
+
|
|
10
|
+
/** Default local checkpoint proposal preparation time (`checkpoint_proposal_prepare_time`) in seconds. */
|
|
11
|
+
export const DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME = 1;
|
|
12
|
+
|
|
13
|
+
/** Default local tolerance for archiver orphan-prune checks when no checkpoint proposal was received. */
|
|
14
|
+
export const DEFAULT_ORPHAN_PRUNE_NO_PROPOSAL_TOLERANCE = 1;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Default proposer initialization time (`checkpoint_proposal_init_time`) in seconds: the budget reserved at
|
|
18
|
+
* the start of the build frame for sync, the proposer check, and checkpoint initialization before the first
|
|
19
|
+
* block sub-slot opens. The proposer rarely starts building exactly at `build_frame_start`; this offset
|
|
20
|
+
* shifts the sub-slot grid so the first sub-slot still has its full duration once the prologue completes.
|
|
21
|
+
*/
|
|
22
|
+
export const DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME = 1;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Ethereum slot duration (seconds) below which a network is treated as a fast local/e2e profile with mocked
|
|
26
|
+
* p2p. Profiles at or above this keep the production operational budgets. Mainnet is 12s; fast anvil-style
|
|
27
|
+
* local profiles run at 4s.
|
|
28
|
+
*/
|
|
29
|
+
export const FAST_PROFILE_ETHEREUM_SLOT_DURATION = 8;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Operational timing budgets for the fast local/e2e profile (mocked p2p), per the README's "Local e2e with
|
|
33
|
+
* mocked p2p" section. When `ethereum_slot_duration < FAST_PROFILE_ETHEREUM_SLOT_DURATION`, these cap the
|
|
34
|
+
* proposer's operational budgets so a fast network does not inherit the conservative production budgets,
|
|
35
|
+
* which would shrink the per-checkpoint build window and under-pack checkpoints. Explicitly configured
|
|
36
|
+
* budgets below these caps are kept as-is (the budgets are clamped down, never raised).
|
|
37
|
+
*/
|
|
38
|
+
export const FAST_PROFILE_P2P_PROPAGATION_TIME = 0.5;
|
|
39
|
+
|
|
40
|
+
/** Fast-profile checkpoint proposal preparation budget (seconds). See {@link FAST_PROFILE_P2P_PROPAGATION_TIME}. */
|
|
41
|
+
export const FAST_PROFILE_CHECKPOINT_PROPOSAL_PREPARE_TIME = 0.5;
|
|
42
|
+
|
|
43
|
+
/** Fast-profile minimum block-building budget (seconds). See {@link FAST_PROFILE_P2P_PROPAGATION_TIME}. */
|
|
44
|
+
export const FAST_PROFILE_MIN_BLOCK_DURATION = 1;
|
|
45
|
+
|
|
46
|
+
/** Resolved operational timing budgets used to size the proposer build window. */
|
|
47
|
+
export type ResolvedTimingBudgets = {
|
|
48
|
+
minBlockDuration: number;
|
|
49
|
+
p2pPropagationTime: number;
|
|
50
|
+
checkpointProposalPrepareTime: number;
|
|
51
|
+
checkpointProposalInitTime: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Default consensus grace for received checkpoint proposals to materialize locally. */
|
|
55
|
+
export function getDefaultCheckpointProposalSyncGrace(blockDuration: number): number {
|
|
56
|
+
return 2 * blockDuration;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the operational timing budgets, applying the fast local/e2e profile when
|
|
61
|
+
* `ethereumSlotDuration < FAST_PROFILE_ETHEREUM_SLOT_DURATION`.
|
|
62
|
+
*
|
|
63
|
+
* Production profiles (`ethereumSlotDuration >= FAST_PROFILE_ETHEREUM_SLOT_DURATION`) use the configured
|
|
64
|
+
* budgets verbatim. Fast profiles clamp `p2pPropagationTime`, `checkpointProposalPrepareTime`, and
|
|
65
|
+
* `minBlockDuration` down to the fast-profile caps so a fast network (mocked p2p) gets a build window sized
|
|
66
|
+
* for local timing rather than the conservative production budgets. The clamp only lowers budgets, so an
|
|
67
|
+
* operator that explicitly configured a smaller value keeps it. `checkpointProposalInitTime` is unchanged by
|
|
68
|
+
* the profile: it is a proposer prologue budget, not a propagation/preparation budget.
|
|
69
|
+
*/
|
|
70
|
+
export function resolveTimingBudgets(ethereumSlotDuration: number, opts: ResolvedTimingBudgets): ResolvedTimingBudgets {
|
|
71
|
+
const { minBlockDuration, p2pPropagationTime, checkpointProposalPrepareTime, checkpointProposalInitTime } = opts;
|
|
72
|
+
|
|
73
|
+
const isFastProfile = ethereumSlotDuration < FAST_PROFILE_ETHEREUM_SLOT_DURATION;
|
|
74
|
+
if (!isFastProfile) {
|
|
75
|
+
return { minBlockDuration, p2pPropagationTime, checkpointProposalPrepareTime, checkpointProposalInitTime };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
minBlockDuration: Math.min(minBlockDuration, FAST_PROFILE_MIN_BLOCK_DURATION),
|
|
80
|
+
p2pPropagationTime: Math.min(p2pPropagationTime, FAST_PROFILE_P2P_PROPAGATION_TIME),
|
|
81
|
+
checkpointProposalPrepareTime: Math.min(
|
|
82
|
+
checkpointProposalPrepareTime,
|
|
83
|
+
FAST_PROFILE_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
84
|
+
),
|
|
85
|
+
checkpointProposalInitTime,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_BLOCK_DURATION,
|
|
3
|
+
DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
4
|
+
DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
5
|
+
DEFAULT_MIN_BLOCK_DURATION,
|
|
6
|
+
DEFAULT_P2P_PROPAGATION_TIME,
|
|
7
|
+
} from './budgets.js';
|
|
8
|
+
import type { SlotTimingConstants } from './consensus_timetable.js';
|
|
9
|
+
import { ProposerTimetable } from './proposer_timetable.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Subset of the sequencer/p2p config the proposer timetable derives its operational budgets from. Both
|
|
13
|
+
* {@link SequencerConfig} and {@link P2PConfig} structurally satisfy this, so the same builder is used by
|
|
14
|
+
* the sequencer, the p2p layer, and the node's `getNodeInfo`.
|
|
15
|
+
*/
|
|
16
|
+
export type ProposerTimetableConfig = {
|
|
17
|
+
blockDurationMs?: number;
|
|
18
|
+
minBlockDuration?: number;
|
|
19
|
+
attestationPropagationTime?: number;
|
|
20
|
+
checkpointProposalPrepareTime?: number;
|
|
21
|
+
checkpointProposalSyncGraceSeconds?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Builds the proposer timetable from a sequencer/p2p config and the slot-timing protocol constants,
|
|
26
|
+
* applying the shared stdlib budget defaults. Single source of truth shared by the sequencer, the p2p
|
|
27
|
+
* layer, and the node's `getNodeInfo` so they all derive the same `maxBlocksPerCheckpoint`.
|
|
28
|
+
*/
|
|
29
|
+
export function buildProposerTimetable(
|
|
30
|
+
config: ProposerTimetableConfig,
|
|
31
|
+
l1Constants: SlotTimingConstants,
|
|
32
|
+
): ProposerTimetable {
|
|
33
|
+
return new ProposerTimetable({
|
|
34
|
+
l1Constants,
|
|
35
|
+
blockDuration: config.blockDurationMs !== undefined ? config.blockDurationMs / 1000 : DEFAULT_BLOCK_DURATION,
|
|
36
|
+
minBlockDuration: config.minBlockDuration ?? DEFAULT_MIN_BLOCK_DURATION,
|
|
37
|
+
p2pPropagationTime: config.attestationPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME,
|
|
38
|
+
checkpointProposalPrepareTime: config.checkpointProposalPrepareTime ?? DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
39
|
+
checkpointProposalInitTime: DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
40
|
+
checkpointProposalSyncGrace: config.checkpointProposalSyncGraceSeconds,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
|
|
3
|
+
import { type L1RollupConstants, getTimestampForSlot } from '../epoch-helpers/index.js';
|
|
4
|
+
import { getDefaultCheckpointProposalSyncGrace } from './budgets.js';
|
|
5
|
+
|
|
6
|
+
/** Slot-timing protocol constants the timetables derive wall-clock times from. */
|
|
7
|
+
export type SlotTimingConstants = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'ethereumSlotDuration'>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Consensus acceptance bounds for the pipelined timetable.
|
|
11
|
+
*
|
|
12
|
+
* Returns the deadlines and matching receive-window lower bounds that validators and p2p use to decide
|
|
13
|
+
* whether a proposal or attestation is acceptable for a given target slot. All getters take a target slot
|
|
14
|
+
* and return an absolute wall-clock timestamp in seconds.
|
|
15
|
+
*
|
|
16
|
+
* Inputs are protocol slot-timing constants only (`genesis`, `aztec_slot_duration`,
|
|
17
|
+
* `ethereum_slot_duration`, `block_duration`, `checkpoint_proposal_sync_grace`); no operational budgets, so every
|
|
18
|
+
* node agrees on these bounds. See `stdlib/src/timetable/README.md` for the timing model.
|
|
19
|
+
*/
|
|
20
|
+
export class ConsensusTimetable {
|
|
21
|
+
/** Aztec slot duration (`S`) in seconds. */
|
|
22
|
+
public readonly aztecSlotDuration: number;
|
|
23
|
+
|
|
24
|
+
/** Ethereum slot duration (`E`) in seconds. */
|
|
25
|
+
public readonly ethereumSlotDuration: number;
|
|
26
|
+
|
|
27
|
+
/** Block sub-slot duration (`D`) in seconds. */
|
|
28
|
+
public readonly blockDuration: number;
|
|
29
|
+
|
|
30
|
+
/** L1 genesis timestamp in seconds (`genesis`), the anchor all slot timings derive from. */
|
|
31
|
+
public readonly genesisTime: bigint;
|
|
32
|
+
|
|
33
|
+
/** Consensus grace for received checkpoint proposals to materialize into local proposed state. */
|
|
34
|
+
public readonly checkpointProposalSyncGrace: number;
|
|
35
|
+
|
|
36
|
+
constructor(opts: { l1Constants: SlotTimingConstants; blockDuration: number; checkpointProposalSyncGrace?: number }) {
|
|
37
|
+
const { l1Constants, blockDuration } = opts;
|
|
38
|
+
const checkpointProposalSyncGrace =
|
|
39
|
+
opts.checkpointProposalSyncGrace ?? getDefaultCheckpointProposalSyncGrace(blockDuration);
|
|
40
|
+
if (l1Constants.slotDuration <= 0) {
|
|
41
|
+
throw new Error(`aztecSlotDuration must be positive (got ${l1Constants.slotDuration})`);
|
|
42
|
+
}
|
|
43
|
+
if (l1Constants.ethereumSlotDuration <= 0) {
|
|
44
|
+
throw new Error(`ethereumSlotDuration must be positive (got ${l1Constants.ethereumSlotDuration})`);
|
|
45
|
+
}
|
|
46
|
+
if (blockDuration <= 0) {
|
|
47
|
+
throw new Error(`blockDuration must be positive (got ${blockDuration})`);
|
|
48
|
+
}
|
|
49
|
+
if (checkpointProposalSyncGrace < 0) {
|
|
50
|
+
throw new Error(`checkpointProposalSyncGrace must be non-negative (got ${checkpointProposalSyncGrace})`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
this.aztecSlotDuration = l1Constants.slotDuration;
|
|
54
|
+
this.ethereumSlotDuration = l1Constants.ethereumSlotDuration;
|
|
55
|
+
this.blockDuration = blockDuration;
|
|
56
|
+
this.genesisTime = l1Constants.l1GenesisTime;
|
|
57
|
+
this.checkpointProposalSyncGrace = checkpointProposalSyncGrace;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Build-frame start for the target slot: `target_slot_start - S - E`. Anchors all sub-slot timings.
|
|
62
|
+
* Computed directly (not via a `slot - 1` hop) so it is well-defined for slot 0, whose build frame
|
|
63
|
+
* predates genesis; p2p validators evaluate acceptance windows for arbitrary peer-supplied slots.
|
|
64
|
+
*/
|
|
65
|
+
public getBuildFrameStart(slot: SlotNumber): number {
|
|
66
|
+
return this.getTargetSlotStart(slot) - this.aztecSlotDuration - this.ethereumSlotDuration;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Start of the target slot: `genesis + slot * S`. */
|
|
70
|
+
public getTargetSlotStart(slot: SlotNumber): number {
|
|
71
|
+
return Number(getTimestampForSlot(slot, this.getL1Constants()));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Earliest acceptable arrival for a checkpoint proposal: `target_slot_start - S - E` (the build frame
|
|
76
|
+
* opening). Nothing legitimate for this slot exists before its build frame opens.
|
|
77
|
+
*/
|
|
78
|
+
public getCheckpointProposalReceiveStart(slot: SlotNumber): number {
|
|
79
|
+
return this.getBuildFrameStart(slot);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Hard consensus receive deadline for a checkpoint proposal: `target_slot_start - E - D`. Validators
|
|
84
|
+
* reject proposals arriving after this, and the next proposer does not build on them.
|
|
85
|
+
*/
|
|
86
|
+
public getCheckpointProposalReceiveDeadline(slot: SlotNumber): number {
|
|
87
|
+
return this.getTargetSlotStart(slot) - this.ethereumSlotDuration - this.blockDuration;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Wall-clock deadline by which a received checkpoint proposal should have materialized into local proposed
|
|
92
|
+
* state. This is `next_proposer_build_frame_start + checkpointProposalSyncGrace`, rounded up to the next
|
|
93
|
+
* integer second because L1 timestamps and archiver comparisons are second-granularity.
|
|
94
|
+
*/
|
|
95
|
+
public getCheckpointProposalSyncedDeadline(slot: SlotNumber): number {
|
|
96
|
+
return Math.ceil(
|
|
97
|
+
this.getCheckpointProposalReceiveDeadline(slot) + this.blockDuration + this.checkpointProposalSyncGrace,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Earliest acceptable arrival for an attestation: `target_slot_start - S - E` (the build frame
|
|
103
|
+
* opening). Deliberately liberal; attestations are attributed by content, not timing.
|
|
104
|
+
*/
|
|
105
|
+
public getAttestationReceiveStart(slot: SlotNumber): number {
|
|
106
|
+
return this.getBuildFrameStart(slot);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Single hard consensus deadline: `target_slot_start + S - 2E`. The latest the checkpoint can still
|
|
111
|
+
* land on L1 in the target slot, and the cutoff by which every block and the checkpoint must be
|
|
112
|
+
* re-executed, validated, and signed. Consensus-driven (used for inactivity/slashing decisions).
|
|
113
|
+
*/
|
|
114
|
+
public getAttestationDeadline(slot: SlotNumber): number {
|
|
115
|
+
return this.getTargetSlotStart(slot) + this.aztecSlotDuration - 2 * this.ethereumSlotDuration;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Slot-timing protocol constants this timetable derives wall-clock times from. */
|
|
119
|
+
public getL1Constants(): SlotTimingConstants {
|
|
120
|
+
return {
|
|
121
|
+
l1GenesisTime: this.genesisTime,
|
|
122
|
+
slotDuration: this.aztecSlotDuration,
|
|
123
|
+
ethereumSlotDuration: this.ethereumSlotDuration,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
package/src/timetable/index.ts
CHANGED
|
@@ -1,66 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* The sequencer slot is divided into phases:
|
|
6
|
-
* 1. Checkpoint initialization (sync + proposer check)
|
|
7
|
-
* 2. Block building (execution)
|
|
8
|
-
* 3. Checkpoint assembly
|
|
9
|
-
* 4. P2P propagation for proposal and attestations (round-trip)
|
|
10
|
-
* 5. L1 publishing
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/** Time budget for checkpoint initialization (sync + proposer check) in seconds */
|
|
14
|
-
export const CHECKPOINT_INITIALIZATION_TIME = 1;
|
|
15
|
-
|
|
16
|
-
/** Time budget for assembling a checkpoint after building the last block in seconds */
|
|
17
|
-
export const CHECKPOINT_ASSEMBLE_TIME = 1;
|
|
18
|
-
|
|
19
|
-
/** Default one-way P2P propagation time for proposals and attestations in seconds */
|
|
20
|
-
export const DEFAULT_P2P_PROPAGATION_TIME = 2;
|
|
21
|
-
|
|
22
|
-
/** Default L1 publishing time (matches Ethereum slot duration on mainnet) in seconds */
|
|
23
|
-
export const DEFAULT_L1_PUBLISHING_TIME = 12;
|
|
24
|
-
|
|
25
|
-
/** Minimum execution time for building a block in seconds */
|
|
26
|
-
export const MIN_EXECUTION_TIME = 2;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Calculates the maximum number of blocks that can be built in a slot.
|
|
30
|
-
* Used by both the sequencer timetable and p2p gossipsub scoring.
|
|
31
|
-
*
|
|
32
|
-
* @param aztecSlotDurationSec - Aztec slot duration in seconds
|
|
33
|
-
* @param blockDurationSec - Duration per block in seconds (undefined = single block mode)
|
|
34
|
-
* @param opts - Optional overrides for timing constants
|
|
35
|
-
* @returns Maximum number of blocks per slot
|
|
36
|
-
*/
|
|
37
|
-
export function calculateMaxBlocksPerSlot(
|
|
38
|
-
aztecSlotDurationSec: number,
|
|
39
|
-
blockDurationSec: number | undefined,
|
|
40
|
-
opts: {
|
|
41
|
-
checkpointInitializationTime?: number;
|
|
42
|
-
checkpointAssembleTime?: number;
|
|
43
|
-
p2pPropagationTime?: number;
|
|
44
|
-
l1PublishingTime?: number;
|
|
45
|
-
} = {},
|
|
46
|
-
): number {
|
|
47
|
-
if (!blockDurationSec) {
|
|
48
|
-
return 1; // Single block per slot
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const initOffset = opts.checkpointInitializationTime ?? CHECKPOINT_INITIALIZATION_TIME;
|
|
52
|
-
const assembleTime = opts.checkpointAssembleTime ?? CHECKPOINT_ASSEMBLE_TIME;
|
|
53
|
-
const p2pTime = opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME;
|
|
54
|
-
const l1Time = opts.l1PublishingTime ?? DEFAULT_L1_PUBLISHING_TIME;
|
|
55
|
-
|
|
56
|
-
// Calculate checkpoint finalization time (assembly + round-trip propagation + L1 publishing)
|
|
57
|
-
const checkpointFinalizationTime = assembleTime + p2pTime * 2 + l1Time;
|
|
58
|
-
|
|
59
|
-
// Time reserved at end for last sub-slot (validator re-execution) + finalization
|
|
60
|
-
const timeReservedAtEnd = blockDurationSec + checkpointFinalizationTime;
|
|
61
|
-
|
|
62
|
-
// Time available for building blocks
|
|
63
|
-
const timeAvailableForBlocks = aztecSlotDurationSec - initOffset - timeReservedAtEnd;
|
|
64
|
-
|
|
65
|
-
return Math.max(1, Math.floor(timeAvailableForBlocks / blockDurationSec));
|
|
66
|
-
}
|
|
1
|
+
export * from './budgets.js';
|
|
2
|
+
export * from './build_proposer_timetable.js';
|
|
3
|
+
export * from './consensus_timetable.js';
|
|
4
|
+
export * from './proposer_timetable.js';
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
3
|
+
|
|
4
|
+
import { type ResolvedTimingBudgets, getDefaultCheckpointProposalSyncGrace, resolveTimingBudgets } from './budgets.js';
|
|
5
|
+
import { ConsensusTimetable, type SlotTimingConstants } from './consensus_timetable.js';
|
|
6
|
+
|
|
7
|
+
/** Result of selecting the next block sub-slot to build. */
|
|
8
|
+
export type SubslotSelection =
|
|
9
|
+
| { canStart: false; index: undefined; deadline: undefined; isLastBlock: false }
|
|
10
|
+
| { canStart: true; index: number; deadline: number; isLastBlock: boolean };
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Proposer ideal/happy-path schedule and block sub-slot timetable.
|
|
14
|
+
*
|
|
15
|
+
* Composes a {@link ConsensusTimetable} and adds the operational budgets that only the proposer needs
|
|
16
|
+
* (`min_block_duration`, `p2p_propagation_time`, `checkpoint_proposal_prepare_time`). Used by the
|
|
17
|
+
* sequencer and checkpoint-proposal job. All getters take a target slot and return an absolute
|
|
18
|
+
* wall-clock timestamp in seconds (or sub-slot deadlines in seconds for {@link selectNextSubslot}).
|
|
19
|
+
*
|
|
20
|
+
* The single hard deadline {@link getAttestationDeadline} is inherited from the composed
|
|
21
|
+
* {@link ConsensusTimetable}, so the proposer uses one object.
|
|
22
|
+
*
|
|
23
|
+
* `maxBlocksPerCheckpoint` is computed from the local operational budgets and then clamped down to the optional
|
|
24
|
+
* network-provided value when that value is lower; a network value at or above the computed count leaves the
|
|
25
|
+
* computed count in effect. When clamping down occurs and a logger is supplied, a warning is emitted.
|
|
26
|
+
*/
|
|
27
|
+
export class ProposerTimetable extends ConsensusTimetable {
|
|
28
|
+
/** Minimum block-building time (`min_block_duration`) in seconds. */
|
|
29
|
+
public readonly minBlockDuration: number;
|
|
30
|
+
|
|
31
|
+
/** One-way proposal/attestation propagation budget (`p2p_propagation_time`) in seconds. */
|
|
32
|
+
public readonly p2pPropagationTime: number;
|
|
33
|
+
|
|
34
|
+
/** Local checkpoint proposal preparation budget (`checkpoint_proposal_prepare_time`) in seconds. */
|
|
35
|
+
public readonly checkpointProposalPrepareTime: number;
|
|
36
|
+
|
|
37
|
+
/** Proposer initialization budget (`checkpoint_proposal_init_time`) reserved before the first sub-slot, in seconds. */
|
|
38
|
+
public readonly checkpointProposalInitTime: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Effective maximum number of block sub-slots per checkpoint: the value the local operational budgets compute,
|
|
42
|
+
* clamped down to the explicit network value when that value is lower. A network value above the computed
|
|
43
|
+
* count has no effect (the computed count is used) and is not logged.
|
|
44
|
+
*/
|
|
45
|
+
public readonly maxBlocksPerCheckpoint: number;
|
|
46
|
+
|
|
47
|
+
constructor(opts: {
|
|
48
|
+
l1Constants: SlotTimingConstants;
|
|
49
|
+
blockDuration: number;
|
|
50
|
+
minBlockDuration: number;
|
|
51
|
+
p2pPropagationTime: number;
|
|
52
|
+
checkpointProposalPrepareTime: number;
|
|
53
|
+
checkpointProposalInitTime: number;
|
|
54
|
+
checkpointProposalSyncGrace?: number;
|
|
55
|
+
/** Explicit network max blocks per checkpoint; the effective value is clamped down to this when it is lower. */
|
|
56
|
+
maxBlocksPerCheckpoint?: number;
|
|
57
|
+
/** Optional logger; warns when the local budgets compute more blocks than the network value allows. */
|
|
58
|
+
logger?: Logger;
|
|
59
|
+
}) {
|
|
60
|
+
super({
|
|
61
|
+
l1Constants: opts.l1Constants,
|
|
62
|
+
blockDuration: opts.blockDuration,
|
|
63
|
+
checkpointProposalSyncGrace:
|
|
64
|
+
opts.checkpointProposalSyncGrace ?? getDefaultCheckpointProposalSyncGrace(opts.blockDuration),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Resolve operational budgets, applying the fast local/e2e profile for low ethereum slot durations so a
|
|
68
|
+
// fast network does not inherit the conservative production budgets (which would shrink the build window).
|
|
69
|
+
const budgets: ResolvedTimingBudgets = resolveTimingBudgets(this.ethereumSlotDuration, {
|
|
70
|
+
minBlockDuration: opts.minBlockDuration,
|
|
71
|
+
p2pPropagationTime: opts.p2pPropagationTime,
|
|
72
|
+
checkpointProposalPrepareTime: opts.checkpointProposalPrepareTime,
|
|
73
|
+
checkpointProposalInitTime: opts.checkpointProposalInitTime,
|
|
74
|
+
});
|
|
75
|
+
this.p2pPropagationTime = budgets.p2pPropagationTime;
|
|
76
|
+
this.checkpointProposalPrepareTime = budgets.checkpointProposalPrepareTime;
|
|
77
|
+
this.checkpointProposalInitTime = budgets.checkpointProposalInitTime;
|
|
78
|
+
|
|
79
|
+
// Clamp min block duration to the block duration so a single sub-slot is always startable.
|
|
80
|
+
this.minBlockDuration = Math.min(budgets.minBlockDuration, this.blockDuration);
|
|
81
|
+
|
|
82
|
+
const computed = this.computeMaxBlocksPerCheckpoint();
|
|
83
|
+
this.maxBlocksPerCheckpoint =
|
|
84
|
+
opts.maxBlocksPerCheckpoint !== undefined ? Math.min(computed, opts.maxBlocksPerCheckpoint) : computed;
|
|
85
|
+
if (opts.maxBlocksPerCheckpoint !== undefined && opts.maxBlocksPerCheckpoint < computed) {
|
|
86
|
+
opts.logger?.warn(`Locally computed max blocks per checkpoint clamped down to the network-provided value`, {
|
|
87
|
+
computed,
|
|
88
|
+
maxBlocksPerCheckpoint: opts.maxBlocksPerCheckpoint,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (this.maxBlocksPerCheckpoint < 1) {
|
|
92
|
+
throw new Error(
|
|
93
|
+
`Invalid timing configuration: derived ${this.maxBlocksPerCheckpoint} blocks per checkpoint for ` +
|
|
94
|
+
`slot duration ${this.aztecSlotDuration}s and block duration ${this.blockDuration}s.`,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Computes the maximum number of full-duration block sub-slots in a checkpoint from the already-resolved
|
|
101
|
+
* budgets. Derived from the spec's `max_blocks_per_checkpoint = floor((last_block_build_time -
|
|
102
|
+
* first_subslot_start) / D)`, where the first sub-slot starts one `checkpoint_proposal_init_time` (`init`)
|
|
103
|
+
* after `build_frame_start`, so it simplifies to `floor((S - init - D - 2P - prepCp) / D)`.
|
|
104
|
+
*/
|
|
105
|
+
private computeMaxBlocksPerCheckpoint(): number {
|
|
106
|
+
// last_block_build_time - (build_frame_start + init) = S - init - D - 2P - prepCp.
|
|
107
|
+
const timeAvailableForBlocks =
|
|
108
|
+
this.aztecSlotDuration -
|
|
109
|
+
this.checkpointProposalInitTime -
|
|
110
|
+
this.blockDuration -
|
|
111
|
+
2 * this.p2pPropagationTime -
|
|
112
|
+
this.checkpointProposalPrepareTime;
|
|
113
|
+
return Math.floor(timeAvailableForBlocks / this.blockDuration);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Ideal time the last block must finish building by to make the ideal L1 publish path:
|
|
118
|
+
* `target_slot_start - E - D - 2P - prepCp` (= `checkpoint_proposal_send_time - prepCp`). Single value;
|
|
119
|
+
* the proposer sizes block production around the ideal L1-publish path only.
|
|
120
|
+
*/
|
|
121
|
+
public getLastBlockBuildTime(slot: SlotNumber): number {
|
|
122
|
+
return (
|
|
123
|
+
this.getTargetSlotStart(slot) -
|
|
124
|
+
this.ethereumSlotDuration -
|
|
125
|
+
this.blockDuration -
|
|
126
|
+
2 * this.p2pPropagationTime -
|
|
127
|
+
this.checkpointProposalPrepareTime
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Latest start at which the proposer can still squeeze in a minimum-duration block.
|
|
133
|
+
*
|
|
134
|
+
* Multi-block mode: `last_block_build_time - min_block_duration`, an ideal-derived cutoff
|
|
135
|
+
* intentionally earlier (by `P`) than the consensus receive gate would strictly allow, and
|
|
136
|
+
* conservatively no later than the final sub-slot's start cutoff in {@link selectNextSubslot}.
|
|
137
|
+
*
|
|
138
|
+
*/
|
|
139
|
+
public getBuildStartDeadline(slot: SlotNumber): number {
|
|
140
|
+
return this.getLastBlockBuildTime(slot) - this.minBlockDuration;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Ideal L1 publish/send time: `target_slot_start - E`. Also the ideal attestation-receipt target. */
|
|
144
|
+
public getL1PublishIdealTime(slot: SlotNumber): number {
|
|
145
|
+
return this.getTargetSlotStart(slot) - this.ethereumSlotDuration;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Build deadline for sub-slot `k` (zero-based): `build_frame_start + init + (k + 1) * D`.
|
|
150
|
+
*
|
|
151
|
+
* The `init` (`checkpoint_proposal_init_time`) offset reserves the proposer's sync/proposer-check/init
|
|
152
|
+
* budget at the start of the build frame, so the first sub-slot still has its full duration once the
|
|
153
|
+
* prologue finishes rather than being eaten by it.
|
|
154
|
+
*/
|
|
155
|
+
public getBlockBuildDeadline(slot: SlotNumber, blockIndex: number): number {
|
|
156
|
+
return this.getBuildFrameStart(slot) + this.checkpointProposalInitTime + (blockIndex + 1) * this.blockDuration;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** Latest time to keep waiting for txs for sub-slot `k`: `block_build_deadline(k) - min_block_duration`. */
|
|
160
|
+
public getWaitForTxsDeadline(slot: SlotNumber, blockIndex: number): number {
|
|
161
|
+
return this.getBlockBuildDeadline(slot, blockIndex) - this.minBlockDuration;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Maximum number of full-duration block sub-slots for this timing config. */
|
|
165
|
+
public getMaxBlocksPerCheckpoint(): number {
|
|
166
|
+
return this.maxBlocksPerCheckpoint;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Selects the next block sub-slot to build for the target slot given the current wall-clock time.
|
|
171
|
+
*
|
|
172
|
+
* Scans sub-slots in order and picks the first whose build deadline is at least `min_block_duration`
|
|
173
|
+
* in the future. Sub-slots with insufficient remaining headroom are skipped.
|
|
174
|
+
*
|
|
175
|
+
* @param slot - Target slot the checkpoint commits to.
|
|
176
|
+
* @param now - Current wall-clock time in seconds.
|
|
177
|
+
*/
|
|
178
|
+
public selectNextSubslot(slot: SlotNumber, now: number): SubslotSelection {
|
|
179
|
+
const maxBlocks = this.maxBlocksPerCheckpoint;
|
|
180
|
+
for (let index = 0; index < maxBlocks; index++) {
|
|
181
|
+
const deadline = this.getBlockBuildDeadline(slot, index);
|
|
182
|
+
if (deadline - now >= this.minBlockDuration) {
|
|
183
|
+
const isLastBlock = index === maxBlocks - 1;
|
|
184
|
+
return { canStart: true, index, deadline, isLastBlock };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return { canStart: false, index: undefined, deadline: undefined, isLastBlock: false };
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg viewBox="0 0 1080 460" width="1080" height="460" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system, Segoe UI, Helvetica, Arial, sans-serif" role="img" aria-label="Proportional example timetable">
|
|
3
|
+
<rect x="0" y="0" width="1080" height="460" fill="#ffffff"/>
|
|
4
|
+
<text x="540" y="28" text-anchor="middle" font-size="16" font-weight="700" fill="#1e293b">Example timetable — offsets from build_frame_start (S=72,E=12,D=6,P=2,prepCp=1)</text>
|
|
5
|
+
|
|
6
|
+
<!-- phase bands -->
|
|
7
|
+
<rect x="70" y="244" width="427" height="32" rx="4" fill="#dbeafe"/>
|
|
8
|
+
<rect x="497" y="244" width="77" height="32" fill="#fde68a"/>
|
|
9
|
+
<rect x="574" y="244" width="84" height="32" fill="#e9d5ff"/>
|
|
10
|
+
<rect x="658" y="244" width="352" height="32" rx="4" fill="#dcfce7"/>
|
|
11
|
+
|
|
12
|
+
<text x="283" y="236" text-anchor="middle" font-size="12" fill="#1e40af">block building</text>
|
|
13
|
+
<text x="535" y="236" text-anchor="middle" font-size="10.5" fill="#92400e">dead zone</text>
|
|
14
|
+
<text x="616" y="236" text-anchor="middle" font-size="10.5" fill="#6b21a8">send lead</text>
|
|
15
|
+
<text x="834" y="236" text-anchor="middle" font-size="12" fill="#166534">target L2 slot →</text>
|
|
16
|
+
|
|
17
|
+
<!-- ethereum-slot ticks (12s) -->
|
|
18
|
+
<g stroke="#94a3b8" stroke-width="1" opacity="0.45">
|
|
19
|
+
<line x1="154" y1="246" x2="154" y2="274"/>
|
|
20
|
+
<line x1="238" y1="246" x2="238" y2="274"/>
|
|
21
|
+
<line x1="322" y1="246" x2="322" y2="274"/>
|
|
22
|
+
<line x1="406" y1="246" x2="406" y2="274"/>
|
|
23
|
+
<line x1="490" y1="246" x2="490" y2="274"/>
|
|
24
|
+
<line x1="574" y1="246" x2="574" y2="274"/>
|
|
25
|
+
<line x1="658" y1="246" x2="658" y2="274"/>
|
|
26
|
+
<line x1="742" y1="246" x2="742" y2="274"/>
|
|
27
|
+
<line x1="826" y1="246" x2="826" y2="274"/>
|
|
28
|
+
<line x1="910" y1="246" x2="910" y2="274"/>
|
|
29
|
+
<line x1="994" y1="246" x2="994" y2="274"/>
|
|
30
|
+
</g>
|
|
31
|
+
|
|
32
|
+
<line x1="70" y1="260" x2="1010" y2="260" stroke="#475569" stroke-width="1.5"/>
|
|
33
|
+
|
|
34
|
+
<!-- slot boundaries (dashed) -->
|
|
35
|
+
<line x1="154" y1="242" x2="154" y2="296" stroke="#94a3b8" stroke-width="1.2" stroke-dasharray="4 3"/>
|
|
36
|
+
<text x="154" y="310" text-anchor="middle" font-size="10" fill="#64748b">build slot start (+12)</text>
|
|
37
|
+
<line x1="658" y1="218" x2="658" y2="302" stroke="#64748b" stroke-width="1.4" stroke-dasharray="5 3"/>
|
|
38
|
+
<text x="658" y="212" text-anchor="middle" font-size="10.5" fill="#334155">target slot start (+84)</text>
|
|
39
|
+
|
|
40
|
+
<!-- build frame opens (+0) -->
|
|
41
|
+
<line x1="70" y1="255" x2="70" y2="222" stroke="#94a3b8" stroke-width="1"/>
|
|
42
|
+
<circle cx="70" cy="260" r="5" fill="#2563eb" stroke="#fff" stroke-width="1.5"/>
|
|
43
|
+
<text x="64" y="216" text-anchor="start" font-size="11" fill="#1e3a5f">Build frame opens (+0)</text>
|
|
44
|
+
|
|
45
|
+
<!-- block 1 build deadline (+6) -->
|
|
46
|
+
<line x1="112" y1="265" x2="112" y2="300" stroke="#94a3b8" stroke-width="1"/>
|
|
47
|
+
<circle cx="112" cy="260" r="4" fill="#2563eb" stroke="#fff" stroke-width="1.5"/>
|
|
48
|
+
<text x="112" y="314" text-anchor="middle" font-size="10" fill="#64748b">block 1 build deadline (+6)</text>
|
|
49
|
+
|
|
50
|
+
<!-- start_deadline (+59) -->
|
|
51
|
+
<line x1="483" y1="265" x2="483" y2="332" stroke="#94a3b8" stroke-width="1"/>
|
|
52
|
+
<circle cx="483" cy="260" r="5" fill="#2563eb" stroke="#fff" stroke-width="1.5"/>
|
|
53
|
+
<text x="483" y="346" text-anchor="middle" font-size="11" fill="#1e3a5f">start_deadline (+59)</text>
|
|
54
|
+
|
|
55
|
+
<!-- last_block_build_time (+61, single value) -->
|
|
56
|
+
<line x1="497" y1="265" x2="497" y2="362" stroke="#94a3b8" stroke-width="1"/>
|
|
57
|
+
<circle cx="497" cy="260" r="5" fill="#2563eb" stroke="#fff" stroke-width="1.5"/>
|
|
58
|
+
<text x="497" y="376" text-anchor="middle" font-size="11" fill="#1e3a5f">last_block_build_time (+61)</text>
|
|
59
|
+
|
|
60
|
+
<!-- checkpoint_proposal_send_time (+62) -->
|
|
61
|
+
<line x1="504" y1="255" x2="504" y2="190" stroke="#94a3b8" stroke-width="1"/>
|
|
62
|
+
<circle cx="504" cy="260" r="5" fill="#2563eb" stroke="#fff" stroke-width="1.5"/>
|
|
63
|
+
<text x="504" y="184" text-anchor="middle" font-size="11" fill="#1e3a5f">checkpoint_proposal_send_time (+62)</text>
|
|
64
|
+
|
|
65
|
+
<!-- checkpoint_proposal_receive_ideal (+64) -->
|
|
66
|
+
<line x1="518" y1="255" x2="518" y2="146" stroke="#16a34a" stroke-width="1"/>
|
|
67
|
+
<circle cx="518" cy="260" r="5" fill="#16a34a" stroke="#fff" stroke-width="1.5"/>
|
|
68
|
+
<text x="518" y="140" text-anchor="middle" font-size="11" fill="#14532d">checkpoint_proposal_receive_ideal (+64)</text>
|
|
69
|
+
|
|
70
|
+
<!-- checkpoint_proposal_receive_deadline (+66) -->
|
|
71
|
+
<line x1="532" y1="255" x2="532" y2="92" stroke="#dc2626" stroke-width="1"/>
|
|
72
|
+
<circle cx="532" cy="260" r="5" fill="#dc2626" stroke="#fff" stroke-width="1.5"/>
|
|
73
|
+
<text x="532" y="72" text-anchor="middle" font-size="11" fill="#7f1d1d">checkpoint_proposal</text>
|
|
74
|
+
<text x="532" y="86" text-anchor="middle" font-size="11" fill="#7f1d1d">receive_deadline (+66)</text>
|
|
75
|
+
|
|
76
|
+
<!-- next proposer frame opens / l1_publish_ideal / attestation_receive_ideal (+72) -->
|
|
77
|
+
<line x1="574" y1="255" x2="574" y2="116" stroke="#16a34a" stroke-width="1"/>
|
|
78
|
+
<circle cx="574" cy="260" r="5" fill="#16a34a" stroke="#fff" stroke-width="1.5"/>
|
|
79
|
+
<text x="574" y="96" text-anchor="middle" font-size="11" fill="#6b21a8">Next proposer frame opens (+72)</text>
|
|
80
|
+
<text x="574" y="110" text-anchor="middle" font-size="11" fill="#14532d">l1_publish_ideal = attestation_receive_ideal</text>
|
|
81
|
+
|
|
82
|
+
<!-- single attestation_deadline (+132) -->
|
|
83
|
+
<line x1="994" y1="255" x2="994" y2="176" stroke="#dc2626" stroke-width="1.4"/>
|
|
84
|
+
<circle cx="994" cy="260" r="5.5" fill="#dc2626" stroke="#fff" stroke-width="1.5"/>
|
|
85
|
+
<text x="994" y="148" text-anchor="middle" font-size="11" font-weight="700" fill="#7f1d1d">attestation_deadline (+132)</text>
|
|
86
|
+
<text x="994" y="162" text-anchor="middle" font-size="10.5" fill="#7f1d1d">single deadline: validation / re-exec / signing</text>
|
|
87
|
+
<text x="994" y="176" text-anchor="middle" font-size="10" fill="#991b1b">+ collection cutoff · latest useful L1 send · tx timeout</text>
|
|
88
|
+
|
|
89
|
+
<!-- acceptance windows — both open at build_frame_start (+0, x=70) -->
|
|
90
|
+
<text x="70" y="397" text-anchor="start" font-size="10" fill="#7f1d1d">acceptance windows open at build_frame_start (+0):</text>
|
|
91
|
+
<!-- proposal acceptance: +0 .. +66 (checkpoint_proposal_receive_deadline) -->
|
|
92
|
+
<rect x="70" y="402" width="462" height="9" rx="3" fill="#fee2e2" stroke="#dc2626" stroke-width="0.8"/>
|
|
93
|
+
<text x="538" y="410" text-anchor="start" font-size="9.5" fill="#991b1b">proposal accept [+0 .. +66] (narrow, non-overlapping)</text>
|
|
94
|
+
<!-- attestation acceptance: +0 .. +132 (attestation_deadline) -->
|
|
95
|
+
<rect x="70" y="414" width="924" height="9" rx="3" fill="#dcfce7" stroke="#16a34a" stroke-width="0.8"/>
|
|
96
|
+
<text x="70" y="436" text-anchor="start" font-size="9.5" fill="#166534">attestation accept [+0 .. +132] (wide, liberal)</text>
|
|
97
|
+
|
|
98
|
+
<!-- legend -->
|
|
99
|
+
<g font-size="11">
|
|
100
|
+
<circle cx="540" cy="432" r="5" fill="#2563eb"/>
|
|
101
|
+
<text x="552" y="436" fill="#334155">build / structural</text>
|
|
102
|
+
<circle cx="682" cy="432" r="5" fill="#16a34a"/>
|
|
103
|
+
<text x="694" y="436" fill="#334155">ideal path</text>
|
|
104
|
+
<circle cx="782" cy="432" r="5" fill="#dc2626"/>
|
|
105
|
+
<text x="794" y="436" fill="#334155">late-acceptance deadline</text>
|
|
106
|
+
<text x="540" y="453" text-anchor="middle" fill="#64748b">dashed = slot boundary · ticks = 12s Ethereum slots · time → seconds from build_frame_start</text>
|
|
107
|
+
</g>
|
|
108
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader, FieldReader,
|
|
3
|
+
import { BufferReader, BufferSink, FieldReader, serializeToSink } from '@aztec/foundation/serialize';
|
|
4
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
5
|
|
|
6
6
|
import { inspect } from 'util';
|
|
@@ -44,8 +44,13 @@ export class AppendOnlyTreeSnapshot {
|
|
|
44
44
|
return this.root.size + 4;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
toBuffer()
|
|
48
|
-
|
|
47
|
+
toBuffer(): Buffer;
|
|
48
|
+
toBuffer(sink: BufferSink): void;
|
|
49
|
+
toBuffer(sink?: BufferSink): Buffer | void {
|
|
50
|
+
if (!sink) {
|
|
51
|
+
return BufferSink.serialize(this);
|
|
52
|
+
}
|
|
53
|
+
serializeToSink(sink, this.root, this.nextAvailableLeafIndex);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
toFields(): Fr[] {
|