@aztec/stdlib 0.0.1-commit.5de5ca79e → 0.0.1-commit.6201a7b05
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/authorization_selector.d.ts +3 -6
- package/dest/abi/authorization_selector.d.ts.map +1 -1
- package/dest/abi/buffer.d.ts +14 -4
- package/dest/abi/buffer.d.ts.map +1 -1
- package/dest/abi/buffer.js +25 -4
- package/dest/abi/decoder.d.ts +5 -44
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +12 -67
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +32 -6
- package/dest/abi/event_selector.d.ts +3 -6
- package/dest/abi/event_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.d.ts +3 -6
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +2 -4
- package/dest/abi/function_signature_decoder.d.ts +43 -0
- package/dest/abi/function_signature_decoder.d.ts.map +1 -0
- package/dest/abi/function_signature_decoder.js +66 -0
- package/dest/abi/index.d.ts +2 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/abi/note_selector.d.ts +3 -6
- package/dest/abi/note_selector.d.ts.map +1 -1
- package/dest/abi/note_selector.js +1 -3
- package/dest/abi/selector.d.ts +2 -2
- package/dest/abi/selector.d.ts.map +1 -1
- package/dest/abi/selector.js +1 -1
- package/dest/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/aztec-address/index.d.ts +3 -6
- package/dest/aztec-address/index.d.ts.map +1 -1
- package/dest/aztec-address/index.js +2 -4
- package/dest/block/attestation_info.d.ts +3 -2
- package/dest/block/attestation_info.d.ts.map +1 -1
- package/dest/block/attestation_info.js +7 -5
- package/dest/block/block_data.d.ts +297 -8
- package/dest/block/block_data.d.ts.map +1 -1
- package/dest/block/block_data.js +16 -2
- package/dest/block/block_hash.d.ts +11 -10
- package/dest/block/block_hash.d.ts.map +1 -1
- package/dest/block/block_hash.js +10 -9
- package/dest/block/block_parameter.d.ts +30 -3
- package/dest/block/block_parameter.d.ts.map +1 -1
- package/dest/block/block_parameter.js +36 -2
- package/dest/block/l2_block_info.d.ts +6 -5
- package/dest/block/l2_block_info.d.ts.map +1 -1
- package/dest/block/l2_block_info.js +6 -5
- package/dest/block/l2_block_source.d.ts +120 -6
- 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/interfaces.d.ts +6 -3
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- 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 +18 -5
- package/dest/block/proposal/attestations_and_signers.d.ts +13 -6
- package/dest/block/proposal/attestations_and_signers.d.ts.map +1 -1
- package/dest/block/proposal/attestations_and_signers.js +26 -18
- package/dest/block/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 +4 -3
- package/dest/checkpoint/checkpoint.d.ts +7 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +9 -1
- package/dest/checkpoint/checkpoint_data.d.ts +77 -5
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +12 -0
- package/dest/config/chain-config.d.ts +2 -2
- package/dest/config/chain-config.d.ts.map +1 -1
- package/dest/config/chain-config.js +9 -3
- package/dest/config/sequencer-config.d.ts +3 -3
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +11 -4
- package/dest/contract/contract_address.d.ts +1 -1
- package/dest/contract/contract_address.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/contract/private_function.d.ts +1 -1
- package/dest/contract/private_function.d.ts.map +1 -1
- package/dest/contract/private_function.js +2 -4
- package/dest/epoch-helpers/index.d.ts +7 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +12 -0
- package/dest/file-store/factory.d.ts +4 -3
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +2 -2
- package/dest/file-store/http.d.ts +9 -2
- package/dest/file-store/http.d.ts.map +1 -1
- package/dest/file-store/http.js +20 -9
- package/dest/file-store/index.d.ts +2 -1
- package/dest/file-store/index.d.ts.map +1 -1
- package/dest/gas/fee_math.d.ts +49 -0
- package/dest/gas/fee_math.d.ts.map +1 -0
- package/dest/gas/fee_math.js +80 -0
- package/dest/gas/gas_fees.d.ts +5 -1
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +10 -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/gas/index.d.ts +2 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +1 -0
- package/dest/ha-signing/config.d.ts +6 -6
- package/dest/ha-signing/config.d.ts.map +1 -1
- package/dest/ha-signing/config.js +4 -3
- package/dest/ha-signing/index.d.ts +2 -2
- package/dest/ha-signing/index.d.ts.map +1 -1
- package/dest/ha-signing/index.js +1 -1
- package/dest/ha-signing/local_config.d.ts +1 -1
- package/dest/ha-signing/local_config.d.ts.map +1 -1
- package/dest/ha-signing/local_config.js +2 -2
- package/dest/ha-signing/types.d.ts +37 -32
- package/dest/ha-signing/types.d.ts.map +1 -1
- package/dest/ha-signing/types.js +13 -6
- package/dest/hash/hash.d.ts +19 -1
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +37 -0
- package/dest/interfaces/archiver.d.ts +11 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +11 -3
- package/dest/interfaces/aztec-node-admin.d.ts +19 -17
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +5 -4
- package/dest/interfaces/aztec-node-debug.d.ts +21 -0
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-debug.js +18 -0
- package/dest/interfaces/aztec-node.d.ts +54 -55
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +20 -16
- package/dest/interfaces/block_response.d.ts +156 -0
- package/dest/interfaces/block_response.d.ts.map +1 -0
- package/dest/interfaces/block_response.js +24 -0
- package/dest/interfaces/chain_tips.d.ts +304 -0
- package/dest/interfaces/chain_tips.d.ts.map +1 -0
- package/dest/interfaces/chain_tips.js +11 -0
- package/dest/interfaces/checkpoint_parameter.d.ts +27 -0
- package/dest/interfaces/checkpoint_parameter.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_parameter.js +20 -0
- package/dest/interfaces/checkpoint_response.d.ts +312 -0
- package/dest/interfaces/checkpoint_response.d.ts.map +1 -0
- package/dest/interfaces/checkpoint_response.js +26 -0
- package/dest/interfaces/client.d.ts +7 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +6 -0
- package/dest/interfaces/configs.d.ts +7 -2
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/l1_publish_info.d.ts +43 -0
- package/dest/interfaces/l1_publish_info.d.ts.map +1 -0
- package/dest/interfaces/l1_publish_info.js +26 -0
- package/dest/interfaces/merkle_tree_operations.d.ts +4 -3
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +1 -1
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +0 -3
- package/dest/interfaces/proving-job.d.ts +200 -200
- package/dest/interfaces/server.d.ts +6 -1
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +5 -0
- 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 +24 -26
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +1 -1
- 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/log_id.d.ts +1 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +1 -2
- 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 +8 -7
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +11 -3
- package/dest/logs/tag.d.ts +5 -6
- package/dest/logs/tag.d.ts.map +1 -1
- package/dest/logs/tag.js +4 -0
- package/dest/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/note/note_dao.d.ts +1 -1
- package/dest/note/note_dao.d.ts.map +1 -1
- package/dest/note/note_dao.js +1 -4
- package/dest/p2p/block_proposal.d.ts +22 -14
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +45 -40
- package/dest/p2p/checkpoint_attestation.d.ts +10 -8
- package/dest/p2p/checkpoint_attestation.d.ts.map +1 -1
- package/dest/p2p/checkpoint_attestation.js +17 -24
- package/dest/p2p/checkpoint_proposal.d.ts +20 -14
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +34 -51
- package/dest/p2p/consensus_payload.d.ts +18 -7
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +31 -19
- package/dest/p2p/gossipable.d.ts +4 -4
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/signature_utils.d.ts +28 -19
- package/dest/p2p/signature_utils.d.ts.map +1 -1
- package/dest/p2p/signature_utils.js +118 -21
- package/dest/p2p/signed_txs.d.ts +15 -13
- package/dest/p2p/signed_txs.d.ts.map +1 -1
- package/dest/p2p/signed_txs.js +26 -24
- package/dest/parity/parity_base_private_inputs.d.ts +7 -3
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -1
- package/dest/parity/parity_base_private_inputs.js +7 -5
- package/dest/parity/parity_public_inputs.d.ts +7 -3
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +6 -3
- 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/rollup/block_headers_hash.d.ts +1 -1
- package/dest/rollup/block_headers_hash.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.js +8 -2
- package/dest/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} +1 -1
- package/dest/slashing/{tally.d.ts.map → votes.d.ts.map} +1 -1
- package/dest/slashing/{tally.js → votes.js} +1 -1
- package/dest/tests/factories.d.ts +3 -10
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +19 -46
- package/dest/tests/mocks.d.ts +7 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +39 -30
- package/dest/timetable/index.d.ts +51 -1
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +218 -14
- package/dest/trees/nullifier_leaf.d.ts +2 -1
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +3 -0
- package/dest/tx/block_header.d.ts +2 -2
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +1 -1
- 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/fee_provider.d.ts +10 -0
- package/dest/tx/fee_provider.d.ts.map +1 -0
- package/dest/tx/fee_provider.js +1 -0
- package/dest/tx/global_variable_builder.d.ts +3 -4
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/index.d.ts +2 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/indexed_tx_effect.d.ts +1 -1
- package/dest/tx/indexed_tx_effect.d.ts.map +1 -1
- package/dest/tx/indexed_tx_effect.js +1 -2
- package/dest/tx/profiling.js +4 -4
- package/dest/tx/simulated_tx.d.ts +4 -4
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +3 -3
- package/dest/tx/tx.d.ts +3 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx_receipt.d.ts +8 -4
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +8 -15
- package/dest/tx/validator/error_texts.d.ts +5 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +6 -0
- package/dest/types/shared.d.ts +1 -10
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/types/shared.js +0 -9
- package/dest/vks/verification_key.d.ts +2 -137
- package/dest/vks/verification_key.d.ts.map +1 -1
- package/dest/vks/verification_key.js +5 -126
- package/dest/world-state/genesis_data.d.ts +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/dest/world-state/world_state_revision.d.ts +8 -1
- package/dest/world-state/world_state_revision.d.ts.map +1 -1
- package/dest/world-state/world_state_revision.js +7 -1
- package/package.json +8 -8
- package/src/abi/authorization_selector.ts +2 -8
- package/src/abi/buffer.ts +25 -4
- package/src/abi/decoder.ts +23 -78
- package/src/abi/encoder.ts +42 -6
- package/src/abi/event_selector.ts +2 -8
- package/src/abi/function_selector.ts +4 -13
- package/src/abi/function_signature_decoder.ts +77 -0
- package/src/abi/index.ts +1 -0
- package/src/abi/note_selector.ts +3 -12
- package/src/abi/selector.ts +1 -1
- package/src/avm/revert_code.ts +25 -39
- package/src/aztec-address/index.ts +4 -10
- package/src/block/attestation_info.ts +11 -11
- package/src/block/block_data.ts +20 -4
- package/src/block/block_hash.ts +21 -14
- package/src/block/block_parameter.ts +35 -2
- package/src/block/l2_block_info.ts +8 -6
- package/src/block/l2_block_source.ts +55 -5
- package/src/block/l2_block_stream/interfaces.ts +6 -2
- package/src/block/l2_block_stream/l2_tips_store_base.ts +25 -13
- package/src/block/proposal/attestations_and_signers.ts +32 -17
- package/src/block/test/l2_tips_store_test_suite.ts +9 -2
- package/src/checkpoint/checkpoint.ts +11 -1
- package/src/checkpoint/checkpoint_data.ts +44 -4
- package/src/config/chain-config.ts +9 -4
- package/src/config/sequencer-config.ts +20 -6
- package/src/contract/contract_address.ts +2 -2
- package/src/contract/index.ts +0 -2
- package/src/contract/interfaces/contract_class.ts +2 -82
- package/src/contract/private_function.ts +3 -1
- package/src/epoch-helpers/index.ts +24 -0
- package/src/file-store/factory.ts +13 -4
- package/src/file-store/http.ts +29 -10
- package/src/file-store/index.ts +1 -0
- package/src/gas/README.md +31 -0
- package/src/gas/fee_math.ts +120 -0
- package/src/gas/gas_fees.ts +17 -4
- package/src/gas/gas_settings.ts +65 -12
- package/src/gas/index.ts +1 -0
- package/src/ha-signing/config.ts +5 -2
- package/src/ha-signing/index.ts +3 -1
- package/src/ha-signing/local_config.ts +2 -2
- package/src/ha-signing/types.ts +48 -34
- package/src/hash/hash.ts +32 -0
- package/src/interfaces/archiver.ts +22 -2
- package/src/interfaces/aztec-node-admin.ts +8 -8
- package/src/interfaces/aztec-node-debug.ts +40 -0
- package/src/interfaces/aztec-node.ts +120 -95
- package/src/interfaces/block_response.ts +79 -0
- package/src/interfaces/chain_tips.ts +24 -0
- package/src/interfaces/checkpoint_parameter.ts +22 -0
- package/src/interfaces/checkpoint_response.ts +84 -0
- package/src/interfaces/client.ts +6 -0
- package/src/interfaces/configs.ts +5 -1
- package/src/interfaces/l1_publish_info.ts +40 -0
- package/src/interfaces/merkle_tree_operations.ts +3 -2
- package/src/interfaces/prover-client.ts +2 -5
- package/src/interfaces/server.ts +5 -0
- package/src/interfaces/slasher.ts +0 -6
- package/src/interfaces/validator.ts +21 -13
- package/src/l1-contracts/index.ts +1 -1
- package/src/logs/extended_directional_app_tagging_secret.ts +19 -8
- package/src/logs/log_id.ts +1 -2
- 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 +15 -11
- package/src/logs/tag.ts +8 -8
- package/src/messaging/l1_to_l2_message.ts +12 -9
- package/src/note/note_dao.ts +1 -4
- package/src/p2p/block_proposal.ts +96 -36
- package/src/p2p/checkpoint_attestation.ts +20 -29
- package/src/p2p/checkpoint_proposal.ts +88 -71
- package/src/p2p/consensus_payload.ts +50 -28
- package/src/p2p/gossipable.ts +4 -4
- package/src/p2p/signature_utils.ts +110 -25
- package/src/p2p/signed_txs.ts +46 -28
- package/src/parity/parity_base_private_inputs.ts +10 -4
- package/src/parity/parity_public_inputs.ts +9 -2
- package/src/proofs/chonk_proof.ts +91 -5
- package/src/rollup/block_headers_hash.ts +11 -2
- 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} +1 -1
- package/src/tests/factories.ts +19 -54
- package/src/tests/mocks.ts +63 -39
- package/src/timetable/index.ts +308 -13
- package/src/trees/nullifier_leaf.ts +4 -0
- package/src/tx/block_header.ts +2 -2
- package/src/tx/capsule.ts +10 -2
- package/src/tx/fee_provider.ts +10 -0
- package/src/tx/global_variable_builder.ts +2 -3
- package/src/tx/index.ts +1 -0
- package/src/tx/indexed_tx_effect.ts +1 -2
- package/src/tx/profiling.ts +4 -4
- package/src/tx/simulated_tx.ts +6 -2
- package/src/tx/tx.ts +2 -2
- package/src/tx/tx_receipt.ts +11 -14
- package/src/tx/validator/error_texts.ts +8 -0
- package/src/types/shared.ts +0 -10
- package/src/vks/verification_key.ts +5 -184
- package/src/world-state/genesis_data.ts +15 -0
- package/src/world-state/index.ts +1 -0
- package/src/world-state/world_state_revision.ts +9 -1
- package/dest/abi/mocked_keys.d.ts +0 -2
- package/dest/abi/mocked_keys.d.ts.map +0 -1
- package/dest/abi/mocked_keys.js +0 -1
- package/dest/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/src/abi/mocked_keys.ts +0 -2
- 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
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
BlockNumber,
|
|
3
|
+
BlockProposalHash,
|
|
4
|
+
type CheckpointNumber,
|
|
5
|
+
IndexWithinCheckpoint,
|
|
6
|
+
SlotNumber,
|
|
7
|
+
} from '@aztec/foundation/branded-types';
|
|
8
|
+
import type { BaseBuffer32 } from '@aztec/foundation/buffer';
|
|
3
9
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
|
-
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
10
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
11
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
12
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
8
13
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
9
14
|
|
|
15
|
+
import type { TypedDataDefinition } from 'viem';
|
|
16
|
+
|
|
10
17
|
import type { L2Block } from '../block/l2_block.js';
|
|
11
18
|
import type { L2BlockInfo } from '../block/l2_block_info.js';
|
|
12
19
|
import { MAX_TXS_PER_BLOCK } from '../deserialization/index.js';
|
|
@@ -16,18 +23,20 @@ import { TxHash } from '../tx/index.js';
|
|
|
16
23
|
import type { Tx } from '../tx/tx.js';
|
|
17
24
|
import { Gossipable } from './gossipable.js';
|
|
18
25
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
type CoordinationSignatureContext,
|
|
27
|
+
type CoordinationSignatureType,
|
|
28
|
+
EMPTY_COORDINATION_SIGNATURE_CONTEXT,
|
|
29
|
+
type Signable,
|
|
30
|
+
coordinationSignatureContextEquals,
|
|
31
|
+
getCoordinationSignatureTypedData,
|
|
32
|
+
readCoordinationSignatureContext,
|
|
33
|
+
recoverCoordinationSigner,
|
|
34
|
+
serializeCoordinationSignatureContext,
|
|
22
35
|
} from './signature_utils.js';
|
|
23
36
|
import { SignedTxs } from './signed_txs.js';
|
|
24
37
|
import { TopicType } from './topic_type.js';
|
|
25
38
|
|
|
26
|
-
export
|
|
27
|
-
constructor(hash: Buffer) {
|
|
28
|
-
super(hash);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
39
|
+
export type { BlockProposalHash } from '@aztec/foundation/branded-types';
|
|
31
40
|
|
|
32
41
|
export type BlockProposalOptions = {
|
|
33
42
|
/**
|
|
@@ -47,10 +56,12 @@ export type BlockProposalOptions = {
|
|
|
47
56
|
* to be included in a block within a checkpoint. This is used for non-last blocks in a slot.
|
|
48
57
|
* The last block is sent as part of a CheckpointProposal.
|
|
49
58
|
*/
|
|
50
|
-
export class BlockProposal extends Gossipable {
|
|
59
|
+
export class BlockProposal extends Gossipable implements Signable {
|
|
51
60
|
static override p2pTopic = TopicType.block_proposal;
|
|
52
61
|
|
|
53
|
-
|
|
62
|
+
readonly primaryType: CoordinationSignatureType = 'BlockProposal';
|
|
63
|
+
|
|
64
|
+
private cachedSender: EthAddress | undefined | null = undefined;
|
|
54
65
|
|
|
55
66
|
constructor(
|
|
56
67
|
/** The per-block header containing block state and global variables */
|
|
@@ -71,14 +82,17 @@ export class BlockProposal extends Gossipable {
|
|
|
71
82
|
/** The proposer's signature over the block data */
|
|
72
83
|
public readonly signature: Signature,
|
|
73
84
|
|
|
85
|
+
/** The signing domain (chainId + rollupAddress) the signature is bound to */
|
|
86
|
+
public readonly signatureContext: CoordinationSignatureContext,
|
|
87
|
+
|
|
74
88
|
/** The signed transactions in the block (optional, for DA guarantees) */
|
|
75
89
|
public readonly signedTxs?: SignedTxs,
|
|
76
90
|
) {
|
|
77
91
|
super();
|
|
78
92
|
}
|
|
79
93
|
|
|
80
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
81
|
-
return Promise.resolve(
|
|
94
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
95
|
+
return Promise.resolve(BlockProposalHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
82
96
|
}
|
|
83
97
|
|
|
84
98
|
get archive(): Fr {
|
|
@@ -112,9 +126,8 @@ export class BlockProposal extends Gossipable {
|
|
|
112
126
|
* Get the payload to sign for this block proposal.
|
|
113
127
|
* The signature is over: blockHeader + indexWithinCheckpoint + inHash + archiveRoot + txHashes
|
|
114
128
|
*/
|
|
115
|
-
getPayloadToSign(
|
|
129
|
+
getPayloadToSign(): Buffer {
|
|
116
130
|
return serializeToBuffer([
|
|
117
|
-
domainSeparator,
|
|
118
131
|
this.blockHeader,
|
|
119
132
|
this.indexWithinCheckpoint,
|
|
120
133
|
this.inHash,
|
|
@@ -126,12 +139,15 @@ export class BlockProposal extends Gossipable {
|
|
|
126
139
|
|
|
127
140
|
static async createProposalFromSigner(
|
|
128
141
|
blockHeader: BlockHeader,
|
|
142
|
+
checkpointNumber: CheckpointNumber,
|
|
129
143
|
indexWithinCheckpoint: IndexWithinCheckpoint,
|
|
130
144
|
inHash: Fr,
|
|
131
145
|
archiveRoot: Fr,
|
|
132
146
|
txHashes: TxHash[],
|
|
133
147
|
txs: Tx[] | undefined,
|
|
134
|
-
|
|
148
|
+
signatureContext: CoordinationSignatureContext,
|
|
149
|
+
proposalSigner: (typedData: TypedDataDefinition, context: SigningContext) => Promise<Signature>,
|
|
150
|
+
txsSigner?: (typedData: TypedDataDefinition, context: SigningContext) => Promise<Signature>,
|
|
135
151
|
): Promise<BlockProposal> {
|
|
136
152
|
// Create a temporary proposal to get the payload to sign
|
|
137
153
|
const tempProposal = new BlockProposal(
|
|
@@ -141,57 +157,76 @@ export class BlockProposal extends Gossipable {
|
|
|
141
157
|
archiveRoot,
|
|
142
158
|
txHashes,
|
|
143
159
|
Signature.empty(),
|
|
160
|
+
signatureContext,
|
|
144
161
|
);
|
|
145
162
|
|
|
146
163
|
// Create the block signing context
|
|
147
164
|
const blockContext: SigningContext = {
|
|
148
165
|
slot: blockHeader.globalVariables.slotNumber,
|
|
149
166
|
blockNumber: blockHeader.globalVariables.blockNumber,
|
|
167
|
+
checkpointNumber,
|
|
150
168
|
blockIndexWithinCheckpoint: indexWithinCheckpoint,
|
|
151
169
|
dutyType: DutyType.BLOCK_PROPOSAL,
|
|
152
170
|
};
|
|
153
171
|
|
|
154
|
-
const
|
|
155
|
-
const sig = await
|
|
172
|
+
const typedData = getCoordinationSignatureTypedData(tempProposal);
|
|
173
|
+
const sig = await proposalSigner(typedData, blockContext);
|
|
156
174
|
|
|
157
175
|
// If txs are provided, sign them as well
|
|
158
176
|
let signedTxs: SignedTxs | undefined;
|
|
159
177
|
if (txs) {
|
|
160
178
|
const txsSigningContext: SigningContext = { dutyType: DutyType.TXS };
|
|
161
|
-
|
|
162
|
-
|
|
179
|
+
if (!txsSigner) {
|
|
180
|
+
throw new Error('signed_txs requires a typed-data signer');
|
|
181
|
+
}
|
|
182
|
+
signedTxs = await SignedTxs.createFromSigner(txs, signatureContext, typedData =>
|
|
183
|
+
txsSigner(typedData, txsSigningContext),
|
|
184
|
+
);
|
|
163
185
|
}
|
|
164
186
|
|
|
165
|
-
return new BlockProposal(
|
|
187
|
+
return new BlockProposal(
|
|
188
|
+
blockHeader,
|
|
189
|
+
indexWithinCheckpoint,
|
|
190
|
+
inHash,
|
|
191
|
+
archiveRoot,
|
|
192
|
+
txHashes,
|
|
193
|
+
sig,
|
|
194
|
+
signatureContext,
|
|
195
|
+
signedTxs,
|
|
196
|
+
);
|
|
166
197
|
}
|
|
167
198
|
|
|
168
199
|
/**
|
|
169
200
|
* Lazily evaluate the sender of the proposal; result is cached.
|
|
170
|
-
* If there's signedTxs, also verifies
|
|
171
|
-
*
|
|
201
|
+
* If there's signedTxs, also verifies that its signing domain matches this proposal's and
|
|
202
|
+
* that the signedTxs sender matches the block proposal sender. This prevents a proposer
|
|
203
|
+
* from wrapping a foreign-chain SignedTxs bundle inside a local-chain proposal.
|
|
204
|
+
* @returns The sender address, or undefined if signature recovery fails or inner/outer mismatch
|
|
172
205
|
*/
|
|
173
206
|
getSender(): EthAddress | undefined {
|
|
174
|
-
if (
|
|
175
|
-
const
|
|
176
|
-
const blockSender = tryRecoverAddress(hashed, this.signature);
|
|
207
|
+
if (this.cachedSender === undefined) {
|
|
208
|
+
const blockSender = recoverCoordinationSigner(this, this.signature);
|
|
177
209
|
|
|
178
|
-
// If there's signedTxs, verify the sender matches
|
|
179
210
|
if (blockSender && this.signedTxs) {
|
|
211
|
+
if (!coordinationSignatureContextEquals(this.signedTxs.signatureContext, this.signatureContext)) {
|
|
212
|
+
this.cachedSender = null;
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
180
215
|
const txsSender = this.signedTxs.getSender();
|
|
181
216
|
if (!txsSender || !txsSender.equals(blockSender)) {
|
|
182
|
-
|
|
217
|
+
this.cachedSender = null;
|
|
218
|
+
return undefined;
|
|
183
219
|
}
|
|
184
220
|
}
|
|
185
221
|
|
|
186
|
-
|
|
187
|
-
this.sender = blockSender;
|
|
222
|
+
this.cachedSender = blockSender ?? null;
|
|
188
223
|
}
|
|
189
224
|
|
|
190
|
-
return this.
|
|
225
|
+
return this.cachedSender ?? undefined;
|
|
191
226
|
}
|
|
192
227
|
|
|
193
228
|
getPayload() {
|
|
194
|
-
return this.getPayloadToSign(
|
|
229
|
+
return this.getPayloadToSign();
|
|
195
230
|
}
|
|
196
231
|
|
|
197
232
|
toBuffer(): Buffer {
|
|
@@ -201,6 +236,7 @@ export class BlockProposal extends Gossipable {
|
|
|
201
236
|
this.inHash,
|
|
202
237
|
this.archiveRoot,
|
|
203
238
|
this.signature,
|
|
239
|
+
serializeCoordinationSignatureContext(this.signatureContext),
|
|
204
240
|
this.txHashes.length,
|
|
205
241
|
this.txHashes,
|
|
206
242
|
];
|
|
@@ -221,6 +257,7 @@ export class BlockProposal extends Gossipable {
|
|
|
221
257
|
const inHash = reader.readObject(Fr);
|
|
222
258
|
const archiveRoot = reader.readObject(Fr);
|
|
223
259
|
const signature = reader.readObject(Signature);
|
|
260
|
+
const signatureContext = readCoordinationSignatureContext(reader);
|
|
224
261
|
const txHashCount = reader.readNumber();
|
|
225
262
|
if (txHashCount > MAX_TXS_PER_BLOCK) {
|
|
226
263
|
throw new Error(`txHashes count ${txHashCount} exceeds maximum ${MAX_TXS_PER_BLOCK}`);
|
|
@@ -238,12 +275,21 @@ export class BlockProposal extends Gossipable {
|
|
|
238
275
|
archiveRoot,
|
|
239
276
|
txHashes,
|
|
240
277
|
signature,
|
|
278
|
+
signatureContext,
|
|
241
279
|
signedTxs,
|
|
242
280
|
);
|
|
243
281
|
}
|
|
244
282
|
}
|
|
245
283
|
|
|
246
|
-
return new BlockProposal(
|
|
284
|
+
return new BlockProposal(
|
|
285
|
+
blockHeader,
|
|
286
|
+
indexWithinCheckpoint,
|
|
287
|
+
inHash,
|
|
288
|
+
archiveRoot,
|
|
289
|
+
txHashes,
|
|
290
|
+
signature,
|
|
291
|
+
signatureContext,
|
|
292
|
+
);
|
|
247
293
|
}
|
|
248
294
|
|
|
249
295
|
getSize(): number {
|
|
@@ -253,6 +299,8 @@ export class BlockProposal extends Gossipable {
|
|
|
253
299
|
this.inHash.size +
|
|
254
300
|
this.archiveRoot.size +
|
|
255
301
|
this.signature.getSize() +
|
|
302
|
+
4 /* chainId */ +
|
|
303
|
+
20 /* rollupAddress */ +
|
|
256
304
|
4 /* txHashes.length */ +
|
|
257
305
|
this.txHashes.length * TxHash.SIZE +
|
|
258
306
|
4 /* hasSignedTxs flag */ +
|
|
@@ -261,7 +309,15 @@ export class BlockProposal extends Gossipable {
|
|
|
261
309
|
}
|
|
262
310
|
|
|
263
311
|
static empty(): BlockProposal {
|
|
264
|
-
return new BlockProposal(
|
|
312
|
+
return new BlockProposal(
|
|
313
|
+
BlockHeader.empty(),
|
|
314
|
+
IndexWithinCheckpoint(0),
|
|
315
|
+
Fr.ZERO,
|
|
316
|
+
Fr.ZERO,
|
|
317
|
+
[],
|
|
318
|
+
Signature.empty(),
|
|
319
|
+
EMPTY_COORDINATION_SIGNATURE_CONTEXT,
|
|
320
|
+
);
|
|
265
321
|
}
|
|
266
322
|
|
|
267
323
|
static random(): BlockProposal {
|
|
@@ -272,6 +328,7 @@ export class BlockProposal extends Gossipable {
|
|
|
272
328
|
Fr.random(),
|
|
273
329
|
[TxHash.random(), TxHash.random()],
|
|
274
330
|
Signature.random(),
|
|
331
|
+
EMPTY_COORDINATION_SIGNATURE_CONTEXT,
|
|
275
332
|
);
|
|
276
333
|
}
|
|
277
334
|
|
|
@@ -283,6 +340,8 @@ export class BlockProposal extends Gossipable {
|
|
|
283
340
|
archiveRoot: this.archiveRoot.toString(),
|
|
284
341
|
signature: this.signature.toString(),
|
|
285
342
|
txHashes: this.txHashes.map(h => h.toString()),
|
|
343
|
+
chainId: this.signatureContext.chainId,
|
|
344
|
+
rollupAddress: this.signatureContext.rollupAddress.toString(),
|
|
286
345
|
};
|
|
287
346
|
}
|
|
288
347
|
|
|
@@ -308,6 +367,7 @@ export class BlockProposal extends Gossipable {
|
|
|
308
367
|
this.archiveRoot,
|
|
309
368
|
this.txHashes,
|
|
310
369
|
this.signature,
|
|
370
|
+
this.signatureContext,
|
|
311
371
|
);
|
|
312
372
|
}
|
|
313
373
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import {
|
|
1
|
+
import { CheckpointAttestationHash, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { BaseBuffer32 } from '@aztec/foundation/buffer';
|
|
3
3
|
import { keccak256 } from '@aztec/foundation/crypto/keccak';
|
|
4
|
-
import { tryRecoverAddress } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
5
4
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
5
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
6
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -13,14 +12,10 @@ import type { ZodFor } from '../schemas/index.js';
|
|
|
13
12
|
import { CheckpointProposal } from './checkpoint_proposal.js';
|
|
14
13
|
import { ConsensusPayload } from './consensus_payload.js';
|
|
15
14
|
import { Gossipable } from './gossipable.js';
|
|
16
|
-
import {
|
|
15
|
+
import { type CoordinationSignatureContext, recoverCoordinationSigner } from './signature_utils.js';
|
|
17
16
|
import { TopicType } from './topic_type.js';
|
|
18
17
|
|
|
19
|
-
export
|
|
20
|
-
constructor(hash: Buffer) {
|
|
21
|
-
super(hash);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
18
|
+
export type { CheckpointAttestationHash } from '@aztec/foundation/branded-types';
|
|
24
19
|
|
|
25
20
|
/**
|
|
26
21
|
* CheckpointAttestation
|
|
@@ -31,8 +26,8 @@ export class CheckpointAttestationHash extends Buffer32 {
|
|
|
31
26
|
export class CheckpointAttestation extends Gossipable {
|
|
32
27
|
static override p2pTopic = TopicType.checkpoint_attestation;
|
|
33
28
|
|
|
34
|
-
private
|
|
35
|
-
private
|
|
29
|
+
private cachedSender: EthAddress | undefined | null = undefined;
|
|
30
|
+
private cachedProposer: EthAddress | undefined | null = undefined;
|
|
36
31
|
|
|
37
32
|
constructor(
|
|
38
33
|
/** The payload of the message, and what the signature is over */
|
|
@@ -57,8 +52,8 @@ export class CheckpointAttestation extends Gossipable {
|
|
|
57
52
|
.transform(obj => new CheckpointAttestation(obj.payload, obj.signature, obj.proposerSignature));
|
|
58
53
|
}
|
|
59
54
|
|
|
60
|
-
override generateP2PMessageIdentifier(): Promise<
|
|
61
|
-
return Promise.resolve(
|
|
55
|
+
override generateP2PMessageIdentifier(): Promise<BaseBuffer32> {
|
|
56
|
+
return Promise.resolve(CheckpointAttestationHash.fromBuffer(keccak256(this.signature.toBuffer())));
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
get archive(): Fr {
|
|
@@ -69,22 +64,19 @@ export class CheckpointAttestation extends Gossipable {
|
|
|
69
64
|
return this.payload.header.slotNumber;
|
|
70
65
|
}
|
|
71
66
|
|
|
67
|
+
get signatureContext(): CoordinationSignatureContext {
|
|
68
|
+
return this.payload.signatureContext;
|
|
69
|
+
}
|
|
70
|
+
|
|
72
71
|
/**
|
|
73
72
|
* Lazily evaluate and cache the signer of the attestation
|
|
74
73
|
* @returns The signer of the attestation, or undefined if signature recovery fails
|
|
75
74
|
*/
|
|
76
75
|
getSender(): EthAddress | undefined {
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
const hashed = getHashedSignaturePayloadEthSignedMessage(
|
|
80
|
-
this.payload,
|
|
81
|
-
SignatureDomainSeparator.checkpointAttestation,
|
|
82
|
-
);
|
|
83
|
-
// Cache the sender for later use
|
|
84
|
-
this.sender = tryRecoverAddress(hashed, this.signature);
|
|
76
|
+
if (this.cachedSender === undefined) {
|
|
77
|
+
this.cachedSender = recoverCoordinationSigner(this.payload, this.signature) ?? null;
|
|
85
78
|
}
|
|
86
|
-
|
|
87
|
-
return this.sender;
|
|
79
|
+
return this.cachedSender ?? undefined;
|
|
88
80
|
}
|
|
89
81
|
|
|
90
82
|
/**
|
|
@@ -92,7 +84,7 @@ export class CheckpointAttestation extends Gossipable {
|
|
|
92
84
|
* @returns The proposer of the checkpoint
|
|
93
85
|
*/
|
|
94
86
|
getProposer(): EthAddress | undefined {
|
|
95
|
-
if (
|
|
87
|
+
if (this.cachedProposer === undefined) {
|
|
96
88
|
// Create a temporary CheckpointProposal to recover the proposer address.
|
|
97
89
|
// We need to use CheckpointProposal because it has a different getPayloadToSign()
|
|
98
90
|
// implementation than ConsensusPayload (uses serializeToBuffer vs ABI encoding).
|
|
@@ -101,16 +93,15 @@ export class CheckpointAttestation extends Gossipable {
|
|
|
101
93
|
this.payload.archive,
|
|
102
94
|
this.payload.feeAssetPriceModifier,
|
|
103
95
|
this.proposerSignature,
|
|
96
|
+
this.payload.signatureContext,
|
|
104
97
|
);
|
|
105
|
-
|
|
106
|
-
this.proposer = proposal.getSender();
|
|
98
|
+
this.cachedProposer = proposal.getSender() ?? null;
|
|
107
99
|
}
|
|
108
|
-
|
|
109
|
-
return this.proposer;
|
|
100
|
+
return this.cachedProposer ?? undefined;
|
|
110
101
|
}
|
|
111
102
|
|
|
112
103
|
getPayload(): Buffer {
|
|
113
|
-
return this.payload.getPayloadToSign(
|
|
104
|
+
return this.payload.getPayloadToSign();
|
|
114
105
|
}
|
|
115
106
|
|
|
116
107
|
toBuffer(): Buffer {
|