@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,61 @@
|
|
|
1
|
+
import { CheckpointNumber, type EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
4
|
+
|
|
5
|
+
import type { L2BlockSource } from '../block/l2_block_source.js';
|
|
6
|
+
import { type L1RollupConstants, getEpochAtSlot } from '../epoch-helpers/index.js';
|
|
7
|
+
import type { ProposedCheckpointData } from './checkpoint_data.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Returns the out hashes (in epoch order) of all checkpoints in `epoch` that precede
|
|
11
|
+
* `checkpointNumber`, used to compute the `epochOutHash` baked into that checkpoint's header.
|
|
12
|
+
*
|
|
13
|
+
* Under proposer pipelining the parent checkpoint may not be confirmed on L1 by the time the
|
|
14
|
+
* builder runs, so the on-chain archiver query (`getCheckpointsData`) is missing it and the
|
|
15
|
+
* resulting `epochOutHash` would diverge from what other validators (and L1) compute after the
|
|
16
|
+
* parent lands. To avoid that, the parent's `checkpointOutHash` is spliced in from the locally
|
|
17
|
+
* known proposed checkpoint when:
|
|
18
|
+
* - pipelining is enabled,
|
|
19
|
+
* - the archiver lookup is genuinely short (its last entry is not already cp `N-1`),
|
|
20
|
+
* - and the proposed cp `N-1` is in the same target epoch (otherwise we're at an epoch boundary
|
|
21
|
+
* and the previous-epoch cps must be excluded).
|
|
22
|
+
*
|
|
23
|
+
* Callers may either pass the already-loaded `proposedCheckpointData` (the proposer has it on
|
|
24
|
+
* hand) or leave it undefined, in which case it's fetched via `getProposedCheckpointData`.
|
|
25
|
+
*/
|
|
26
|
+
export async function getPreviousCheckpointOutHashes(input: {
|
|
27
|
+
blockSource: Pick<L2BlockSource, 'getCheckpointsData' | 'getProposedCheckpointData'>;
|
|
28
|
+
epoch: EpochNumber;
|
|
29
|
+
checkpointNumber: CheckpointNumber;
|
|
30
|
+
l1Constants: Pick<L1RollupConstants, 'epochDuration'>;
|
|
31
|
+
pipeliningEnabled: boolean;
|
|
32
|
+
proposedCheckpointData?: ProposedCheckpointData;
|
|
33
|
+
log?: Logger;
|
|
34
|
+
}): Promise<Fr[]> {
|
|
35
|
+
const { blockSource, epoch, checkpointNumber, l1Constants, pipeliningEnabled, log } = input;
|
|
36
|
+
|
|
37
|
+
const checkpointed = (await blockSource.getCheckpointsData({ epoch }))
|
|
38
|
+
.filter(c => c.checkpointNumber < checkpointNumber)
|
|
39
|
+
.sort((a, b) => a.checkpointNumber - b.checkpointNumber);
|
|
40
|
+
|
|
41
|
+
if (!pipeliningEnabled || checkpointNumber === 0) {
|
|
42
|
+
return checkpointed.map(c => c.checkpointOutHash);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const parentCheckpoint = CheckpointNumber(checkpointNumber - 1);
|
|
46
|
+
if (checkpointed.at(-1)?.checkpointNumber === parentCheckpoint) {
|
|
47
|
+
return checkpointed.map(c => c.checkpointOutHash);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const proposedParent =
|
|
51
|
+
input.proposedCheckpointData ?? (await blockSource.getProposedCheckpointData({ number: parentCheckpoint }));
|
|
52
|
+
if (!proposedParent || proposedParent.checkpointNumber !== parentCheckpoint) {
|
|
53
|
+
return checkpointed.map(c => c.checkpointOutHash);
|
|
54
|
+
}
|
|
55
|
+
if (getEpochAtSlot(proposedParent.header.slotNumber, l1Constants) !== epoch) {
|
|
56
|
+
return checkpointed.map(c => c.checkpointOutHash);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
log?.debug(`Splicing pipelined parent cp ${parentCheckpoint} outHash for cp ${checkpointNumber}`);
|
|
60
|
+
return [...checkpointed.map(c => c.checkpointOutHash), proposedParent.checkpointOutHash];
|
|
61
|
+
}
|
|
@@ -2,7 +2,7 @@ import { BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, MAX_PROCESSABLE_DA_GAS_PER_CHECK
|
|
|
2
2
|
import type { CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { sum } from '@aztec/foundation/collection';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT } from '../deserialization/index.js';
|
|
6
6
|
import type { Checkpoint } from './checkpoint.js';
|
|
7
7
|
|
|
8
8
|
export class CheckpointValidationError extends Error {
|
|
@@ -32,9 +32,15 @@ export function validateCheckpoint(
|
|
|
32
32
|
maxDABlockGas?: number;
|
|
33
33
|
maxTxsPerCheckpoint?: number;
|
|
34
34
|
maxTxsPerBlock?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Max blocks per checkpoint. Defaults to {@link MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT}; the L1-sync
|
|
37
|
+
* ingest path passes `MAX_CAPACITY_BLOCKS_PER_CHECKPOINT` to tolerate larger checkpoints already
|
|
38
|
+
* accepted by L1.
|
|
39
|
+
*/
|
|
40
|
+
maxBlocksPerCheckpoint?: number;
|
|
35
41
|
},
|
|
36
42
|
): void {
|
|
37
|
-
validateCheckpointStructure(checkpoint);
|
|
43
|
+
validateCheckpointStructure(checkpoint, { maxBlocksPerCheckpoint: opts.maxBlocksPerCheckpoint });
|
|
38
44
|
validateCheckpointLimits(checkpoint, opts);
|
|
39
45
|
validateCheckpointBlocksLimits(checkpoint, opts);
|
|
40
46
|
}
|
|
@@ -42,7 +48,7 @@ export function validateCheckpoint(
|
|
|
42
48
|
/**
|
|
43
49
|
* Validates structural integrity of a checkpoint.
|
|
44
50
|
* - Non-empty block list
|
|
45
|
-
* - Block count within
|
|
51
|
+
* - Block count within `maxBlocksPerCheckpoint` (default {@link MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT})
|
|
46
52
|
* - Checkpoint slot matches the first block's slot
|
|
47
53
|
* - Checkpoint lastArchiveRoot matches the first block's lastArchive root
|
|
48
54
|
* - Sequential block numbers without gaps
|
|
@@ -51,16 +57,20 @@ export function validateCheckpoint(
|
|
|
51
57
|
* - Consistent slot number across all blocks
|
|
52
58
|
* - Global variables (slot, timestamp, coinbase, feeRecipient, gasFees) match checkpoint header for each block
|
|
53
59
|
*/
|
|
54
|
-
export function validateCheckpointStructure(
|
|
60
|
+
export function validateCheckpointStructure(
|
|
61
|
+
checkpoint: Checkpoint,
|
|
62
|
+
opts: { maxBlocksPerCheckpoint?: number } = {},
|
|
63
|
+
): void {
|
|
64
|
+
const { maxBlocksPerCheckpoint = MAX_ATTESTABLE_BLOCKS_PER_CHECKPOINT } = opts;
|
|
55
65
|
const { blocks, number, slot } = checkpoint;
|
|
56
66
|
|
|
57
67
|
if (blocks.length === 0) {
|
|
58
68
|
throw new CheckpointValidationError('Checkpoint has no blocks', number, slot);
|
|
59
69
|
}
|
|
60
70
|
|
|
61
|
-
if (blocks.length >
|
|
71
|
+
if (blocks.length > maxBlocksPerCheckpoint) {
|
|
62
72
|
throw new CheckpointValidationError(
|
|
63
|
-
`Checkpoint has ${blocks.length} blocks, exceeding limit of ${
|
|
73
|
+
`Checkpoint has ${blocks.length} blocks, exceeding limit of ${maxBlocksPerCheckpoint}`,
|
|
64
74
|
number,
|
|
65
75
|
slot,
|
|
66
76
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import { type L1ContractAddresses, pickL1ContractAddressMappings } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
|
+
import { type ConfigMappingsType, numberConfigHelper } from '@aztec/foundation/config';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
|
|
5
5
|
export { type SequencerConfig, SequencerConfigSchema } from '../interfaces/configs.js';
|
|
@@ -7,26 +7,28 @@ export { type AllowedElement } from '../interfaces/allowed_element.js';
|
|
|
7
7
|
|
|
8
8
|
export const emptyChainConfig: ChainConfig = {
|
|
9
9
|
l1ChainId: 0,
|
|
10
|
-
l1Contracts: { rollupAddress: EthAddress.ZERO },
|
|
11
10
|
rollupVersion: 0,
|
|
11
|
+
rollupAddress: EthAddress.ZERO,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export const chainConfigMappings: ConfigMappingsType<ChainConfig> = {
|
|
15
15
|
l1ChainId: {
|
|
16
16
|
env: 'L1_CHAIN_ID',
|
|
17
|
-
|
|
18
|
-
defaultValue: 31337,
|
|
17
|
+
...numberConfigHelper(31337),
|
|
19
18
|
description: 'The chain ID of the ethereum host.',
|
|
20
19
|
},
|
|
21
20
|
rollupVersion: {
|
|
22
21
|
env: 'ROLLUP_VERSION',
|
|
23
22
|
description: 'The version of the rollup.',
|
|
24
|
-
parseEnv: (val: string) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
parseEnv: (val: string) => {
|
|
24
|
+
const parsed = parseInt(val, 10);
|
|
25
|
+
if (!Number.isSafeInteger(parsed)) {
|
|
26
|
+
throw new Error(`Invalid rollup version: ${val}`);
|
|
27
|
+
}
|
|
28
|
+
return parsed;
|
|
29
|
+
},
|
|
29
30
|
},
|
|
31
|
+
...pickL1ContractAddressMappings('rollupAddress'),
|
|
30
32
|
};
|
|
31
33
|
|
|
32
34
|
/** Chain configuration. */
|
|
@@ -35,9 +37,4 @@ export type ChainConfig = {
|
|
|
35
37
|
l1ChainId: number;
|
|
36
38
|
/** The version of the rollup. */
|
|
37
39
|
rollupVersion: number;
|
|
38
|
-
|
|
39
|
-
l1Contracts: {
|
|
40
|
-
/** The address to rollup */
|
|
41
|
-
rollupAddress: EthAddress;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
40
|
+
} & Pick<L1ContractAddresses, 'rollupAddress'>;
|
package/src/config/index.ts
CHANGED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { type L1ContractsConfig, l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
2
|
+
import { type EnvVar, pickConfigMappings } from '@aztec/foundation/config';
|
|
3
|
+
|
|
4
|
+
import type { SequencerConfig } from '../interfaces/configs.js';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
7
|
+
DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
8
|
+
DEFAULT_MIN_BLOCK_DURATION,
|
|
9
|
+
DEFAULT_P2P_PROPAGATION_TIME,
|
|
10
|
+
} from '../timetable/budgets.js';
|
|
11
|
+
import { ProposerTimetable } from '../timetable/proposer_timetable.js';
|
|
12
|
+
import { sharedSequencerConfigMappings } from './sequencer-config.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Environment variables whose values must be identical across every node of a network. They fall into three
|
|
16
|
+
* categories, all consensus-critical:
|
|
17
|
+
*
|
|
18
|
+
* - Timing/protocol consensus: slot and epoch durations, block sub-slot duration, max blocks per checkpoint, and
|
|
19
|
+
* the checkpoint-proposal materialization grace. Proposers and validators must agree on these to land on the
|
|
20
|
+
* same proposed chain and the same checkpoint-proposal receive/handoff deadlines.
|
|
21
|
+
* - Network identity and L1-posted deployment params: the L1 chain id and the staking/governance/slashing
|
|
22
|
+
* parameters baked into the deployed rollup contract (committee size, lags, thresholds, mana target, fee
|
|
23
|
+
* pricing, governance/slashing round sizes, quorums, slash amounts, etc.). A node disagreeing with the rollup
|
|
24
|
+
* it points at would compute the wrong epoch geometry, fees, or slashing rounds.
|
|
25
|
+
* - Node-side slashing offense consensus: the offense detection/penalty parameters validators apply locally to
|
|
26
|
+
* decide which payloads to sign. Validators must agree on these to reach the on-chain slashing quorum.
|
|
27
|
+
*
|
|
28
|
+
* Deliberately excluded: bootnodes, P2P/store/OTEL/sentinel settings, SEQ_MIN_TX_PER_BLOCK, SEQ_MAX_TX_PER_*,
|
|
29
|
+
* AZTEC_SLASHER_ENABLED, PROVER_REAL_PROOFS, TRANSACTIONS_DISABLED, and AZTEC_ENTRY_QUEUE_* (mainnet-only genesis
|
|
30
|
+
* params enforced by L1).
|
|
31
|
+
*/
|
|
32
|
+
export const NETWORK_CONSENSUS_ENV_VARS = [
|
|
33
|
+
// Timing/protocol consensus.
|
|
34
|
+
'ETHEREUM_SLOT_DURATION',
|
|
35
|
+
'AZTEC_SLOT_DURATION',
|
|
36
|
+
'AZTEC_EPOCH_DURATION',
|
|
37
|
+
'SEQ_BLOCK_DURATION_MS',
|
|
38
|
+
'MAX_BLOCKS_PER_CHECKPOINT',
|
|
39
|
+
'CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS',
|
|
40
|
+
|
|
41
|
+
// Network identity / L1-posted deployment params.
|
|
42
|
+
'L1_CHAIN_ID',
|
|
43
|
+
'AZTEC_TARGET_COMMITTEE_SIZE',
|
|
44
|
+
'AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET',
|
|
45
|
+
'AZTEC_LAG_IN_EPOCHS_FOR_RANDAO',
|
|
46
|
+
'AZTEC_ACTIVATION_THRESHOLD',
|
|
47
|
+
'AZTEC_EJECTION_THRESHOLD',
|
|
48
|
+
'AZTEC_LOCAL_EJECTION_THRESHOLD',
|
|
49
|
+
'AZTEC_EXIT_DELAY_SECONDS',
|
|
50
|
+
'AZTEC_INBOX_LAG',
|
|
51
|
+
'AZTEC_PROOF_SUBMISSION_EPOCHS',
|
|
52
|
+
'AZTEC_MANA_TARGET',
|
|
53
|
+
'AZTEC_PROVING_COST_PER_MANA',
|
|
54
|
+
'AZTEC_INITIAL_ETH_PER_FEE_ASSET',
|
|
55
|
+
'AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE',
|
|
56
|
+
'AZTEC_GOVERNANCE_PROPOSER_QUORUM',
|
|
57
|
+
'AZTEC_SLASHING_QUORUM',
|
|
58
|
+
'AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS',
|
|
59
|
+
'AZTEC_SLASHING_LIFETIME_IN_ROUNDS',
|
|
60
|
+
'AZTEC_SLASHING_OFFSET_IN_ROUNDS',
|
|
61
|
+
'AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS',
|
|
62
|
+
'AZTEC_SLASHING_VETOER',
|
|
63
|
+
'AZTEC_SLASHING_DISABLE_DURATION',
|
|
64
|
+
'AZTEC_SLASH_AMOUNT_SMALL',
|
|
65
|
+
'AZTEC_SLASH_AMOUNT_MEDIUM',
|
|
66
|
+
'AZTEC_SLASH_AMOUNT_LARGE',
|
|
67
|
+
|
|
68
|
+
// Node-side slashing offense consensus.
|
|
69
|
+
'SLASH_OFFENSE_EXPIRATION_ROUNDS',
|
|
70
|
+
'SLASH_MAX_PAYLOAD_SIZE',
|
|
71
|
+
'SLASH_EXECUTE_ROUNDS_LOOK_BACK',
|
|
72
|
+
'SLASH_DATA_WITHHOLDING_TOLERANCE_SLOTS',
|
|
73
|
+
'SLASH_DATA_WITHHOLDING_PENALTY',
|
|
74
|
+
'SLASH_INACTIVITY_TARGET_PERCENTAGE',
|
|
75
|
+
'SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD',
|
|
76
|
+
'SLASH_INACTIVITY_PENALTY',
|
|
77
|
+
'SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY',
|
|
78
|
+
'SLASH_DUPLICATE_PROPOSAL_PENALTY',
|
|
79
|
+
'SLASH_DUPLICATE_ATTESTATION_PENALTY',
|
|
80
|
+
'SLASH_PROPOSE_DESCENDANT_OF_CHECKPOINT_WITH_INVALID_ATTESTATIONS_PENALTY',
|
|
81
|
+
'SLASH_ATTEST_INVALID_CHECKPOINT_PROPOSAL_PENALTY',
|
|
82
|
+
'SLASH_UNKNOWN_PENALTY',
|
|
83
|
+
'SLASH_INVALID_BLOCK_PENALTY',
|
|
84
|
+
'SLASH_INVALID_CHECKPOINT_PROPOSAL_PENALTY',
|
|
85
|
+
'SLASH_GRACE_PERIOD_L2_SLOTS',
|
|
86
|
+
] as const satisfies readonly EnvVar[];
|
|
87
|
+
|
|
88
|
+
/** A consensus-critical environment variable name; see {@link NETWORK_CONSENSUS_ENV_VARS}. */
|
|
89
|
+
export type ConsensusEnvVar = (typeof NETWORK_CONSENSUS_ENV_VARS)[number];
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The subset of consensus-critical timing config whose geometry can be validated in isolation. Composed by
|
|
93
|
+
* picking the canonical fields from their owning config types so the field set never drifts from the config
|
|
94
|
+
* layer: slot durations from {@link L1ContractsConfig}, block sub-slot/checkpoint timings from
|
|
95
|
+
* {@link SequencerConfig} (whose fields are optional there, hence `Required`).
|
|
96
|
+
*/
|
|
97
|
+
export type NetworkConsensusConfig = Pick<L1ContractsConfig, 'aztecSlotDuration' | 'ethereumSlotDuration'> &
|
|
98
|
+
Required<Pick<SequencerConfig, 'blockDurationMs' | 'maxBlocksPerCheckpoint' | 'checkpointProposalSyncGraceSeconds'>>;
|
|
99
|
+
|
|
100
|
+
/** Config mappings for the slot-timing fields of {@link NetworkConsensusConfig}, picked from their owners. */
|
|
101
|
+
const networkConsensusConfigMappings = {
|
|
102
|
+
...pickConfigMappings(l1ContractsConfigMappings, ['aztecSlotDuration', 'ethereumSlotDuration']),
|
|
103
|
+
...pickConfigMappings(sharedSequencerConfigMappings, [
|
|
104
|
+
'blockDurationMs',
|
|
105
|
+
'maxBlocksPerCheckpoint',
|
|
106
|
+
'checkpointProposalSyncGraceSeconds',
|
|
107
|
+
]),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Extracts the timing {@link NetworkConsensusConfig} from a generated network config object. The env-var names
|
|
112
|
+
* and the per-field parsing both come from the canonical config mappings (`l1ContractsConfigMappings` and
|
|
113
|
+
* `sharedSequencerConfigMappings`), so each field is parsed exactly as the node's config layer would parse it.
|
|
114
|
+
* A field whose env var is absent becomes `NaN`, which {@link validateNetworkConsensusConfig} reports as an
|
|
115
|
+
* error. Never throws: parse helpers that would throw or yield `undefined` are coerced to `NaN`.
|
|
116
|
+
*/
|
|
117
|
+
export function getConsensusConfigFromNetworkEnv(
|
|
118
|
+
values: Record<string, string | number | boolean>,
|
|
119
|
+
): NetworkConsensusConfig {
|
|
120
|
+
const result = {} as Record<keyof NetworkConsensusConfig, number>;
|
|
121
|
+
for (const [field, mapping] of Object.entries(networkConsensusConfigMappings)) {
|
|
122
|
+
const raw = mapping.env !== undefined ? values[mapping.env] : undefined;
|
|
123
|
+
if (raw === undefined) {
|
|
124
|
+
result[field as keyof NetworkConsensusConfig] = NaN;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
let parsed: number | undefined;
|
|
128
|
+
try {
|
|
129
|
+
parsed = mapping.parseEnv ? mapping.parseEnv(String(raw)) : Number(raw);
|
|
130
|
+
} catch {
|
|
131
|
+
parsed = NaN;
|
|
132
|
+
}
|
|
133
|
+
result[field as keyof NetworkConsensusConfig] = parsed ?? NaN;
|
|
134
|
+
}
|
|
135
|
+
return result;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Validates a {@link NetworkConsensusConfig} for self-consistency, returning a list of error messages (empty
|
|
140
|
+
* when valid). Used by the cli unit test that gates the generated network configs.
|
|
141
|
+
*
|
|
142
|
+
* The check requires `maxBlocksPerCheckpoint` to be *exactly* what a {@link ProposerTimetable} built from the
|
|
143
|
+
* same slot timings and the production default budgets derives. This exact-equality requirement ensures the
|
|
144
|
+
* published network value is precisely what the production default budgets produce, so every node running those
|
|
145
|
+
* defaults agrees on the per-checkpoint block count without clamping.
|
|
146
|
+
*/
|
|
147
|
+
export function validateNetworkConsensusConfig(config: NetworkConsensusConfig): string[] {
|
|
148
|
+
const errors: string[] = [];
|
|
149
|
+
|
|
150
|
+
for (const [field, value] of Object.entries(config)) {
|
|
151
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
152
|
+
errors.push(`${field} must be a finite number (got ${value})`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (errors.length > 0) {
|
|
156
|
+
return errors;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (config.ethereumSlotDuration <= 0) {
|
|
160
|
+
errors.push(`ethereumSlotDuration must be positive (got ${config.ethereumSlotDuration})`);
|
|
161
|
+
}
|
|
162
|
+
if (config.blockDurationMs <= 0) {
|
|
163
|
+
errors.push(`blockDurationMs must be positive (got ${config.blockDurationMs})`);
|
|
164
|
+
}
|
|
165
|
+
if (config.aztecSlotDuration <= 0) {
|
|
166
|
+
errors.push(`aztecSlotDuration must be positive (got ${config.aztecSlotDuration})`);
|
|
167
|
+
}
|
|
168
|
+
if (config.ethereumSlotDuration > 0 && config.aztecSlotDuration % config.ethereumSlotDuration !== 0) {
|
|
169
|
+
errors.push(
|
|
170
|
+
`aztecSlotDuration (${config.aztecSlotDuration}s) must be a multiple of ethereumSlotDuration ` +
|
|
171
|
+
`(${config.ethereumSlotDuration}s)`,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
if (config.blockDurationMs / 1000 > config.aztecSlotDuration) {
|
|
175
|
+
errors.push(
|
|
176
|
+
`blockDurationMs (${config.blockDurationMs}ms) exceeds aztecSlotDuration (${config.aztecSlotDuration}s)`,
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (config.maxBlocksPerCheckpoint < 1) {
|
|
180
|
+
errors.push(`maxBlocksPerCheckpoint must be at least 1 (got ${config.maxBlocksPerCheckpoint})`);
|
|
181
|
+
}
|
|
182
|
+
if (config.checkpointProposalSyncGraceSeconds < 0) {
|
|
183
|
+
errors.push(
|
|
184
|
+
`checkpointProposalSyncGraceSeconds must be non-negative (got ${config.checkpointProposalSyncGraceSeconds})`,
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
if (errors.length > 0) {
|
|
188
|
+
return errors;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let computed: number;
|
|
192
|
+
try {
|
|
193
|
+
computed = new ProposerTimetable({
|
|
194
|
+
l1Constants: {
|
|
195
|
+
l1GenesisTime: 0n,
|
|
196
|
+
slotDuration: config.aztecSlotDuration,
|
|
197
|
+
ethereumSlotDuration: config.ethereumSlotDuration,
|
|
198
|
+
},
|
|
199
|
+
blockDuration: config.blockDurationMs / 1000,
|
|
200
|
+
minBlockDuration: DEFAULT_MIN_BLOCK_DURATION,
|
|
201
|
+
p2pPropagationTime: DEFAULT_P2P_PROPAGATION_TIME,
|
|
202
|
+
checkpointProposalPrepareTime: DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
203
|
+
checkpointProposalInitTime: DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
204
|
+
checkpointProposalSyncGrace: config.checkpointProposalSyncGraceSeconds,
|
|
205
|
+
}).getMaxBlocksPerCheckpoint();
|
|
206
|
+
} catch (err) {
|
|
207
|
+
// The timetable constructor throws when not even one block fits the default budgets; report instead.
|
|
208
|
+
errors.push(
|
|
209
|
+
`maxBlocksPerCheckpoint (${config.maxBlocksPerCheckpoint}) cannot be achieved: the default operational ` +
|
|
210
|
+
`budgets fit fewer than one block for slot duration ${config.aztecSlotDuration}s and block duration ` +
|
|
211
|
+
`${config.blockDurationMs / 1000}s (${err instanceof Error ? err.message : String(err)})`,
|
|
212
|
+
);
|
|
213
|
+
return errors;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (computed !== config.maxBlocksPerCheckpoint) {
|
|
217
|
+
errors.push(
|
|
218
|
+
`maxBlocksPerCheckpoint (${config.maxBlocksPerCheckpoint}) does not match the ${computed} blocks the ` +
|
|
219
|
+
`production default budgets derive for slot duration ${config.aztecSlotDuration}s and block duration ` +
|
|
220
|
+
`${config.blockDurationMs / 1000}s`,
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return errors;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Enforces that operators do not silently override consensus-critical values diverging from the network config.
|
|
229
|
+
*
|
|
230
|
+
* For each var in {@link NETWORK_CONSENSUS_ENV_VARS} present in `networkConfig`: if the operator set it in `env`
|
|
231
|
+
* to a conflicting value, this throws unless `ALLOW_OVERRIDING_NETWORK_CONFIG` is truthy (in which case it logs
|
|
232
|
+
* and keeps the operator value).
|
|
233
|
+
*
|
|
234
|
+
* This function is pure: it never writes to `env`. Instead it returns the canonical env writes the caller
|
|
235
|
+
* should apply — a map of env-var name to canonical string value for every numeric var whose env value matched
|
|
236
|
+
* the network value numerically. Applying these closes a bypass where the config layer parses some vars with
|
|
237
|
+
* `parseInt` (which reads '6e3' as 6); rewriting them to the network value's string form keeps the operator's
|
|
238
|
+
* numerically-equal value but in canonical form. Vars kept under `ALLOW_OVERRIDING_NETWORK_CONFIG` (genuine
|
|
239
|
+
* conflicts) are not included, so the operator value is preserved untouched.
|
|
240
|
+
*
|
|
241
|
+
* @returns Canonical env writes (env-var name -> canonical string value) for the caller to apply.
|
|
242
|
+
*/
|
|
243
|
+
export function checkConsensusEnvOverrides(
|
|
244
|
+
networkConfig: Record<string, string | number | boolean>,
|
|
245
|
+
env: { [key: string]: string | undefined } = process.env,
|
|
246
|
+
log?: (msg: string) => void,
|
|
247
|
+
): Record<string, string> {
|
|
248
|
+
const allowOverride = allowsNetworkConfigOverride(env);
|
|
249
|
+
const canonical: Record<string, string> = {};
|
|
250
|
+
const conflicts: string[] = [];
|
|
251
|
+
|
|
252
|
+
for (const envVar of NETWORK_CONSENSUS_ENV_VARS) {
|
|
253
|
+
const networkValue = networkConfig[envVar];
|
|
254
|
+
if (networkValue === undefined) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const current = env[envVar];
|
|
259
|
+
if (current === undefined || current === '') {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const networkIsNumeric = typeof networkValue === 'number';
|
|
264
|
+
const matches = networkIsNumeric ? Number(current) === networkValue : current === String(networkValue);
|
|
265
|
+
if (matches) {
|
|
266
|
+
if (networkIsNumeric) {
|
|
267
|
+
canonical[envVar] = String(networkValue);
|
|
268
|
+
}
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const conflict = `${envVar}=${current} conflicts with the network value ${networkValue}`;
|
|
273
|
+
if (allowOverride) {
|
|
274
|
+
log?.(
|
|
275
|
+
`Environment variable ${conflict}. Consensus-critical values must match across the network, but ` +
|
|
276
|
+
`ALLOW_OVERRIDING_NETWORK_CONFIG is set so the operator value is kept (only do this if you know what ` +
|
|
277
|
+
`you are doing).`,
|
|
278
|
+
);
|
|
279
|
+
continue;
|
|
280
|
+
}
|
|
281
|
+
conflicts.push(conflict);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Accumulate every conflict so the operator sees all the env vars they need to reconcile at once, rather than
|
|
285
|
+
// fixing them one failed startup at a time.
|
|
286
|
+
if (conflicts.length > 0) {
|
|
287
|
+
throw new Error(
|
|
288
|
+
`Environment variables conflict with consensus-critical network values:\n` +
|
|
289
|
+
conflicts.map(c => ` - ${c}`).join('\n') +
|
|
290
|
+
`\nConsensus-critical values must match across the network. Set ALLOW_OVERRIDING_NETWORK_CONFIG=1 to ` +
|
|
291
|
+
`override (only do this if you know what you are doing).`,
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
return canonical;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** Whether the env opts into overriding network-wide consensus values (`ALLOW_OVERRIDING_NETWORK_CONFIG`). */
|
|
299
|
+
export function allowsNetworkConfigOverride(env: { [key: string]: string | undefined } = process.env): boolean {
|
|
300
|
+
const value = env.ALLOW_OVERRIDING_NETWORK_CONFIG;
|
|
301
|
+
return value === '1' || value?.toLowerCase() === 'true';
|
|
302
|
+
}
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
type ConfigMappingsType,
|
|
3
|
+
floatConfigHelper,
|
|
4
|
+
numberConfigHelper,
|
|
5
|
+
optionalNumberConfigHelper,
|
|
6
|
+
} from '@aztec/foundation/config';
|
|
2
7
|
|
|
3
8
|
import type { SequencerConfig } from '../interfaces/configs.js';
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_BLOCK_DURATION,
|
|
11
|
+
DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
12
|
+
DEFAULT_MIN_BLOCK_DURATION,
|
|
13
|
+
DEFAULT_P2P_PROPAGATION_TIME,
|
|
14
|
+
getDefaultCheckpointProposalSyncGrace,
|
|
15
|
+
} from '../timetable/index.js';
|
|
16
|
+
|
|
17
|
+
/** Default duration per block in milliseconds, used to derive how many blocks fit in a slot. */
|
|
18
|
+
export const DEFAULT_BLOCK_DURATION_MS = DEFAULT_BLOCK_DURATION * 1000;
|
|
4
19
|
|
|
5
20
|
/** Default maximum number of transactions per block. */
|
|
6
21
|
export const DEFAULT_MAX_TXS_PER_BLOCK = 32;
|
|
7
22
|
|
|
23
|
+
/** Default maximum number of blocks the sequencer packs into a single checkpoint. */
|
|
24
|
+
export const DEFAULT_MAX_BLOCKS_PER_CHECKPOINT = 24;
|
|
25
|
+
|
|
8
26
|
/**
|
|
9
27
|
* Partial sequencer config mappings for fields that need to be shared across packages.
|
|
10
28
|
* The full sequencer config mappings remain in sequencer-client, but shared fields
|
|
@@ -12,26 +30,67 @@ export const DEFAULT_MAX_TXS_PER_BLOCK = 32;
|
|
|
12
30
|
* to avoid duplication.
|
|
13
31
|
*/
|
|
14
32
|
export const sharedSequencerConfigMappings: ConfigMappingsType<
|
|
15
|
-
Pick<
|
|
33
|
+
Pick<
|
|
34
|
+
SequencerConfig,
|
|
35
|
+
| 'blockDurationMs'
|
|
36
|
+
| 'checkpointProposalSyncGraceSeconds'
|
|
37
|
+
| 'expectedBlockProposalsPerSlot'
|
|
38
|
+
| 'maxTxsPerBlock'
|
|
39
|
+
| 'attestationPropagationTime'
|
|
40
|
+
| 'checkpointProposalPrepareTime'
|
|
41
|
+
| 'minBlockDuration'
|
|
42
|
+
| 'maxBlocksPerCheckpoint'
|
|
43
|
+
>
|
|
16
44
|
> = {
|
|
17
45
|
blockDurationMs: {
|
|
18
46
|
env: 'SEQ_BLOCK_DURATION_MS',
|
|
19
|
-
description:
|
|
20
|
-
|
|
21
|
-
'If undefined (default), builds a single block per slot using the full slot duration.',
|
|
22
|
-
parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
|
|
47
|
+
description: 'Duration per block in milliseconds, used to derive how many blocks fit in a slot.',
|
|
48
|
+
...numberConfigHelper(DEFAULT_BLOCK_DURATION_MS),
|
|
23
49
|
},
|
|
24
50
|
expectedBlockProposalsPerSlot: {
|
|
25
51
|
env: 'SEQ_EXPECTED_BLOCK_PROPOSALS_PER_SLOT',
|
|
26
52
|
description:
|
|
27
53
|
'Expected number of block proposals per slot for P2P peer scoring. ' +
|
|
28
54
|
'0 (default) disables block proposal scoring. Set to a positive value to enable.',
|
|
29
|
-
|
|
30
|
-
|
|
55
|
+
...numberConfigHelper(0),
|
|
56
|
+
},
|
|
57
|
+
checkpointProposalSyncGraceSeconds: {
|
|
58
|
+
env: 'CHECKPOINT_PROPOSAL_SYNC_GRACE_SECONDS',
|
|
59
|
+
description:
|
|
60
|
+
'Consensus grace in seconds for a received checkpoint proposal to materialize into local proposed state. ' +
|
|
61
|
+
'Defaults to twice the block duration.',
|
|
62
|
+
defaultValue: getDefaultCheckpointProposalSyncGrace(DEFAULT_BLOCK_DURATION_MS / 1000),
|
|
63
|
+
...optionalNumberConfigHelper(),
|
|
31
64
|
},
|
|
32
65
|
maxTxsPerBlock: {
|
|
33
66
|
env: 'SEQ_MAX_TX_PER_BLOCK',
|
|
34
67
|
description: 'The maximum number of txs to include in a block.',
|
|
35
|
-
|
|
68
|
+
...optionalNumberConfigHelper(),
|
|
69
|
+
},
|
|
70
|
+
attestationPropagationTime: {
|
|
71
|
+
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
72
|
+
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way).',
|
|
73
|
+
defaultValue: DEFAULT_P2P_PROPAGATION_TIME,
|
|
74
|
+
...floatConfigHelper(DEFAULT_P2P_PROPAGATION_TIME),
|
|
75
|
+
},
|
|
76
|
+
checkpointProposalPrepareTime: {
|
|
77
|
+
env: 'SEQ_CHECKPOINT_PROPOSAL_PREPARE_TIME',
|
|
78
|
+
description:
|
|
79
|
+
'Local time in seconds between the last block build finishing and the checkpoint proposal being ready for p2p send.',
|
|
80
|
+
defaultValue: DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
81
|
+
...floatConfigHelper(DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME),
|
|
82
|
+
},
|
|
83
|
+
minBlockDuration: {
|
|
84
|
+
env: 'SEQ_MIN_BLOCK_DURATION',
|
|
85
|
+
description: 'Minimum block-building time in seconds still worth allocating if the proposer starts late.',
|
|
86
|
+
defaultValue: DEFAULT_MIN_BLOCK_DURATION,
|
|
87
|
+
...floatConfigHelper(DEFAULT_MIN_BLOCK_DURATION),
|
|
88
|
+
},
|
|
89
|
+
maxBlocksPerCheckpoint: {
|
|
90
|
+
env: 'MAX_BLOCKS_PER_CHECKPOINT',
|
|
91
|
+
description:
|
|
92
|
+
'Maximum number of blocks the sequencer packs into a single checkpoint, and the maximum indexWithinCheckpoint accepted on inbound block proposals.',
|
|
93
|
+
parseEnv: (val: string) => parseInt(val, 10),
|
|
94
|
+
defaultValue: DEFAULT_MAX_BLOCKS_PER_CHECKPOINT,
|
|
36
95
|
},
|
|
37
96
|
};
|
|
@@ -38,7 +38,8 @@ export class CompleteAddress {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** Size in bytes of an instance */
|
|
41
|
-
|
|
41
|
+
// address (1 Fr) + publicKeys (1 Fr hash + 1 Point + 4 Fr hashes = 7 Fr) + partialAddress (1 Fr) = 9 Fr
|
|
42
|
+
static readonly SIZE_IN_BYTES = 32 * 9;
|
|
42
43
|
|
|
43
44
|
static get schema() {
|
|
44
45
|
return hexSchemaFor(CompleteAddress);
|
|
@@ -54,8 +55,11 @@ export class CompleteAddress {
|
|
|
54
55
|
|
|
55
56
|
static async fromSecretKeyAndPartialAddress(secretKey: Fr, partialAddress: Fr): Promise<CompleteAddress> {
|
|
56
57
|
const { publicKeys } = await deriveKeys(secretKey);
|
|
57
|
-
|
|
58
|
+
return await this.fromPublicKeysAndPartialAddress(publicKeys, partialAddress);
|
|
59
|
+
}
|
|
58
60
|
|
|
61
|
+
static async fromPublicKeysAndPartialAddress(publicKeys: PublicKeys, partialAddress: Fr): Promise<CompleteAddress> {
|
|
62
|
+
const address = await computeAddress(publicKeys, partialAddress);
|
|
59
63
|
return new CompleteAddress(address, publicKeys, partialAddress);
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -87,7 +91,7 @@ export class CompleteAddress {
|
|
|
87
91
|
* @returns A readable string representation of the complete address.
|
|
88
92
|
*/
|
|
89
93
|
public toReadableString(): string {
|
|
90
|
-
return `Address: ${this.address.toString()}\
|
|
94
|
+
return `Address: ${this.address.toString()}\nNpkM hash: ${this.publicKeys.npkMHash.toString()}\nIvpkM: ${this.publicKeys.ivpkM.toString()}\nOvpkM hash: ${this.publicKeys.ovpkMHash.toString()}\nTpkM hash: ${this.publicKeys.tpkMHash.toString()}\nMspkM hash: ${this.publicKeys.mspkMHash.toString()}\nFbpkM hash: ${this.publicKeys.fbpkMHash.toString()}\nPartial Address: ${this.partialAddress.toString()}\n`;
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
/**
|
|
@@ -13,9 +13,9 @@ import type { ContractInstance } from './interfaces/contract_instance.js';
|
|
|
13
13
|
/**
|
|
14
14
|
* Returns the deployment address for a given contract instance.
|
|
15
15
|
* ```
|
|
16
|
-
* salted_initialization_hash = poseidon2(
|
|
16
|
+
* salted_initialization_hash = poseidon2(DOM_SEP__SALTED_INITIALIZATION_HASH, [salt, initialization_hash, deployer, immutables_hash])
|
|
17
17
|
* partial_address = poseidon2(DOM_SEP__PARTIAL_ADDRESS, [contract_class_id, salted_initialization_hash])
|
|
18
|
-
* address = ((poseidon2(
|
|
18
|
+
* address = ((poseidon2(DOM_SEP__CONTRACT_ADDRESS_V2, [public_keys_hash, partial_address]) * G) + ivpk_m).x <- the x-coordinate of the address point
|
|
19
19
|
* ```
|
|
20
20
|
* @param instance - A contract instance for which to calculate the deployment address.
|
|
21
21
|
*/
|
|
@@ -34,7 +34,7 @@ export async function computeContractAddressFromInstance(
|
|
|
34
34
|
*/
|
|
35
35
|
export async function computePartialAddress(
|
|
36
36
|
instance:
|
|
37
|
-
| Pick<ContractInstance, 'originalContractClassId' | 'initializationHash' | 'salt' | 'deployer'>
|
|
37
|
+
| Pick<ContractInstance, 'originalContractClassId' | 'initializationHash' | 'salt' | 'deployer' | 'immutablesHash'>
|
|
38
38
|
| { originalContractClassId: Fr; saltedInitializationHash: Fr },
|
|
39
39
|
): Promise<Fr> {
|
|
40
40
|
const saltedInitializationHash =
|
|
@@ -53,11 +53,11 @@ export async function computePartialAddress(
|
|
|
53
53
|
* @param instance - Contract instance for which to compute the salted initialization hash.
|
|
54
54
|
*/
|
|
55
55
|
export function computeSaltedInitializationHash(
|
|
56
|
-
instance: Pick<ContractInstance, 'initializationHash' | 'salt' | 'deployer'>,
|
|
56
|
+
instance: Pick<ContractInstance, 'initializationHash' | 'salt' | 'deployer' | 'immutablesHash'>,
|
|
57
57
|
): Promise<Fr> {
|
|
58
58
|
return poseidon2HashWithSeparator(
|
|
59
|
-
[instance.salt, instance.initializationHash, instance.deployer],
|
|
60
|
-
DomainSeparator.
|
|
59
|
+
[instance.salt, instance.initializationHash, instance.deployer, instance.immutablesHash],
|
|
60
|
+
DomainSeparator.SALTED_INITIALIZATION_HASH,
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
|