@aztec/stdlib 0.0.1-commit.f504929 → 0.0.1-commit.f650c0a5c
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 +138 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +10 -2
- 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/decoder.d.ts +5 -44
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +12 -67
- package/dest/abi/function_selector.js +1 -1
- 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/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/avm/avm.d.ts +300 -300
- package/dest/avm/revert_code.d.ts +8 -18
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +15 -30
- package/dest/block/l2_block.d.ts +9 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +12 -2
- package/dest/block/l2_block_source.d.ts +95 -10
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +1 -0
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +1 -1
- 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 +17 -4
- 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 +3 -2
- package/dest/checkpoint/checkpoint.d.ts +8 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +18 -5
- package/dest/checkpoint/checkpoint_data.d.ts +71 -5
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +10 -0
- 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/validate.d.ts +36 -0
- package/dest/checkpoint/validate.d.ts.map +1 -0
- package/dest/checkpoint/validate.js +120 -0
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/pipelining-config.d.ts +19 -0
- package/dest/config/pipelining-config.d.ts.map +1 -0
- package/dest/config/pipelining-config.js +18 -0
- package/dest/config/sequencer-config.d.ts +2 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +1 -2
- package/dest/contract/contract_address.d.ts +3 -3
- package/dest/contract/contract_address.js +3 -3
- package/dest/contract/contract_class_id.d.ts +2 -2
- package/dest/contract/contract_class_id.js +2 -2
- 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 +3 -156
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +1 -28
- package/dest/epoch-helpers/index.d.ts +11 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +16 -2
- 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/gas_settings.d.ts +40 -3
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +50 -6
- package/dest/ha-signing/config.d.ts +49 -14
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +20 -15
- package/dest/ha-signing/index.d.ts +3 -2
- package/dest/ha-signing/index.d.ts.map +1 -1
- package/dest/ha-signing/index.js +2 -1
- package/dest/ha-signing/local_config.d.ts +63 -0
- package/dest/ha-signing/local_config.d.ts.map +1 -0
- package/dest/ha-signing/local_config.js +24 -0
- package/dest/hash/hash.d.ts +19 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +29 -0
- package/dest/interfaces/allowed_element.d.ts +25 -1
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +8 -2
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +6 -3
- package/dest/interfaces/aztec-node-admin.d.ts +73 -23
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +3 -3
- package/dest/interfaces/aztec-node.d.ts +12 -6
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +5 -2
- package/dest/interfaces/block-builder.d.ts +38 -11
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +12 -5
- package/dest/interfaces/configs.d.ts +47 -7
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +3 -1
- package/dest/interfaces/l2_logs_source.d.ts +5 -3
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +9 -19
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +6 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +7 -1
- package/dest/interfaces/proving-job.d.ts +34 -34
- package/dest/interfaces/slasher.d.ts +1 -10
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +0 -2
- package/dest/interfaces/validator.d.ts +103 -35
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +7 -5
- package/dest/interfaces/world_state.d.ts +5 -4
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +2 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +4 -0
- package/dest/kv-store/config.d.ts +17 -0
- package/dest/kv-store/config.d.ts.map +1 -0
- package/dest/kv-store/config.js +26 -0
- package/dest/kv-store/index.d.ts +2 -0
- package/dest/kv-store/index.d.ts.map +1 -0
- package/dest/kv-store/index.js +1 -0
- 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/extended_directional_app_tagging_secret.d.ts +4 -4
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/extended_directional_app_tagging_secret.js +12 -5
- package/dest/logs/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +1 -0
- package/dest/logs/log_filter.d.ts +4 -1
- package/dest/logs/log_filter.d.ts.map +1 -1
- package/dest/logs/log_filter.js +2 -1
- package/dest/logs/message_context.d.ts +4 -7
- package/dest/logs/message_context.d.ts.map +1 -1
- package/dest/logs/message_context.js +23 -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/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 +4 -1
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +7 -3
- package/dest/logs/tagging_index_range.d.ts +40 -0
- package/dest/logs/tagging_index_range.d.ts.map +1 -0
- package/dest/logs/tagging_index_range.js +8 -0
- package/dest/logs/tx_scoped_l2_log.d.ts +3 -1
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +7 -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/l1_to_l2_message_source.d.ts +4 -2
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +32 -6
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +69 -26
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.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/checkpoint_proposal.d.ts +2 -7
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +3 -25
- package/dest/p2p/peer_error.d.ts +3 -1
- package/dest/p2p/peer_error.d.ts.map +1 -1
- package/dest/p2p/peer_error.js +5 -0
- package/dest/proofs/chonk_proof.d.ts +46 -2
- package/dest/proofs/chonk_proof.d.ts.map +1 -1
- package/dest/proofs/chonk_proof.js +85 -10
- 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 +4 -90
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +0 -14
- package/dest/slashing/{tally.d.ts → votes.d.ts} +5 -6
- package/dest/slashing/votes.d.ts.map +1 -0
- package/dest/slashing/{tally.js → votes.js} +19 -10
- package/dest/tests/factories.d.ts +2 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +11 -28
- package/dest/tests/mocks.d.ts +4 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +26 -26
- package/dest/timetable/index.d.ts +2 -1
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +6 -2
- package/dest/tx/block_header.d.ts +3 -1
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +4 -0
- package/dest/tx/capsule.d.ts +6 -2
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +9 -3
- package/dest/tx/global_variable_builder.d.ts +14 -2
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/private_execution_result.d.ts +6 -6
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +6 -6
- package/dest/tx/profiling.d.ts +14 -2
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +13 -3
- package/dest/tx/simulated_tx.d.ts +111 -3
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +2 -2
- package/dest/tx/tx.d.ts +6 -5
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +18 -6
- package/dest/tx/tx_receipt.d.ts +14 -5
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +14 -18
- package/dest/tx/validator/error_texts.d.ts +8 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +9 -0
- package/dest/update-checker/index.d.ts +3 -2
- package/dest/update-checker/index.d.ts.map +1 -1
- package/dest/update-checker/index.js +2 -1
- package/dest/update-checker/package_version.d.ts +3 -0
- package/dest/update-checker/package_version.d.ts.map +1 -0
- package/dest/update-checker/package_version.js +24 -0
- package/dest/update-checker/version_checker.d.ts +25 -0
- package/dest/update-checker/version_checker.d.ts.map +1 -0
- package/dest/update-checker/version_checker.js +50 -0
- package/dest/validators/errors.d.ts +6 -1
- package/dest/validators/errors.d.ts.map +1 -1
- package/dest/validators/errors.js +7 -0
- package/dest/versioning/versioning.d.ts +4 -2
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +4 -1
- package/dest/world-state/genesis_data.d.ts +11 -0
- package/dest/world-state/genesis_data.d.ts.map +1 -0
- package/dest/world-state/genesis_data.js +4 -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/package.json +10 -9
- package/src/abi/abi.ts +25 -2
- package/src/abi/buffer.ts +25 -4
- package/src/abi/decoder.ts +23 -78
- package/src/abi/function_selector.ts +1 -1
- package/src/abi/function_signature_decoder.ts +77 -0
- package/src/abi/index.ts +1 -0
- package/src/abi/selector.ts +1 -1
- package/src/avm/revert_code.ts +25 -39
- package/src/block/l2_block.ts +13 -1
- package/src/block/l2_block_source.ts +26 -9
- package/src/block/l2_block_stream/l2_tips_store_base.ts +24 -12
- package/src/block/test/l2_tips_store_test_suite.ts +8 -1
- package/src/checkpoint/checkpoint.ts +23 -4
- package/src/checkpoint/checkpoint_data.ts +40 -4
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/validate.ts +230 -0
- package/src/config/index.ts +1 -0
- package/src/config/pipelining-config.ts +31 -0
- package/src/config/sequencer-config.ts +2 -2
- package/src/contract/contract_address.ts +3 -3
- package/src/contract/contract_class_id.ts +2 -2
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/epoch-helpers/index.ts +27 -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/gas_settings.ts +65 -12
- package/src/ha-signing/config.ts +45 -38
- package/src/ha-signing/index.ts +9 -0
- package/src/ha-signing/local_config.ts +46 -0
- package/src/hash/hash.ts +34 -0
- package/src/interfaces/allowed_element.ts +28 -4
- package/src/interfaces/archiver.ts +6 -3
- package/src/interfaces/aztec-node-admin.ts +5 -7
- package/src/interfaces/aztec-node.ts +24 -5
- package/src/interfaces/block-builder.ts +56 -13
- package/src/interfaces/configs.ts +15 -4
- package/src/interfaces/l2_logs_source.ts +4 -1
- package/src/interfaces/merkle_tree_operations.ts +8 -18
- package/src/interfaces/prover-client.ts +8 -0
- package/src/interfaces/slasher.ts +0 -6
- package/src/interfaces/validator.ts +47 -33
- package/src/interfaces/world_state.ts +4 -3
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +9 -0
- package/src/kv-store/config.ts +36 -0
- package/src/kv-store/index.ts +1 -0
- package/src/l1-contracts/index.ts +1 -1
- package/src/logs/extended_directional_app_tagging_secret.ts +19 -8
- package/src/logs/index.ts +1 -0
- package/src/logs/log_filter.ts +5 -0
- package/src/logs/message_context.ts +17 -7
- package/src/logs/pending_tagged_log.ts +1 -3
- package/src/logs/shared_secret_derivation.ts +21 -10
- package/src/logs/siloed_tag.ts +7 -2
- package/src/logs/tagging_index_range.ts +24 -0
- package/src/logs/tx_scoped_l2_log.ts +16 -0
- package/src/messaging/l1_to_l2_message.ts +12 -9
- package/src/messaging/l1_to_l2_message_source.ts +3 -1
- package/src/messaging/l2_to_l1_membership.ts +98 -33
- package/src/noir/index.ts +2 -2
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/checkpoint_proposal.ts +8 -38
- package/src/p2p/peer_error.ts +7 -0
- package/src/proofs/chonk_proof.ts +91 -5
- package/src/slashing/index.ts +1 -2
- package/src/slashing/serialization.ts +1 -81
- package/src/slashing/types.ts +3 -35
- package/src/slashing/{tally.ts → votes.ts} +22 -4
- package/src/tests/factories.ts +5 -34
- package/src/tests/mocks.ts +31 -18
- package/src/timetable/index.ts +7 -2
- package/src/tx/block_header.ts +6 -0
- package/src/tx/capsule.ts +10 -2
- package/src/tx/global_variable_builder.ts +15 -0
- package/src/tx/private_execution_result.ts +5 -5
- package/src/tx/profiling.ts +11 -2
- package/src/tx/simulated_tx.ts +5 -1
- package/src/tx/tx.ts +20 -11
- package/src/tx/tx_receipt.ts +18 -16
- package/src/tx/validator/error_texts.ts +11 -0
- package/src/update-checker/index.ts +2 -1
- package/src/update-checker/package_version.ts +30 -0
- package/src/update-checker/version_checker.ts +65 -0
- package/src/validators/errors.ts +9 -0
- package/src/versioning/versioning.ts +4 -1
- package/src/world-state/genesis_data.ts +15 -0
- package/src/world-state/index.ts +1 -0
- 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/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/slashing/empire.d.ts +0 -31
- package/dest/slashing/empire.d.ts.map +0 -1
- package/dest/slashing/empire.js +0 -87
- package/dest/slashing/tally.d.ts.map +0 -1
- package/dest/update-checker/update-checker.d.ts +0 -49
- package/dest/update-checker/update-checker.d.ts.map +0 -1
- package/dest/update-checker/update-checker.js +0 -130
- package/src/contract/private_function_membership_proof.ts +0 -167
- package/src/contract/utility_function_membership_proof.ts +0 -118
- package/src/l1-contracts/slash_factory.ts +0 -180
- package/src/slashing/empire.ts +0 -104
- package/src/update-checker/update-checker.ts +0 -166
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
BlockNumber,
|
|
5
5
|
BlockNumberPositiveSchema,
|
|
6
6
|
BlockNumberSchema,
|
|
7
|
+
CheckpointNumber,
|
|
7
8
|
CheckpointNumberPositiveSchema,
|
|
9
|
+
CheckpointNumberSchema,
|
|
8
10
|
EpochNumber,
|
|
9
11
|
EpochNumberSchema,
|
|
10
12
|
type SlotNumber,
|
|
@@ -23,6 +25,7 @@ import { CheckpointedL2Block } from '../block/checkpointed_l2_block.js';
|
|
|
23
25
|
import { type DataInBlock, dataInBlockSchemaFor } from '../block/in_block.js';
|
|
24
26
|
import { L2Block } from '../block/l2_block.js';
|
|
25
27
|
import { type L2BlockSource, type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
|
|
28
|
+
import { CheckpointDataSchema } from '../checkpoint/checkpoint_data.js';
|
|
26
29
|
import { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
27
30
|
import {
|
|
28
31
|
type ContractClassPublic,
|
|
@@ -72,7 +75,12 @@ import { type WorldStateSyncStatus, WorldStateSyncStatusSchema } from './world_s
|
|
|
72
75
|
export interface AztecNode
|
|
73
76
|
extends Pick<
|
|
74
77
|
L2BlockSource,
|
|
75
|
-
|
|
78
|
+
| 'getBlocks'
|
|
79
|
+
| 'getCheckpoints'
|
|
80
|
+
| 'getBlockHeader'
|
|
81
|
+
| 'getL2Tips'
|
|
82
|
+
| 'getCheckpointedBlocks'
|
|
83
|
+
| 'getCheckpointsDataForEpoch'
|
|
76
84
|
> {
|
|
77
85
|
/**
|
|
78
86
|
* Returns the tips of the L2 chain.
|
|
@@ -114,6 +122,7 @@ export interface AztecNode
|
|
|
114
122
|
* @param referenceBlock - The block parameter (block number, block hash, or 'latest') at which to get the data.
|
|
115
123
|
* @param nullifier - Nullifier we try to find the low nullifier witness for.
|
|
116
124
|
* @returns The low nullifier membership witness (if found).
|
|
125
|
+
* @throws If the nullifier already exists in the tree, since non-inclusion cannot be proven.
|
|
117
126
|
* @remarks Low nullifier witness can be used to perform a nullifier non-inclusion proof by leveraging the "linked
|
|
118
127
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
119
128
|
* we are trying to prove non-inclusion for.
|
|
@@ -172,14 +181,14 @@ export interface AztecNode
|
|
|
172
181
|
l1ToL2Message: Fr,
|
|
173
182
|
): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>] | undefined>;
|
|
174
183
|
|
|
175
|
-
/** Returns the L2
|
|
176
|
-
|
|
184
|
+
/** Returns the L2 checkpoint number in which this L1 to L2 message becomes available, or undefined if not found. */
|
|
185
|
+
getL1ToL2MessageCheckpoint(l1ToL2Message: Fr): Promise<CheckpointNumber | undefined>;
|
|
177
186
|
|
|
178
187
|
/**
|
|
179
188
|
* Returns whether an L1 to L2 message is synced by archiver.
|
|
180
189
|
* @param l1ToL2Message - The L1 to L2 message to check.
|
|
181
190
|
* @returns Whether the message is synced.
|
|
182
|
-
* @deprecated Use `
|
|
191
|
+
* @deprecated Use `getL1ToL2MessageCheckpoint` instead. This method may return true even if the message is not ready to use.
|
|
183
192
|
*/
|
|
184
193
|
isL1ToL2MessageSynced(l1ToL2Message: Fr): Promise<boolean>;
|
|
185
194
|
|
|
@@ -230,6 +239,12 @@ export interface AztecNode
|
|
|
230
239
|
*/
|
|
231
240
|
getCheckpointedBlockNumber(): Promise<BlockNumber>;
|
|
232
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Method to fetch the latest checkpoint number synchronized by the node.
|
|
244
|
+
* @returns The checkpoint number.
|
|
245
|
+
*/
|
|
246
|
+
getCheckpointNumber(): Promise<CheckpointNumber>;
|
|
247
|
+
|
|
233
248
|
/**
|
|
234
249
|
* Method to determine if the node is ready to accept transactions.
|
|
235
250
|
* @returns - Flag indicating the readiness for tx submission.
|
|
@@ -517,7 +532,7 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
517
532
|
.args(BlockParameterSchema, schemas.Fr)
|
|
518
533
|
.returns(z.tuple([schemas.BigInt, SiblingPath.schemaFor(L1_TO_L2_MSG_TREE_HEIGHT)]).optional()),
|
|
519
534
|
|
|
520
|
-
|
|
535
|
+
getL1ToL2MessageCheckpoint: z.function().args(schemas.Fr).returns(CheckpointNumberSchema.optional()),
|
|
521
536
|
|
|
522
537
|
isL1ToL2MessageSynced: z.function().args(schemas.Fr).returns(z.boolean()),
|
|
523
538
|
|
|
@@ -534,6 +549,8 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
534
549
|
|
|
535
550
|
getBlockNumber: z.function().returns(BlockNumberSchema),
|
|
536
551
|
|
|
552
|
+
getCheckpointNumber: z.function().returns(CheckpointNumberSchema),
|
|
553
|
+
|
|
537
554
|
getProvenBlockNumber: z.function().returns(BlockNumberSchema),
|
|
538
555
|
|
|
539
556
|
getCheckpointedBlockNumber: z.function().returns(BlockNumberSchema),
|
|
@@ -557,6 +574,8 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
557
574
|
.args(BlockNumberPositiveSchema, z.number().gt(0).lte(MAX_RPC_BLOCKS_LEN))
|
|
558
575
|
.returns(z.array(CheckpointedL2Block.schema)),
|
|
559
576
|
|
|
577
|
+
getCheckpointsDataForEpoch: z.function().args(EpochNumberSchema).returns(z.array(CheckpointDataSchema)),
|
|
578
|
+
|
|
560
579
|
getCurrentMinFees: z.function().returns(GasFees.schema),
|
|
561
580
|
|
|
562
581
|
getMaxPriorityFees: z.function().returns(GasFees.schema),
|
|
@@ -35,24 +35,59 @@ export interface IBlockFactory extends ProcessedTxHandler {
|
|
|
35
35
|
setBlockCompleted(expectedBlockHeader?: BlockHeader): Promise<L2Block>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
/** Limits passed to the public processor for tx processing within a block. */
|
|
39
|
+
export type PublicProcessorLimits = {
|
|
40
|
+
/** Maximum number of txs to process. */
|
|
39
41
|
maxTransactions?: number;
|
|
40
|
-
|
|
42
|
+
/** L2 and DA gas limits. */
|
|
41
43
|
maxBlockGas?: Gas;
|
|
44
|
+
/** Maximum number of blob fields allowed. */
|
|
42
45
|
maxBlobFields?: number;
|
|
46
|
+
/** Deadline for processing the txs. Processor will stop as soon as it hits this time. */
|
|
43
47
|
deadline?: Date;
|
|
44
|
-
|
|
48
|
+
/** Whether this processor is building a proposal (as opposed to re-executing one). Skipping txs due to gas or blob limits is only done during proposal building. */
|
|
49
|
+
isBuildingProposal?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** Base fields shared by both proposer and validator block builder options. */
|
|
53
|
+
type BlockBuilderOptionsBase = PublicProcessorLimits & {
|
|
54
|
+
/** Minimum number of successfully processed txs required. Block is rejected if fewer succeed. */
|
|
55
|
+
minValidTxs: number;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Proposer mode: redistribution params are required. */
|
|
59
|
+
type ProposerBlockBuilderOptions = BlockBuilderOptionsBase & {
|
|
60
|
+
isBuildingProposal: true;
|
|
61
|
+
/** Maximum number of blocks per checkpoint, derived from the timetable. */
|
|
62
|
+
maxBlocksPerCheckpoint: number;
|
|
63
|
+
/** Per-block gas budget multiplier. Budget = (remaining / remainingBlocks) * multiplier. */
|
|
64
|
+
perBlockAllocationMultiplier: number;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Validator mode: no redistribution params needed. */
|
|
68
|
+
type ValidatorBlockBuilderOptions = BlockBuilderOptionsBase & {
|
|
69
|
+
isBuildingProposal: false;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** Options for building a block within a checkpoint. When proposing, redistribution params are required. */
|
|
73
|
+
export type BlockBuilderOptions = ProposerBlockBuilderOptions | ValidatorBlockBuilderOptions;
|
|
45
74
|
|
|
46
75
|
export interface PublicProcessorValidator {
|
|
47
76
|
preprocessValidator?: TxValidator<Tx>;
|
|
48
77
|
nullifierCache?: { addNullifiers: (nullifiers: Buffer[]) => void };
|
|
49
78
|
}
|
|
50
79
|
|
|
51
|
-
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'> &
|
|
80
|
+
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit'> &
|
|
52
81
|
Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
|
|
53
82
|
Pick<
|
|
54
83
|
SequencerConfig,
|
|
55
|
-
|
|
84
|
+
| 'txPublicSetupAllowListExtend'
|
|
85
|
+
| 'fakeProcessingDelayPerTxMs'
|
|
86
|
+
| 'fakeThrowAfterProcessingTxCount'
|
|
87
|
+
| 'maxTxsPerBlock'
|
|
88
|
+
| 'maxTxsPerCheckpoint'
|
|
89
|
+
| 'maxL2BlockGas'
|
|
90
|
+
| 'maxDABlockGas'
|
|
56
91
|
>;
|
|
57
92
|
|
|
58
93
|
export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[] = [
|
|
@@ -63,34 +98,42 @@ export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[
|
|
|
63
98
|
'txPublicSetupAllowListExtend',
|
|
64
99
|
'fakeProcessingDelayPerTxMs',
|
|
65
100
|
'fakeThrowAfterProcessingTxCount',
|
|
101
|
+
'maxTxsPerBlock',
|
|
102
|
+
'maxTxsPerCheckpoint',
|
|
103
|
+
'maxL2BlockGas',
|
|
104
|
+
'maxDABlockGas',
|
|
105
|
+
'rollupManaLimit',
|
|
66
106
|
] as const;
|
|
67
107
|
|
|
68
|
-
/** Thrown when
|
|
69
|
-
export class
|
|
70
|
-
constructor(
|
|
71
|
-
|
|
72
|
-
|
|
108
|
+
/** Thrown when the number of successfully processed transactions is below the required minimum. */
|
|
109
|
+
export class InsufficientValidTxsError extends Error {
|
|
110
|
+
constructor(
|
|
111
|
+
public readonly processedCount: number,
|
|
112
|
+
public readonly minRequired: number,
|
|
113
|
+
public readonly failedTxs: FailedTx[],
|
|
114
|
+
) {
|
|
115
|
+
super(`Insufficient valid txs: got ${processedCount} but need ${minRequired}`);
|
|
116
|
+
this.name = 'InsufficientValidTxsError';
|
|
73
117
|
}
|
|
74
118
|
}
|
|
75
119
|
|
|
76
120
|
/** Result of building a block within a checkpoint. */
|
|
77
121
|
export type BuildBlockInCheckpointResult = {
|
|
78
122
|
block: L2Block;
|
|
79
|
-
publicGas: Gas;
|
|
80
123
|
publicProcessorDuration: number;
|
|
81
124
|
numTxs: number;
|
|
82
125
|
failedTxs: FailedTx[];
|
|
83
126
|
usedTxs: Tx[];
|
|
84
|
-
usedTxBlobFields: number;
|
|
85
127
|
};
|
|
86
128
|
|
|
87
129
|
/** Interface for building blocks within a checkpoint context. */
|
|
88
130
|
export interface ICheckpointBlockBuilder {
|
|
131
|
+
/** Builds a single block within this checkpoint. Throws InsufficientValidTxsError if fewer than minValidTxs succeed. */
|
|
89
132
|
buildBlock(
|
|
90
133
|
pendingTxs: Iterable<Tx> | AsyncIterable<Tx>,
|
|
91
134
|
blockNumber: BlockNumber,
|
|
92
135
|
timestamp: bigint,
|
|
93
|
-
opts:
|
|
136
|
+
opts: BlockBuilderOptions,
|
|
94
137
|
): Promise<BuildBlockInCheckpointResult>;
|
|
95
138
|
}
|
|
96
139
|
|
|
@@ -13,6 +13,8 @@ export interface SequencerConfig {
|
|
|
13
13
|
sequencerPollingIntervalMS?: number;
|
|
14
14
|
/** The maximum number of txs to include in a block. */
|
|
15
15
|
maxTxsPerBlock?: number;
|
|
16
|
+
/** The maximum number of txs across all blocks in a checkpoint. */
|
|
17
|
+
maxTxsPerCheckpoint?: number;
|
|
16
18
|
/** The minimum number of txs to include in a block. */
|
|
17
19
|
minTxsPerBlock?: number;
|
|
18
20
|
/** The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock. */
|
|
@@ -23,6 +25,10 @@ export interface SequencerConfig {
|
|
|
23
25
|
maxL2BlockGas?: number;
|
|
24
26
|
/** The maximum DA block gas. */
|
|
25
27
|
maxDABlockGas?: number;
|
|
28
|
+
/** Per-block gas budget multiplier for both L2 and DA gas. Budget = (checkpointLimit / maxBlocks) * multiplier. */
|
|
29
|
+
perBlockAllocationMultiplier?: number;
|
|
30
|
+
/** Redistribute remaining checkpoint budget evenly across remaining blocks instead of allowing a single block to consume the entire remaining budget. */
|
|
31
|
+
redistributeCheckpointBudget?: boolean;
|
|
26
32
|
/** Recipient of block reward. */
|
|
27
33
|
coinbase?: EthAddress;
|
|
28
34
|
/** Address to receive fees. */
|
|
@@ -33,8 +39,6 @@ export interface SequencerConfig {
|
|
|
33
39
|
acvmBinaryPath?: string;
|
|
34
40
|
/** Additional entries to extend the default setup allow list. */
|
|
35
41
|
txPublicSetupAllowListExtend?: AllowedElement[];
|
|
36
|
-
/** Max block size */
|
|
37
|
-
maxBlockSizeInBytes?: number;
|
|
38
42
|
/** Payload address to vote for */
|
|
39
43
|
governanceProposerPayload?: EthAddress;
|
|
40
44
|
/** Whether to enforce the time table when building blocks */
|
|
@@ -85,17 +89,19 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
85
89
|
z.object({
|
|
86
90
|
sequencerPollingIntervalMS: z.number().optional(),
|
|
87
91
|
maxTxsPerBlock: z.number().optional(),
|
|
92
|
+
maxTxsPerCheckpoint: z.number().optional(),
|
|
88
93
|
minValidTxsPerBlock: z.number().optional(),
|
|
89
94
|
minTxsPerBlock: z.number().optional(),
|
|
90
95
|
maxL2BlockGas: z.number().optional(),
|
|
91
96
|
publishTxsWithProposals: z.boolean().optional(),
|
|
92
97
|
maxDABlockGas: z.number().optional(),
|
|
98
|
+
perBlockAllocationMultiplier: z.number().optional(),
|
|
99
|
+
redistributeCheckpointBudget: z.boolean().optional(),
|
|
93
100
|
coinbase: schemas.EthAddress.optional(),
|
|
94
101
|
feeRecipient: schemas.AztecAddress.optional(),
|
|
95
102
|
acvmWorkingDirectory: z.string().optional(),
|
|
96
103
|
acvmBinaryPath: z.string().optional(),
|
|
97
104
|
txPublicSetupAllowListExtend: z.array(AllowedElementSchema).optional(),
|
|
98
|
-
maxBlockSizeInBytes: z.number().optional(),
|
|
99
105
|
governanceProposerPayload: schemas.EthAddress.optional(),
|
|
100
106
|
l1PublishingTime: z.number().optional(),
|
|
101
107
|
enforceTimeTable: z.boolean().optional(),
|
|
@@ -134,7 +140,12 @@ type SequencerConfigOptionalKeys =
|
|
|
134
140
|
| 'l1PublishingTime'
|
|
135
141
|
| 'txPublicSetupAllowListExtend'
|
|
136
142
|
| 'minValidTxsPerBlock'
|
|
137
|
-
| 'minBlocksForCheckpoint'
|
|
143
|
+
| 'minBlocksForCheckpoint'
|
|
144
|
+
| 'maxTxsPerBlock'
|
|
145
|
+
| 'maxTxsPerCheckpoint'
|
|
146
|
+
| 'maxL2BlockGas'
|
|
147
|
+
| 'maxDABlockGas'
|
|
148
|
+
| 'redistributeCheckpointBudget';
|
|
138
149
|
|
|
139
150
|
export type ResolvedSequencerConfig = Prettify<
|
|
140
151
|
Required<Omit<SequencerConfig, SequencerConfigOptionalKeys>> & Pick<SequencerConfig, SequencerConfigOptionalKeys>
|
|
@@ -16,10 +16,11 @@ export interface L2LogsSource {
|
|
|
16
16
|
* array implies no logs match that tag.
|
|
17
17
|
* @param tags - The tags to search for.
|
|
18
18
|
* @param page - The page number (0-indexed) for pagination.
|
|
19
|
+
* @param upToBlockNumber - If set, only return logs from blocks up to and including this block number.
|
|
19
20
|
* @returns An array of log arrays, one per tag. Returns at most 10 logs per tag per page. If 10 logs are returned
|
|
20
21
|
* for a tag, the caller should fetch the next page to check for more logs.
|
|
21
22
|
*/
|
|
22
|
-
getPrivateLogsByTags(tags: SiloedTag[], page?: number): Promise<TxScopedL2Log[][]>;
|
|
23
|
+
getPrivateLogsByTags(tags: SiloedTag[], page?: number, upToBlockNumber?: BlockNumber): Promise<TxScopedL2Log[][]>;
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Gets public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
@@ -27,6 +28,7 @@ export interface L2LogsSource {
|
|
|
27
28
|
* @param contractAddress - The contract address to search logs for.
|
|
28
29
|
* @param tags - The tags to search for.
|
|
29
30
|
* @param page - The page number (0-indexed) for pagination.
|
|
31
|
+
* @param upToBlockNumber - If set, only return logs from blocks up to and including this block number.
|
|
30
32
|
* @returns An array of log arrays, one per tag. Returns at most 10 logs per tag per page. If 10 logs are returned
|
|
31
33
|
* for a tag, the caller should fetch the next page to check for more logs.
|
|
32
34
|
*/
|
|
@@ -34,6 +36,7 @@ export interface L2LogsSource {
|
|
|
34
36
|
contractAddress: AztecAddress,
|
|
35
37
|
tags: Tag[],
|
|
36
38
|
page?: number,
|
|
39
|
+
upToBlockNumber?: BlockNumber,
|
|
37
40
|
): Promise<TxScopedL2Log[][]>;
|
|
38
41
|
|
|
39
42
|
/**
|
|
@@ -225,30 +225,20 @@ export interface MerkleTreeReadOperations {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
export interface MerkleTreeCheckpointOperations {
|
|
228
|
-
/**
|
|
229
|
-
|
|
230
|
-
*/
|
|
231
|
-
createCheckpoint(): Promise<void>;
|
|
228
|
+
/** Checkpoints the current fork state. Returns the depth of the new checkpoint. */
|
|
229
|
+
createCheckpoint(): Promise<number>;
|
|
232
230
|
|
|
233
|
-
/**
|
|
234
|
-
* Commits the current checkpoint
|
|
235
|
-
*/
|
|
231
|
+
/** Commits the current checkpoint. */
|
|
236
232
|
commitCheckpoint(): Promise<void>;
|
|
237
233
|
|
|
238
|
-
/**
|
|
239
|
-
* Reverts the current checkpoint
|
|
240
|
-
*/
|
|
234
|
+
/** Reverts the current checkpoint. */
|
|
241
235
|
revertCheckpoint(): Promise<void>;
|
|
242
236
|
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
*/
|
|
246
|
-
commitAllCheckpoints(): Promise<void>;
|
|
237
|
+
/** Commits all checkpoints above the given depth, leaving checkpoint depth at the given value. */
|
|
238
|
+
commitAllCheckpointsTo(depth: number): Promise<void>;
|
|
247
239
|
|
|
248
|
-
/**
|
|
249
|
-
|
|
250
|
-
*/
|
|
251
|
-
revertAllCheckpoints(): Promise<void>;
|
|
240
|
+
/** Reverts all checkpoints above the given depth, leaving checkpoint depth at the given value. */
|
|
241
|
+
revertAllCheckpointsTo(depth: number): Promise<void>;
|
|
252
242
|
}
|
|
253
243
|
|
|
254
244
|
export interface MerkleTreeWriteOperations
|
|
@@ -23,6 +23,8 @@ export type ActualProverConfig = {
|
|
|
23
23
|
* When true, jobs are explicitly cancelled with the broker, which prevents reuse.
|
|
24
24
|
*/
|
|
25
25
|
cancelJobsOnStop: boolean;
|
|
26
|
+
/** Max concurrent jobs the orchestrator serializes and enqueues to the broker. */
|
|
27
|
+
enqueueConcurrency: number;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -53,6 +55,7 @@ export const ProverConfigSchema = zodFor<ProverConfig>()(
|
|
|
53
55
|
proofStore: z.string().optional(),
|
|
54
56
|
failedProofStore: z.string().optional(),
|
|
55
57
|
cancelJobsOnStop: z.boolean(),
|
|
58
|
+
enqueueConcurrency: z.number(),
|
|
56
59
|
}),
|
|
57
60
|
);
|
|
58
61
|
|
|
@@ -107,6 +110,11 @@ export const proverConfigMappings: ConfigMappingsType<ProverConfig> = {
|
|
|
107
110
|
'When true, jobs are explicitly cancelled with the broker, which prevents reuse.',
|
|
108
111
|
...booleanConfigHelper(false),
|
|
109
112
|
},
|
|
113
|
+
enqueueConcurrency: {
|
|
114
|
+
env: 'PROVER_ENQUEUE_CONCURRENCY',
|
|
115
|
+
description: 'Max concurrent jobs the orchestrator serializes and enqueues to the broker.',
|
|
116
|
+
...numberConfigHelper(50),
|
|
117
|
+
},
|
|
110
118
|
};
|
|
111
119
|
|
|
112
120
|
function parseProverId(str?: string) {
|
|
@@ -3,12 +3,8 @@ import { schemas, zodFor } from '@aztec/foundation/schemas';
|
|
|
3
3
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
|
-
export type SlasherClientType = 'empire' | 'tally';
|
|
7
|
-
|
|
8
6
|
export interface SlasherConfig {
|
|
9
7
|
slashOverridePayload?: EthAddress;
|
|
10
|
-
slashMinPenaltyPercentage: number;
|
|
11
|
-
slashMaxPenaltyPercentage: number;
|
|
12
8
|
slashSelfAllowed?: boolean; // Whether to allow slashes to own validators
|
|
13
9
|
slashValidatorsAlways: EthAddress[]; // Array of validator addresses
|
|
14
10
|
slashValidatorsNever: EthAddress[]; // Array of validator addresses
|
|
@@ -32,8 +28,6 @@ export interface SlasherConfig {
|
|
|
32
28
|
export const SlasherConfigSchema = zodFor<SlasherConfig>()(
|
|
33
29
|
z.object({
|
|
34
30
|
slashOverridePayload: schemas.EthAddress.optional(),
|
|
35
|
-
slashMinPenaltyPercentage: z.number(),
|
|
36
|
-
slashMaxPenaltyPercentage: z.number(),
|
|
37
31
|
slashValidatorsAlways: z.array(schemas.EthAddress),
|
|
38
32
|
slashValidatorsNever: z.array(schemas.EthAddress),
|
|
39
33
|
slashPrunePenalty: schemas.BigInt,
|
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
BlockProposal,
|
|
10
10
|
BlockProposalOptions,
|
|
11
11
|
CheckpointAttestation,
|
|
12
|
-
CheckpointLastBlockData,
|
|
13
12
|
CheckpointProposal,
|
|
14
13
|
CheckpointProposalOptions,
|
|
15
14
|
} from '@aztec/stdlib/p2p';
|
|
@@ -20,49 +19,64 @@ import type { PeerId } from '@libp2p/interface';
|
|
|
20
19
|
import { z } from 'zod';
|
|
21
20
|
|
|
22
21
|
import type { CommitteeAttestationsAndSigners } from '../block/index.js';
|
|
23
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
type LocalSignerConfig,
|
|
24
|
+
LocalSignerConfigSchema,
|
|
25
|
+
type ValidatorHASignerConfig,
|
|
26
|
+
ValidatorHASignerConfigSchema,
|
|
27
|
+
} from '../ha-signing/index.js';
|
|
24
28
|
import { AllowedElementSchema } from './allowed_element.js';
|
|
25
29
|
|
|
26
30
|
/**
|
|
27
31
|
* Validator client configuration
|
|
28
32
|
*/
|
|
29
|
-
export type ValidatorClientConfig = ValidatorHASignerConfig &
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
export type ValidatorClientConfig = ValidatorHASignerConfig &
|
|
34
|
+
LocalSignerConfig & {
|
|
35
|
+
/** The private keys of the validators participating in attestation duties */
|
|
36
|
+
validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
|
|
32
37
|
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
/** The addresses of the validators to use with remote signers */
|
|
39
|
+
validatorAddresses?: EthAddress[];
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
/** Do not run the validator */
|
|
42
|
+
disableValidator: boolean;
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
/** Temporarily disable these specific validator addresses */
|
|
45
|
+
disabledValidators: EthAddress[];
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
/** Interval between polling for new attestations from peers */
|
|
48
|
+
attestationPollingIntervalMs: number;
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
/** Whether to always reexecute block proposals, even for non-validator nodes or when out of the current committee */
|
|
51
|
+
alwaysReexecuteBlockProposals?: boolean;
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
/** Whether to run in fisherman mode: validates all proposals and attestations but does not broadcast attestations or participate in consensus */
|
|
54
|
+
fishermanMode?: boolean;
|
|
50
55
|
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
/** Skip checkpoint proposal validation and always attest (default: false) */
|
|
57
|
+
skipCheckpointProposalValidation?: boolean;
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
/** Skip pushing re-executed blocks to archiver (default: false) */
|
|
60
|
+
skipPushProposedBlocksToArchiver?: boolean;
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
/** Agree to attest to equivocated checkpoint proposals (for testing purposes only) */
|
|
63
|
+
attestToEquivocatedProposals?: boolean;
|
|
59
64
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
/** Maximum L2 gas per block for validation. Proposals exceeding this limit are rejected. */
|
|
66
|
+
validateMaxL2BlockGas?: number;
|
|
67
|
+
|
|
68
|
+
/** Maximum DA gas per block for validation. Proposals exceeding this limit are rejected. */
|
|
69
|
+
validateMaxDABlockGas?: number;
|
|
70
|
+
|
|
71
|
+
/** Maximum transactions per block for validation. Proposals exceeding this limit are rejected. */
|
|
72
|
+
validateMaxTxsPerBlock?: number;
|
|
73
|
+
|
|
74
|
+
/** Maximum transactions per checkpoint for validation. Proposals exceeding this limit are rejected. */
|
|
75
|
+
validateMaxTxsPerCheckpoint?: number;
|
|
76
|
+
};
|
|
63
77
|
|
|
64
78
|
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
65
|
-
Pick<SequencerConfig, 'txPublicSetupAllowListExtend' | 'broadcastInvalidBlockProposal'
|
|
79
|
+
Pick<SequencerConfig, 'txPublicSetupAllowListExtend' | 'broadcastInvalidBlockProposal'> &
|
|
66
80
|
Pick<
|
|
67
81
|
SlasherConfig,
|
|
68
82
|
'slashBroadcastedInvalidBlockPenalty' | 'slashDuplicateProposalPenalty' | 'slashDuplicateAttestationPenalty'
|
|
@@ -75,17 +89,20 @@ export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
|
75
89
|
};
|
|
76
90
|
|
|
77
91
|
export const ValidatorClientConfigSchema = zodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>()(
|
|
78
|
-
ValidatorHASignerConfigSchema.extend({
|
|
92
|
+
ValidatorHASignerConfigSchema.merge(LocalSignerConfigSchema).extend({
|
|
79
93
|
validatorAddresses: z.array(schemas.EthAddress).optional(),
|
|
80
94
|
disableValidator: z.boolean(),
|
|
81
95
|
disabledValidators: z.array(schemas.EthAddress),
|
|
82
96
|
attestationPollingIntervalMs: z.number().min(0),
|
|
83
|
-
validatorReexecute: z.boolean(),
|
|
84
97
|
alwaysReexecuteBlockProposals: z.boolean().optional(),
|
|
85
98
|
fishermanMode: z.boolean().optional(),
|
|
86
99
|
skipCheckpointProposalValidation: z.boolean().optional(),
|
|
87
100
|
skipPushProposedBlocksToArchiver: z.boolean().optional(),
|
|
88
101
|
attestToEquivocatedProposals: z.boolean().optional(),
|
|
102
|
+
validateMaxL2BlockGas: z.number().optional(),
|
|
103
|
+
validateMaxDABlockGas: z.number().optional(),
|
|
104
|
+
validateMaxTxsPerBlock: z.number().optional(),
|
|
105
|
+
validateMaxTxsPerCheckpoint: z.number().optional(),
|
|
89
106
|
}),
|
|
90
107
|
);
|
|
91
108
|
|
|
@@ -93,7 +110,6 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
|
|
|
93
110
|
ValidatorClientConfigSchema.extend({
|
|
94
111
|
txPublicSetupAllowListExtend: z.array(AllowedElementSchema).optional(),
|
|
95
112
|
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
96
|
-
maxTxsPerBlock: z.number().optional(),
|
|
97
113
|
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
98
114
|
slashDuplicateProposalPenalty: schemas.BigInt,
|
|
99
115
|
slashDuplicateAttestationPenalty: schemas.BigInt,
|
|
@@ -101,8 +117,6 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
|
|
|
101
117
|
}),
|
|
102
118
|
);
|
|
103
119
|
|
|
104
|
-
export type CreateCheckpointProposalLastBlockData = Omit<CheckpointLastBlockData, 'txHashes'> & { txs: Tx[] };
|
|
105
|
-
|
|
106
120
|
export interface Validator {
|
|
107
121
|
start(): Promise<void>;
|
|
108
122
|
updateConfig(config: Partial<ValidatorClientFullConfig>): void;
|
|
@@ -123,7 +137,7 @@ export interface Validator {
|
|
|
123
137
|
checkpointHeader: CheckpointHeader,
|
|
124
138
|
archive: Fr,
|
|
125
139
|
feeAssetPriceModifier: bigint,
|
|
126
|
-
|
|
140
|
+
lastBlockProposal: BlockProposal | undefined,
|
|
127
141
|
proposerAddress: EthAddress | undefined,
|
|
128
142
|
options: CheckpointProposalOptions,
|
|
129
143
|
): Promise<CheckpointProposal>;
|
|
@@ -3,6 +3,7 @@ import type { PromiseWithResolvers } from '@aztec/foundation/promise';
|
|
|
3
3
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
|
+
import type { BlockHash } from '../block/block_hash.js';
|
|
6
7
|
import type { SnapshotDataKeys } from '../snapshots/types.js';
|
|
7
8
|
import type { MerkleTreeReadOperations, MerkleTreeWriteOperations } from './merkle_tree_operations.js';
|
|
8
9
|
|
|
@@ -80,12 +81,12 @@ export interface WorldStateSynchronizer extends ReadonlyWorldStateAccess, ForkMe
|
|
|
80
81
|
resumeSync(): void;
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
|
-
* Forces an immediate sync to an optionally provided minimum block number
|
|
84
|
+
* Forces an immediate sync to an optionally provided minimum block number.
|
|
84
85
|
* @param targetBlockNumber - The target block number that we must sync to. Will download unproven blocks if needed to reach it.
|
|
85
|
-
* @param
|
|
86
|
+
* @param blockHash - If provided, verifies the block at targetBlockNumber matches this hash. On mismatch, triggers a resync (reorg detection).
|
|
86
87
|
* @returns A promise that resolves with the block number the world state was synced to
|
|
87
88
|
*/
|
|
88
|
-
syncImmediate(minBlockNumber?: BlockNumber,
|
|
89
|
+
syncImmediate(minBlockNumber?: BlockNumber, blockHash?: BlockHash): Promise<BlockNumber>;
|
|
89
90
|
|
|
90
91
|
/** Deletes the db */
|
|
91
92
|
clear(): Promise<void>;
|
|
@@ -234,6 +234,15 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
234
234
|
return noteHashes.filter(n => !n.isZero());
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
getNonEmptyL2ToL1Msgs() {
|
|
238
|
+
const l2ToL1Msgs = this.forPublic
|
|
239
|
+
? this.forPublic.nonRevertibleAccumulatedData.l2ToL1Msgs.concat(
|
|
240
|
+
this.forPublic.revertibleAccumulatedData.l2ToL1Msgs,
|
|
241
|
+
)
|
|
242
|
+
: this.forRollup!.end.l2ToL1Msgs;
|
|
243
|
+
return l2ToL1Msgs.filter(m => !m.isEmpty());
|
|
244
|
+
}
|
|
245
|
+
|
|
237
246
|
getNonEmptyNullifiers() {
|
|
238
247
|
const nullifiers = this.forPublic
|
|
239
248
|
? this.forPublic.nonRevertibleAccumulatedData.nullifiers.concat(
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
|
+
import { type ConfigMappingsType, getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
|
|
3
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
|
|
5
|
+
export type DataStoreConfig = {
|
|
6
|
+
dataDirectory?: string;
|
|
7
|
+
dataStoreMapSizeKb: number;
|
|
8
|
+
l1Contracts?: { rollupAddress: EthAddress };
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const dataConfigMappings: ConfigMappingsType<DataStoreConfig> = {
|
|
12
|
+
dataDirectory: {
|
|
13
|
+
env: 'DATA_DIRECTORY',
|
|
14
|
+
description: 'Optional dir to store data. If omitted will store in memory.',
|
|
15
|
+
},
|
|
16
|
+
dataStoreMapSizeKb: {
|
|
17
|
+
env: 'DATA_STORE_MAP_SIZE_KB',
|
|
18
|
+
description: 'The maximum possible size of a data store DB in KB. Can be overridden by component-specific options.',
|
|
19
|
+
...numberConfigHelper(128 * 1_024 * 1_024), // Defaulted to 128 GB
|
|
20
|
+
},
|
|
21
|
+
l1Contracts: {
|
|
22
|
+
description: 'The deployed L1 contract addresses',
|
|
23
|
+
nested: {
|
|
24
|
+
rollupAddress: l1ContractAddressesMapping.rollupAddress,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Returns the archiver configuration from the environment variables.
|
|
31
|
+
* Note: If an environment variable is not set, the default value is used.
|
|
32
|
+
* @returns The archiver configuration.
|
|
33
|
+
*/
|
|
34
|
+
export function getDataConfigFromEnv(): DataStoreConfig {
|
|
35
|
+
return getConfigFromMappings<DataStoreConfig>(dataConfigMappings);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './config.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
// No exports.
|