@aztec/stdlib 1.2.0 → 2.0.0-nightly.20250813
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 +0 -67
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +1 -14
- package/dest/abi/authorization_selector.d.ts +52 -0
- package/dest/abi/authorization_selector.d.ts.map +1 -0
- package/dest/abi/authorization_selector.js +70 -0
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +0 -40
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +3 -6
- package/dest/abi/index.d.ts +1 -0
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/avm/avm.d.ts +278 -412
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +12 -12
- package/dest/avm/avm_proving_request.d.ts +160 -186
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/l2_block.d.ts +8 -0
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +9 -0
- package/dest/block/l2_block_source.d.ts +446 -2
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_source.js +29 -0
- package/dest/block/proposal/committee_attestation.d.ts +3 -1
- package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
- package/dest/block/proposal/committee_attestation.js +3 -0
- package/dest/block/published_l2_block.d.ts +2 -1
- package/dest/block/published_l2_block.d.ts.map +1 -1
- package/dest/block/published_l2_block.js +6 -1
- package/dest/contract/contract_instance.d.ts +3 -3
- package/dest/contract/contract_instance.d.ts.map +1 -1
- package/dest/contract/contract_instance.js +3 -3
- package/dest/contract/interfaces/contract_class.d.ts +2 -2
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts +9 -9
- package/dest/contract/interfaces/protocol_contract_addresses.d.ts.map +1 -1
- package/dest/contract/interfaces/protocol_contract_addresses.js +4 -4
- package/dest/contract/private_function_membership_proof.d.ts +1 -1
- package/dest/contract/private_function_membership_proof.js +1 -1
- package/dest/contract/utility_function_membership_proof.d.ts +1 -1
- package/dest/contract/utility_function_membership_proof.js +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +20 -0
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -0
- package/dest/{shared_mutable/shared_mutable_values.js → delayed_public_mutable/delayed_public_mutable_values.js} +9 -9
- package/dest/{shared_mutable/shared_mutable_values_with_hash.d.ts → delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts} +6 -6
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.d.ts.map +1 -0
- package/dest/delayed_public_mutable/delayed_public_mutable_values_with_hash.js +30 -0
- package/dest/delayed_public_mutable/index.d.ts +5 -0
- package/dest/delayed_public_mutable/index.d.ts.map +1 -0
- package/dest/delayed_public_mutable/index.js +4 -0
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -0
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -0
- package/dest/gas/gas.d.ts +1 -0
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +3 -0
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +1 -4
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +4 -2
- package/dest/interfaces/aztec-node-admin.d.ts +211 -8
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +9 -3
- package/dest/interfaces/configs.d.ts +27 -0
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +6 -1
- package/dest/interfaces/get_logs_response.d.ts +1 -1
- package/dest/interfaces/proving-job.d.ts +166 -192
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +3 -1
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +1 -1
- package/dest/interfaces/server.d.ts +4 -2
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +4 -2
- package/dest/interfaces/slasher.d.ts +86 -0
- package/dest/interfaces/slasher.d.ts.map +1 -0
- package/dest/interfaces/slasher.js +23 -0
- package/dest/interfaces/tx_provider.d.ts +24 -0
- package/dest/interfaces/tx_provider.d.ts.map +1 -0
- package/dest/kernel/claimed_length_array.d.ts +34 -0
- package/dest/kernel/claimed_length_array.d.ts.map +1 -0
- package/dest/kernel/claimed_length_array.js +58 -0
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -6
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +18 -20
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +7 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +17 -32
- package/dest/kernel/hints/build_transient_data_hints.d.ts +4 -3
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -10
- 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 +1 -2
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.js +4 -4
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.js +4 -4
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts +5 -5
- package/dest/kernel/hints/private_kernel_reset_hints.d.ts.map +1 -1
- package/dest/kernel/hints/private_kernel_reset_hints.js +9 -9
- package/dest/kernel/hints/read_request_hints.d.ts +17 -17
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.js +28 -28
- package/dest/kernel/hints/{transient_data_index_hint.d.ts → transient_data_squashing_hint.d.ts} +5 -5
- package/dest/kernel/hints/transient_data_squashing_hint.d.ts.map +1 -0
- package/dest/kernel/hints/{transient_data_index_hint.js → transient_data_squashing_hint.js} +5 -5
- package/dest/kernel/index.d.ts +1 -0
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -0
- package/dest/kernel/private_accumulated_data.d.ts +16 -15
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_call_data.d.ts +4 -4
- package/dest/kernel/private_call_data.d.ts.map +1 -1
- package/dest/kernel/private_call_data.js +2 -2
- package/dest/kernel/private_circuit_public_inputs.d.ts +26 -25
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +33 -15
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +9 -0
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +8 -4
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +10 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +9 -6
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +11 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +20 -18
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +9 -10
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +11 -11
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +11 -12
- package/dest/kernel/private_validation_requests.d.ts +8 -20
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +9 -21
- package/dest/kernel/utils/order_and_comparison.d.ts +0 -3
- package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.js +0 -19
- package/dest/logs/extended_public_log.d.ts +1 -1
- package/dest/logs/shared_secret_derivation.d.ts +1 -1
- package/dest/logs/shared_secret_derivation.js +1 -1
- package/dest/messaging/l2_to_l1_membership.d.ts +4 -1
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +49 -54
- package/dest/messaging/l2_to_l1_message.d.ts +2 -0
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +7 -0
- package/dest/note/notes_filter.d.ts +5 -2
- package/dest/note/notes_filter.d.ts.map +1 -1
- package/dest/note/notes_filter.js +1 -1
- package/dest/p2p/attestation_utils.d.ts +10 -0
- package/dest/p2p/attestation_utils.d.ts.map +1 -0
- package/dest/p2p/attestation_utils.js +21 -0
- package/dest/p2p/block_attestation.d.ts +3 -4
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/block_attestation.js +3 -4
- package/dest/p2p/block_proposal.d.ts +8 -1
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +21 -8
- package/dest/p2p/consensus_payload.d.ts +3 -11
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +13 -22
- package/dest/p2p/index.d.ts +1 -0
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +5 -3
- package/dest/rollup/block_root_rollup.d.ts +1 -1
- package/dest/slashing/index.d.ts +51 -0
- package/dest/slashing/index.d.ts.map +1 -0
- package/dest/slashing/index.js +54 -0
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +0 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +25 -24
- package/dest/tests/mocks.d.ts +2 -0
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +31 -22
- package/dest/tx/index.d.ts +0 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +11 -11
- package/dest/tx/processed_tx.d.ts +2 -2
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +4 -4
- package/dest/tx/proven_tx.d.ts +1 -1
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +7 -3
- package/dest/tx/simulated_tx.d.ts +11 -17
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +12 -12
- package/dest/tx/tx.d.ts +25 -25
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +60 -48
- package/dest/tx/tx_effect.d.ts +2 -2
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +3 -18
- package/dest/tx/tx_execution_request.js +2 -2
- package/dest/tx/tx_hash.d.ts +7 -0
- package/dest/tx/tx_hash.d.ts.map +1 -1
- package/dest/tx/tx_hash.js +19 -1
- package/dest/tx/tx_request.d.ts +5 -5
- package/dest/tx/tx_request.d.ts.map +1 -1
- package/dest/tx/tx_request.js +7 -7
- package/dest/tx/validator/error_texts.d.ts +1 -0
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -0
- package/dest/tx/validator/tx_validator.d.ts +6 -4
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +3 -0
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +4 -4
- package/package.json +10 -9
- package/src/abi/abi.ts +0 -38
- package/src/abi/authorization_selector.ts +95 -0
- package/src/abi/contract_artifact.ts +0 -49
- package/src/abi/decoder.ts +3 -6
- package/src/abi/index.ts +1 -0
- package/src/avm/avm.ts +7 -9
- package/src/block/l2_block.ts +18 -0
- package/src/block/l2_block_source.ts +70 -1
- package/src/block/proposal/committee_attestation.ts +5 -1
- package/src/block/published_l2_block.ts +14 -5
- package/src/contract/contract_instance.ts +3 -3
- package/src/contract/interfaces/protocol_contract_addresses.ts +5 -10
- package/src/contract/private_function_membership_proof.ts +1 -1
- package/src/contract/utility_function_membership_proof.ts +1 -1
- package/src/{shared_mutable/shared_mutable_values.ts → delayed_public_mutable/delayed_public_mutable_values.ts} +10 -10
- package/src/delayed_public_mutable/delayed_public_mutable_values_with_hash.ts +38 -0
- package/src/delayed_public_mutable/index.ts +4 -0
- package/src/gas/gas.ts +4 -0
- package/src/hash/hash.ts +1 -4
- package/src/interfaces/archiver.ts +3 -1
- package/src/interfaces/aztec-node-admin.ts +19 -8
- package/src/interfaces/configs.ts +17 -0
- package/src/interfaces/pxe.ts +4 -2
- package/src/interfaces/server.ts +4 -2
- package/src/interfaces/slasher.ts +49 -0
- package/src/interfaces/tx_provider.ts +16 -0
- package/src/kernel/claimed_length_array.ts +104 -0
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +28 -30
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +28 -59
- package/src/kernel/hints/build_transient_data_hints.ts +12 -14
- package/src/kernel/hints/index.ts +1 -2
- package/src/kernel/hints/note_hash_read_request_hints.ts +4 -16
- package/src/kernel/hints/nullifier_read_request_hints.ts +4 -16
- package/src/kernel/hints/private_kernel_reset_hints.ts +7 -7
- package/src/kernel/hints/read_request_hints.ts +22 -22
- package/src/kernel/hints/{transient_data_index_hint.ts → transient_data_squashing_hint.ts} +5 -5
- package/src/kernel/index.ts +1 -0
- package/src/kernel/private_accumulated_data.ts +23 -23
- package/src/kernel/private_call_data.ts +3 -3
- package/src/kernel/private_circuit_public_inputs.ts +92 -68
- package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -1
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +13 -4
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +20 -20
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +7 -7
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +16 -10
- package/src/kernel/private_validation_requests.ts +19 -50
- package/src/kernel/utils/order_and_comparison.ts +0 -25
- package/src/logs/shared_secret_derivation.ts +1 -1
- package/src/messaging/l2_to_l1_membership.ts +76 -85
- package/src/messaging/l2_to_l1_message.ts +9 -0
- package/src/note/notes_filter.ts +6 -3
- package/src/p2p/attestation_utils.ts +35 -0
- package/src/p2p/block_attestation.ts +3 -4
- package/src/p2p/block_proposal.ts +23 -5
- package/src/p2p/consensus_payload.ts +10 -29
- package/src/p2p/index.ts +1 -0
- package/src/p2p/topic_type.ts +3 -1
- package/src/slashing/index.ts +74 -0
- package/src/stats/stats.ts +2 -2
- package/src/tests/factories.ts +37 -27
- package/src/tests/mocks.ts +24 -22
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +11 -9
- package/src/tx/processed_tx.ts +6 -6
- package/src/tx/proven_tx.ts +7 -8
- package/src/tx/simulated_tx.ts +13 -19
- package/src/tx/tx.ts +70 -57
- package/src/tx/tx_effect.ts +5 -20
- package/src/tx/tx_execution_request.ts +2 -2
- package/src/tx/tx_hash.ts +21 -1
- package/src/tx/tx_request.ts +7 -6
- package/src/tx/validator/error_texts.ts +1 -0
- package/src/tx/validator/tx_validator.ts +5 -0
- package/src/versioning/versioning.ts +0 -3
- package/src/vks/verification_key.ts +4 -7
- package/dest/interfaces/tx-collector.d.ts +0 -15
- package/dest/interfaces/tx-collector.d.ts.map +0 -1
- package/dest/kernel/hints/rollup_validation_requests.d.ts +0 -34
- package/dest/kernel/hints/rollup_validation_requests.d.ts.map +0 -1
- package/dest/kernel/hints/rollup_validation_requests.js +0 -55
- package/dest/kernel/hints/transient_data_index_hint.d.ts.map +0 -1
- package/dest/shared_mutable/index.d.ts +0 -5
- package/dest/shared_mutable/index.d.ts.map +0 -1
- package/dest/shared_mutable/index.js +0 -4
- package/dest/shared_mutable/scheduled_delay_change.d.ts.map +0 -1
- package/dest/shared_mutable/scheduled_value_change.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values.d.ts +0 -20
- package/dest/shared_mutable/shared_mutable_values.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values_with_hash.d.ts.map +0 -1
- package/dest/shared_mutable/shared_mutable_values_with_hash.js +0 -30
- package/dest/tx/include_by_timestamp.d.ts +0 -54
- package/dest/tx/include_by_timestamp.d.ts.map +0 -1
- package/dest/tx/include_by_timestamp.js +0 -72
- package/src/interfaces/tx-collector.ts +0 -17
- package/src/kernel/hints/rollup_validation_requests.ts +0 -71
- package/src/shared_mutable/index.ts +0 -4
- package/src/shared_mutable/shared_mutable_values_with_hash.ts +0 -38
- package/src/tx/include_by_timestamp.ts +0 -90
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.d.ts +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.js +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.d.ts +0 -0
- /package/dest/{shared_mutable → delayed_public_mutable}/scheduled_value_change.js +0 -0
- /package/dest/interfaces/{tx-collector.js → tx_provider.js} +0 -0
- /package/src/{shared_mutable → delayed_public_mutable}/scheduled_delay_change.ts +0 -0
- /package/src/{shared_mutable → delayed_public_mutable}/scheduled_value_change.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avm_proving_request.d.ts","sourceRoot":"","sources":["../../src/avm/avm_proving_request.ts"],"names":[],"mappings":"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|
115
116
|
equals(other: L2Block): boolean;
|
|
116
117
|
}
|
|
118
|
+
export type BlockInfo = {
|
|
119
|
+
blockHash?: string;
|
|
120
|
+
archive: string;
|
|
121
|
+
blockNumber: number;
|
|
122
|
+
slotNumber: number;
|
|
123
|
+
txCount: number;
|
|
124
|
+
};
|
|
117
125
|
//# sourceMappingURL=l2_block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;GAEG;AACH,qBAAa,OAAO;IAEhB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;;IANjB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI,EACT,SAAS,GAAE,EAAE,GAAG,SAAqB;IAG/C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAS5C;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG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G/C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAS5C;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;;;;;OAQG;WACU,MAAM,CACjB,UAAU,EAAE,MAAM,EAClB,WAAW,SAAI,EACf,mBAAmB,SAAI,EACvB,oBAAoB,SAAI,EACxB,MAAM,GAAE,EAAE,GAAG,SAAqB,EAClC,UAAU,GAAE,MAAM,GAAG,SAAqB,EAC1C,UAAU,GAAE,MAAM,GAAG,SAAqB,GACzC,OAAO,CAAC,OAAO,CAAC;IAUnB;;;OAGG;IACH,MAAM,CAAC,KAAK,IAAI,OAAO;IAIvB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;OAGG;IACU,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAOhC;;;OAGG;IACH,QAAQ;;;;;;;;;IAuBR,WAAW,IAAI,SAAS;IAUxB,MAAM,CAAC,KAAK,EAAE,OAAO;CAGtB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
package/dest/block/l2_block.js
CHANGED
|
@@ -101,6 +101,15 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
|
|
|
101
101
|
...logsStats
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
+
toBlockInfo() {
|
|
105
|
+
return {
|
|
106
|
+
blockHash: this.blockHash?.toString(),
|
|
107
|
+
archive: this.archive.root.toString(),
|
|
108
|
+
blockNumber: this.number,
|
|
109
|
+
slotNumber: Number(this.header.getSlot()),
|
|
110
|
+
txCount: this.body.txEffects.length
|
|
111
|
+
};
|
|
112
|
+
}
|
|
104
113
|
equals(other) {
|
|
105
114
|
return this.archive.equals(other.archive) && this.header.equals(other.header) && this.body.equals(other.body);
|
|
106
115
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
2
3
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import type { L1RollupConstants } from '../epoch-helpers/index.js';
|
|
6
|
+
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
5
7
|
import type { BlockHeader } from '../tx/block_header.js';
|
|
6
8
|
import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
|
|
7
9
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
8
10
|
import type { TxReceipt } from '../tx/tx_receipt.js';
|
|
9
11
|
import type { L2Block } from './l2_block.js';
|
|
10
|
-
import
|
|
12
|
+
import { PublishedL2Block } from './published_l2_block.js';
|
|
11
13
|
/**
|
|
12
14
|
* Interface of classes allowing for the retrieval of L2 blocks.
|
|
13
15
|
*/
|
|
@@ -101,9 +103,445 @@ export interface L2BlockSource {
|
|
|
101
103
|
getL1Constants(): Promise<L1RollupConstants>;
|
|
102
104
|
/** Latest synced L1 timestamp. */
|
|
103
105
|
getL1Timestamp(): Promise<bigint>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns whether the latest block in the pending chain on L1 is invalid (ie its attestations are incorrect).
|
|
108
|
+
* Note that invalid blocks do not get synced, so the latest block returned by the block source is always a valid one.
|
|
109
|
+
*/
|
|
110
|
+
isPendingChainInvalid(): Promise<boolean>;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the status of the pending chain validation. If the chain is invalid, reports the earliest consecutive block
|
|
113
|
+
* that is invalid, along with the reason for being invalid, which can be used to trigger an invalidation.
|
|
114
|
+
*/
|
|
115
|
+
getPendingChainValidationStatus(): Promise<ValidateBlockResult>;
|
|
104
116
|
/** Force a sync. */
|
|
105
117
|
syncImmediate(): Promise<void>;
|
|
106
118
|
}
|
|
119
|
+
/** Subtype for invalid block validation results */
|
|
120
|
+
export type ValidateBlockNegativeResult = {
|
|
121
|
+
valid: false;
|
|
122
|
+
block: PublishedL2Block;
|
|
123
|
+
committee: EthAddress[];
|
|
124
|
+
epoch: bigint;
|
|
125
|
+
seed: bigint;
|
|
126
|
+
attestations: BlockAttestation[];
|
|
127
|
+
reason: 'insufficient-attestations';
|
|
128
|
+
} | {
|
|
129
|
+
valid: false;
|
|
130
|
+
block: PublishedL2Block;
|
|
131
|
+
committee: EthAddress[];
|
|
132
|
+
epoch: bigint;
|
|
133
|
+
seed: bigint;
|
|
134
|
+
reason: 'invalid-attestation';
|
|
135
|
+
attestations: BlockAttestation[];
|
|
136
|
+
invalidIndex: number;
|
|
137
|
+
};
|
|
138
|
+
/** Result type for validating a block attestations */
|
|
139
|
+
export type ValidateBlockResult = {
|
|
140
|
+
valid: true;
|
|
141
|
+
} | ValidateBlockNegativeResult;
|
|
142
|
+
export declare const ValidateBlockResultSchema: z.ZodUnion<[z.ZodObject<{
|
|
143
|
+
valid: z.ZodLiteral<true>;
|
|
144
|
+
block: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
block: z.ZodEffects<z.ZodObject<{
|
|
146
|
+
archive: z.ZodEffects<z.ZodObject<{
|
|
147
|
+
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
148
|
+
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
root: import("@aztec/foundation/schemas").Fr;
|
|
151
|
+
nextAvailableLeafIndex: number;
|
|
152
|
+
}, {
|
|
153
|
+
root: string;
|
|
154
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
155
|
+
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
156
|
+
root: string;
|
|
157
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
158
|
+
}>;
|
|
159
|
+
header: ZodFor<BlockHeader>;
|
|
160
|
+
body: ZodFor<import("./body.js").Body>;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
163
|
+
header: BlockHeader;
|
|
164
|
+
body: import("./body.js").Body;
|
|
165
|
+
}, {
|
|
166
|
+
archive: {
|
|
167
|
+
root: string;
|
|
168
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
169
|
+
};
|
|
170
|
+
header?: any;
|
|
171
|
+
body?: any;
|
|
172
|
+
}>, L2Block, {
|
|
173
|
+
archive: {
|
|
174
|
+
root: string;
|
|
175
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
176
|
+
};
|
|
177
|
+
header?: any;
|
|
178
|
+
body?: any;
|
|
179
|
+
}>;
|
|
180
|
+
l1: z.ZodObject<{
|
|
181
|
+
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
182
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
183
|
+
blockHash: z.ZodString;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
blockNumber: bigint;
|
|
186
|
+
timestamp: bigint;
|
|
187
|
+
blockHash: string;
|
|
188
|
+
}, {
|
|
189
|
+
blockNumber: string | number | bigint;
|
|
190
|
+
timestamp: string | number | bigint;
|
|
191
|
+
blockHash: string;
|
|
192
|
+
}>;
|
|
193
|
+
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
194
|
+
address: z.ZodType<EthAddress, any, string>;
|
|
195
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
address: EthAddress;
|
|
198
|
+
signature: import("./index.js").Signature;
|
|
199
|
+
}, {
|
|
200
|
+
address: string;
|
|
201
|
+
signature: string;
|
|
202
|
+
}>, import("./index.js").CommitteeAttestation, {
|
|
203
|
+
address: string;
|
|
204
|
+
signature: string;
|
|
205
|
+
}>, "many">;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
block: L2Block;
|
|
208
|
+
l1: {
|
|
209
|
+
blockNumber: bigint;
|
|
210
|
+
timestamp: bigint;
|
|
211
|
+
blockHash: string;
|
|
212
|
+
};
|
|
213
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
214
|
+
}, {
|
|
215
|
+
block: {
|
|
216
|
+
archive: {
|
|
217
|
+
root: string;
|
|
218
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
219
|
+
};
|
|
220
|
+
header?: any;
|
|
221
|
+
body?: any;
|
|
222
|
+
};
|
|
223
|
+
l1: {
|
|
224
|
+
blockNumber: string | number | bigint;
|
|
225
|
+
timestamp: string | number | bigint;
|
|
226
|
+
blockHash: string;
|
|
227
|
+
};
|
|
228
|
+
attestations: {
|
|
229
|
+
address: string;
|
|
230
|
+
signature: string;
|
|
231
|
+
}[];
|
|
232
|
+
}>>;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
valid: true;
|
|
235
|
+
block?: {
|
|
236
|
+
block: L2Block;
|
|
237
|
+
l1: {
|
|
238
|
+
blockNumber: bigint;
|
|
239
|
+
timestamp: bigint;
|
|
240
|
+
blockHash: string;
|
|
241
|
+
};
|
|
242
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
243
|
+
} | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
valid: true;
|
|
246
|
+
block?: {
|
|
247
|
+
block: {
|
|
248
|
+
archive: {
|
|
249
|
+
root: string;
|
|
250
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
251
|
+
};
|
|
252
|
+
header?: any;
|
|
253
|
+
body?: any;
|
|
254
|
+
};
|
|
255
|
+
l1: {
|
|
256
|
+
blockNumber: string | number | bigint;
|
|
257
|
+
timestamp: string | number | bigint;
|
|
258
|
+
blockHash: string;
|
|
259
|
+
};
|
|
260
|
+
attestations: {
|
|
261
|
+
address: string;
|
|
262
|
+
signature: string;
|
|
263
|
+
}[];
|
|
264
|
+
} | undefined;
|
|
265
|
+
}>, z.ZodObject<{
|
|
266
|
+
valid: z.ZodLiteral<false>;
|
|
267
|
+
block: z.ZodObject<{
|
|
268
|
+
block: z.ZodEffects<z.ZodObject<{
|
|
269
|
+
archive: z.ZodEffects<z.ZodObject<{
|
|
270
|
+
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
271
|
+
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
272
|
+
}, "strip", z.ZodTypeAny, {
|
|
273
|
+
root: import("@aztec/foundation/schemas").Fr;
|
|
274
|
+
nextAvailableLeafIndex: number;
|
|
275
|
+
}, {
|
|
276
|
+
root: string;
|
|
277
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
278
|
+
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
279
|
+
root: string;
|
|
280
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
281
|
+
}>;
|
|
282
|
+
header: ZodFor<BlockHeader>;
|
|
283
|
+
body: ZodFor<import("./body.js").Body>;
|
|
284
|
+
}, "strip", z.ZodTypeAny, {
|
|
285
|
+
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
286
|
+
header: BlockHeader;
|
|
287
|
+
body: import("./body.js").Body;
|
|
288
|
+
}, {
|
|
289
|
+
archive: {
|
|
290
|
+
root: string;
|
|
291
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
292
|
+
};
|
|
293
|
+
header?: any;
|
|
294
|
+
body?: any;
|
|
295
|
+
}>, L2Block, {
|
|
296
|
+
archive: {
|
|
297
|
+
root: string;
|
|
298
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
299
|
+
};
|
|
300
|
+
header?: any;
|
|
301
|
+
body?: any;
|
|
302
|
+
}>;
|
|
303
|
+
l1: z.ZodObject<{
|
|
304
|
+
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
305
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
306
|
+
blockHash: z.ZodString;
|
|
307
|
+
}, "strip", z.ZodTypeAny, {
|
|
308
|
+
blockNumber: bigint;
|
|
309
|
+
timestamp: bigint;
|
|
310
|
+
blockHash: string;
|
|
311
|
+
}, {
|
|
312
|
+
blockNumber: string | number | bigint;
|
|
313
|
+
timestamp: string | number | bigint;
|
|
314
|
+
blockHash: string;
|
|
315
|
+
}>;
|
|
316
|
+
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
317
|
+
address: z.ZodType<EthAddress, any, string>;
|
|
318
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
319
|
+
}, "strip", z.ZodTypeAny, {
|
|
320
|
+
address: EthAddress;
|
|
321
|
+
signature: import("./index.js").Signature;
|
|
322
|
+
}, {
|
|
323
|
+
address: string;
|
|
324
|
+
signature: string;
|
|
325
|
+
}>, import("./index.js").CommitteeAttestation, {
|
|
326
|
+
address: string;
|
|
327
|
+
signature: string;
|
|
328
|
+
}>, "many">;
|
|
329
|
+
}, "strip", z.ZodTypeAny, {
|
|
330
|
+
block: L2Block;
|
|
331
|
+
l1: {
|
|
332
|
+
blockNumber: bigint;
|
|
333
|
+
timestamp: bigint;
|
|
334
|
+
blockHash: string;
|
|
335
|
+
};
|
|
336
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
337
|
+
}, {
|
|
338
|
+
block: {
|
|
339
|
+
archive: {
|
|
340
|
+
root: string;
|
|
341
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
342
|
+
};
|
|
343
|
+
header?: any;
|
|
344
|
+
body?: any;
|
|
345
|
+
};
|
|
346
|
+
l1: {
|
|
347
|
+
blockNumber: string | number | bigint;
|
|
348
|
+
timestamp: string | number | bigint;
|
|
349
|
+
blockHash: string;
|
|
350
|
+
};
|
|
351
|
+
attestations: {
|
|
352
|
+
address: string;
|
|
353
|
+
signature: string;
|
|
354
|
+
}[];
|
|
355
|
+
}>;
|
|
356
|
+
committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
357
|
+
epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
358
|
+
seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
359
|
+
attestations: z.ZodArray<ZodFor<BlockAttestation>, "many">;
|
|
360
|
+
reason: z.ZodLiteral<"insufficient-attestations">;
|
|
361
|
+
}, "strip", z.ZodTypeAny, {
|
|
362
|
+
valid: false;
|
|
363
|
+
block: {
|
|
364
|
+
block: L2Block;
|
|
365
|
+
l1: {
|
|
366
|
+
blockNumber: bigint;
|
|
367
|
+
timestamp: bigint;
|
|
368
|
+
blockHash: string;
|
|
369
|
+
};
|
|
370
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
371
|
+
};
|
|
372
|
+
attestations: BlockAttestation[];
|
|
373
|
+
committee: EthAddress[];
|
|
374
|
+
epoch: bigint;
|
|
375
|
+
seed: bigint;
|
|
376
|
+
reason: "insufficient-attestations";
|
|
377
|
+
}, {
|
|
378
|
+
valid: false;
|
|
379
|
+
block: {
|
|
380
|
+
block: {
|
|
381
|
+
archive: {
|
|
382
|
+
root: string;
|
|
383
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
384
|
+
};
|
|
385
|
+
header?: any;
|
|
386
|
+
body?: any;
|
|
387
|
+
};
|
|
388
|
+
l1: {
|
|
389
|
+
blockNumber: string | number | bigint;
|
|
390
|
+
timestamp: string | number | bigint;
|
|
391
|
+
blockHash: string;
|
|
392
|
+
};
|
|
393
|
+
attestations: {
|
|
394
|
+
address: string;
|
|
395
|
+
signature: string;
|
|
396
|
+
}[];
|
|
397
|
+
};
|
|
398
|
+
attestations: any[];
|
|
399
|
+
committee: string[];
|
|
400
|
+
epoch: string | number | bigint;
|
|
401
|
+
seed: string | number | bigint;
|
|
402
|
+
reason: "insufficient-attestations";
|
|
403
|
+
}>, z.ZodObject<{
|
|
404
|
+
valid: z.ZodLiteral<false>;
|
|
405
|
+
block: z.ZodObject<{
|
|
406
|
+
block: z.ZodEffects<z.ZodObject<{
|
|
407
|
+
archive: z.ZodEffects<z.ZodObject<{
|
|
408
|
+
root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
|
|
409
|
+
nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
410
|
+
}, "strip", z.ZodTypeAny, {
|
|
411
|
+
root: import("@aztec/foundation/schemas").Fr;
|
|
412
|
+
nextAvailableLeafIndex: number;
|
|
413
|
+
}, {
|
|
414
|
+
root: string;
|
|
415
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
416
|
+
}>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
|
|
417
|
+
root: string;
|
|
418
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
419
|
+
}>;
|
|
420
|
+
header: ZodFor<BlockHeader>;
|
|
421
|
+
body: ZodFor<import("./body.js").Body>;
|
|
422
|
+
}, "strip", z.ZodTypeAny, {
|
|
423
|
+
archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
424
|
+
header: BlockHeader;
|
|
425
|
+
body: import("./body.js").Body;
|
|
426
|
+
}, {
|
|
427
|
+
archive: {
|
|
428
|
+
root: string;
|
|
429
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
430
|
+
};
|
|
431
|
+
header?: any;
|
|
432
|
+
body?: any;
|
|
433
|
+
}>, L2Block, {
|
|
434
|
+
archive: {
|
|
435
|
+
root: string;
|
|
436
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
437
|
+
};
|
|
438
|
+
header?: any;
|
|
439
|
+
body?: any;
|
|
440
|
+
}>;
|
|
441
|
+
l1: z.ZodObject<{
|
|
442
|
+
blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
443
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
444
|
+
blockHash: z.ZodString;
|
|
445
|
+
}, "strip", z.ZodTypeAny, {
|
|
446
|
+
blockNumber: bigint;
|
|
447
|
+
timestamp: bigint;
|
|
448
|
+
blockHash: string;
|
|
449
|
+
}, {
|
|
450
|
+
blockNumber: string | number | bigint;
|
|
451
|
+
timestamp: string | number | bigint;
|
|
452
|
+
blockHash: string;
|
|
453
|
+
}>;
|
|
454
|
+
attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
455
|
+
address: z.ZodType<EthAddress, any, string>;
|
|
456
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
|
|
457
|
+
}, "strip", z.ZodTypeAny, {
|
|
458
|
+
address: EthAddress;
|
|
459
|
+
signature: import("./index.js").Signature;
|
|
460
|
+
}, {
|
|
461
|
+
address: string;
|
|
462
|
+
signature: string;
|
|
463
|
+
}>, import("./index.js").CommitteeAttestation, {
|
|
464
|
+
address: string;
|
|
465
|
+
signature: string;
|
|
466
|
+
}>, "many">;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
block: L2Block;
|
|
469
|
+
l1: {
|
|
470
|
+
blockNumber: bigint;
|
|
471
|
+
timestamp: bigint;
|
|
472
|
+
blockHash: string;
|
|
473
|
+
};
|
|
474
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
475
|
+
}, {
|
|
476
|
+
block: {
|
|
477
|
+
archive: {
|
|
478
|
+
root: string;
|
|
479
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
480
|
+
};
|
|
481
|
+
header?: any;
|
|
482
|
+
body?: any;
|
|
483
|
+
};
|
|
484
|
+
l1: {
|
|
485
|
+
blockNumber: string | number | bigint;
|
|
486
|
+
timestamp: string | number | bigint;
|
|
487
|
+
blockHash: string;
|
|
488
|
+
};
|
|
489
|
+
attestations: {
|
|
490
|
+
address: string;
|
|
491
|
+
signature: string;
|
|
492
|
+
}[];
|
|
493
|
+
}>;
|
|
494
|
+
committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
|
|
495
|
+
epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
496
|
+
seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
497
|
+
attestations: z.ZodArray<ZodFor<BlockAttestation>, "many">;
|
|
498
|
+
reason: z.ZodLiteral<"invalid-attestation">;
|
|
499
|
+
invalidIndex: z.ZodNumber;
|
|
500
|
+
}, "strip", z.ZodTypeAny, {
|
|
501
|
+
valid: false;
|
|
502
|
+
block: {
|
|
503
|
+
block: L2Block;
|
|
504
|
+
l1: {
|
|
505
|
+
blockNumber: bigint;
|
|
506
|
+
timestamp: bigint;
|
|
507
|
+
blockHash: string;
|
|
508
|
+
};
|
|
509
|
+
attestations: import("./index.js").CommitteeAttestation[];
|
|
510
|
+
};
|
|
511
|
+
attestations: BlockAttestation[];
|
|
512
|
+
committee: EthAddress[];
|
|
513
|
+
epoch: bigint;
|
|
514
|
+
seed: bigint;
|
|
515
|
+
reason: "invalid-attestation";
|
|
516
|
+
invalidIndex: number;
|
|
517
|
+
}, {
|
|
518
|
+
valid: false;
|
|
519
|
+
block: {
|
|
520
|
+
block: {
|
|
521
|
+
archive: {
|
|
522
|
+
root: string;
|
|
523
|
+
nextAvailableLeafIndex: string | number | bigint;
|
|
524
|
+
};
|
|
525
|
+
header?: any;
|
|
526
|
+
body?: any;
|
|
527
|
+
};
|
|
528
|
+
l1: {
|
|
529
|
+
blockNumber: string | number | bigint;
|
|
530
|
+
timestamp: string | number | bigint;
|
|
531
|
+
blockHash: string;
|
|
532
|
+
};
|
|
533
|
+
attestations: {
|
|
534
|
+
address: string;
|
|
535
|
+
signature: string;
|
|
536
|
+
}[];
|
|
537
|
+
};
|
|
538
|
+
attestations: any[];
|
|
539
|
+
committee: string[];
|
|
540
|
+
epoch: string | number | bigint;
|
|
541
|
+
seed: string | number | bigint;
|
|
542
|
+
reason: "invalid-attestation";
|
|
543
|
+
invalidIndex: number;
|
|
544
|
+
}>]>;
|
|
107
545
|
/**
|
|
108
546
|
* L2BlockSource that emits events upon pending / proven chain changes.
|
|
109
547
|
* see L2BlockSourceEvents for the events emitted.
|
|
@@ -111,6 +549,7 @@ export interface L2BlockSource {
|
|
|
111
549
|
export type ArchiverEmitter = TypedEventEmitter<{
|
|
112
550
|
[L2BlockSourceEvents.L2PruneDetected]: (args: L2BlockPruneEvent) => void;
|
|
113
551
|
[L2BlockSourceEvents.L2BlockProven]: (args: L2BlockProvenEvent) => void;
|
|
552
|
+
[L2BlockSourceEvents.InvalidAttestationsBlockDetected]: (args: InvalidBlockDetectedEvent) => void;
|
|
114
553
|
}>;
|
|
115
554
|
export interface L2BlockSourceEventEmitter extends L2BlockSource, ArchiverEmitter {
|
|
116
555
|
}
|
|
@@ -251,7 +690,8 @@ export declare const L2TipsSchema: z.ZodObject<{
|
|
|
251
690
|
}>;
|
|
252
691
|
export declare enum L2BlockSourceEvents {
|
|
253
692
|
L2PruneDetected = "l2PruneDetected",
|
|
254
|
-
L2BlockProven = "l2BlockProven"
|
|
693
|
+
L2BlockProven = "l2BlockProven",
|
|
694
|
+
InvalidAttestationsBlockDetected = "invalidBlockDetected"
|
|
255
695
|
}
|
|
256
696
|
export type L2BlockProvenEvent = {
|
|
257
697
|
type: 'l2BlockProven';
|
|
@@ -264,5 +704,9 @@ export type L2BlockPruneEvent = {
|
|
|
264
704
|
epochNumber: bigint;
|
|
265
705
|
blocks: L2Block[];
|
|
266
706
|
};
|
|
707
|
+
export type InvalidBlockDetectedEvent = {
|
|
708
|
+
type: 'invalidBlockDetected';
|
|
709
|
+
validationResult: ValidateBlockNegativeResult;
|
|
710
|
+
};
|
|
267
711
|
export {};
|
|
268
712
|
//# sourceMappingURL=l2_block_source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,O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/B,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,gBAAgB,EAAE,2BAA2B,CAAC;CAC/C,CAAC"}
|
|
@@ -1,4 +1,32 @@
|
|
|
1
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
1
2
|
import { z } from 'zod';
|
|
3
|
+
import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
4
|
+
import { PublishedL2Block } from './published_l2_block.js';
|
|
5
|
+
export const ValidateBlockResultSchema = z.union([
|
|
6
|
+
z.object({
|
|
7
|
+
valid: z.literal(true),
|
|
8
|
+
block: PublishedL2Block.schema.optional()
|
|
9
|
+
}),
|
|
10
|
+
z.object({
|
|
11
|
+
valid: z.literal(false),
|
|
12
|
+
block: PublishedL2Block.schema,
|
|
13
|
+
committee: z.array(schemas.EthAddress),
|
|
14
|
+
epoch: schemas.BigInt,
|
|
15
|
+
seed: schemas.BigInt,
|
|
16
|
+
attestations: z.array(BlockAttestation.schema),
|
|
17
|
+
reason: z.literal('insufficient-attestations')
|
|
18
|
+
}),
|
|
19
|
+
z.object({
|
|
20
|
+
valid: z.literal(false),
|
|
21
|
+
block: PublishedL2Block.schema,
|
|
22
|
+
committee: z.array(schemas.EthAddress),
|
|
23
|
+
epoch: schemas.BigInt,
|
|
24
|
+
seed: schemas.BigInt,
|
|
25
|
+
attestations: z.array(BlockAttestation.schema),
|
|
26
|
+
reason: z.literal('invalid-attestation'),
|
|
27
|
+
invalidIndex: z.number()
|
|
28
|
+
})
|
|
29
|
+
]);
|
|
2
30
|
/** Creates an L2 block id */ export function makeL2BlockId(number, hash) {
|
|
3
31
|
if (number !== 0 && !hash) {
|
|
4
32
|
throw new Error(`Hash is required for non-genesis blocks (got block number ${number})`);
|
|
@@ -27,5 +55,6 @@ export const L2TipsSchema = z.object({
|
|
|
27
55
|
export var L2BlockSourceEvents = /*#__PURE__*/ function(L2BlockSourceEvents) {
|
|
28
56
|
L2BlockSourceEvents["L2PruneDetected"] = "l2PruneDetected";
|
|
29
57
|
L2BlockSourceEvents["L2BlockProven"] = "l2BlockProven";
|
|
58
|
+
L2BlockSourceEvents["InvalidAttestationsBlockDetected"] = "invalidBlockDetected";
|
|
30
59
|
return L2BlockSourceEvents;
|
|
31
60
|
}({});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ViemCommitteeAttestation, ViemCommitteeAttestations } from '@aztec/ethereum';
|
|
2
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
4
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
5
|
import { z } from 'zod';
|
|
5
6
|
export { EthAddress, Signature };
|
|
6
7
|
export declare class CommitteeAttestation {
|
|
@@ -22,8 +23,9 @@ export declare class CommitteeAttestation {
|
|
|
22
23
|
}>;
|
|
23
24
|
static fromAddress(address: EthAddress): CommitteeAttestation;
|
|
24
25
|
static fromAddressAndSignature(address: EthAddress, signature: Signature): CommitteeAttestation;
|
|
26
|
+
static fromSignature(signature: Signature): CommitteeAttestation;
|
|
25
27
|
static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation;
|
|
26
|
-
static fromBuffer(buffer: Buffer): CommitteeAttestation;
|
|
28
|
+
static fromBuffer(buffer: Buffer | BufferReader): CommitteeAttestation;
|
|
27
29
|
static random(): CommitteeAttestation;
|
|
28
30
|
static empty(): CommitteeAttestation;
|
|
29
31
|
static fromPacked(packed: ViemCommitteeAttestations, committeeSize: number): CommitteeAttestation[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAEjC,qBAAa,oBAAoB;aAEb,OAAO,EAAE,UAAU;aACnB,SAAS,EAAE,SAAS;gBADpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,SAAS;IAGtC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAGD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;IAK7D,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB;IAI/F,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,oBAAoB;IAIhE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB;IAIrE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,oBAAoB;IAOtE,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAKrC,MAAM,CAAC,KAAK,IAAI,oBAAoB;IAIpC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,GAAG,oBAAoB,EAAE;IA+CnG,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI5C,MAAM,IAAI,wBAAwB;CAMnC"}
|
|
@@ -24,6 +24,9 @@ export class CommitteeAttestation {
|
|
|
24
24
|
static fromAddressAndSignature(address, signature) {
|
|
25
25
|
return new CommitteeAttestation(address, signature);
|
|
26
26
|
}
|
|
27
|
+
static fromSignature(signature) {
|
|
28
|
+
return new CommitteeAttestation(EthAddress.ZERO, signature);
|
|
29
|
+
}
|
|
27
30
|
static fromViem(viem) {
|
|
28
31
|
return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
|
|
29
32
|
}
|
|
@@ -20,6 +20,7 @@ export declare class L1PublishedData {
|
|
|
20
20
|
timestamp: string | number | bigint;
|
|
21
21
|
blockHash: string;
|
|
22
22
|
}>;
|
|
23
|
+
static random(): L1PublishedData;
|
|
23
24
|
}
|
|
24
25
|
export declare class PublishedL2Block {
|
|
25
26
|
block: L2Block;
|
|
@@ -116,5 +117,5 @@ export declare class PublishedL2Block {
|
|
|
116
117
|
}[];
|
|
117
118
|
}>;
|
|
118
119
|
}
|
|
119
|
-
export declare function getAttestationsFromPublishedL2Block(block: PublishedL2Block): BlockAttestation[];
|
|
120
|
+
export declare function getAttestationsFromPublishedL2Block(block: Pick<PublishedL2Block, 'attestations' | 'block'>): BlockAttestation[];
|
|
120
121
|
//# sourceMappingURL=published_l2_block.d.ts.map
|