@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/src/tx/tx.ts
CHANGED
|
@@ -26,11 +26,12 @@ import { TxHash } from './tx_hash.js';
|
|
|
26
26
|
*/
|
|
27
27
|
export class Tx extends Gossipable {
|
|
28
28
|
static override p2pTopic = TopicType.tx;
|
|
29
|
-
|
|
30
|
-
private txHash: TxHash | undefined;
|
|
29
|
+
|
|
31
30
|
private calldataMap: Map<string, Fr[]> | undefined;
|
|
32
31
|
|
|
33
32
|
constructor(
|
|
33
|
+
/** Identifier of the tx */
|
|
34
|
+
public readonly txHash: TxHash,
|
|
34
35
|
/**
|
|
35
36
|
* Output of the private kernel circuit for this tx.
|
|
36
37
|
*/
|
|
@@ -45,18 +46,18 @@ export class Tx extends Gossipable {
|
|
|
45
46
|
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
46
47
|
* It's checked in data_validator.ts
|
|
47
48
|
*/
|
|
48
|
-
public contractClassLogFields: ContractClassLogFields[],
|
|
49
|
+
public readonly contractClassLogFields: ContractClassLogFields[],
|
|
49
50
|
/**
|
|
50
51
|
* An array of calldata for the enqueued public function calls and the teardown function call.
|
|
51
52
|
*/
|
|
52
|
-
public publicFunctionCalldata: HashedValues[],
|
|
53
|
+
public readonly publicFunctionCalldata: HashedValues[],
|
|
53
54
|
) {
|
|
54
55
|
super();
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
// Gossipable method
|
|
58
|
-
override
|
|
59
|
-
return new Buffer32(
|
|
59
|
+
override generateP2PMessageIdentifier(): Promise<Buffer32> {
|
|
60
|
+
return Promise.resolve(new Buffer32(this.getTxHash().toBuffer()));
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
hasPublicCalls() {
|
|
@@ -106,6 +107,7 @@ export class Tx extends Gossipable {
|
|
|
106
107
|
static fromBuffer(buffer: Buffer | BufferReader): Tx {
|
|
107
108
|
const reader = BufferReader.asReader(buffer);
|
|
108
109
|
return new Tx(
|
|
110
|
+
reader.readObject(TxHash),
|
|
109
111
|
reader.readObject(PrivateKernelTailCircuitPublicInputs),
|
|
110
112
|
reader.readObject(ClientIvcProof),
|
|
111
113
|
reader.readVectorUint8Prefix(ContractClassLogFields),
|
|
@@ -119,6 +121,7 @@ export class Tx extends Gossipable {
|
|
|
119
121
|
*/
|
|
120
122
|
toBuffer() {
|
|
121
123
|
return serializeToBuffer([
|
|
124
|
+
this.txHash,
|
|
122
125
|
this.data,
|
|
123
126
|
this.clientIvcProof,
|
|
124
127
|
serializeArrayOfBufferableToVector(this.contractClassLogFields, 1),
|
|
@@ -134,11 +137,29 @@ export class Tx extends Gossipable {
|
|
|
134
137
|
contractClassLogFields: z.array(ContractClassLogFields.schema),
|
|
135
138
|
publicFunctionCalldata: z.array(HashedValues.schema),
|
|
136
139
|
})
|
|
137
|
-
.transform(Tx.
|
|
140
|
+
.transform(Tx.create);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static async computeTxHash(fields: Pick<FieldsOf<Tx>, 'data'>) {
|
|
144
|
+
const hash = fields.data.forPublic
|
|
145
|
+
? await fields.data.toPrivateToPublicKernelCircuitPublicInputs().hash()
|
|
146
|
+
: await fields.data.toPrivateToRollupKernelCircuitPublicInputs().hash();
|
|
147
|
+
return new TxHash(hash);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
static async create(fields: Omit<FieldsOf<Tx>, 'txHash'>): Promise<Tx> {
|
|
151
|
+
const txHash = await Tx.computeTxHash(fields);
|
|
152
|
+
return Tx.from({ ...fields, txHash });
|
|
138
153
|
}
|
|
139
154
|
|
|
140
155
|
static from(fields: FieldsOf<Tx>) {
|
|
141
|
-
return new Tx(
|
|
156
|
+
return new Tx(
|
|
157
|
+
fields.txHash,
|
|
158
|
+
fields.data,
|
|
159
|
+
fields.clientIvcProof,
|
|
160
|
+
fields.contractClassLogFields,
|
|
161
|
+
fields.publicFunctionCalldata,
|
|
162
|
+
);
|
|
142
163
|
}
|
|
143
164
|
|
|
144
165
|
/**
|
|
@@ -146,8 +167,8 @@ export class Tx extends Gossipable {
|
|
|
146
167
|
* @param logsSource - An instance of `L2LogsSource` which can be used to obtain the logs.
|
|
147
168
|
* @returns The requested logs.
|
|
148
169
|
*/
|
|
149
|
-
public
|
|
150
|
-
return logsSource.getPublicLogs({ txHash:
|
|
170
|
+
public getPublicLogs(logsSource: L2LogsSource): Promise<GetPublicLogsResponse> {
|
|
171
|
+
return logsSource.getPublicLogs({ txHash: this.getTxHash() });
|
|
151
172
|
}
|
|
152
173
|
|
|
153
174
|
getContractClassLogs(): ContractClassLog[] {
|
|
@@ -179,17 +200,11 @@ export class Tx extends Gossipable {
|
|
|
179
200
|
}
|
|
180
201
|
|
|
181
202
|
/**
|
|
182
|
-
*
|
|
203
|
+
* Return transaction hash.
|
|
183
204
|
* @returns The hash of the public inputs of the private kernel tail circuit.
|
|
184
205
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const hash = this.data.forPublic
|
|
188
|
-
? await this.data.toPrivateToPublicKernelCircuitPublicInputs().hash()
|
|
189
|
-
: await this.data.toPrivateToRollupKernelCircuitPublicInputs().hash();
|
|
190
|
-
this.txHash = new TxHash(hash);
|
|
191
|
-
}
|
|
192
|
-
return this.txHash!;
|
|
206
|
+
getTxHash(): TxHash {
|
|
207
|
+
return this.txHash;
|
|
193
208
|
}
|
|
194
209
|
|
|
195
210
|
/**
|
|
@@ -198,8 +213,8 @@ export class Tx extends Gossipable {
|
|
|
198
213
|
* Don't set a Tx hash received from an untrusted source.
|
|
199
214
|
* @param hash - The hash to set.
|
|
200
215
|
*/
|
|
201
|
-
setTxHash(
|
|
202
|
-
this
|
|
216
|
+
setTxHash(_hash: TxHash) {
|
|
217
|
+
return this;
|
|
203
218
|
}
|
|
204
219
|
|
|
205
220
|
getCalldataMap(): Map<string, Fr[]> {
|
|
@@ -213,14 +228,14 @@ export class Tx extends Gossipable {
|
|
|
213
228
|
}
|
|
214
229
|
|
|
215
230
|
/** Returns stats about this tx. */
|
|
216
|
-
|
|
231
|
+
getStats(): TxStats {
|
|
217
232
|
return {
|
|
218
|
-
txHash:
|
|
233
|
+
txHash: this.txHash.toString(),
|
|
219
234
|
|
|
220
235
|
noteHashCount: this.data.getNonEmptyNoteHashes().length,
|
|
221
236
|
nullifierCount: this.data.getNonEmptyNullifiers().length,
|
|
222
237
|
privateLogCount: this.data.getNonEmptyPrivateLogs().length,
|
|
223
|
-
|
|
238
|
+
classPublishedCount: this.data.getNonEmptyContractClassLogsHashes().length,
|
|
224
239
|
contractClassLogSize: this.data.getEmittedContractClassLogsLength(),
|
|
225
240
|
|
|
226
241
|
proofSize: this.clientIvcProof.clientIvcProofBuffer.length,
|
|
@@ -254,24 +269,6 @@ export class Tx extends Gossipable {
|
|
|
254
269
|
);
|
|
255
270
|
}
|
|
256
271
|
|
|
257
|
-
/**
|
|
258
|
-
* Convenience function to get a hash out of a tx or a tx-like.
|
|
259
|
-
* @param tx - Tx-like object.
|
|
260
|
-
* @returns - The hash.
|
|
261
|
-
*/
|
|
262
|
-
static async getHash(tx: Tx | HasHash): Promise<TxHash> {
|
|
263
|
-
return hasHash(tx) ? tx.hash : await tx.getTxHash();
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Convenience function to get array of hashes for an array of txs.
|
|
268
|
-
* @param txs - The txs to get the hashes from.
|
|
269
|
-
* @returns The corresponding array of hashes.
|
|
270
|
-
*/
|
|
271
|
-
static async getHashes(txs: (Tx | HasHash)[]): Promise<TxHash[]> {
|
|
272
|
-
return await Promise.all(txs.map(Tx.getHash));
|
|
273
|
-
}
|
|
274
|
-
|
|
275
272
|
/**
|
|
276
273
|
* Clones a tx, making a deep copy of all fields.
|
|
277
274
|
* @param tx - The transaction to be cloned.
|
|
@@ -282,10 +279,7 @@ export class Tx extends Gossipable {
|
|
|
282
279
|
const clientIvcProof = ClientIvcProof.fromBuffer(tx.clientIvcProof.toBuffer());
|
|
283
280
|
const contractClassLogFields = tx.contractClassLogFields.map(p => p.clone());
|
|
284
281
|
const publicFunctionCalldata = tx.publicFunctionCalldata.map(cd => HashedValues.fromBuffer(cd.toBuffer()));
|
|
285
|
-
const clonedTx = new Tx(publicInputs, clientIvcProof, contractClassLogFields, publicFunctionCalldata);
|
|
286
|
-
if (tx.txHash) {
|
|
287
|
-
clonedTx.setTxHash(TxHash.fromBuffer(tx.txHash.toBuffer()));
|
|
288
|
-
}
|
|
282
|
+
const clonedTx = new Tx(tx.txHash, publicInputs, clientIvcProof, contractClassLogFields, publicFunctionCalldata);
|
|
289
283
|
|
|
290
284
|
return clonedTx;
|
|
291
285
|
}
|
|
@@ -295,13 +289,19 @@ export class Tx extends Gossipable {
|
|
|
295
289
|
* @param randomProof - Whether to create a random proof - this will be random bytes of the full size.
|
|
296
290
|
* @returns A random tx.
|
|
297
291
|
*/
|
|
298
|
-
static random(randomProof =
|
|
299
|
-
return
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
[
|
|
304
|
-
|
|
292
|
+
static random(args: { randomProof?: boolean; txHash?: string | TxHash } = {}): Tx {
|
|
293
|
+
return Tx.from({
|
|
294
|
+
txHash: (typeof args.txHash === 'string' ? TxHash.fromString(args.txHash) : args.txHash) ?? TxHash.random(),
|
|
295
|
+
data: PrivateKernelTailCircuitPublicInputs.emptyWithNullifier(),
|
|
296
|
+
clientIvcProof: args.randomProof ? ClientIvcProof.random() : ClientIvcProof.empty(),
|
|
297
|
+
contractClassLogFields: [ContractClassLogFields.random()],
|
|
298
|
+
publicFunctionCalldata: [HashedValues.random()],
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** Recomputes the tx hash. Used for testing purposes only when a property of the tx was mutated. */
|
|
303
|
+
public async recomputeHash() {
|
|
304
|
+
(this as any).txHash = await Tx.computeTxHash(this);
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
#combinePublicCallRequestWithCallData(request: PublicCallRequest) {
|
|
@@ -313,9 +313,22 @@ export class Tx extends Gossipable {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
/**
|
|
317
|
-
|
|
316
|
+
/**
|
|
317
|
+
* Helper class to handle Serialization and Deserialization of Txs array.
|
|
318
|
+
*/
|
|
319
|
+
export class TxArray extends Array<Tx> {
|
|
320
|
+
static fromBuffer(buffer: Buffer | BufferReader): TxArray {
|
|
321
|
+
try {
|
|
322
|
+
const reader = BufferReader.asReader(buffer);
|
|
323
|
+
const txs = reader.readVector(Tx);
|
|
324
|
+
|
|
325
|
+
return new TxArray(...txs);
|
|
326
|
+
} catch {
|
|
327
|
+
return new TxArray();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
318
330
|
|
|
319
|
-
|
|
320
|
-
|
|
331
|
+
public toBuffer(): Buffer {
|
|
332
|
+
return serializeArrayOfBufferableToVector(this);
|
|
333
|
+
}
|
|
321
334
|
}
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -17,8 +17,6 @@ import {
|
|
|
17
17
|
} from '@aztec/constants';
|
|
18
18
|
import { type FieldsOf, makeTuple, makeTupleAsync } from '@aztec/foundation/array';
|
|
19
19
|
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
20
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
21
|
-
import { sha256Trunc } from '@aztec/foundation/crypto';
|
|
22
20
|
import { Fr } from '@aztec/foundation/fields';
|
|
23
21
|
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
24
22
|
import {
|
|
@@ -28,6 +26,7 @@ import {
|
|
|
28
26
|
serializeToBuffer,
|
|
29
27
|
} from '@aztec/foundation/serialize';
|
|
30
28
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
29
|
+
import { computeUnbalancedMerkleTreeRoot } from '@aztec/foundation/trees';
|
|
31
30
|
|
|
32
31
|
import { inspect } from 'util';
|
|
33
32
|
import { z } from 'zod';
|
|
@@ -206,29 +205,15 @@ export class TxEffect {
|
|
|
206
205
|
|
|
207
206
|
/**
|
|
208
207
|
* Computes txOutHash of this tx effect.
|
|
209
|
-
* @dev Follows new_sha in
|
|
208
|
+
* @dev Follows new_sha in unbalanced_merkle_tree.nr
|
|
210
209
|
*/
|
|
211
|
-
txOutHash() {
|
|
210
|
+
txOutHash(): Buffer {
|
|
212
211
|
const { l2ToL1Msgs } = this;
|
|
213
212
|
if (l2ToL1Msgs.length == 0) {
|
|
214
213
|
return Buffer.alloc(32);
|
|
215
214
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
l2ToL1Msgs.map(msg => msg.toBuffer()),
|
|
219
|
-
Buffer.alloc(32),
|
|
220
|
-
2 ** depth,
|
|
221
|
-
);
|
|
222
|
-
let nextLayer = [];
|
|
223
|
-
for (let i = 0; i < depth; i++) {
|
|
224
|
-
for (let j = 0; j < thisLayer.length; j += 2) {
|
|
225
|
-
// Store the hash of each pair one layer up
|
|
226
|
-
nextLayer[j / 2] = sha256Trunc(Buffer.concat([thisLayer[j], thisLayer[j + 1]]));
|
|
227
|
-
}
|
|
228
|
-
thisLayer = nextLayer;
|
|
229
|
-
nextLayer = [];
|
|
230
|
-
}
|
|
231
|
-
return thisLayer[0];
|
|
215
|
+
|
|
216
|
+
return computeUnbalancedMerkleTreeRoot(l2ToL1Msgs.map(msg => msg.toBuffer()));
|
|
232
217
|
}
|
|
233
218
|
|
|
234
219
|
static async random(
|
|
@@ -79,10 +79,10 @@ export class TxExecutionRequest {
|
|
|
79
79
|
toTxRequest(): TxRequest {
|
|
80
80
|
return new TxRequest(
|
|
81
81
|
this.origin,
|
|
82
|
-
// Entrypoints must be private as as defined by the protocol.
|
|
83
|
-
new FunctionData(this.functionSelector, true /* isPrivate */),
|
|
84
82
|
this.firstCallArgsHash,
|
|
85
83
|
this.txContext,
|
|
84
|
+
// Entrypoints must be private as defined by the protocol.
|
|
85
|
+
new FunctionData(this.functionSelector, true /* isPrivate */),
|
|
86
86
|
this.salt,
|
|
87
87
|
);
|
|
88
88
|
}
|
package/src/tx/tx_hash.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
+
import { BufferReader, serializeArrayOfBufferableToVector } from '@aztec/foundation/serialize';
|
|
3
3
|
|
|
4
4
|
import { schemas } from '../schemas/index.js';
|
|
5
5
|
|
|
@@ -66,3 +66,23 @@ export class TxHash {
|
|
|
66
66
|
return Fr.SIZE_IN_BYTES;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Helper class to handle Serialization and Deserialization of TxHashes array.
|
|
72
|
+
**/
|
|
73
|
+
export class TxHashArray extends Array<TxHash> {
|
|
74
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
75
|
+
try {
|
|
76
|
+
const reader = BufferReader.asReader(buffer);
|
|
77
|
+
const hashes = reader.readVector(TxHash);
|
|
78
|
+
|
|
79
|
+
return new TxHashArray(...hashes);
|
|
80
|
+
} catch {
|
|
81
|
+
return new TxHashArray();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public toBuffer(): Buffer {
|
|
86
|
+
return serializeArrayOfBufferableToVector([...this]);
|
|
87
|
+
}
|
|
88
|
+
}
|
package/src/tx/tx_request.ts
CHANGED
|
@@ -16,18 +16,19 @@ export class TxRequest {
|
|
|
16
16
|
constructor(
|
|
17
17
|
/** Sender. */
|
|
18
18
|
public origin: AztecAddress,
|
|
19
|
-
/** Function data representing the function to call. */
|
|
20
|
-
public functionData: FunctionData,
|
|
21
19
|
/** Pedersen hash of function arguments. */
|
|
22
20
|
public argsHash: Fr,
|
|
23
21
|
/** Transaction context. */
|
|
24
22
|
public txContext: TxContext,
|
|
23
|
+
/** Function data representing the function to call. */
|
|
24
|
+
public functionData: FunctionData,
|
|
25
25
|
/** 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. */
|
|
26
26
|
public salt: Fr,
|
|
27
27
|
) {}
|
|
28
28
|
// docs:end:constructor
|
|
29
|
+
|
|
29
30
|
static getFields(fields: FieldsOf<TxRequest>) {
|
|
30
|
-
return [fields.origin, fields.
|
|
31
|
+
return [fields.origin, fields.argsHash, fields.txContext, fields.functionData, fields.salt] as const;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
static from(fields: FieldsOf<TxRequest>): TxRequest {
|
|
@@ -59,9 +60,9 @@ export class TxRequest {
|
|
|
59
60
|
const reader = BufferReader.asReader(buffer);
|
|
60
61
|
return new TxRequest(
|
|
61
62
|
reader.readObject(AztecAddress),
|
|
62
|
-
reader.readObject(FunctionData),
|
|
63
63
|
Fr.fromBuffer(reader),
|
|
64
64
|
reader.readObject(TxContext),
|
|
65
|
+
reader.readObject(FunctionData),
|
|
65
66
|
Fr.fromBuffer(reader),
|
|
66
67
|
);
|
|
67
68
|
}
|
|
@@ -71,15 +72,15 @@ export class TxRequest {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
static empty() {
|
|
74
|
-
return new TxRequest(AztecAddress.ZERO,
|
|
75
|
+
return new TxRequest(AztecAddress.ZERO, Fr.zero(), TxContext.empty(), FunctionData.empty(), Fr.zero());
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
isEmpty() {
|
|
78
79
|
return (
|
|
79
80
|
this.origin.isZero() &&
|
|
80
|
-
this.functionData.isEmpty() &&
|
|
81
81
|
this.argsHash.isZero() &&
|
|
82
82
|
this.txContext.isEmpty() &&
|
|
83
|
+
this.functionData.isEmpty() &&
|
|
83
84
|
this.salt.isZero()
|
|
84
85
|
);
|
|
85
86
|
}
|
|
@@ -28,6 +28,7 @@ export const TX_ERROR_CONTRACT_CLASS_LOG_COUNT = 'Mismatched number of contract
|
|
|
28
28
|
export const TX_ERROR_CONTRACT_CLASS_LOG_LENGTH = 'Incorrect contract class logs length';
|
|
29
29
|
export const TX_ERROR_CONTRACT_CLASS_LOGS = 'Mismatched contract class logs';
|
|
30
30
|
export const TX_ERROR_CONTRACT_CLASS_LOG_SORTING = 'Incorrectly sorted contract class logs';
|
|
31
|
+
export const TX_ERROR_INCORRECT_HASH = 'Incorrect tx hash';
|
|
31
32
|
|
|
32
33
|
// Block header
|
|
33
34
|
export const TX_ERROR_BLOCK_HEADER = 'Block header not found';
|
|
@@ -3,9 +3,14 @@ import { z } from 'zod';
|
|
|
3
3
|
import type { ZodFor } from '../../schemas/schemas.js';
|
|
4
4
|
import type { ProcessedTx } from '../processed_tx.js';
|
|
5
5
|
import type { Tx } from '../tx.js';
|
|
6
|
+
import type { TxHash } from '../tx_hash.js';
|
|
6
7
|
|
|
7
8
|
export type AnyTx = Tx | ProcessedTx;
|
|
8
9
|
|
|
10
|
+
export function getTxHash(tx: AnyTx): TxHash {
|
|
11
|
+
return 'txHash' in tx ? tx.txHash : tx.hash;
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
export function hasPublicCalls(tx: AnyTx): boolean {
|
|
10
15
|
return tx.data.numberOfPublicCallRequests() > 0;
|
|
11
16
|
}
|
|
@@ -6,9 +6,6 @@ import type Koa from 'koa';
|
|
|
6
6
|
|
|
7
7
|
import type { ChainConfig } from '../config/chain-config.js';
|
|
8
8
|
|
|
9
|
-
// REFACTOR: This file is not a circuit-type, but at the moment we don't have any other
|
|
10
|
-
// package common to all components that we can use for this shared code.
|
|
11
|
-
|
|
12
9
|
/** Fields that identify a version of the Aztec protocol. Any mismatch between these fields should signal an incompatibility between nodes. */
|
|
13
10
|
export type ComponentsVersions = {
|
|
14
11
|
l1ChainId: number;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS,
|
|
3
|
-
ROLLUP_HONK_VERIFICATION_KEY_LENGTH_IN_FIELDS,
|
|
4
|
-
} from '@aztec/constants';
|
|
1
|
+
import { ULTRA_VK_LENGTH_IN_FIELDS } from '@aztec/constants';
|
|
5
2
|
import { makeTuple } from '@aztec/foundation/array';
|
|
6
3
|
import { times } from '@aztec/foundation/collection';
|
|
7
4
|
import { Fq, Fr } from '@aztec/foundation/fields';
|
|
@@ -151,12 +148,12 @@ export class VerificationKeyAsFields {
|
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
static makeFakeHonk(seed = 1): VerificationKeyAsFields {
|
|
154
|
-
return new VerificationKeyAsFields(makeTuple(
|
|
151
|
+
return new VerificationKeyAsFields(makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, Fr.random, seed), Fr.random());
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
static makeFakeRollupHonk(seed = 1): VerificationKeyAsFields {
|
|
158
155
|
return new VerificationKeyAsFields(
|
|
159
|
-
makeTuple(
|
|
156
|
+
makeTuple(ULTRA_VK_LENGTH_IN_FIELDS, i => new Fr(i), seed),
|
|
160
157
|
new Fr(seed + 1),
|
|
161
158
|
);
|
|
162
159
|
}
|
|
@@ -293,7 +290,7 @@ export class VerificationKeyData {
|
|
|
293
290
|
);
|
|
294
291
|
}
|
|
295
292
|
|
|
296
|
-
static makeFake(len =
|
|
293
|
+
static makeFake(len = ULTRA_VK_LENGTH_IN_FIELDS): VerificationKeyData {
|
|
297
294
|
return new VerificationKeyData(VerificationKeyAsFields.makeFake(len), VerificationKey.makeFake().toBuffer());
|
|
298
295
|
}
|
|
299
296
|
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PeerId } from '@libp2p/interface';
|
|
2
|
-
import type { BlockProposal } from '../p2p/block_proposal.js';
|
|
3
|
-
import type { Tx } from '../tx/tx.js';
|
|
4
|
-
import type { TxHash } from '../tx/tx_hash.js';
|
|
5
|
-
export interface ITxCollector {
|
|
6
|
-
collectTransactions(txHashes: TxHash[], peerWhoSentTheProposal: PeerId | undefined): Promise<{
|
|
7
|
-
txs: Tx[];
|
|
8
|
-
missing?: TxHash[];
|
|
9
|
-
}>;
|
|
10
|
-
collectForBlockProposal(proposal: BlockProposal, peerWhoSentTheProposal: PeerId | undefined): Promise<{
|
|
11
|
-
txs: Tx[];
|
|
12
|
-
missing?: TxHash[];
|
|
13
|
-
}>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=tx-collector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tx-collector.d.ts","sourceRoot":"","sources":["../../src/interfaces/tx-collector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,mBAAmB,CACjB,QAAQ,EAAE,MAAM,EAAE,EAClB,sBAAsB,EAAE,MAAM,GAAG,SAAS,GACzC,OAAO,CAAC;QAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAE9C,uBAAuB,CACrB,QAAQ,EAAE,aAAa,EACvB,sBAAsB,EAAE,MAAM,GAAG,SAAS,GACzC,OAAO,CAAC;QAAE,GAAG,EAAE,EAAE,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC/C"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
4
|
-
import { IncludeByTimestamp } from '../../tx/include_by_timestamp.js';
|
|
5
|
-
/**
|
|
6
|
-
* Validation requests directed at the rollup, accumulated during the execution of the transaction.
|
|
7
|
-
*/
|
|
8
|
-
export declare class RollupValidationRequests {
|
|
9
|
-
/** The highest timestamp of a block in which this transaction can still be included. */
|
|
10
|
-
includeByTimestamp: IncludeByTimestamp;
|
|
11
|
-
constructor(
|
|
12
|
-
/** The highest timestamp of a block in which this transaction can still be included. */
|
|
13
|
-
includeByTimestamp: IncludeByTimestamp);
|
|
14
|
-
getSize(): number;
|
|
15
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
16
|
-
toString(): `0x${string}`;
|
|
17
|
-
static getFields(fields: FieldsOf<RollupValidationRequests>): readonly [IncludeByTimestamp];
|
|
18
|
-
static fromFields(fields: Fr[] | FieldReader): RollupValidationRequests;
|
|
19
|
-
toFields(): Fr[];
|
|
20
|
-
/**
|
|
21
|
-
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
22
|
-
* @param buffer - Buffer or reader to read from.
|
|
23
|
-
* @returns Deserialized object.
|
|
24
|
-
*/
|
|
25
|
-
static fromBuffer(buffer: Buffer | BufferReader): RollupValidationRequests;
|
|
26
|
-
/**
|
|
27
|
-
* Deserializes from a string, corresponding to a write in cpp.
|
|
28
|
-
* @param str - String to read from.
|
|
29
|
-
* @returns Deserialized object.
|
|
30
|
-
*/
|
|
31
|
-
static fromString(str: string): RollupValidationRequests;
|
|
32
|
-
static empty(): RollupValidationRequests;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=rollup_validation_requests.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rollup_validation_requests.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/rollup_validation_requests.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;GAEG;AACH,qBAAa,wBAAwB;IAEjC,wFAAwF;IACjF,kBAAkB,EAAE,kBAAkB;;IAD7C,wFAAwF;IACjF,kBAAkB,EAAE,kBAAkB;IAG/C,OAAO;IAIP,QAAQ;IAIR,QAAQ;IAIR,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,wBAAwB,CAAC;IAI3D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAK5C,QAAQ,IAAI,EAAE,EAAE;IAUhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;CAGb"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ROLLUP_VALIDATION_REQUESTS_LENGTH } from '@aztec/constants';
|
|
2
|
-
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
3
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
-
import { IncludeByTimestamp } from '../../tx/include_by_timestamp.js';
|
|
5
|
-
/**
|
|
6
|
-
* Validation requests directed at the rollup, accumulated during the execution of the transaction.
|
|
7
|
-
*/ export class RollupValidationRequests {
|
|
8
|
-
includeByTimestamp;
|
|
9
|
-
constructor(/** The highest timestamp of a block in which this transaction can still be included. */ includeByTimestamp){
|
|
10
|
-
this.includeByTimestamp = includeByTimestamp;
|
|
11
|
-
}
|
|
12
|
-
getSize() {
|
|
13
|
-
return this.toBuffer().length;
|
|
14
|
-
}
|
|
15
|
-
toBuffer() {
|
|
16
|
-
return serializeToBuffer(this.includeByTimestamp);
|
|
17
|
-
}
|
|
18
|
-
toString() {
|
|
19
|
-
return bufferToHex(this.toBuffer());
|
|
20
|
-
}
|
|
21
|
-
static getFields(fields) {
|
|
22
|
-
return [
|
|
23
|
-
fields.includeByTimestamp
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
static fromFields(fields) {
|
|
27
|
-
const reader = FieldReader.asReader(fields);
|
|
28
|
-
return new RollupValidationRequests(IncludeByTimestamp.fromFields(reader));
|
|
29
|
-
}
|
|
30
|
-
toFields() {
|
|
31
|
-
const fields = serializeToFields(...RollupValidationRequests.getFields(this));
|
|
32
|
-
if (fields.length !== ROLLUP_VALIDATION_REQUESTS_LENGTH) {
|
|
33
|
-
throw new Error(`Invalid number of fields for RollupValidationRequests. Expected ${ROLLUP_VALIDATION_REQUESTS_LENGTH}, got ${fields.length}`);
|
|
34
|
-
}
|
|
35
|
-
return fields;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
39
|
-
* @param buffer - Buffer or reader to read from.
|
|
40
|
-
* @returns Deserialized object.
|
|
41
|
-
*/ static fromBuffer(buffer) {
|
|
42
|
-
const reader = BufferReader.asReader(buffer);
|
|
43
|
-
return new RollupValidationRequests(reader.readObject(IncludeByTimestamp));
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Deserializes from a string, corresponding to a write in cpp.
|
|
47
|
-
* @param str - String to read from.
|
|
48
|
-
* @returns Deserialized object.
|
|
49
|
-
*/ static fromString(str) {
|
|
50
|
-
return RollupValidationRequests.fromBuffer(hexToBuffer(str));
|
|
51
|
-
}
|
|
52
|
-
static empty() {
|
|
53
|
-
return new RollupValidationRequests(IncludeByTimestamp.empty());
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transient_data_index_hint.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/transient_data_index_hint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,qBAAa,sBAAsB;IAExB,cAAc,EAAE,MAAM;IACtB,aAAa,EAAE,MAAM;gBADrB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM;IAG9B,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAK5C,OAAO;IAIP,MAAM,CAAC,KAAK;IAIZ,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,QAAQ,IAAI,MAAM;IAIlB,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;CAG3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared_mutable/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled_delay_change.d.ts","sourceRoot":"","sources":["../../src/shared_mutable/scheduled_delay_change.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,oBAAoB;IAEtB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS;IACxB,iBAAiB,EAAE,MAAM;gBAFzB,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,MAAM;IAGlC,MAAM,CAAC,KAAK;IAIZ,OAAO,IAAI,OAAO;CAGnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled_value_change.d.ts","sourceRoot":"","sources":["../../src/shared_mutable/scheduled_value_change.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,oBAAoB;IAEtB,QAAQ,EAAE,EAAE,EAAE;IACd,IAAI,EAAE,EAAE,EAAE;IACV,iBAAiB,EAAE,MAAM;gBAFzB,QAAQ,EAAE,EAAE,EAAE,EACd,IAAI,EAAE,EAAE,EAAE,EACV,iBAAiB,EAAE,MAAM;IAOlC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM;IAI9B,OAAO,IAAI,OAAO;IAIlB,YAAY,CAAC,SAAS,EAAE,MAAM;CAO/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { ScheduledDelayChange } from './scheduled_delay_change.js';
|
|
4
|
-
import { ScheduledValueChange } from './scheduled_value_change.js';
|
|
5
|
-
export declare const SHARED_MUTABLE_VALUES_LEN: number;
|
|
6
|
-
export declare class SharedMutableValues {
|
|
7
|
-
svc: ScheduledValueChange;
|
|
8
|
-
sdc: ScheduledDelayChange;
|
|
9
|
-
constructor(svc: ScheduledValueChange, sdc: ScheduledDelayChange);
|
|
10
|
-
static fromFields(fields: Fr[] | FieldReader): SharedMutableValues;
|
|
11
|
-
toFields(): Fr[];
|
|
12
|
-
toBuffer(): Buffer;
|
|
13
|
-
static fromBuffer(buffer: Buffer | BufferReader, valueSize: number): SharedMutableValues;
|
|
14
|
-
static empty(valueSize: number): SharedMutableValues;
|
|
15
|
-
static readFromTree(sharedMutableSlot: Fr, readStorage: (storageSlot: Fr) => Promise<Fr>): Promise<SharedMutableValues>;
|
|
16
|
-
isEmpty(): boolean;
|
|
17
|
-
writeToTree(sharedMutableSlot: Fr, storageWrite: (storageSlot: Fr, value: Fr) => Promise<void>): Promise<void>;
|
|
18
|
-
hash(): Promise<Fr>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=shared_mutable_values.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared_mutable_values.d.ts","sourceRoot":"","sources":["../../src/shared_mutable/shared_mutable_values.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,eAAO,MAAM,yBAAyB,QAA6B,CAAC;AAEpE,qBAAa,mBAAmB;IAErB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,oBAAoB;gBADzB,GAAG,EAAE,oBAAoB,EACzB,GAAG,EAAE,oBAAoB;IAGlC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IA2B5C,QAAQ,IAAI,EAAE,EAAE;IAahB,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,mBAAmB;IAKxF,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM;WAIjB,YAAY,CAAC,iBAAiB,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC;IAQ9F,OAAO,IAAI,OAAO;IAIZ,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;IAQ9F,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;CAK1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared_mutable_values_with_hash.d.ts","sourceRoot":"","sources":["../../src/shared_mutable/shared_mutable_values_with_hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,qBAAa,2BAA2B;IACtC,OAAO,CAAC,GAAG,CAAsB;gBAErB,GAAG,EAAE,oBAAoB,EAAE,GAAG,EAAE,oBAAoB;IAI1D,QAAQ,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIzB,WAAW,CAAC,iBAAiB,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC;WAQvF,sBAAsB,CAAC,eAAe,EAAE,YAAY;;;;CASlE"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { UPDATED_CLASS_IDS_SLOT } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { deriveStorageSlotInMap } from '../hash/map_slot.js';
|
|
4
|
-
import { SHARED_MUTABLE_VALUES_LEN, SharedMutableValues } from './shared_mutable_values.js';
|
|
5
|
-
export class SharedMutableValuesWithHash {
|
|
6
|
-
smv;
|
|
7
|
-
constructor(svc, sdc){
|
|
8
|
-
this.smv = new SharedMutableValues(svc, sdc);
|
|
9
|
-
}
|
|
10
|
-
async toFields() {
|
|
11
|
-
return [
|
|
12
|
-
...this.smv.toFields(),
|
|
13
|
-
await this.smv.hash()
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
async writeToTree(sharedMutableSlot, storageWrite) {
|
|
17
|
-
const fields = await this.toFields();
|
|
18
|
-
for(let i = 0; i < fields.length; i++){
|
|
19
|
-
await storageWrite(sharedMutableSlot.add(new Fr(i)), fields[i]);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
static async getContractUpdateSlots(contractAddress) {
|
|
23
|
-
const sharedMutableSlot = await deriveStorageSlotInMap(new Fr(UPDATED_CLASS_IDS_SLOT), contractAddress);
|
|
24
|
-
const sharedMutableHashSlot = sharedMutableSlot.add(new Fr(SHARED_MUTABLE_VALUES_LEN));
|
|
25
|
-
return {
|
|
26
|
-
sharedMutableSlot,
|
|
27
|
-
sharedMutableHashSlot
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|