@aztec/stdlib 0.0.1-commit.993d240 → 0.0.1-commit.9a89641
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 +32 -7
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +11 -2
- package/dest/abi/buffer.d.ts +6 -2
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +13 -1
- package/dest/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +35 -19
- package/dest/abi/decoder.d.ts +12 -5
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +18 -21
- package/dest/abi/function_call.d.ts +17 -8
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +28 -9
- package/dest/avm/avm.d.ts +212 -211
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +4 -2
- package/dest/avm/index.d.ts +1 -6
- package/dest/avm/index.d.ts.map +1 -1
- package/dest/avm/index.js +0 -5
- package/dest/aztec-address/index.d.ts +35 -5
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +32 -8
- package/dest/block/attestation_info.d.ts +1 -1
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -4
- package/dest/block/l2_block_source.d.ts +57 -28
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +20 -2
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +39 -0
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -0
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +165 -0
- package/dest/block/l2_block_stream/index.d.ts +2 -1
- package/dest/block/l2_block_stream/index.d.ts.map +1 -1
- package/dest/block/l2_block_stream/index.js +1 -0
- package/dest/block/l2_block_stream/interfaces.d.ts +83 -11
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/interfaces.js +25 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +24 -15
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +175 -151
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +6 -12
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +8 -32
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +17 -18
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +70 -58
- package/dest/block/proposal/attestations_and_signers.d.ts +19 -1
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +47 -7
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +301 -37
- package/dest/block/validate_block_result.d.ts +16 -1
- package/dest/block/validate_block_result.d.ts.map +1 -1
- package/dest/block/validate_block_result.js +18 -3
- package/dest/checkpoint/checkpoint.js +2 -2
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/simulation_overrides.d.ts +61 -0
- package/dest/checkpoint/simulation_overrides.d.ts.map +1 -0
- package/dest/checkpoint/simulation_overrides.js +98 -0
- package/dest/checkpoint/validate.d.ts +11 -3
- package/dest/checkpoint/validate.d.ts.map +1 -1
- package/dest/checkpoint/validate.js +9 -6
- package/dest/config/index.d.ts +2 -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 +223 -0
- package/dest/config/node-rpc-config.d.ts +1 -1
- package/dest/config/node-rpc-config.d.ts.map +1 -1
- package/dest/config/node-rpc-config.js +1 -1
- package/dest/config/sequencer-config.d.ts +4 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +22 -3
- package/dest/contract/artifact_hash.d.ts +2 -2
- package/dest/contract/artifact_hash.d.ts.map +1 -1
- package/dest/contract/artifact_hash.js +10 -2
- package/dest/contract/contract_address.d.ts +5 -4
- package/dest/contract/contract_address.d.ts.map +1 -1
- package/dest/contract/contract_class.d.ts +1 -1
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class.js +3 -2
- package/dest/contract/contract_instance.d.ts +16 -2
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +45 -0
- package/dest/contract/index.d.ts +1 -2
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +0 -1
- package/dest/contract/interfaces/contract_data_source.d.ts +3 -5
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.d.ts +71 -10
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +7 -2
- package/dest/contract/interfaces/node-info.d.ts +11 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +7 -1
- package/dest/contract/partial_address.d.ts +9 -3
- package/dest/contract/partial_address.d.ts.map +1 -1
- package/dest/contract/partial_address.js +8 -2
- package/dest/database-version/version_manager.d.ts +18 -4
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +76 -6
- package/dest/deserialization/index.d.ts +35 -3
- package/dest/deserialization/index.d.ts.map +1 -1
- package/dest/deserialization/index.js +32 -1
- package/dest/file-store/factory.d.ts +1 -1
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +7 -0
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/file-store/index.js +1 -0
- package/dest/file-store/memory.d.ts +24 -0
- package/dest/file-store/memory.d.ts.map +1 -0
- package/dest/file-store/memory.js +80 -0
- package/dest/gas/gas_settings.d.ts +7 -13
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +9 -16
- package/dest/gas/index.d.ts +2 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +1 -0
- package/dest/gas/tx_gas_limits.d.ts +72 -0
- package/dest/gas/tx_gas_limits.d.ts.map +1 -0
- package/dest/gas/tx_gas_limits.js +85 -0
- package/dest/ha-signing/config.d.ts +19 -5
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +9 -3
- package/dest/ha-signing/local_config.d.ts +10 -2
- package/dest/ha-signing/local_config.d.ts.map +1 -1
- package/dest/ha-signing/local_config.js +8 -2
- package/dest/hash/hash.d.ts +1 -2
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +0 -7
- package/dest/interfaces/api_limit.d.ts +6 -1
- package/dest/interfaces/api_limit.d.ts.map +1 -1
- package/dest/interfaces/api_limit.js +3 -0
- package/dest/interfaces/archiver.d.ts +12 -7
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +13 -6
- package/dest/interfaces/aztec-node-admin.d.ts +25 -17
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +1 -1
- package/dest/interfaces/aztec-node-debug.d.ts +40 -2
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-debug.js +29 -1
- package/dest/interfaces/aztec-node.d.ts +100 -33
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +72 -23
- package/dest/interfaces/block-builder.d.ts +9 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block_response.d.ts +5 -5
- package/dest/interfaces/block_response.d.ts.map +1 -1
- package/dest/interfaces/chain_tips.d.ts +8 -47
- package/dest/interfaces/chain_tips.d.ts.map +1 -1
- package/dest/interfaces/chain_tips.js +1 -6
- package/dest/interfaces/checkpoint_parameter.d.ts +3 -3
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -1
- package/dest/interfaces/checkpoint_parameter.js +3 -3
- package/dest/interfaces/checkpoint_response.d.ts +5 -5
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -1
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +33 -6
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +6 -1
- package/dest/interfaces/get_tx_by_hash_options.d.ts +9 -0
- package/dest/interfaces/get_tx_by_hash_options.d.ts.map +1 -0
- package/dest/interfaces/get_tx_by_hash_options.js +4 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +8 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +38 -9
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +14 -2
- package/dest/interfaces/private_kernel_prover.d.ts +71 -12
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +2 -3
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-node.d.ts +12 -8
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +24 -17
- package/dest/interfaces/proving-job.d.ts +17 -4
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +13 -4
- package/dest/interfaces/server.d.ts +1 -3
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +0 -2
- package/dest/interfaces/server_circuit_prover.d.ts +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/tx_provider.d.ts +5 -1
- package/dest/interfaces/tx_provider.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +15 -4
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +3 -1
- package/dest/interfaces/world_state.d.ts +14 -1
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
- package/dest/kernel/hints/index.d.ts +1 -2
- package/dest/kernel/hints/index.d.ts.map +1 -1
- package/dest/kernel/hints/index.js +0 -1
- package/dest/kernel/hints/read_request.js +1 -1
- package/dest/kernel/index.d.ts +6 -2
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +5 -1
- package/dest/kernel/log_hash.d.ts +1 -1
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +2 -2
- package/dest/kernel/note_hash.js +1 -1
- package/dest/kernel/nullifier.js +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +14 -7
- package/dest/kernel/private_context_inputs.d.ts +4 -3
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +7 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -9
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +10 -7
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts +24 -0
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_4_circuit_private_inputs.js +37 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts +25 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_init_5_circuit_private_inputs.js +39 -0
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts +18 -0
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_4_circuit_private_inputs.js +27 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts +19 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_inner_5_circuit_private_inputs.js +29 -0
- package/dest/kernel/private_kernel_prover_output.d.ts +4 -1
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_prover_output.js +4 -1
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
- package/dest/kernel/private_kernel_simulated_output.d.ts +1 -7
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/kernel/private_kernel_simulated_output.js +2 -1
- package/dest/kernel/private_log_data.d.ts +1 -1
- package/dest/kernel/private_log_data.d.ts.map +1 -1
- package/dest/kernel/private_log_data.js +1 -1
- package/dest/kernel/utils/index.d.ts +1 -2
- package/dest/kernel/utils/index.d.ts.map +1 -1
- package/dest/kernel/utils/index.js +0 -1
- package/dest/keys/derivation.d.ts +41 -6
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +49 -26
- package/dest/logs/app_tagging_secret.d.ts +30 -7
- package/dest/logs/app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/app_tagging_secret.js +46 -39
- package/dest/logs/app_tagging_secret_kind.d.ts +2 -1
- package/dest/logs/app_tagging_secret_kind.d.ts.map +1 -1
- package/dest/logs/app_tagging_secret_kind.js +13 -0
- package/dest/logs/contract_class_log.d.ts +1 -2
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +0 -4
- package/dest/logs/log_result.d.ts +3 -3
- package/dest/logs/log_result.d.ts.map +1 -1
- package/dest/logs/logs_query.d.ts +2 -2
- package/dest/logs/message_context.d.ts +4 -13
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +1 -62
- package/dest/logs/pending_tagged_log.d.ts +6 -8
- package/dest/logs/pending_tagged_log.d.ts.map +1 -1
- package/dest/logs/pending_tagged_log.js +1 -31
- package/dest/logs/shared_secret_derivation.d.ts +29 -6
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +44 -11
- package/dest/messaging/l1_to_l2_message.d.ts +23 -2
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message.js +36 -11
- package/dest/messaging/l2_to_l1_membership.d.ts +11 -4
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +22 -7
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.d.ts +1 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +8 -1
- package/dest/p2p/checkpoint_attestation.d.ts +10 -1
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +10 -0
- package/dest/p2p/checkpoint_proposal.d.ts +2 -1
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.d.ts +2 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -1
- package/dest/p2p/signature_utils.d.ts +10 -1
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +9 -1
- package/dest/rollup/avm_proof_data.d.ts +3 -3
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.d.ts +8 -3
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +20 -10
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +1 -27
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +10 -45
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -2
- package/dest/timetable/budgets.d.ts +57 -0
- package/dest/timetable/budgets.d.ts.map +1 -0
- package/dest/timetable/budgets.js +56 -0
- package/dest/timetable/build_proposer_timetable.d.ts +21 -0
- package/dest/timetable/build_proposer_timetable.d.ts.map +1 -0
- package/dest/timetable/build_proposer_timetable.js +17 -0
- package/dest/timetable/consensus_timetable.d.ts +70 -0
- package/dest/timetable/consensus_timetable.d.ts.map +1 -0
- package/dest/timetable/consensus_timetable.js +89 -0
- package/dest/timetable/index.d.ts +5 -87
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +4 -243
- package/dest/timetable/proposer_timetable.d.ts +106 -0
- package/dest/timetable/proposer_timetable.d.ts.map +1 -0
- package/dest/timetable/proposer_timetable.js +132 -0
- package/dest/trees/nullifier_membership_witness.d.ts +5 -8
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +0 -9
- package/dest/trees/public_data_witness.d.ts +7 -17
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +0 -27
- package/dest/tx/execution_payload.d.ts +1 -1
- package/dest/tx/execution_payload.d.ts.map +1 -1
- package/dest/tx/execution_payload.js +1 -1
- package/dest/tx/fee_provider.d.ts +2 -2
- package/dest/tx/fee_provider.d.ts.map +1 -1
- package/dest/tx/global_variable_builder.d.ts +2 -12
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.js +2 -2
- package/dest/tx/hashed_values.d.ts +7 -1
- package/dest/tx/hashed_values.d.ts.map +1 -1
- package/dest/tx/hashed_values.js +9 -1
- package/dest/tx/index.d.ts +1 -2
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/indexed_tx_effect.d.ts +5 -2
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +8 -4
- package/dest/tx/offchain_effect.js +1 -1
- package/dest/tx/private_tx_constant_data.d.ts +18 -2
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/private_tx_constant_data.js +13 -4
- package/dest/tx/profiling.d.ts +1 -1
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +2 -0
- package/dest/tx/simulated_tx.d.ts +10 -6
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +7 -2
- package/dest/tx/tx.d.ts +23 -1
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +32 -3
- package/dest/tx/tx_receipt.d.ts +143 -60
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +141 -45
- package/dest/tx/validator/error_texts.d.ts +2 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/dest/validators/errors.d.ts +16 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +12 -0
- package/dest/world-state/genesis_data.d.ts +9 -1
- package/dest/world-state/genesis_data.d.ts.map +1 -1
- package/dest/world-state/genesis_data.js +1 -0
- package/dest/world-state/world_state_revision.d.ts +1 -18
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +0 -20
- package/package.json +8 -8
- package/src/abi/abi.ts +32 -4
- package/src/abi/buffer.ts +13 -1
- package/src/abi/contract_artifact.ts +40 -16
- package/src/abi/decoder.ts +20 -24
- package/src/abi/function_call.ts +19 -7
- package/src/avm/avm.ts +5 -2
- package/src/avm/index.ts +0 -5
- package/src/aztec-address/index.ts +36 -6
- package/src/block/attestation_info.ts +7 -2
- package/src/block/l2_block_source.ts +95 -19
- package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +207 -0
- package/src/block/l2_block_stream/index.ts +1 -0
- package/src/block/l2_block_stream/interfaces.ts +98 -10
- package/src/block/l2_block_stream/l2_block_stream.ts +255 -177
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +12 -41
- package/src/block/l2_block_stream/l2_tips_store_base.ts +84 -93
- package/src/block/proposal/attestations_and_signers.ts +53 -7
- package/src/block/test/l2_tips_store_test_suite.ts +275 -28
- package/src/block/validate_block_result.ts +48 -2
- package/src/checkpoint/checkpoint.ts +2 -2
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/simulation_overrides.ts +171 -0
- package/src/checkpoint/validate.ts +16 -6
- package/src/config/index.ts +1 -1
- package/src/config/network-consensus-config.ts +291 -0
- package/src/config/node-rpc-config.ts +2 -1
- package/src/config/sequencer-config.ts +36 -5
- package/src/contract/artifact_hash.ts +15 -3
- package/src/contract/contract_address.ts +4 -3
- package/src/contract/contract_class.ts +3 -2
- package/src/contract/contract_instance.ts +62 -1
- package/src/contract/index.ts +0 -1
- package/src/contract/interfaces/contract_data_source.ts +2 -4
- package/src/contract/interfaces/contract_instance.ts +26 -8
- package/src/contract/interfaces/node-info.ts +11 -0
- package/src/contract/partial_address.ts +8 -2
- package/src/database-version/version_manager.ts +96 -6
- package/src/deserialization/index.ts +35 -2
- package/src/file-store/factory.ts +7 -0
- package/src/file-store/index.ts +1 -0
- package/src/file-store/memory.ts +94 -0
- package/src/gas/README.md +199 -35
- package/src/gas/gas_settings.ts +11 -21
- package/src/gas/index.ts +1 -0
- package/src/gas/tx_gas_limits.ts +123 -0
- package/src/ha-signing/config.ts +23 -5
- package/src/ha-signing/local_config.ts +20 -1
- package/src/hash/hash.ts +0 -8
- package/src/interfaces/api_limit.ts +5 -0
- package/src/interfaces/archiver.ts +22 -9
- package/src/interfaces/aztec-node-admin.ts +1 -1
- package/src/interfaces/aztec-node-debug.ts +54 -2
- package/src/interfaces/aztec-node.ts +175 -49
- package/src/interfaces/block-builder.ts +8 -1
- package/src/interfaces/block_response.ts +4 -4
- package/src/interfaces/chain_tips.ts +8 -16
- package/src/interfaces/checkpoint_parameter.ts +3 -3
- package/src/interfaces/checkpoint_response.ts +4 -4
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/configs.ts +33 -6
- package/src/interfaces/get_tx_by_hash_options.ts +14 -0
- package/src/interfaces/merkle_tree_operations.ts +8 -2
- package/src/interfaces/p2p.ts +29 -9
- package/src/interfaces/private_kernel_prover.ts +104 -13
- package/src/interfaces/prover-client.ts +1 -3
- package/src/interfaces/prover-node.ts +32 -17
- package/src/interfaces/proving-job.ts +15 -3
- package/src/interfaces/server.ts +0 -2
- package/src/interfaces/server_circuit_prover.ts +2 -2
- package/src/interfaces/tx_provider.ts +4 -0
- package/src/interfaces/validator.ts +11 -0
- package/src/interfaces/world_state.ts +14 -0
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
- package/src/kernel/hints/index.ts +0 -1
- package/src/kernel/hints/read_request.ts +1 -1
- package/src/kernel/index.ts +5 -1
- package/src/kernel/log_hash.ts +5 -2
- package/src/kernel/note_hash.ts +1 -1
- package/src/kernel/nullifier.ts +1 -1
- package/src/kernel/private_circuit_public_inputs.ts +12 -1
- package/src/kernel/private_context_inputs.ts +10 -3
- package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -7
- package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_4_circuit_private_inputs.ts +52 -0
- package/src/kernel/private_kernel_init_5_circuit_private_inputs.ts +55 -0
- package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
- package/src/kernel/private_kernel_inner_4_circuit_private_inputs.ts +39 -0
- package/src/kernel/private_kernel_inner_5_circuit_private_inputs.ts +42 -0
- package/src/kernel/private_kernel_prover_output.ts +4 -0
- package/src/kernel/private_kernel_reset_dimensions.ts +16 -6
- package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
- package/src/kernel/private_kernel_simulated_output.ts +0 -7
- package/src/kernel/private_log_data.ts +4 -1
- package/src/kernel/utils/index.ts +0 -1
- package/src/keys/derivation.ts +69 -24
- package/src/logs/app_tagging_secret.ts +62 -39
- package/src/logs/app_tagging_secret_kind.ts +15 -0
- package/src/logs/contract_class_log.ts +0 -9
- package/src/logs/log_result.ts +2 -2
- package/src/logs/logs_query.ts +2 -2
- package/src/logs/message_context.ts +6 -60
- package/src/logs/pending_tagged_log.ts +6 -33
- package/src/logs/shared_secret_derivation.ts +47 -14
- package/src/messaging/l1_to_l2_message.ts +51 -13
- package/src/messaging/l2_to_l1_membership.ts +28 -11
- package/src/noir/index.ts +2 -1
- package/src/p2p/attestation_utils.ts +8 -1
- package/src/p2p/checkpoint_attestation.ts +12 -0
- package/src/p2p/index.ts +0 -1
- package/src/p2p/signature_utils.ts +9 -0
- package/src/rollup/avm_proof_data.ts +2 -2
- package/src/rollup/checkpoint_header.ts +16 -2
- package/src/stats/stats.ts +6 -2
- package/src/tests/factories.ts +13 -51
- package/src/tests/mocks.ts +7 -2
- package/src/timetable/README.md +609 -0
- package/src/timetable/budgets.ts +87 -0
- package/src/timetable/build_proposer_timetable.ts +42 -0
- package/src/timetable/consensus_timetable.ts +126 -0
- package/src/timetable/index.ts +4 -361
- package/src/timetable/proposer_timetable.ts +190 -0
- package/src/timetable/timetable-example.svg +108 -0
- package/src/trees/nullifier_membership_witness.ts +0 -11
- package/src/trees/public_data_witness.ts +0 -31
- package/src/tx/execution_payload.ts +2 -1
- package/src/tx/fee_provider.ts +1 -1
- package/src/tx/global_variable_builder.ts +1 -17
- package/src/tx/global_variables.ts +2 -2
- package/src/tx/hashed_values.ts +11 -6
- package/src/tx/index.ts +0 -1
- package/src/tx/indexed_tx_effect.ts +17 -4
- package/src/tx/offchain_effect.ts +1 -1
- package/src/tx/private_tx_constant_data.ts +25 -2
- package/src/tx/profiling.ts +2 -0
- package/src/tx/simulated_tx.ts +13 -2
- package/src/tx/tx.ts +46 -3
- package/src/tx/tx_receipt.ts +263 -71
- package/src/tx/validator/error_texts.ts +2 -1
- package/src/validators/errors.ts +17 -0
- package/src/world-state/genesis_data.ts +10 -0
- package/src/world-state/world_state_revision.ts +0 -33
- package/dest/avm/contract_storage_read.d.ts +0 -58
- package/dest/avm/contract_storage_read.d.ts.map +0 -1
- package/dest/avm/contract_storage_read.js +0 -65
- package/dest/avm/contract_storage_update_request.d.ts +0 -65
- package/dest/avm/contract_storage_update_request.d.ts.map +0 -1
- package/dest/avm/contract_storage_update_request.js +0 -80
- package/dest/avm/public_call_stack_item_compressed.d.ts +0 -43
- package/dest/avm/public_call_stack_item_compressed.d.ts.map +0 -1
- package/dest/avm/public_call_stack_item_compressed.js +0 -70
- package/dest/avm/public_data_update_request.d.ts +0 -62
- package/dest/avm/public_data_update_request.d.ts.map +0 -1
- package/dest/avm/public_data_update_request.js +0 -67
- package/dest/avm/public_inner_call_request.d.ts +0 -50
- package/dest/avm/public_inner_call_request.d.ts.map +0 -1
- package/dest/avm/public_inner_call_request.js +0 -74
- package/dest/config/pipelining-config.d.ts +0 -15
- package/dest/config/pipelining-config.d.ts.map +0 -1
- package/dest/config/pipelining-config.js +0 -18
- package/dest/contract/deployment_info.d.ts +0 -24
- package/dest/contract/deployment_info.d.ts.map +0 -1
- package/dest/contract/deployment_info.js +0 -3
- package/dest/interfaces/epoch-prover.d.ts +0 -57
- package/dest/interfaces/epoch-prover.d.ts.map +0 -1
- package/dest/interfaces/epoch-prover.js +0 -1
- package/dest/interfaces/prover-coordination.d.ts +0 -15
- package/dest/interfaces/prover-coordination.d.ts.map +0 -1
- package/dest/interfaces/prover-coordination.js +0 -1
- package/dest/kernel/hints/tree_leaf_read_request.d.ts +0 -14
- package/dest/kernel/hints/tree_leaf_read_request.d.ts.map +0 -1
- package/dest/kernel/hints/tree_leaf_read_request.js +0 -33
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
- package/dest/kernel/utils/optional_number.d.ts +0 -31
- package/dest/kernel/utils/optional_number.d.ts.map +0 -1
- package/dest/kernel/utils/optional_number.js +0 -42
- package/dest/p2p/interface.d.ts +0 -5
- package/dest/p2p/interface.d.ts.map +0 -1
- package/dest/p2p/interface.js +0 -1
- package/dest/tx/validator/empty_validator.d.ts +0 -5
- package/dest/tx/validator/empty_validator.d.ts.map +0 -1
- package/dest/tx/validator/empty_validator.js +0 -7
- package/src/avm/contract_storage_read.ts +0 -77
- package/src/avm/contract_storage_update_request.ts +0 -93
- package/src/avm/public_call_stack_item_compressed.ts +0 -113
- package/src/avm/public_data_update_request.ts +0 -106
- package/src/avm/public_inner_call_request.ts +0 -85
- package/src/config/pipelining-config.ts +0 -31
- package/src/contract/deployment_info.ts +0 -25
- package/src/interfaces/epoch-prover.ts +0 -72
- package/src/interfaces/prover-coordination.ts +0 -17
- package/src/kernel/hints/tree_leaf_read_request.ts +0 -35
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
- package/src/kernel/utils/optional_number.ts +0 -50
- package/src/p2p/interface.ts +0 -4
- package/src/tx/validator/empty_validator.ts +0 -7
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
type ABIParameter,
|
|
14
14
|
type ABIParameterVisibility,
|
|
15
15
|
ARTIFACT_VERSION_BEFORE_INJECTION,
|
|
16
|
+
type AbiNamedValue,
|
|
16
17
|
type AbiType,
|
|
18
|
+
type AbiValue,
|
|
17
19
|
type BasicValue,
|
|
18
20
|
type ContractArtifact,
|
|
19
21
|
ContractArtifactSchema,
|
|
@@ -166,9 +168,9 @@ function generateFunctionAbi(fn: NoirCompiledContractFunction, contract: NoirCom
|
|
|
166
168
|
parameters = parameters.slice(1);
|
|
167
169
|
}
|
|
168
170
|
|
|
169
|
-
let
|
|
171
|
+
let returnType: AbiType | undefined;
|
|
170
172
|
if (functionType === FunctionType.UTILITY) {
|
|
171
|
-
|
|
173
|
+
returnType = fn.abi.return_type?.abi_type;
|
|
172
174
|
} else {
|
|
173
175
|
const pathToFind = `${contract.name}::${fn.name}_abi`;
|
|
174
176
|
const abiStructs: AbiType[] = contract.outputs.structs['functions'];
|
|
@@ -180,10 +182,7 @@ function generateFunctionAbi(fn: NoirCompiledContractFunction, contract: NoirCom
|
|
|
180
182
|
throw new Error('Could not generate contract function artifact');
|
|
181
183
|
}
|
|
182
184
|
|
|
183
|
-
|
|
184
|
-
if (returnTypeField) {
|
|
185
|
-
returnTypes = [returnTypeField.type];
|
|
186
|
-
}
|
|
185
|
+
returnType = returnStruct.fields.find(field => field.name === 'return_type')?.type;
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
|
|
@@ -194,7 +193,10 @@ function generateFunctionAbi(fn: NoirCompiledContractFunction, contract: NoirCom
|
|
|
194
193
|
isStatic,
|
|
195
194
|
isInitializer: fn.custom_attributes.includes(AZTEC_INITIALIZER_ATTRIBUTE),
|
|
196
195
|
parameters,
|
|
197
|
-
|
|
196
|
+
returnType,
|
|
197
|
+
// Old consumers expect `returnTypes` property, not `returnType`. So we write both down for now, until we can
|
|
198
|
+
// safely remove the old version.
|
|
199
|
+
returnTypes: returnType ? [returnType] : [],
|
|
198
200
|
errorTypes: fn.abi.error_types,
|
|
199
201
|
...(fn.assert_messages ? { assertMessages: fn.assert_messages } : undefined),
|
|
200
202
|
};
|
|
@@ -246,20 +248,24 @@ function hasKernelFunctionInputs(params: ABIParameter[]): boolean {
|
|
|
246
248
|
|
|
247
249
|
/**
|
|
248
250
|
* Generates a storage layout for the contract artifact.
|
|
249
|
-
* @param
|
|
251
|
+
* @param contractName - The name of the compiled Noir contract.
|
|
252
|
+
* @param globals - The normalized globals exported by the contract.
|
|
250
253
|
* @returns A storage layout for the contract.
|
|
251
254
|
*/
|
|
252
|
-
function getStorageLayout(
|
|
255
|
+
function getStorageLayout(contractName: string, globals: Record<string, AbiValue[]>) {
|
|
253
256
|
// If another contract is imported by the main contract, its storage layout its going to also show up here.
|
|
254
257
|
// The layout export includes the contract name, so here we can find the one that belongs to the current one and
|
|
255
258
|
// ignore the rest.
|
|
256
|
-
const storageExports =
|
|
257
|
-
const storageForContract = storageExports.find(storageExport => {
|
|
259
|
+
const storageExports = globals.storage ?? [];
|
|
260
|
+
const storageForContract = storageExports.find((storageExport): storageExport is StructValue => {
|
|
261
|
+
if (storageExport.kind !== 'struct') {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
258
264
|
const contractNameField = storageExport.fields.find(field => field.name === 'contract_name')?.value as BasicValue<
|
|
259
265
|
'string',
|
|
260
266
|
string
|
|
261
267
|
>;
|
|
262
|
-
return contractNameField.value ===
|
|
268
|
+
return contractNameField.value === contractName;
|
|
263
269
|
});
|
|
264
270
|
const storageFields = storageForContract
|
|
265
271
|
? ((storageForContract.fields.find(field => field.name == 'fields') as TypedStructFieldValue<StructValue>).value
|
|
@@ -280,6 +286,22 @@ function getStorageLayout(input: NoirCompiledContract) {
|
|
|
280
286
|
}, {});
|
|
281
287
|
}
|
|
282
288
|
|
|
289
|
+
function isAbiNamedValue(value: AbiNamedValue | AbiValue): value is AbiNamedValue {
|
|
290
|
+
return 'name' in value;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function normalizeContractOutputs(outputs: NoirCompiledContract['outputs']): ContractArtifact['outputs'] {
|
|
294
|
+
return {
|
|
295
|
+
structs: outputs.structs,
|
|
296
|
+
globals: Object.fromEntries(
|
|
297
|
+
Object.entries(outputs.globals).map(([tag, values]) => [
|
|
298
|
+
tag,
|
|
299
|
+
values.map(value => (isAbiNamedValue(value) ? value.value : value)),
|
|
300
|
+
]),
|
|
301
|
+
),
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
|
|
283
305
|
/**
|
|
284
306
|
* Given a post-processed Nargo output defined as `contract` generates an Aztec-compatible contract artifact.
|
|
285
307
|
*
|
|
@@ -290,6 +312,7 @@ function generateContractArtifact(contract: NoirCompiledContract): ContractArtif
|
|
|
290
312
|
if (!contract.transpiled) {
|
|
291
313
|
throw new Error("Contract's public bytecode has not been transpiled");
|
|
292
314
|
}
|
|
315
|
+
const outputs = normalizeContractOutputs(contract.outputs);
|
|
293
316
|
return ContractArtifactSchema.parse({
|
|
294
317
|
name: contract.name,
|
|
295
318
|
aztecVersion: contract.aztec_version,
|
|
@@ -297,8 +320,8 @@ function generateContractArtifact(contract: NoirCompiledContract): ContractArtif
|
|
|
297
320
|
nonDispatchPublicFunctions: contract.functions
|
|
298
321
|
.filter(f => !retainBytecode(f))
|
|
299
322
|
.map(f => generateFunctionAbi(f, contract)),
|
|
300
|
-
outputs
|
|
301
|
-
storageLayout: getStorageLayout(contract),
|
|
323
|
+
outputs,
|
|
324
|
+
storageLayout: getStorageLayout(contract.name, outputs.globals),
|
|
302
325
|
fileMap: contract.file_map,
|
|
303
326
|
});
|
|
304
327
|
} catch (err) {
|
|
@@ -313,6 +336,7 @@ function generateContractArtifact(contract: NoirCompiledContract): ContractArtif
|
|
|
313
336
|
*/
|
|
314
337
|
function generateContractArtifactForPublic(contract: NoirCompiledContract): ContractArtifact {
|
|
315
338
|
try {
|
|
339
|
+
const outputs = normalizeContractOutputs(contract.outputs);
|
|
316
340
|
return ContractArtifactSchema.parse({
|
|
317
341
|
name: contract.name,
|
|
318
342
|
aztecVersion: contract.aztec_version,
|
|
@@ -320,8 +344,8 @@ function generateContractArtifactForPublic(contract: NoirCompiledContract): Cont
|
|
|
320
344
|
nonDispatchPublicFunctions: contract.functions
|
|
321
345
|
.filter(f => !retainBytecode(f))
|
|
322
346
|
.map(f => generateFunctionAbi(f, contract)),
|
|
323
|
-
outputs
|
|
324
|
-
storageLayout: getStorageLayout(contract),
|
|
347
|
+
outputs,
|
|
348
|
+
storageLayout: getStorageLayout(contract.name, outputs.globals),
|
|
325
349
|
fileMap: contract.file_map,
|
|
326
350
|
});
|
|
327
351
|
} catch (err) {
|
package/src/abi/decoder.ts
CHANGED
|
@@ -32,17 +32,14 @@ export type AbiDecoded =
|
|
|
32
32
|
* Decodes values using a provided ABI.
|
|
33
33
|
*/
|
|
34
34
|
class AbiDecoder {
|
|
35
|
-
constructor(
|
|
36
|
-
private types: AbiType[],
|
|
37
|
-
private flattened: Fr[],
|
|
38
|
-
) {}
|
|
35
|
+
constructor(private flattened: Fr[]) {}
|
|
39
36
|
|
|
40
37
|
/**
|
|
41
|
-
* Decodes a single
|
|
42
|
-
* @param abiType - The type of the
|
|
43
|
-
* @returns The decoded
|
|
38
|
+
* Decodes a single value from field to the given type.
|
|
39
|
+
* @param abiType - The type of the value.
|
|
40
|
+
* @returns The decoded value.
|
|
44
41
|
*/
|
|
45
|
-
|
|
42
|
+
public decodeNext(abiType: AbiType): AbiDecoded {
|
|
46
43
|
switch (abiType.kind) {
|
|
47
44
|
case 'field':
|
|
48
45
|
return this.getNextField().toBigInt();
|
|
@@ -121,26 +118,25 @@ class AbiDecoder {
|
|
|
121
118
|
}
|
|
122
119
|
return field;
|
|
123
120
|
}
|
|
121
|
+
}
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
134
|
-
return this.types.map(type => this.decodeNext(type));
|
|
135
|
-
}
|
|
123
|
+
/**
|
|
124
|
+
* Decodes the single value a function returns, or undefined if it returns nothing. Multiple return values are expressed
|
|
125
|
+
* as one `tuple` type, so they decode through here too.
|
|
126
|
+
* @param type - The type the function returns.
|
|
127
|
+
* @param buffer - The flattened Field array to decode.
|
|
128
|
+
*/
|
|
129
|
+
export function decodeFromAbi(type: AbiType | undefined, buffer: Fr[]): AbiDecoded {
|
|
130
|
+
return type === undefined ? undefined : new AbiDecoder(buffer.slice()).decodeNext(type);
|
|
136
131
|
}
|
|
137
132
|
|
|
138
133
|
/**
|
|
139
|
-
* Decodes
|
|
140
|
-
*
|
|
134
|
+
* Decodes one value per given type, consumed from the buffer in order. Always returns one decoded value per type, so
|
|
135
|
+
* callers can index the result positionally. A function's arguments are encoded this way.
|
|
136
|
+
* @param types - The type of each value, in order.
|
|
141
137
|
* @param buffer - The flattened Field array to decode.
|
|
142
|
-
* @returns
|
|
143
138
|
*/
|
|
144
|
-
export function
|
|
145
|
-
|
|
139
|
+
export function decodeEachFromAbi(types: AbiType[], buffer: Fr[]): AbiDecoded[] {
|
|
140
|
+
const decoder = new AbiDecoder(buffer.slice());
|
|
141
|
+
return types.map(type => decoder.decodeNext(type));
|
|
146
142
|
}
|
package/src/abi/function_call.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from 'zod';
|
|
|
5
5
|
|
|
6
6
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
7
|
import { schemas } from '../schemas/index.js';
|
|
8
|
-
import { type AbiType, AbiTypeSchema, FunctionType } from './abi.js';
|
|
8
|
+
import { type AbiType, AbiTypeSchema, FunctionType, getFunctionReturnType } from './abi.js';
|
|
9
9
|
import { FunctionSelector } from './function_selector.js';
|
|
10
10
|
|
|
11
11
|
/** A request to call a function on a contract. */
|
|
@@ -25,8 +25,8 @@ export class FunctionCall {
|
|
|
25
25
|
public isStatic: boolean,
|
|
26
26
|
/** The encoded args */
|
|
27
27
|
public args: Fr[],
|
|
28
|
-
/** The
|
|
29
|
-
public
|
|
28
|
+
/** The type the call returns, for decoding, or undefined if it returns nothing */
|
|
29
|
+
public returnType?: AbiType,
|
|
30
30
|
) {}
|
|
31
31
|
|
|
32
32
|
static getFields(fields: FieldsOf<FunctionCall>) {
|
|
@@ -38,7 +38,7 @@ export class FunctionCall {
|
|
|
38
38
|
fields.hideMsgSender,
|
|
39
39
|
fields.isStatic,
|
|
40
40
|
fields.args,
|
|
41
|
-
fields.
|
|
41
|
+
fields.returnType,
|
|
42
42
|
] as const;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -56,9 +56,22 @@ export class FunctionCall {
|
|
|
56
56
|
isStatic: z.boolean(),
|
|
57
57
|
hideMsgSender: z.boolean(),
|
|
58
58
|
args: z.array(schemas.Fr),
|
|
59
|
-
|
|
59
|
+
returnType: AbiTypeSchema.optional(),
|
|
60
|
+
// Old consumers send `returnTypes`, not `returnType`. So we accept both for now, until we can safely remove
|
|
61
|
+
// the old version.
|
|
62
|
+
returnTypes: z.array(AbiTypeSchema).optional(),
|
|
60
63
|
})
|
|
61
|
-
.transform(
|
|
64
|
+
.transform(({ returnType, returnTypes, ...fields }) =>
|
|
65
|
+
FunctionCall.from({ ...fields, returnType: getFunctionReturnType({ returnType, returnTypes }) }),
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Serializes the deprecated `returnTypes` alongside `returnType`, so that peers that still require the old field can
|
|
71
|
+
* parse calls sent by this version.
|
|
72
|
+
*/
|
|
73
|
+
public toJSON() {
|
|
74
|
+
return { ...this, returnTypes: this.returnType ? [this.returnType] : [] };
|
|
62
75
|
}
|
|
63
76
|
|
|
64
77
|
public isPublicStatic(): boolean {
|
|
@@ -78,7 +91,6 @@ export class FunctionCall {
|
|
|
78
91
|
hideMsgSender: false,
|
|
79
92
|
isStatic: false,
|
|
80
93
|
args: [],
|
|
81
|
-
returnTypes: [],
|
|
82
94
|
});
|
|
83
95
|
}
|
|
84
96
|
}
|
package/src/avm/avm.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DEFAULT_MAX_DEBUG_LOG_MEMORY_READS } from '@aztec/constants';
|
|
2
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
2
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
3
|
|
|
@@ -1152,7 +1151,7 @@ export class CallStackMetadata {
|
|
|
1152
1151
|
|
|
1153
1152
|
const { stack, leaf } = failingCall;
|
|
1154
1153
|
const aztecCallStack = stack.map(call => ({
|
|
1155
|
-
contractAddress: AztecAddress.
|
|
1154
|
+
contractAddress: AztecAddress.fromFieldUnsafe(call.contractAddress),
|
|
1156
1155
|
functionSelector: call.calldata.length > 0 ? FunctionSelector.fromFieldOrUndefined(call.calldata[0]) : undefined,
|
|
1157
1156
|
}));
|
|
1158
1157
|
|
|
@@ -1384,6 +1383,10 @@ export class PublicTxResult {
|
|
|
1384
1383
|
}
|
|
1385
1384
|
}
|
|
1386
1385
|
|
|
1386
|
+
// Excessive memory reads due to debug logging can open a DOS vector to nodes that perform public tx simulation for users.
|
|
1387
|
+
// This default limit (4MB) can be configured further by node runners via the `RPC_SIMULATE_PUBLIC_MAX_DEBUG_LOG_MEMORY_READS` environment variable.
|
|
1388
|
+
export const DEFAULT_MAX_DEBUG_LOG_MEMORY_READS = 125000;
|
|
1389
|
+
|
|
1387
1390
|
export class CollectionLimitsConfig {
|
|
1388
1391
|
constructor(
|
|
1389
1392
|
public readonly maxDebugLogMemoryReads: number,
|
package/src/avm/index.ts
CHANGED
|
@@ -3,10 +3,5 @@ export * from './avm_accumulated_data.js';
|
|
|
3
3
|
export * from './avm_circuit_public_inputs.js';
|
|
4
4
|
export * from './revert_code.js';
|
|
5
5
|
export * from './public_data_write.js';
|
|
6
|
-
export * from './public_data_update_request.js';
|
|
7
|
-
export * from './contract_storage_update_request.js';
|
|
8
|
-
export * from './contract_storage_read.js';
|
|
9
|
-
export * from './public_inner_call_request.js';
|
|
10
|
-
export * from './public_call_stack_item_compressed.js';
|
|
11
6
|
export * from './avm_proving_request.js';
|
|
12
7
|
export * from './message_pack.js';
|
|
@@ -43,34 +43,64 @@ export class AztecAddress {
|
|
|
43
43
|
static ZERO = new AztecAddress(Buffer.alloc(32, 0));
|
|
44
44
|
|
|
45
45
|
/** Null msg sender address. Not part of the protocol contracts tree. */
|
|
46
|
-
static NULL_MSG_SENDER = AztecAddress.
|
|
46
|
+
static NULL_MSG_SENDER = AztecAddress.fromBigIntUnsafe(NULL_MSG_SENDER_CONTRACT_ADDRESS);
|
|
47
47
|
|
|
48
48
|
static zero(): AztecAddress {
|
|
49
49
|
return AztecAddress.ZERO;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Builds an `AztecAddress` from a field **without checking it is a valid address** (the x-coordinate of a point on
|
|
54
|
+
* the Grumpkin curve, which is what lets it be encrypted to). Use {@link AztecAddress.isValid} to validate an
|
|
55
|
+
* untrusted one, or {@link AztecAddress.random} for valid test addresses.
|
|
56
|
+
*/
|
|
57
|
+
static fromFieldUnsafe(fr: Fr) {
|
|
53
58
|
return new AztecAddress(fr);
|
|
54
59
|
}
|
|
55
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Deserializes an `AztecAddress` from a buffer. It does **not** check the value is a valid Grumpkin-curve address
|
|
63
|
+
* (see {@link AztecAddress.isValid}); it is meant for reading addresses from already-validated serialized data. Use
|
|
64
|
+
* {@link AztecAddress.random} for valid test addresses.
|
|
65
|
+
*/
|
|
56
66
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
57
67
|
return new AztecAddress(fromBuffer(buffer, Fr));
|
|
58
68
|
}
|
|
59
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Deserializes an `AztecAddress` from a field reader. It does **not** check the value is a valid Grumpkin-curve
|
|
72
|
+
* address (see {@link AztecAddress.isValid}); it is meant for reading addresses from already-validated serialized
|
|
73
|
+
* data. Use {@link AztecAddress.random} for valid test addresses.
|
|
74
|
+
*/
|
|
60
75
|
static fromFields(fields: Fr[] | FieldReader) {
|
|
61
76
|
const reader = FieldReader.asReader(fields);
|
|
62
77
|
return new AztecAddress(reader.readField());
|
|
63
78
|
}
|
|
64
79
|
|
|
65
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Builds an `AztecAddress` from a bigint **without checking it is a valid address** (the x-coordinate of a point on
|
|
82
|
+
* the Grumpkin curve, which is what lets it be encrypted to). Use {@link AztecAddress.isValid} to validate an
|
|
83
|
+
* untrusted one, or {@link AztecAddress.random} for valid test addresses.
|
|
84
|
+
*/
|
|
85
|
+
static fromBigIntUnsafe(value: bigint) {
|
|
66
86
|
return new AztecAddress(new Fr(value));
|
|
67
87
|
}
|
|
68
88
|
|
|
69
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Builds an `AztecAddress` from a number **without checking it is a valid address** (the x-coordinate of a point on
|
|
91
|
+
* the Grumpkin curve, which is what lets it be encrypted to). Use {@link AztecAddress.isValid} to validate an
|
|
92
|
+
* untrusted one, or {@link AztecAddress.random} for valid test addresses.
|
|
93
|
+
*/
|
|
94
|
+
static fromNumberUnsafe(value: number) {
|
|
70
95
|
return new AztecAddress(new Fr(value));
|
|
71
96
|
}
|
|
72
97
|
|
|
73
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Builds an `AztecAddress` from a hex string **without checking it is a valid address** (the x-coordinate of a
|
|
100
|
+
* point on the Grumpkin curve, which is what lets it be encrypted to). Use {@link AztecAddress.isValid} to
|
|
101
|
+
* validate an untrusted one, or {@link AztecAddress.random} for valid test addresses.
|
|
102
|
+
*/
|
|
103
|
+
static fromStringUnsafe(buf: string) {
|
|
74
104
|
return new AztecAddress(hexToBuffer(buf));
|
|
75
105
|
}
|
|
76
106
|
|
|
@@ -89,7 +119,7 @@ export class AztecAddress {
|
|
|
89
119
|
if (obj instanceof Buffer || Buffer.isBuffer(obj)) {
|
|
90
120
|
return new AztecAddress(obj);
|
|
91
121
|
}
|
|
92
|
-
return AztecAddress.
|
|
122
|
+
return AztecAddress.fromStringUnsafe(obj);
|
|
93
123
|
}
|
|
94
124
|
|
|
95
125
|
/**
|
|
@@ -60,9 +60,14 @@ export function getAttestationInfoFromPayload(
|
|
|
60
60
|
return { address: attestation.address, status: 'provided-as-address' as const };
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
// Try to recover address from signature
|
|
63
|
+
// Try to recover address from signature. Recover with default opts (no allowYParityAsV): a slot
|
|
64
|
+
// whose recovery byte is in yParity form (v ∈ {0, 1}) is judged invalid here, matching L1 proving
|
|
65
|
+
// (ValidatorSelectionLib.verifyAttestations → ECDSA.recover only accepts v ∈ {27, 28}). A malicious
|
|
66
|
+
// proposer that lands such a slot cannot have it silently treated as valid off-chain; it is routed to
|
|
67
|
+
// invalid-attestation and invalidated. The gossip receipt path (recoverCoordinationSigner) stays
|
|
68
|
+
// lenient with allowYParityAsV; A-1351 normalizes on pool ingress and before the L1 bundle.
|
|
64
69
|
try {
|
|
65
|
-
const recoveredAddress = recoverAddress(hashedPayload, attestation.signature
|
|
70
|
+
const recoveredAddress = recoverAddress(hashedPayload, attestation.signature);
|
|
66
71
|
return { address: recoveredAddress, status: 'recovered-from-signature' as const };
|
|
67
72
|
} catch {
|
|
68
73
|
// Signature present but recovery failed
|
|
@@ -19,10 +19,11 @@ import type { CheckpointData, ProposedCheckpointData, ProposedCheckpointInput }
|
|
|
19
19
|
import type { CheckpointInfo } from '../checkpoint/checkpoint_info.js';
|
|
20
20
|
import type { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
21
21
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
22
|
+
import { MAX_RPC_CHECKPOINTS_DATA_LEN } from '../interfaces/api_limit.js';
|
|
23
|
+
import type { L2ToL1MembershipWitness } from '../messaging/l2_to_l1_membership.js';
|
|
22
24
|
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
23
25
|
import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
|
|
24
26
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
25
|
-
import type { TxReceipt } from '../tx/tx_receipt.js';
|
|
26
27
|
import type { BlockData } from './block_data.js';
|
|
27
28
|
import { BlockHash } from './block_hash.js';
|
|
28
29
|
import { BlockTagWithoutLatestSchema, type NormalizedBlockParameter } from './block_parameter.js';
|
|
@@ -63,8 +64,18 @@ export type CheckpointQuery =
|
|
|
63
64
|
| { slot: SlotNumber }
|
|
64
65
|
| { tag: 'checkpointed' | 'proven' | 'finalized' };
|
|
65
66
|
|
|
66
|
-
/**
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Query a range of confirmed checkpoints by start/limit, by slot anchor, or by epoch.
|
|
69
|
+
*
|
|
70
|
+
* The `fromSlot` variant walks the slot index: it returns up to `limit` checkpoints anchored at
|
|
71
|
+
* `fromSlot`, ordered nearest-first. With `reverse` it takes the checkpoints at or before the slot
|
|
72
|
+
* (descending); otherwise the checkpoints at or after it (ascending). Use `limit: 1, reverse: true`
|
|
73
|
+
* to find the latest checkpoint at or before a slot in a single range scan.
|
|
74
|
+
*/
|
|
75
|
+
export type CheckpointsQuery =
|
|
76
|
+
| { from: CheckpointNumber; limit: number }
|
|
77
|
+
| { fromSlot: SlotNumber; limit: number; reverse?: boolean }
|
|
78
|
+
| { epoch: EpochNumber };
|
|
68
79
|
|
|
69
80
|
/**
|
|
70
81
|
* Lookup a proposed (archiver-internal, not-yet-L1-confirmed) checkpoint.
|
|
@@ -79,8 +90,20 @@ export const CheckpointQuerySchema: z.ZodType<CheckpointQuery, unknown> = z.unio
|
|
|
79
90
|
z.object({ tag: z.union([z.literal('checkpointed'), z.literal('proven'), z.literal('finalized')]) }).strict(),
|
|
80
91
|
]);
|
|
81
92
|
|
|
93
|
+
const checkpointsQueryLimitSchema = () =>
|
|
94
|
+
z
|
|
95
|
+
.number()
|
|
96
|
+
.int()
|
|
97
|
+
.min(1)
|
|
98
|
+
.max(MAX_RPC_CHECKPOINTS_DATA_LEN, {
|
|
99
|
+
message: `limit must be at most ${MAX_RPC_CHECKPOINTS_DATA_LEN}`,
|
|
100
|
+
});
|
|
101
|
+
|
|
82
102
|
export const CheckpointsQuerySchema: z.ZodType<CheckpointsQuery, unknown> = z.union([
|
|
83
|
-
z.object({ from: CheckpointNumberSchema, limit:
|
|
103
|
+
z.object({ from: CheckpointNumberSchema, limit: checkpointsQueryLimitSchema() }).strict(),
|
|
104
|
+
z
|
|
105
|
+
.object({ fromSlot: SlotNumberSchema, limit: checkpointsQueryLimitSchema(), reverse: z.boolean().optional() })
|
|
106
|
+
.strict(),
|
|
84
107
|
z.object({ epoch: EpochNumberSchema }).strict(),
|
|
85
108
|
]);
|
|
86
109
|
|
|
@@ -162,11 +185,21 @@ export interface L2BlockSource {
|
|
|
162
185
|
getTxEffect(txHash: TxHash): Promise<IndexedTxEffect | undefined>;
|
|
163
186
|
|
|
164
187
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
188
|
+
* Returns the L2-to-L1 membership witness for `message` emitted by tx `txHash`, built against the
|
|
189
|
+
* smallest partial-proof root on the Outbox that covers the tx's checkpoint.
|
|
190
|
+
*
|
|
191
|
+
* The Outbox roots are read lazily, pinned to the node's synced L1 block, so the witness reflects
|
|
192
|
+
* the node's synced view. Returns `undefined` if the tx isn't yet in a block/epoch or no covering
|
|
193
|
+
* root has landed on L1 as of the synced block.
|
|
194
|
+
*
|
|
195
|
+
* Caveat: cached roots that are sealed and L1-finalized are not re-validated. A reorg deeper than
|
|
196
|
+
* L1 finality could leave the node serving a witness against a no-longer-canonical root.
|
|
168
197
|
*/
|
|
169
|
-
|
|
198
|
+
getL2ToL1MembershipWitness(
|
|
199
|
+
txHash: TxHash,
|
|
200
|
+
message: Fr,
|
|
201
|
+
messageIndexInTx?: number,
|
|
202
|
+
): Promise<L2ToL1MembershipWitness | undefined>;
|
|
170
203
|
|
|
171
204
|
/**
|
|
172
205
|
* Returns the last L2 slot number for which we have all L1 data needed to build the next checkpoint.
|
|
@@ -231,7 +264,10 @@ export interface L2BlockSource {
|
|
|
231
264
|
|
|
232
265
|
/**
|
|
233
266
|
* Looks up a proposed (archiver-internal, not-yet-L1-confirmed) checkpoint.
|
|
234
|
-
* Returns the latest proposed entry when called with no args or `{ tag: 'proposed' }
|
|
267
|
+
* Returns the latest proposed entry when called with no args or `{ tag: 'proposed' }`; since a
|
|
268
|
+
* proposed entry can only be stored with a checkpoint number beyond the confirmed frontier (and is
|
|
269
|
+
* deleted on confirmation), the latest entry is always the leading one. Callers derive the proposed
|
|
270
|
+
* tip from the payload (checkpoint number, and last block `startBlock + blockCount - 1`).
|
|
235
271
|
* With `{ number }` or `{ slot }`, returns the matching entry or undefined.
|
|
236
272
|
* Never falls back to confirmed checkpoints.
|
|
237
273
|
*/
|
|
@@ -311,36 +347,37 @@ export type ArchiverEmitter = TypedEventEmitter<{
|
|
|
311
347
|
[L2BlockSourceEvents.DescendentOfInvalidAttestationsCheckpointDetected]: (
|
|
312
348
|
args: DescendentOfInvalidAttestationsCheckpointEvent,
|
|
313
349
|
) => void;
|
|
350
|
+
[L2BlockSourceEvents.L2BlockSourceUpdated]: (args: L2BlockSourceUpdatedEvent) => void;
|
|
314
351
|
}>;
|
|
315
352
|
export interface L2BlockSourceEventEmitter extends L2BlockSource {
|
|
316
353
|
events: ArchiverEmitter;
|
|
317
354
|
}
|
|
318
355
|
|
|
319
356
|
/**
|
|
320
|
-
* Identifier for L2 block tags. Internal counterpart to {@link BlockTag} that
|
|
321
|
-
*
|
|
322
|
-
* archiver side) and omits `latest` (which is an alias for `proposed` accepted only at
|
|
323
|
-
* the public RPC surface).
|
|
357
|
+
* Identifier for L2 block tags. Internal counterpart to {@link BlockTag} that omits `latest`
|
|
358
|
+
* (which is an alias for `proposed` accepted only at the public RPC surface).
|
|
324
359
|
*
|
|
325
360
|
* - proposed: Latest block proposed on L2.
|
|
326
|
-
* - proposedCheckpoint: Latest block in the most recent proposed checkpoint (archiver-internal).
|
|
327
361
|
* - checkpointed: Latest block whose enclosing checkpoint has been published on L1.
|
|
328
362
|
* - proven: Latest block whose enclosing checkpoint has been proven on L1.
|
|
329
363
|
* - finalized: Latest block whose proving L1 transaction has reached L1 finality.
|
|
330
|
-
*
|
|
331
|
-
* TODO(palla): Remove `proposedCheckpoint` and unify with `proposed`.
|
|
332
364
|
*/
|
|
333
|
-
export type L2BlockTag = 'proposed' | '
|
|
365
|
+
export type L2BlockTag = 'proposed' | 'checkpointed' | 'proven' | 'finalized';
|
|
334
366
|
|
|
335
367
|
/** Tips of the L2 chain. */
|
|
336
368
|
export type L2Tips = {
|
|
337
369
|
proposed: L2BlockId;
|
|
338
370
|
checkpointed: L2TipId;
|
|
339
|
-
proposedCheckpoint: L2TipId;
|
|
340
371
|
proven: L2TipId;
|
|
341
372
|
finalized: L2TipId;
|
|
342
373
|
};
|
|
343
374
|
|
|
375
|
+
/**
|
|
376
|
+
* Tips of the L2 chain as tracked by a local provider (world-state, l2-tips-store). Identical to
|
|
377
|
+
* {@link L2Tips}; the alias is retained for call sites that document a local-only provenance.
|
|
378
|
+
*/
|
|
379
|
+
export type LocalL2Tips = L2Tips;
|
|
380
|
+
|
|
344
381
|
export const GENESIS_CHECKPOINT_HEADER_HASH = CheckpointHeader.empty().hash();
|
|
345
382
|
|
|
346
383
|
/** Identifies a block by number and hash. */
|
|
@@ -363,6 +400,28 @@ export function makeL2CheckpointId(number: CheckpointNumber, hash: string): Chec
|
|
|
363
400
|
return { number, hash };
|
|
364
401
|
}
|
|
365
402
|
|
|
403
|
+
function l2BlockIdEquals(a: L2BlockId, b: L2BlockId): boolean {
|
|
404
|
+
return a.number === b.number && a.hash === b.hash;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function l2TipIdEquals(a: L2TipId, b: L2TipId): boolean {
|
|
408
|
+
return (
|
|
409
|
+
l2BlockIdEquals(a.block, b.block) &&
|
|
410
|
+
a.checkpoint.number === b.checkpoint.number &&
|
|
411
|
+
a.checkpoint.hash === b.checkpoint.hash
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** Returns whether two {@link L2Tips} snapshots agree on every tier (proposed, checkpointed, proven, finalized). */
|
|
416
|
+
export function l2TipsEqual(a: L2Tips, b: L2Tips): boolean {
|
|
417
|
+
return (
|
|
418
|
+
l2BlockIdEquals(a.proposed, b.proposed) &&
|
|
419
|
+
l2TipIdEquals(a.checkpointed, b.checkpointed) &&
|
|
420
|
+
l2TipIdEquals(a.proven, b.proven) &&
|
|
421
|
+
l2TipIdEquals(a.finalized, b.finalized)
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
|
|
366
425
|
const L2BlockIdSchema = z.object({
|
|
367
426
|
number: BlockNumberSchema,
|
|
368
427
|
hash: z.string(),
|
|
@@ -381,7 +440,6 @@ const L2TipIdSchema = z.object({
|
|
|
381
440
|
export const L2TipsSchema = z.object({
|
|
382
441
|
proposed: L2BlockIdSchema,
|
|
383
442
|
checkpointed: L2TipIdSchema,
|
|
384
|
-
proposedCheckpoint: L2TipIdSchema,
|
|
385
443
|
proven: L2TipIdSchema,
|
|
386
444
|
finalized: L2TipIdSchema,
|
|
387
445
|
});
|
|
@@ -394,8 +452,26 @@ export enum L2BlockSourceEvents {
|
|
|
394
452
|
InvalidAttestationsCheckpointDetected = 'invalidCheckpointDetected',
|
|
395
453
|
CheckpointEquivocationDetected = 'checkpointEquivocationDetected',
|
|
396
454
|
DescendentOfInvalidAttestationsCheckpointDetected = 'descendentOfInvalidAttestationsCheckpointDetected',
|
|
455
|
+
L2BlockSourceUpdated = 'l2BlockSourceUpdated',
|
|
397
456
|
}
|
|
398
457
|
|
|
458
|
+
/**
|
|
459
|
+
* Aggregate event emitted once per committed archiver sync pass that mutated local state. Carries the chain tips
|
|
460
|
+
* before and after the pass, and the blocks added during it. Consumers compare `fromTips` and `toTips` to learn what
|
|
461
|
+
* moved; there is no separate `changed` section.
|
|
462
|
+
*
|
|
463
|
+
* This is an optimization signal that lets a block stream reconcile immediately on an archiver update rather than
|
|
464
|
+
* waiting for its next poll. Polling remains the correctness fallback, so a missed event only affects latency.
|
|
465
|
+
* `blocksAdded` are hydrated blocks already in hand from the sync pass, so a triggered sync that is caught up to
|
|
466
|
+
* `fromTips` can reuse them (and `toTips`) instead of re-reading the store.
|
|
467
|
+
*/
|
|
468
|
+
export type L2BlockSourceUpdatedEvent = {
|
|
469
|
+
type: 'l2BlockSourceUpdated';
|
|
470
|
+
fromTips: L2Tips;
|
|
471
|
+
toTips: L2Tips;
|
|
472
|
+
blocksAdded: readonly L2Block[];
|
|
473
|
+
};
|
|
474
|
+
|
|
399
475
|
export type L2BlockProvenEvent = {
|
|
400
476
|
type: 'l2BlockProven';
|
|
401
477
|
blockNumber: BlockNumber;
|