@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
package/dest/tx/tx_request.d.ts
CHANGED
|
@@ -10,26 +10,26 @@ import { TxContext } from './tx_context.js';
|
|
|
10
10
|
export declare class TxRequest {
|
|
11
11
|
/** Sender. */
|
|
12
12
|
origin: AztecAddress;
|
|
13
|
-
/** Function data representing the function to call. */
|
|
14
|
-
functionData: FunctionData;
|
|
15
13
|
/** Pedersen hash of function arguments. */
|
|
16
14
|
argsHash: Fr;
|
|
17
15
|
/** Transaction context. */
|
|
18
16
|
txContext: TxContext;
|
|
17
|
+
/** Function data representing the function to call. */
|
|
18
|
+
functionData: FunctionData;
|
|
19
19
|
/** A salt to make the hash difficult to predict. The hash is used as the first nullifier if there is no nullifier emitted throughout the tx. */
|
|
20
20
|
salt: Fr;
|
|
21
21
|
constructor(
|
|
22
22
|
/** Sender. */
|
|
23
23
|
origin: AztecAddress,
|
|
24
|
-
/** Function data representing the function to call. */
|
|
25
|
-
functionData: FunctionData,
|
|
26
24
|
/** Pedersen hash of function arguments. */
|
|
27
25
|
argsHash: Fr,
|
|
28
26
|
/** Transaction context. */
|
|
29
27
|
txContext: TxContext,
|
|
28
|
+
/** Function data representing the function to call. */
|
|
29
|
+
functionData: FunctionData,
|
|
30
30
|
/** A salt to make the hash difficult to predict. The hash is used as the first nullifier if there is no nullifier emitted throughout the tx. */
|
|
31
31
|
salt: Fr);
|
|
32
|
-
static getFields(fields: FieldsOf<TxRequest>): readonly [AztecAddress,
|
|
32
|
+
static getFields(fields: FieldsOf<TxRequest>): readonly [AztecAddress, Fr, TxContext, FunctionData, Fr];
|
|
33
33
|
static from(fields: FieldsOf<TxRequest>): TxRequest;
|
|
34
34
|
/**
|
|
35
35
|
* Serialize as a buffer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_request.d.ts","sourceRoot":"","sources":["../../src/tx/tx_request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAwC,MAAM,6BAA6B,CAAC;AACjG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,2B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IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAW3D,IAAI;IAIJ,MAAM,CAAC,KAAK;IAIZ,OAAO;CASR"}
|
package/dest/tx/tx_request.js
CHANGED
|
@@ -9,25 +9,25 @@ import { TxContext } from './tx_context.js';
|
|
|
9
9
|
* Transaction request.
|
|
10
10
|
*/ export class TxRequest {
|
|
11
11
|
origin;
|
|
12
|
-
functionData;
|
|
13
12
|
argsHash;
|
|
14
13
|
txContext;
|
|
14
|
+
functionData;
|
|
15
15
|
salt;
|
|
16
16
|
// docs:start:constructor
|
|
17
|
-
constructor(/** Sender. */ origin, /**
|
|
17
|
+
constructor(/** Sender. */ origin, /** Pedersen hash of function arguments. */ argsHash, /** Transaction context. */ txContext, /** Function data representing the function to call. */ functionData, /** A salt to make the hash difficult to predict. The hash is used as the first nullifier if there is no nullifier emitted throughout the tx. */ salt){
|
|
18
18
|
this.origin = origin;
|
|
19
|
-
this.functionData = functionData;
|
|
20
19
|
this.argsHash = argsHash;
|
|
21
20
|
this.txContext = txContext;
|
|
21
|
+
this.functionData = functionData;
|
|
22
22
|
this.salt = salt;
|
|
23
23
|
}
|
|
24
24
|
// docs:end:constructor
|
|
25
25
|
static getFields(fields) {
|
|
26
26
|
return [
|
|
27
27
|
fields.origin,
|
|
28
|
-
fields.functionData,
|
|
29
28
|
fields.argsHash,
|
|
30
29
|
fields.txContext,
|
|
30
|
+
fields.functionData,
|
|
31
31
|
fields.salt
|
|
32
32
|
];
|
|
33
33
|
}
|
|
@@ -55,15 +55,15 @@ import { TxContext } from './tx_context.js';
|
|
|
55
55
|
* @returns The deserialized TxRequest object.
|
|
56
56
|
*/ static fromBuffer(buffer) {
|
|
57
57
|
const reader = BufferReader.asReader(buffer);
|
|
58
|
-
return new TxRequest(reader.readObject(AztecAddress),
|
|
58
|
+
return new TxRequest(reader.readObject(AztecAddress), Fr.fromBuffer(reader), reader.readObject(TxContext), reader.readObject(FunctionData), Fr.fromBuffer(reader));
|
|
59
59
|
}
|
|
60
60
|
hash() {
|
|
61
61
|
return poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.TX_REQUEST);
|
|
62
62
|
}
|
|
63
63
|
static empty() {
|
|
64
|
-
return new TxRequest(AztecAddress.ZERO,
|
|
64
|
+
return new TxRequest(AztecAddress.ZERO, Fr.zero(), TxContext.empty(), FunctionData.empty(), Fr.zero());
|
|
65
65
|
}
|
|
66
66
|
isEmpty() {
|
|
67
|
-
return this.origin.isZero() && this.
|
|
67
|
+
return this.origin.isZero() && this.argsHash.isZero() && this.txContext.isEmpty() && this.functionData.isEmpty() && this.salt.isZero();
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -17,6 +17,7 @@ export declare const TX_ERROR_CONTRACT_CLASS_LOG_COUNT = "Mismatched number of c
|
|
|
17
17
|
export declare const TX_ERROR_CONTRACT_CLASS_LOG_LENGTH = "Incorrect contract class logs length";
|
|
18
18
|
export declare const TX_ERROR_CONTRACT_CLASS_LOGS = "Mismatched contract class logs";
|
|
19
19
|
export declare const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = "Incorrectly sorted contract class logs";
|
|
20
|
+
export declare const TX_ERROR_INCORRECT_HASH = "Incorrect tx hash";
|
|
20
21
|
export declare const TX_ERROR_BLOCK_HEADER = "Block header not found";
|
|
21
22
|
export declare const TX_ERROR_DURING_VALIDATION = "Unexpected error during validation";
|
|
22
23
|
//# sourceMappingURL=error_texts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_texts.d.ts","sourceRoot":"","sources":["../../../src/tx/validator/error_texts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iCAAiC,6BAA6B,CAAC;AAC5E,eAAO,MAAM,uCAAuC,mCAAmC,CAAC;AACxF,eAAO,MAAM,+BAA+B,8CAA8C,CAAC;AAG3F,eAAO,MAAM,mCAAmC,qCAAqC,CAAC;AAGtF,eAAO,MAAM,kCAAkC,8BAA8B,CAAC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gCAAgC,8CAA8C,CAAC;AAC5F,eAAO,MAAM,iCAAiC,uDAAuD,CAAC;AACtG,eAAO,MAAM,iCAAiC,6CAA6C,CAAC;AAC5F,eAAO,MAAM,kCAAkC,yCAAyC,CAAC;AACzF,eAAO,MAAM,4BAA4B,mCAAmC,CAAC;AAC7E,eAAO,MAAM,mCAAmC,2CAA2C,CAAC;AAC5F,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAG3D,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAG9D,eAAO,MAAM,0BAA0B,uCAAuC,CAAC"}
|
|
@@ -23,6 +23,7 @@ export const TX_ERROR_CONTRACT_CLASS_LOG_COUNT = 'Mismatched number of contract
|
|
|
23
23
|
export const TX_ERROR_CONTRACT_CLASS_LOG_LENGTH = 'Incorrect contract class logs length';
|
|
24
24
|
export const TX_ERROR_CONTRACT_CLASS_LOGS = 'Mismatched contract class logs';
|
|
25
25
|
export const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = 'Incorrectly sorted contract class logs';
|
|
26
|
+
export const TX_ERROR_INCORRECT_HASH = 'Incorrect tx hash';
|
|
26
27
|
// Block header
|
|
27
28
|
export const TX_ERROR_BLOCK_HEADER = 'Block header not found';
|
|
28
29
|
// General
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ProcessedTx } from '../processed_tx.js';
|
|
3
3
|
import type { Tx } from '../tx.js';
|
|
4
|
+
import type { TxHash } from '../tx_hash.js';
|
|
4
5
|
export type AnyTx = Tx | ProcessedTx;
|
|
6
|
+
export declare function getTxHash(tx: AnyTx): TxHash;
|
|
5
7
|
export declare function hasPublicCalls(tx: AnyTx): boolean;
|
|
6
8
|
export type TxValidationResult = {
|
|
7
9
|
result: 'valid';
|
|
@@ -28,19 +30,19 @@ export declare const TxValidationResultSchema: z.ZodDiscriminatedUnion<"result",
|
|
|
28
30
|
result: z.ZodLiteral<"invalid">;
|
|
29
31
|
reason: z.ZodArray<z.ZodString, "many">;
|
|
30
32
|
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
result: "invalid";
|
|
32
33
|
reason: string[];
|
|
33
|
-
}, {
|
|
34
34
|
result: "invalid";
|
|
35
|
+
}, {
|
|
35
36
|
reason: string[];
|
|
37
|
+
result: "invalid";
|
|
36
38
|
}>, z.ZodObject<{
|
|
37
39
|
result: z.ZodLiteral<"skipped">;
|
|
38
40
|
reason: z.ZodArray<z.ZodString, "many">;
|
|
39
41
|
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
result: "skipped";
|
|
41
42
|
reason: string[];
|
|
42
|
-
}, {
|
|
43
43
|
result: "skipped";
|
|
44
|
+
}, {
|
|
44
45
|
reason: string[];
|
|
46
|
+
result: "skipped";
|
|
45
47
|
}>]>;
|
|
46
48
|
//# sourceMappingURL=tx_validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_validator.d.ts","sourceRoot":"","sources":["../../../src/tx/validator/tx_validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tx_validator.d.ts","sourceRoot":"","sources":["../../../src/tx/validator/tx_validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG,EAAE,GAAG,WAAW,CAAC;AAErC,wBAAgB,SAAS,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM,CAE3C;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,KAAK,GAAG,OAAO,CAEjD;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE5C,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK;IAClD,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChD;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,8IAA8I;AAC9I,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAIlB,eAAe,EAAE,UAAU,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,2BAA2B,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,qDAAqD;AACrD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,WAAW,EACnB,2BAA2B,EAAE,MAAM,GAAG,EAAE,EACxC,oBAAoB,EAAE,MAAM,GAAG,EAAE,GAChC,kBAAkB,CAQpB;AAED,qGAAqG;AACrG,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,CAiB9E;AAED,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAIzD;AAED,iGAAiG;AACjG,wBAAgB,+BAA+B,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,QA6B/F;AAED,8EAA8E;AAC9E,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACrC,MAAM,EAAE,OAAO,CAAC,kBAAkB,CAAC,QAiBpC;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,IAC7D,KAAK,GAAG,CAAC,OAAO,EAAE,MAAM,MAAM,OAAO,CAAC,IAAI,CAAC,mBAS1D;AAED,0FAA0F;AAC1F,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,OAAO,CAAC,kBAAkB,CAAC,IACxE,aAAa;IAAE,OAAO,EAAE;QAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,CAAA;CAAE,mBAYzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification_key.d.ts","sourceRoot":"","sources":["../../src/vks/verification_key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verification_key.d.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,qBAAa,mBAAmB;aAEZ,WAAW,EAAE,uBAAuB;aACpC,UAAU,EAAE,MAAM;gBADlB,WAAW,EAAE,uBAAuB,EACpC,UAAU,EAAE,MAAM;IAGpC,IAAW,eAAe,WAEzB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,WAAW,YAErB;IAED,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,YAAY,IAAI,mBAAmB;IAI1C,MAAM,CAAC,kBAAkB,IAAI,mBAAmB;IAOhD,MAAM,CAAC,QAAQ,CAAC,GAAG,SAA4B,GAAG,mBAAmB;IAIrE;;;OAGG;IACH,QAAQ;IAIR,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,mBAAmB;IAQrE,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAI5C,KAAK;IAIZ,2DAA2D;IAC3D,MAAM;IAIN,6CAA6C;IAC7C,MAAM,KAAK,MAAM,4DAEhB;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ULTRA_VK_LENGTH_IN_FIELDS } from '@aztec/constants';
|
|
2
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
3
|
import { times } from '@aztec/foundation/collection';
|
|
4
4
|
import { Fq, Fr } from '@aztec/foundation/fields';
|
|
@@ -122,10 +122,10 @@ export const CIRCUIT_RECURSIVE_INDEX = 3;
|
|
|
122
122
|
return new VerificationKeyAsFields(makeTuple(size, Fr.random, seed), Fr.random());
|
|
123
123
|
}
|
|
124
124
|
static makeFakeHonk(seed = 1) {
|
|
125
|
-
return new VerificationKeyAsFields(makeTuple(
|
|
125
|
+
return new VerificationKeyAsFields(makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, Fr.random, seed), Fr.random());
|
|
126
126
|
}
|
|
127
127
|
static makeFakeRollupHonk(seed = 1) {
|
|
128
|
-
return new VerificationKeyAsFields(makeTuple(
|
|
128
|
+
return new VerificationKeyAsFields(makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, (i)=>new Fr(i), seed), new Fr(seed + 1));
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Builds an 'empty' verification key
|
|
@@ -212,7 +212,7 @@ export class VerificationKeyData {
|
|
|
212
212
|
static makeFakeRollupHonk() {
|
|
213
213
|
return new VerificationKeyData(VerificationKeyAsFields.makeFakeRollupHonk(), VerificationKey.makeRollupFake().toBuffer());
|
|
214
214
|
}
|
|
215
|
-
static makeFake(len =
|
|
215
|
+
static makeFake(len = ULTRA_VK_LENGTH_IN_FIELDS) {
|
|
216
216
|
return new VerificationKeyData(VerificationKeyAsFields.makeFake(len), VerificationKey.makeFake().toBuffer());
|
|
217
217
|
}
|
|
218
218
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-nightly.20250813",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./avm": "./dest/avm/index.js",
|
|
25
25
|
"./schemas": "./dest/schemas/index.js",
|
|
26
26
|
"./noir": "./dest/noir/index.js",
|
|
27
|
-
"./
|
|
27
|
+
"./delayed-public-mutable": "./dest/delayed_public_mutable/index.js",
|
|
28
28
|
"./parity": "./dest/parity/index.js",
|
|
29
29
|
"./vks": "./dest/vks/index.js",
|
|
30
30
|
"./proofs": "./dest/proofs/index.js",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"./file-store": "./dest/file-store/index.js",
|
|
51
51
|
"./snapshots": "./dest/snapshots/index.js",
|
|
52
52
|
"./update-checker": "./dest/update-checker/index.js",
|
|
53
|
-
"./zkpassport": "./dest/zkpassport/index.js"
|
|
53
|
+
"./zkpassport": "./dest/zkpassport/index.js",
|
|
54
|
+
"./slashing": "./dest/slashing/index.js"
|
|
54
55
|
},
|
|
55
56
|
"typedocOptions": {
|
|
56
57
|
"entryPoints": [
|
|
@@ -67,12 +68,12 @@
|
|
|
67
68
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
|
-
"@aztec/bb.js": "
|
|
71
|
-
"@aztec/blob-lib": "
|
|
72
|
-
"@aztec/constants": "
|
|
73
|
-
"@aztec/ethereum": "
|
|
74
|
-
"@aztec/foundation": "
|
|
75
|
-
"@aztec/noir-noirc_abi": "
|
|
71
|
+
"@aztec/bb.js": "2.0.0-nightly.20250813",
|
|
72
|
+
"@aztec/blob-lib": "2.0.0-nightly.20250813",
|
|
73
|
+
"@aztec/constants": "2.0.0-nightly.20250813",
|
|
74
|
+
"@aztec/ethereum": "2.0.0-nightly.20250813",
|
|
75
|
+
"@aztec/foundation": "2.0.0-nightly.20250813",
|
|
76
|
+
"@aztec/noir-noirc_abi": "2.0.0-nightly.20250813",
|
|
76
77
|
"@google-cloud/storage": "^7.15.0",
|
|
77
78
|
"axios": "^1.9.0",
|
|
78
79
|
"json-stringify-deterministic": "1.0.12",
|
package/src/abi/abi.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { inflate } from 'pako';
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
9
9
|
import { FunctionSelector } from './function_selector.js';
|
|
10
|
-
import { NoteSelector } from './note_selector.js';
|
|
11
10
|
|
|
12
11
|
/** A basic value. */
|
|
13
12
|
export interface BasicValue<T extends string, V> {
|
|
@@ -313,38 +312,6 @@ export type DebugFileMap = Record<
|
|
|
313
312
|
}
|
|
314
313
|
>;
|
|
315
314
|
|
|
316
|
-
/** Type representing a field of a note (e.g. `amount` in `TokenNote`). */
|
|
317
|
-
export type NoteField = {
|
|
318
|
-
/** Name of the field (e.g. `amount`). */
|
|
319
|
-
name: string;
|
|
320
|
-
/** Index where the note field starts in the serialized note array. */
|
|
321
|
-
index: number;
|
|
322
|
-
/** Whether the field can be unset when creating the note (in the partial notes flow). */
|
|
323
|
-
nullable: boolean;
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
export const NoteFieldSchema = z.object({
|
|
327
|
-
name: z.string(),
|
|
328
|
-
index: z.number(),
|
|
329
|
-
nullable: z.boolean(),
|
|
330
|
-
}) satisfies z.ZodType<NoteField>;
|
|
331
|
-
|
|
332
|
-
/** Type representing a note in use in the contract. */
|
|
333
|
-
export type ContractNote = {
|
|
334
|
-
/** Note identifier */
|
|
335
|
-
id: NoteSelector;
|
|
336
|
-
/** Type of the note (e.g., 'TransparentNote') */
|
|
337
|
-
typ: string;
|
|
338
|
-
/** Fields of the note. */
|
|
339
|
-
fields: NoteField[];
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
export const ContractNoteSchema = z.object({
|
|
343
|
-
id: NoteSelector.schema,
|
|
344
|
-
typ: z.string(),
|
|
345
|
-
fields: z.array(NoteFieldSchema),
|
|
346
|
-
}) satisfies ZodFor<ContractNote>;
|
|
347
|
-
|
|
348
315
|
/** Type representing a field layout in the storage of a contract. */
|
|
349
316
|
export type FieldLayout = {
|
|
350
317
|
/** Slot in which the field is stored. */
|
|
@@ -371,9 +338,6 @@ export interface ContractArtifact {
|
|
|
371
338
|
/** Storage layout */
|
|
372
339
|
storageLayout: Record<string, FieldLayout>;
|
|
373
340
|
|
|
374
|
-
/** The notes used in the contract. */
|
|
375
|
-
notes: Record<string, ContractNote>;
|
|
376
|
-
|
|
377
341
|
/** The map of file ID to the source code and path of the file. */
|
|
378
342
|
fileMap: DebugFileMap;
|
|
379
343
|
}
|
|
@@ -398,7 +362,6 @@ export const ContractArtifactSchema: ZodFor<ContractArtifact> = z.object({
|
|
|
398
362
|
globals: z.record(z.array(AbiValueSchema)),
|
|
399
363
|
}),
|
|
400
364
|
storageLayout: z.record(z.object({ slot: schemas.Fr })),
|
|
401
|
-
notes: z.record(ContractNoteSchema),
|
|
402
365
|
fileMap: z.record(z.coerce.number(), z.object({ source: z.string(), path: z.string() })),
|
|
403
366
|
});
|
|
404
367
|
|
|
@@ -567,6 +530,5 @@ export function emptyContractArtifact(): ContractArtifact {
|
|
|
567
530
|
},
|
|
568
531
|
storageLayout: {},
|
|
569
532
|
fileMap: {},
|
|
570
|
-
notes: {},
|
|
571
533
|
};
|
|
572
534
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { fromHex, toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
+
import { poseidon2HashBytes, randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import type { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { hexSchemaFor } from '@aztec/foundation/schemas';
|
|
5
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
6
|
+
|
|
7
|
+
import { Selector } from './selector.js';
|
|
8
|
+
|
|
9
|
+
/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */
|
|
10
|
+
|
|
11
|
+
/** Authorization selector branding */
|
|
12
|
+
export interface AuthorizationSelector {
|
|
13
|
+
/** Brand. */
|
|
14
|
+
_branding: 'AuthorizationSelector';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An authorization selector is the first 4 bytes of the hash of an authorization struct signature.
|
|
19
|
+
*/
|
|
20
|
+
export class AuthorizationSelector extends Selector {
|
|
21
|
+
/**
|
|
22
|
+
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
23
|
+
* @param buffer - Buffer or BufferReader to read from.
|
|
24
|
+
* @returns The Selector.
|
|
25
|
+
*/
|
|
26
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
27
|
+
const reader = BufferReader.asReader(buffer);
|
|
28
|
+
const value = Number(toBigIntBE(reader.readBytes(Selector.SIZE)));
|
|
29
|
+
return new AuthorizationSelector(value);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Converts a field to selector.
|
|
34
|
+
* @param fr - The field to convert.
|
|
35
|
+
* @returns The selector.
|
|
36
|
+
*/
|
|
37
|
+
static fromField(fr: Fr) {
|
|
38
|
+
return new AuthorizationSelector(Number(fr.toBigInt()));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Creates a selector from a signature.
|
|
43
|
+
* @param signature - Signature to generate the selector for (e.g. "CallAuthorization(field,field)").
|
|
44
|
+
* @returns selector.
|
|
45
|
+
*/
|
|
46
|
+
static async fromSignature(signature: string) {
|
|
47
|
+
// throw if signature contains whitespace
|
|
48
|
+
if (/\s/.test(signature)) {
|
|
49
|
+
throw new Error('Signature cannot contain whitespace');
|
|
50
|
+
}
|
|
51
|
+
const hash = await poseidon2HashBytes(Buffer.from(signature));
|
|
52
|
+
// We take the last Selector.SIZE big endian bytes
|
|
53
|
+
const bytes = hash.toBuffer().slice(-Selector.SIZE);
|
|
54
|
+
return AuthorizationSelector.fromBuffer(bytes);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Create a Selector instance from a hex-encoded string.
|
|
59
|
+
*
|
|
60
|
+
* @param selector - The hex-encoded string representing the Selector.
|
|
61
|
+
* @returns An Selector instance.
|
|
62
|
+
* @throws If the selector length is invalid.
|
|
63
|
+
*/
|
|
64
|
+
static fromString(selector: string) {
|
|
65
|
+
const buf = fromHex(selector);
|
|
66
|
+
if (buf.length !== Selector.SIZE) {
|
|
67
|
+
throw new Error(`Invalid AuthorizationSelector length ${buf.length} (expected ${Selector.SIZE}).`);
|
|
68
|
+
}
|
|
69
|
+
return AuthorizationSelector.fromBuffer(buf);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Creates an empty selector.
|
|
74
|
+
* @returns An empty selector.
|
|
75
|
+
*/
|
|
76
|
+
static empty() {
|
|
77
|
+
return new AuthorizationSelector(0);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates a random selector.
|
|
82
|
+
* @returns A random selector.
|
|
83
|
+
*/
|
|
84
|
+
static random() {
|
|
85
|
+
return AuthorizationSelector.fromBuffer(randomBytes(Selector.SIZE));
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
toJSON() {
|
|
89
|
+
return this.toString();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static get schema() {
|
|
93
|
+
return hexSchemaFor(AuthorizationSelector);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
type BasicValue,
|
|
8
8
|
type ContractArtifact,
|
|
9
9
|
ContractArtifactSchema,
|
|
10
|
-
type ContractNote,
|
|
11
10
|
type FieldLayout,
|
|
12
11
|
type FunctionAbi,
|
|
13
12
|
type FunctionArtifact,
|
|
@@ -276,52 +275,6 @@ function getStorageLayout(input: NoirCompiledContract) {
|
|
|
276
275
|
}, {});
|
|
277
276
|
}
|
|
278
277
|
|
|
279
|
-
/**
|
|
280
|
-
* Generates records of the notes with note type ids of the artifact.
|
|
281
|
-
* @param input - The compiled noir contract to get note types for
|
|
282
|
-
* @return A record of the note types and their ids
|
|
283
|
-
*/
|
|
284
|
-
function getNoteTypes(input: NoirCompiledContract) {
|
|
285
|
-
// The type is useless here as it does not give us any guarantee (e.g. `AbiValue` can be one of many different
|
|
286
|
-
// types) so we nuke it and later we manually check the values are as we expect.
|
|
287
|
-
const notes = input.outputs.globals.notes as any[];
|
|
288
|
-
|
|
289
|
-
if (!notes) {
|
|
290
|
-
return {};
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return notes.reduce((acc: Record<string, Omit<ContractNote, 'id'> & { id: string }>, note) => {
|
|
294
|
-
const noteFields = note.fields;
|
|
295
|
-
|
|
296
|
-
// We find note type id by looking for respective kinds as each of them is unique
|
|
297
|
-
const rawNoteTypeId = noteFields.find((field: any) => field.kind === 'integer');
|
|
298
|
-
const rawName = noteFields.find((field: any) => field.kind === 'string');
|
|
299
|
-
const rawNoteFields = noteFields.find((field: any) => field.kind === 'struct');
|
|
300
|
-
|
|
301
|
-
if (!rawNoteTypeId || !rawName || !rawNoteFields) {
|
|
302
|
-
throw new Error(`Could not find note type id, name or fields for note ${note}`);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const noteTypeId = rawNoteTypeId.value as string;
|
|
306
|
-
const name = rawName.value as string;
|
|
307
|
-
|
|
308
|
-
// Note type id is encoded as a hex string
|
|
309
|
-
const fields = rawNoteFields.fields.map((field: any) => {
|
|
310
|
-
return {
|
|
311
|
-
name: field.name,
|
|
312
|
-
index: parseInt(field.value.fields[0].value.value, 16),
|
|
313
|
-
nullable: field.value.fields[1].value.value,
|
|
314
|
-
};
|
|
315
|
-
});
|
|
316
|
-
acc[name] = {
|
|
317
|
-
id: noteTypeId,
|
|
318
|
-
typ: name,
|
|
319
|
-
fields,
|
|
320
|
-
};
|
|
321
|
-
return acc;
|
|
322
|
-
}, {});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
278
|
/**
|
|
326
279
|
* Given a Nargo output generates an Aztec-compatible contract artifact.
|
|
327
280
|
* Does not include public bytecode, apart from the public_dispatch function.
|
|
@@ -338,7 +291,6 @@ function generateContractArtifact(contract: NoirCompiledContract): ContractArtif
|
|
|
338
291
|
.map(f => generateFunctionAbi(f, contract)),
|
|
339
292
|
outputs: contract.outputs,
|
|
340
293
|
storageLayout: getStorageLayout(contract),
|
|
341
|
-
notes: getNoteTypes(contract),
|
|
342
294
|
fileMap: contract.file_map,
|
|
343
295
|
});
|
|
344
296
|
} catch (err) {
|
|
@@ -362,7 +314,6 @@ function generateContractArtifactForPublic(contract: NoirCompiledContract): Cont
|
|
|
362
314
|
.map(f => generateFunctionAbi(f, contract)),
|
|
363
315
|
outputs: contract.outputs,
|
|
364
316
|
storageLayout: getStorageLayout(contract),
|
|
365
|
-
notes: getNoteTypes(contract),
|
|
366
317
|
fileMap: contract.file_map,
|
|
367
318
|
});
|
|
368
319
|
} catch (err) {
|
package/src/abi/decoder.ts
CHANGED
|
@@ -95,13 +95,10 @@ class AbiDecoder {
|
|
|
95
95
|
* @returns The decoded return values.
|
|
96
96
|
*/
|
|
97
97
|
public decode(): AbiDecoded {
|
|
98
|
-
if (this.types.length
|
|
99
|
-
|
|
98
|
+
if (this.types.length === 1) {
|
|
99
|
+
return this.decodeNext(this.types[0]);
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
return [];
|
|
103
|
-
}
|
|
104
|
-
return this.decodeNext(this.types[0]);
|
|
101
|
+
return this.types.map(type => this.decodeNext(type));
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
104
|
|
package/src/abi/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './abi.js';
|
|
|
2
2
|
export * from './buffer.js';
|
|
3
3
|
export * from './decoder.js';
|
|
4
4
|
export * from './encoder.js';
|
|
5
|
+
export * from './authorization_selector.js';
|
|
5
6
|
export * from './event_selector.js';
|
|
6
7
|
export * from './function_selector.js';
|
|
7
8
|
export * from './note_selector.js';
|
package/src/avm/avm.ts
CHANGED
|
@@ -388,7 +388,6 @@ export class AvmRevertCheckpointHint {
|
|
|
388
388
|
export class AvmTxHint {
|
|
389
389
|
constructor(
|
|
390
390
|
public readonly hash: string,
|
|
391
|
-
public readonly globalVariables: GlobalVariables,
|
|
392
391
|
public readonly gasSettings: GasSettings,
|
|
393
392
|
public readonly effectiveGasFees: GasFees,
|
|
394
393
|
public readonly nonRevertibleAccumulatedData: {
|
|
@@ -410,7 +409,7 @@ export class AvmTxHint {
|
|
|
410
409
|
public readonly feePayer: AztecAddress,
|
|
411
410
|
) {}
|
|
412
411
|
|
|
413
|
-
static
|
|
412
|
+
static fromTx(tx: Tx): AvmTxHint {
|
|
414
413
|
const setupCallRequests = tx.getNonRevertiblePublicCallRequestsWithCalldata();
|
|
415
414
|
const appLogicCallRequests = tx.getRevertiblePublicCallRequestsWithCalldata();
|
|
416
415
|
const teardownCallRequest = tx.getTeardownPublicCallRequestWithCalldata();
|
|
@@ -421,11 +420,10 @@ export class AvmTxHint {
|
|
|
421
420
|
);
|
|
422
421
|
|
|
423
422
|
// For informational purposes. Assumed quick because it should be cached.
|
|
424
|
-
const txHash =
|
|
423
|
+
const txHash = tx.getTxHash();
|
|
425
424
|
|
|
426
425
|
return new AvmTxHint(
|
|
427
426
|
txHash.hash.toString(),
|
|
428
|
-
tx.data.constants.historicalHeader.globalVariables,
|
|
429
427
|
gasSettings,
|
|
430
428
|
effectiveGasFees,
|
|
431
429
|
{
|
|
@@ -449,7 +447,6 @@ export class AvmTxHint {
|
|
|
449
447
|
static empty() {
|
|
450
448
|
return new AvmTxHint(
|
|
451
449
|
'',
|
|
452
|
-
GlobalVariables.empty(),
|
|
453
450
|
GasSettings.empty(),
|
|
454
451
|
GasFees.empty(),
|
|
455
452
|
{ noteHashes: [], nullifiers: [], l2ToL1Messages: [] },
|
|
@@ -466,7 +463,6 @@ export class AvmTxHint {
|
|
|
466
463
|
return z
|
|
467
464
|
.object({
|
|
468
465
|
hash: z.string(),
|
|
469
|
-
globalVariables: GlobalVariables.schema,
|
|
470
466
|
gasSettings: GasSettings.schema,
|
|
471
467
|
effectiveGasFees: GasFees.schema,
|
|
472
468
|
nonRevertibleAccumulatedData: z.object({
|
|
@@ -488,7 +484,6 @@ export class AvmTxHint {
|
|
|
488
484
|
.transform(
|
|
489
485
|
({
|
|
490
486
|
hash,
|
|
491
|
-
globalVariables,
|
|
492
487
|
gasSettings,
|
|
493
488
|
effectiveGasFees,
|
|
494
489
|
nonRevertibleAccumulatedData,
|
|
@@ -501,7 +496,6 @@ export class AvmTxHint {
|
|
|
501
496
|
}) =>
|
|
502
497
|
new AvmTxHint(
|
|
503
498
|
hash,
|
|
504
|
-
globalVariables,
|
|
505
499
|
gasSettings,
|
|
506
500
|
effectiveGasFees,
|
|
507
501
|
nonRevertibleAccumulatedData,
|
|
@@ -518,6 +512,7 @@ export class AvmTxHint {
|
|
|
518
512
|
|
|
519
513
|
export class AvmExecutionHints {
|
|
520
514
|
constructor(
|
|
515
|
+
public readonly globalVariables: GlobalVariables,
|
|
521
516
|
public tx: AvmTxHint,
|
|
522
517
|
// Contract hints.
|
|
523
518
|
public readonly contractInstances: AvmContractInstanceHint[] = [],
|
|
@@ -539,12 +534,13 @@ export class AvmExecutionHints {
|
|
|
539
534
|
) {}
|
|
540
535
|
|
|
541
536
|
static empty() {
|
|
542
|
-
return new AvmExecutionHints(AvmTxHint.empty());
|
|
537
|
+
return new AvmExecutionHints(GlobalVariables.empty(), AvmTxHint.empty());
|
|
543
538
|
}
|
|
544
539
|
|
|
545
540
|
static get schema() {
|
|
546
541
|
return z
|
|
547
542
|
.object({
|
|
543
|
+
globalVariables: GlobalVariables.schema,
|
|
548
544
|
tx: AvmTxHint.schema,
|
|
549
545
|
contractInstances: AvmContractInstanceHint.schema.array(),
|
|
550
546
|
contractClasses: AvmContractClassHint.schema.array(),
|
|
@@ -564,6 +560,7 @@ export class AvmExecutionHints {
|
|
|
564
560
|
})
|
|
565
561
|
.transform(
|
|
566
562
|
({
|
|
563
|
+
globalVariables,
|
|
567
564
|
tx,
|
|
568
565
|
contractInstances,
|
|
569
566
|
contractClasses,
|
|
@@ -582,6 +579,7 @@ export class AvmExecutionHints {
|
|
|
582
579
|
revertCheckpointHints,
|
|
583
580
|
}) =>
|
|
584
581
|
new AvmExecutionHints(
|
|
582
|
+
globalVariables,
|
|
585
583
|
tx,
|
|
586
584
|
contractInstances,
|
|
587
585
|
contractClasses,
|
package/src/block/l2_block.ts
CHANGED
|
@@ -148,7 +148,25 @@ export class L2Block {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
toBlockInfo(): BlockInfo {
|
|
152
|
+
return {
|
|
153
|
+
blockHash: this.blockHash?.toString(),
|
|
154
|
+
archive: this.archive.root.toString(),
|
|
155
|
+
blockNumber: this.number,
|
|
156
|
+
slotNumber: Number(this.header.getSlot()),
|
|
157
|
+
txCount: this.body.txEffects.length,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
151
161
|
equals(other: L2Block) {
|
|
152
162
|
return this.archive.equals(other.archive) && this.header.equals(other.header) && this.body.equals(other.body);
|
|
153
163
|
}
|
|
154
164
|
}
|
|
165
|
+
|
|
166
|
+
export type BlockInfo = {
|
|
167
|
+
blockHash?: string;
|
|
168
|
+
archive: string;
|
|
169
|
+
blockNumber: number;
|
|
170
|
+
slotNumber: number;
|
|
171
|
+
txCount: number;
|
|
172
|
+
};
|