@aztec/stdlib 0.80.0 → 0.82.0
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 +5 -1
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +2 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +11 -0
- package/dest/auth_witness/auth_witness.d.ts +21 -0
- package/dest/auth_witness/auth_witness.d.ts.map +1 -1
- package/dest/auth_witness/auth_witness.js +29 -0
- package/dest/avm/avm.d.ts +173 -405
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +34 -27
- package/dest/avm/avm_proving_request.d.ts +84 -186
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/avm/public_data_write.d.ts +1 -0
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +3 -0
- package/dest/block/body.d.ts +1 -0
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +3 -0
- package/dest/block/index.d.ts +1 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -1
- package/dest/block/l2_block.d.ts +2 -1
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +3 -0
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +3 -3
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +2 -4
- package/dest/block/l2_block_source.d.ts +9 -0
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/published_l2_block.d.ts +89 -0
- package/dest/block/published_l2_block.d.ts.map +1 -0
- package/dest/block/published_l2_block.js +32 -0
- package/dest/contract/interfaces/contract_data_source.d.ts +3 -14
- package/dest/contract/interfaces/contract_data_source.d.ts.map +1 -1
- package/dest/database-version/version_manager.d.ts +5 -0
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +8 -1
- package/dest/interfaces/archiver.d.ts +1 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +5 -6
- package/dest/interfaces/aztec-node-admin.d.ts +20 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -0
- package/dest/interfaces/aztec-node-admin.js +16 -0
- package/dest/interfaces/aztec-node.d.ts +9 -39
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +6 -12
- package/dest/interfaces/client.d.ts +1 -0
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +1 -0
- package/dest/interfaces/private_kernel_prover.d.ts +2 -3
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/prover-node.d.ts +1 -2
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +5 -4
- package/dest/interfaces/proving-job.d.ts +106 -208
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/pxe.d.ts +21 -39
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +10 -9
- package/dest/kernel/index.d.ts +1 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -1
- package/dest/kernel/private_kernel_prover_output.d.ts +49 -0
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -0
- package/dest/kernel/private_kernel_prover_output.js +8 -0
- package/dest/kernel/private_kernel_simulated_output.d.ts +3 -7
- package/dest/kernel/private_kernel_simulated_output.d.ts.map +1 -1
- package/dest/logs/contract_class_log.d.ts +1 -0
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +3 -0
- package/dest/logs/l1_payload/index.d.ts +1 -1
- package/dest/logs/l1_payload/index.d.ts.map +1 -1
- package/dest/logs/l1_payload/index.js +1 -1
- package/dest/logs/log_with_tx_data.js +2 -2
- package/dest/logs/private_log.d.ts +2 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +14 -3
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +4 -1
- package/dest/logs/tx_scoped_l2_log.d.ts +16 -28
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +28 -19
- package/dest/noir/index.d.ts +5 -1
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/note/extended_note.d.ts +10 -21
- package/dest/note/extended_note.d.ts.map +1 -1
- package/dest/note/extended_note.js +19 -28
- package/dest/note/notes_filter.d.ts +2 -2
- package/dest/note/notes_filter.d.ts.map +1 -1
- package/dest/note/notes_filter.js +1 -1
- package/dest/p2p/consensus_payload.d.ts +3 -1
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +3 -0
- package/dest/proofs/client_ivc_proof.d.ts +1 -2
- package/dest/proofs/client_ivc_proof.d.ts.map +1 -1
- package/dest/proofs/client_ivc_proof.js +6 -9
- package/dest/proofs/proof.d.ts +0 -1
- package/dest/proofs/proof.d.ts.map +1 -1
- package/dest/proofs/proof.js +2 -7
- package/dest/rollup/block_root_rollup.d.ts +1 -1
- package/dest/rollup/tube_inputs.d.ts +7 -2
- package/dest/rollup/tube_inputs.d.ts.map +1 -1
- package/dest/rollup/tube_inputs.js +10 -4
- package/dest/tests/factories.d.ts +3 -2
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +14 -8
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -5
- package/dest/trees/nullifier_membership_witness.d.ts +11 -7
- package/dest/trees/nullifier_membership_witness.d.ts.map +1 -1
- package/dest/trees/nullifier_membership_witness.js +10 -0
- package/dest/trees/public_data_witness.d.ts +12 -12
- package/dest/trees/public_data_witness.d.ts.map +1 -1
- package/dest/trees/public_data_witness.js +13 -0
- package/dest/tx/capsule.d.ts +2 -0
- package/dest/tx/capsule.d.ts.map +1 -1
- package/dest/tx/capsule.js +2 -0
- package/dest/tx/index.d.ts +2 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +2 -0
- package/dest/tx/private_execution_result.d.ts +4 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +5 -0
- package/dest/tx/profiled_tx.d.ts +9 -0
- package/dest/tx/profiled_tx.d.ts.map +1 -0
- package/dest/tx/profiled_tx.js +27 -0
- package/dest/tx/proven_tx.d.ts +33 -0
- package/dest/tx/proven_tx.d.ts.map +1 -0
- package/dest/tx/proven_tx.js +35 -0
- package/dest/tx/simulated_tx.d.ts +8 -44
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +17 -40
- package/dest/tx/tx_effect.d.ts +1 -0
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +4 -1
- package/dest/tx/tx_receipt.d.ts +1 -30
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +3 -13
- package/package.json +6 -7
- package/src/abi/abi.ts +7 -2
- package/src/abi/contract_artifact.ts +11 -0
- package/src/auth_witness/auth_witness.ts +29 -0
- package/src/avm/avm.ts +42 -39
- package/src/avm/public_data_write.ts +4 -0
- package/src/block/body.ts +6 -0
- package/src/block/index.ts +1 -1
- package/src/block/l2_block.ts +4 -0
- package/src/block/l2_block_downloader/l2_block_stream.ts +5 -7
- package/src/block/l2_block_source.ts +11 -0
- package/src/block/published_l2_block.ts +45 -0
- package/src/contract/interfaces/contract_data_source.ts +3 -16
- package/src/database-version/version_manager.ts +11 -1
- package/src/interfaces/archiver.ts +11 -14
- package/src/interfaces/aztec-node-admin.ts +39 -0
- package/src/interfaces/aztec-node.ts +13 -72
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/private_kernel_prover.ts +2 -3
- package/src/interfaces/prover-node.ts +2 -4
- package/src/interfaces/pxe.ts +34 -56
- package/src/kernel/index.ts +1 -1
- package/src/kernel/private_kernel_prover_output.ts +44 -0
- package/src/kernel/private_kernel_simulated_output.ts +4 -13
- package/src/logs/contract_class_log.ts +8 -0
- package/src/logs/l1_payload/index.ts +1 -1
- package/src/logs/log_with_tx_data.ts +2 -2
- package/src/logs/private_log.ts +13 -3
- package/src/logs/public_log.ts +11 -1
- package/src/logs/tx_scoped_l2_log.ts +28 -25
- package/src/noir/index.ts +6 -1
- package/src/note/extended_note.ts +17 -36
- package/src/note/notes_filter.ts +3 -3
- package/src/p2p/consensus_payload.ts +9 -0
- package/src/proofs/client_ivc_proof.ts +5 -15
- package/src/proofs/proof.ts +2 -8
- package/src/rollup/tube_inputs.ts +8 -4
- package/src/tests/factories.ts +15 -14
- package/src/tests/mocks.ts +4 -9
- package/src/trees/nullifier_membership_witness.ts +12 -0
- package/src/trees/public_data_witness.ts +15 -0
- package/src/tx/capsule.ts +2 -0
- package/src/tx/index.ts +2 -0
- package/src/tx/private_execution_result.ts +7 -0
- package/src/tx/profiled_tx.ts +27 -0
- package/src/tx/proven_tx.ts +58 -0
- package/src/tx/simulated_tx.ts +11 -63
- package/src/tx/tx_effect.ts +23 -1
- package/src/tx/tx_receipt.ts +0 -36
- package/dest/block/nullifier_with_block_source.d.ts +0 -6
- package/dest/block/nullifier_with_block_source.d.ts.map +0 -1
- package/dest/block/nullifier_with_block_source.js +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.d.ts +0 -25
- package/dest/kernel/private_kernel_prover_profile_result.d.ts.map +0 -1
- package/dest/kernel/private_kernel_prover_profile_result.js +0 -7
- package/dest/logs/l1_payload/l1_note_payload.d.ts +0 -82
- package/dest/logs/l1_payload/l1_note_payload.d.ts.map +0 -1
- package/dest/logs/l1_payload/l1_note_payload.js +0 -129
- package/src/block/nullifier_with_block_source.ts +0 -7
- package/src/kernel/private_kernel_prover_profile_result.ts +0 -7
- package/src/logs/l1_payload/l1_note_payload.ts +0 -182
|
@@ -7,6 +7,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
7
7
|
import { encodeAbiParameters, parseAbiParameters } from 'viem';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
|
|
10
|
+
import type { L2Block } from '../block/l2_block.js';
|
|
10
11
|
import { BlockHeader } from '../tx/block_header.js';
|
|
11
12
|
import { TxHash } from '../tx/tx_hash.js';
|
|
12
13
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
@@ -73,6 +74,14 @@ export class ConsensusPayload implements Signable {
|
|
|
73
74
|
return new ConsensusPayload(fields.header, fields.archive, fields.txHashes);
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
static fromBlock(block: L2Block): ConsensusPayload {
|
|
78
|
+
return new ConsensusPayload(
|
|
79
|
+
block.header,
|
|
80
|
+
block.archive.root,
|
|
81
|
+
block.body.txEffects.map(tx => tx.txHash),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
76
85
|
static empty(): ConsensusPayload {
|
|
77
86
|
return new ConsensusPayload(BlockHeader.empty(), Fr.ZERO, []);
|
|
78
87
|
}
|
|
@@ -3,7 +3,6 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
|
|
5
5
|
const CLIENT_IVC_PROOF_LENGTH = 172052;
|
|
6
|
-
const CLIENT_IVC_VK_LENGTH = 2730;
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* TODO(https://github.com/AztecProtocol/aztec-packages/issues/7370) refactor this to
|
|
@@ -15,7 +14,6 @@ export class ClientIvcProof {
|
|
|
15
14
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/7370): Need to precompute private kernel tail VK so we can verify this immediately in the tx pool
|
|
16
15
|
// which parts of these are needed to quickly verify that we have a correct IVC proof
|
|
17
16
|
public clientIvcProofBuffer: Buffer,
|
|
18
|
-
public clientIvcVkBuffer: Buffer,
|
|
19
17
|
) {}
|
|
20
18
|
|
|
21
19
|
public isEmpty() {
|
|
@@ -23,18 +21,15 @@ export class ClientIvcProof {
|
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
static empty() {
|
|
26
|
-
return new ClientIvcProof(Buffer.from('')
|
|
24
|
+
return new ClientIvcProof(Buffer.from(''));
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
static fake(fill = Math.floor(Math.random() * 255)) {
|
|
30
|
-
return new ClientIvcProof(Buffer.alloc(1, fill)
|
|
28
|
+
return new ClientIvcProof(Buffer.alloc(1, fill));
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
static random() {
|
|
34
|
-
return new ClientIvcProof(
|
|
35
|
-
Buffer.from(randomBytes(CLIENT_IVC_PROOF_LENGTH)),
|
|
36
|
-
Buffer.from(randomBytes(CLIENT_IVC_VK_LENGTH)),
|
|
37
|
-
);
|
|
32
|
+
return new ClientIvcProof(Buffer.from(randomBytes(CLIENT_IVC_PROOF_LENGTH)));
|
|
38
33
|
}
|
|
39
34
|
|
|
40
35
|
static get schema() {
|
|
@@ -47,15 +42,10 @@ export class ClientIvcProof {
|
|
|
47
42
|
|
|
48
43
|
static fromBuffer(buffer: Buffer | BufferReader): ClientIvcProof {
|
|
49
44
|
const reader = BufferReader.asReader(buffer);
|
|
50
|
-
return new ClientIvcProof(reader.readBuffer()
|
|
45
|
+
return new ClientIvcProof(reader.readBuffer());
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
public toBuffer() {
|
|
54
|
-
return serializeToBuffer(
|
|
55
|
-
this.clientIvcProofBuffer.length,
|
|
56
|
-
this.clientIvcProofBuffer,
|
|
57
|
-
this.clientIvcVkBuffer.length,
|
|
58
|
-
this.clientIvcVkBuffer,
|
|
59
|
-
);
|
|
49
|
+
return serializeToBuffer(this.clientIvcProofBuffer.length, this.clientIvcProofBuffer);
|
|
60
50
|
}
|
|
61
51
|
}
|
package/src/proofs/proof.ts
CHANGED
|
@@ -18,9 +18,6 @@ export class Proof {
|
|
|
18
18
|
// Honk proofs start with a 4 byte length prefix
|
|
19
19
|
// the proof metadata starts immediately after
|
|
20
20
|
private readonly metadataOffset = 4;
|
|
21
|
-
// the metadata is 3 Frs long
|
|
22
|
-
// the public inputs are after it
|
|
23
|
-
private readonly publicInputsOffset = 100;
|
|
24
21
|
|
|
25
22
|
constructor(
|
|
26
23
|
/**
|
|
@@ -65,15 +62,12 @@ export class Proof {
|
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
public withoutPublicInputs(): Buffer {
|
|
68
|
-
return Buffer.concat([
|
|
69
|
-
this.buffer.subarray(this.metadataOffset, this.publicInputsOffset),
|
|
70
|
-
this.buffer.subarray(this.publicInputsOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs),
|
|
71
|
-
]);
|
|
65
|
+
return Buffer.concat([this.buffer.subarray(this.metadataOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs)]);
|
|
72
66
|
}
|
|
73
67
|
|
|
74
68
|
public extractPublicInputs(): Fr[] {
|
|
75
69
|
const reader = BufferReader.asReader(
|
|
76
|
-
this.buffer.subarray(this.
|
|
70
|
+
this.buffer.subarray(this.metadataOffset, this.metadataOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs),
|
|
77
71
|
);
|
|
78
72
|
return reader.readArray(this.numPublicInputs, Fr);
|
|
79
73
|
}
|
|
@@ -5,15 +5,19 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
5
5
|
|
|
6
6
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Inputs for the tube circuit, which turns a client IVC proof folding stack into an ultrahonk proof.
|
|
10
|
+
* 'usePublicTailVk' signifies if we should prove this with the public or private kernel tail client IVC VKs.
|
|
11
|
+
*/
|
|
8
12
|
export class TubeInputs {
|
|
9
|
-
constructor(public clientIVCData: ClientIvcProof) {}
|
|
13
|
+
constructor(public usePublicTailVk: boolean, public clientIVCData: ClientIvcProof) {}
|
|
10
14
|
|
|
11
15
|
static from(fields: FieldsOf<TubeInputs>): TubeInputs {
|
|
12
16
|
return new TubeInputs(...TubeInputs.getFields(fields));
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
static getFields(fields: FieldsOf<TubeInputs>) {
|
|
16
|
-
return [fields.clientIVCData] as const;
|
|
20
|
+
return [fields.usePublicTailVk, fields.clientIVCData] as const;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
/**
|
|
@@ -39,7 +43,7 @@ export class TubeInputs {
|
|
|
39
43
|
*/
|
|
40
44
|
static fromBuffer(buffer: Buffer | BufferReader): TubeInputs {
|
|
41
45
|
const reader = BufferReader.asReader(buffer);
|
|
42
|
-
return new TubeInputs(reader.readObject(ClientIvcProof));
|
|
46
|
+
return new TubeInputs(reader.readBoolean(), reader.readObject(ClientIvcProof));
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
isEmpty(): boolean {
|
|
@@ -55,7 +59,7 @@ export class TubeInputs {
|
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
static empty() {
|
|
58
|
-
return new TubeInputs(ClientIvcProof.empty());
|
|
62
|
+
return new TubeInputs(false, ClientIvcProof.empty());
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
/** Returns a hex representation for JSON serialization. */
|
package/src/tests/factories.ts
CHANGED
|
@@ -56,6 +56,7 @@ import { ContractStorageUpdateRequest } from '../avm/contract_storage_update_req
|
|
|
56
56
|
import {
|
|
57
57
|
AvmAccumulatedData,
|
|
58
58
|
AvmAppendTreeHint,
|
|
59
|
+
AvmBytecodeCommitmentHint,
|
|
59
60
|
AvmCircuitInputs,
|
|
60
61
|
AvmCircuitPublicInputs,
|
|
61
62
|
AvmContractClassHint,
|
|
@@ -1337,7 +1338,6 @@ export function makeAvmStorageUpdateTreeHints(seed = 0): AvmPublicDataWriteTreeH
|
|
|
1337
1338
|
export function makeAvmContractInstanceHint(seed = 0): AvmContractInstanceHint {
|
|
1338
1339
|
return new AvmContractInstanceHint(
|
|
1339
1340
|
new AztecAddress(new Fr(seed)),
|
|
1340
|
-
true /* exists */,
|
|
1341
1341
|
new Fr(seed + 0x2),
|
|
1342
1342
|
new AztecAddress(new Fr(seed + 0x3)),
|
|
1343
1343
|
new Fr(seed + 0x4),
|
|
@@ -1349,8 +1349,6 @@ export function makeAvmContractInstanceHint(seed = 0): AvmContractInstanceHint {
|
|
|
1349
1349
|
new Point(new Fr(seed + 0x11), new Fr(seed + 0x12), false),
|
|
1350
1350
|
new Point(new Fr(seed + 0x13), new Fr(seed + 0x14), false),
|
|
1351
1351
|
),
|
|
1352
|
-
makeAvmPublicDataReadTreeHints(seed + 0x2000),
|
|
1353
|
-
makeArray(4, i => new Fr(i), seed + 0x3000),
|
|
1354
1352
|
);
|
|
1355
1353
|
}
|
|
1356
1354
|
|
|
@@ -1358,22 +1356,23 @@ export function makeAvmContractInstanceHint(seed = 0): AvmContractInstanceHint {
|
|
|
1358
1356
|
* @param seed - The seed to use for generating the state reference.
|
|
1359
1357
|
* @returns AvmContractClassHint.
|
|
1360
1358
|
*/
|
|
1361
|
-
export
|
|
1359
|
+
export function makeAvmContractClassHint(seed = 0): AvmContractClassHint {
|
|
1362
1360
|
const bytecode = makeBytes(32, seed + 0x5);
|
|
1363
|
-
return new AvmContractClassHint(
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
);
|
|
1361
|
+
return new AvmContractClassHint(new Fr(seed), new Fr(seed + 0x2), new Fr(seed + 0x3), bytecode);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
export async function makeAvmBytecodeCommitmentHint(seed = 0): Promise<AvmBytecodeCommitmentHint> {
|
|
1365
|
+
const classId = new Fr(seed + 2);
|
|
1366
|
+
const bytecode = makeBytes(32, seed + 0x5);
|
|
1367
|
+
return new AvmBytecodeCommitmentHint(classId, await computePublicBytecodeCommitment(bytecode));
|
|
1371
1368
|
}
|
|
1372
1369
|
|
|
1373
1370
|
export function makeAvmEnqueuedCallHint(seed = 0): AvmEnqueuedCallHint {
|
|
1374
1371
|
return new AvmEnqueuedCallHint(
|
|
1375
1372
|
new AztecAddress(new Fr(seed)),
|
|
1373
|
+
new AztecAddress(new Fr(seed + 2)),
|
|
1376
1374
|
makeArray((seed % 20) + 4, i => new Fr(i), seed + 0x1000),
|
|
1375
|
+
/*isStaticCall=*/ false,
|
|
1377
1376
|
);
|
|
1378
1377
|
}
|
|
1379
1378
|
|
|
@@ -1392,8 +1391,9 @@ export async function makeAvmExecutionHints(
|
|
|
1392
1391
|
|
|
1393
1392
|
const fields = {
|
|
1394
1393
|
enqueuedCalls: makeArray(baseLength, makeAvmEnqueuedCallHint, seed + 0x4100),
|
|
1395
|
-
contractInstances: makeArray(baseLength +
|
|
1396
|
-
contractClasses:
|
|
1394
|
+
contractInstances: makeArray(baseLength + 2, makeAvmContractInstanceHint, seed + 0x4700),
|
|
1395
|
+
contractClasses: makeArray(baseLength + 5, makeAvmContractClassHint, seed + 0x4900),
|
|
1396
|
+
bytecodeCommitments: await makeArrayAsync(baseLength + 5, makeAvmBytecodeCommitmentHint, seed + 0x4900),
|
|
1397
1397
|
publicDataReads: makeArray(baseLength + 7, makeAvmStorageReadTreeHints, seed + 0x4900),
|
|
1398
1398
|
publicDataWrites: makeArray(baseLength + 8, makeAvmStorageUpdateTreeHints, seed + 0x4a00),
|
|
1399
1399
|
nullifierReads: makeArray(baseLength + 9, makeAvmNullifierReadTreeHints, seed + 0x4b00),
|
|
@@ -1408,6 +1408,7 @@ export async function makeAvmExecutionHints(
|
|
|
1408
1408
|
fields.enqueuedCalls,
|
|
1409
1409
|
fields.contractInstances,
|
|
1410
1410
|
fields.contractClasses,
|
|
1411
|
+
fields.bytecodeCommitments,
|
|
1411
1412
|
fields.publicDataReads,
|
|
1412
1413
|
fields.publicDataWrites,
|
|
1413
1414
|
fields.nullifierReads,
|
package/src/tests/mocks.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { Secp256k1Signer, randomBytes } from '@aztec/foundation/crypto';
|
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
|
|
6
6
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
7
|
-
import { NoteSelector } from '../abi/note_selector.js';
|
|
8
7
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
8
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
10
9
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
@@ -46,37 +45,33 @@ export const randomTxHash = (): TxHash => TxHash.random();
|
|
|
46
45
|
|
|
47
46
|
export const randomExtendedNote = async ({
|
|
48
47
|
note = Note.random(),
|
|
49
|
-
|
|
48
|
+
recipient = undefined,
|
|
50
49
|
contractAddress = undefined,
|
|
51
50
|
txHash = randomTxHash(),
|
|
52
51
|
storageSlot = Fr.random(),
|
|
53
|
-
noteTypeId = NoteSelector.random(),
|
|
54
52
|
}: Partial<ExtendedNote> = {}) => {
|
|
55
53
|
return new ExtendedNote(
|
|
56
54
|
note,
|
|
57
|
-
|
|
55
|
+
recipient ?? (await AztecAddress.random()),
|
|
58
56
|
contractAddress ?? (await AztecAddress.random()),
|
|
59
57
|
storageSlot,
|
|
60
|
-
noteTypeId,
|
|
61
58
|
txHash,
|
|
62
59
|
);
|
|
63
60
|
};
|
|
64
61
|
|
|
65
62
|
export const randomUniqueNote = async ({
|
|
66
63
|
note = Note.random(),
|
|
67
|
-
|
|
64
|
+
recipient = undefined,
|
|
68
65
|
contractAddress = undefined,
|
|
69
66
|
txHash = randomTxHash(),
|
|
70
67
|
storageSlot = Fr.random(),
|
|
71
|
-
noteTypeId = NoteSelector.random(),
|
|
72
68
|
nonce = Fr.random(),
|
|
73
69
|
}: Partial<UniqueNote> = {}) => {
|
|
74
70
|
return new UniqueNote(
|
|
75
71
|
note,
|
|
76
|
-
|
|
72
|
+
recipient ?? (await AztecAddress.random()),
|
|
77
73
|
contractAddress ?? (await AztecAddress.random()),
|
|
78
74
|
storageSlot,
|
|
79
|
-
noteTypeId,
|
|
80
75
|
txHash,
|
|
81
76
|
nonce,
|
|
82
77
|
);
|
|
@@ -56,4 +56,16 @@ export class NullifierMembershipWitness {
|
|
|
56
56
|
public toFields(): Fr[] {
|
|
57
57
|
return [new Fr(this.index), ...this.leafPreimage.toFields(), ...this.siblingPath.toFields()];
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Returns a representation of the nullifier membership witness as expected by intrinsic Noir deserialization.
|
|
62
|
+
*/
|
|
63
|
+
public toNoirRepresentation(): (string | string[])[] {
|
|
64
|
+
// TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
|
|
65
|
+
return [
|
|
66
|
+
new Fr(this.index).toString() as string,
|
|
67
|
+
...(this.leafPreimage.toFields().map(fr => fr.toString()) as string[]),
|
|
68
|
+
this.siblingPath.toFields().map(fr => fr.toString()) as string[],
|
|
69
|
+
];
|
|
70
|
+
}
|
|
59
71
|
}
|
|
@@ -58,6 +58,21 @@ export class PublicDataWitness {
|
|
|
58
58
|
];
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Returns a representation of the public data witness as expected by intrinsic Noir deserialization.
|
|
63
|
+
*/
|
|
64
|
+
public toNoirRepresentation(): (string | string[])[] {
|
|
65
|
+
// TODO(#12874): remove the stupid as string conversion by modifying ForeignCallOutput type in acvm.js
|
|
66
|
+
return [
|
|
67
|
+
new Fr(this.index).toString() as string,
|
|
68
|
+
new Fr(this.leafPreimage.slot).toString() as string,
|
|
69
|
+
new Fr(this.leafPreimage.value).toString() as string,
|
|
70
|
+
new Fr(this.leafPreimage.nextSlot).toString() as string,
|
|
71
|
+
new Fr(this.leafPreimage.nextIndex).toString() as string,
|
|
72
|
+
this.siblingPath.toFields().map(fr => fr.toString()) as string[],
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
|
|
61
76
|
toBuffer(): Buffer {
|
|
62
77
|
return serializeToBuffer([this.index, this.leafPreimage, this.siblingPath]);
|
|
63
78
|
}
|
package/src/tx/capsule.ts
CHANGED
|
@@ -8,6 +8,8 @@ import { Vector } from '../types/shared.js';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Read-only data that is passed to the contract through an oracle during a transaction execution.
|
|
11
|
+
* TODO(#12425): Check whether this is always used to represent a transient capsule and if so, rename to
|
|
12
|
+
* TransientCapsule.
|
|
11
13
|
*/
|
|
12
14
|
export class Capsule {
|
|
13
15
|
constructor(
|
package/src/tx/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ export * from './tx_hash.js';
|
|
|
16
16
|
export * from './tx_receipt.js';
|
|
17
17
|
export * from './tx.js';
|
|
18
18
|
export * from './processed_tx.js';
|
|
19
|
+
export * from './proven_tx.js';
|
|
20
|
+
export * from './profiled_tx.js';
|
|
19
21
|
export * from './simulated_tx.js';
|
|
20
22
|
export * from './tx_effect.js';
|
|
21
23
|
export * from './public_simulation_output.js';
|
|
@@ -115,6 +115,13 @@ export class PrivateExecutionResult {
|
|
|
115
115
|
static async random(nested = 1): Promise<PrivateExecutionResult> {
|
|
116
116
|
return new PrivateExecutionResult(await PrivateCallExecutionResult.random(nested), Fr.random());
|
|
117
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The block number that this execution was simulated with.
|
|
121
|
+
*/
|
|
122
|
+
getSimulationBlockNumber(): number {
|
|
123
|
+
return this.entrypoint.publicInputs.historicalHeader.globalVariables.blockNumber.toNumber();
|
|
124
|
+
}
|
|
118
125
|
}
|
|
119
126
|
|
|
120
127
|
/**
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ZodFor } from '@aztec/foundation/schemas';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
6
|
+
|
|
7
|
+
export class TxProfileResult {
|
|
8
|
+
constructor(public executionSteps: PrivateExecutionStep[]) {}
|
|
9
|
+
|
|
10
|
+
static get schema(): ZodFor<TxProfileResult> {
|
|
11
|
+
return z
|
|
12
|
+
.object({
|
|
13
|
+
executionSteps: z.array(PrivateExecutionStepSchema),
|
|
14
|
+
})
|
|
15
|
+
.transform(({ executionSteps }) => new TxProfileResult(executionSteps));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static random(): TxProfileResult {
|
|
19
|
+
return new TxProfileResult([
|
|
20
|
+
{
|
|
21
|
+
functionName: 'random',
|
|
22
|
+
bytecode: Buffer.from('random'),
|
|
23
|
+
witness: new Map([[1, 'random']]),
|
|
24
|
+
},
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
6
|
+
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
7
|
+
import {
|
|
8
|
+
PrivateExecutionResult,
|
|
9
|
+
collectEnqueuedPublicFunctionCalls,
|
|
10
|
+
collectPublicTeardownFunctionCall,
|
|
11
|
+
collectSortedContractClassLogs,
|
|
12
|
+
} from './private_execution_result.js';
|
|
13
|
+
import { Tx } from './tx.js';
|
|
14
|
+
|
|
15
|
+
export class TxProvingResult {
|
|
16
|
+
constructor(
|
|
17
|
+
public privateExecutionResult: PrivateExecutionResult,
|
|
18
|
+
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
19
|
+
public clientIvcProof: ClientIvcProof,
|
|
20
|
+
) {}
|
|
21
|
+
|
|
22
|
+
toTx(): Tx {
|
|
23
|
+
const contractClassLogs = collectSortedContractClassLogs(this.privateExecutionResult);
|
|
24
|
+
const enqueuedPublicFunctions = collectEnqueuedPublicFunctionCalls(this.privateExecutionResult);
|
|
25
|
+
const teardownPublicFunction = collectPublicTeardownFunctionCall(this.privateExecutionResult);
|
|
26
|
+
|
|
27
|
+
const tx = new Tx(
|
|
28
|
+
this.publicInputs,
|
|
29
|
+
this.clientIvcProof,
|
|
30
|
+
contractClassLogs,
|
|
31
|
+
enqueuedPublicFunctions,
|
|
32
|
+
teardownPublicFunction,
|
|
33
|
+
);
|
|
34
|
+
return tx;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
static get schema() {
|
|
38
|
+
return z
|
|
39
|
+
.object({
|
|
40
|
+
privateExecutionResult: PrivateExecutionResult.schema,
|
|
41
|
+
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
42
|
+
clientIvcProof: ClientIvcProof.schema,
|
|
43
|
+
})
|
|
44
|
+
.transform(TxProvingResult.from);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static from(fields: FieldsOf<TxProvingResult>) {
|
|
48
|
+
return new TxProvingResult(fields.privateExecutionResult, fields.publicInputs, fields.clientIvcProof);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static async random() {
|
|
52
|
+
return new TxProvingResult(
|
|
53
|
+
await PrivateExecutionResult.random(),
|
|
54
|
+
PrivateKernelTailCircuitPublicInputs.empty(),
|
|
55
|
+
ClientIvcProof.empty(),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/tx/simulated_tx.ts
CHANGED
|
@@ -5,10 +5,6 @@ import { z } from 'zod';
|
|
|
5
5
|
|
|
6
6
|
import { Gas } from '../gas/gas.js';
|
|
7
7
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
8
|
-
import {
|
|
9
|
-
type PrivateKernelProverProfileResult,
|
|
10
|
-
PrivateKernelProverProfileResultSchema,
|
|
11
|
-
} from '../kernel/private_kernel_prover_profile_result.js';
|
|
12
8
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
13
9
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
14
10
|
import {
|
|
@@ -47,15 +43,12 @@ export class PrivateSimulationResult {
|
|
|
47
43
|
}
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
export class TxSimulationResult
|
|
46
|
+
export class TxSimulationResult {
|
|
51
47
|
constructor(
|
|
52
|
-
privateExecutionResult: PrivateExecutionResult,
|
|
53
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
48
|
+
public privateExecutionResult: PrivateExecutionResult,
|
|
49
|
+
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
54
50
|
public publicOutput?: PublicSimulationOutput,
|
|
55
|
-
|
|
56
|
-
) {
|
|
57
|
-
super(privateExecutionResult, publicInputs);
|
|
58
|
-
}
|
|
51
|
+
) {}
|
|
59
52
|
|
|
60
53
|
get gasUsed(): GasUsed {
|
|
61
54
|
return (
|
|
@@ -74,34 +67,22 @@ export class TxSimulationResult extends PrivateSimulationResult {
|
|
|
74
67
|
privateExecutionResult: PrivateExecutionResult.schema,
|
|
75
68
|
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
76
69
|
publicOutput: PublicSimulationOutput.schema.optional(),
|
|
77
|
-
profileResult: PrivateKernelProverProfileResultSchema.optional(),
|
|
78
70
|
})
|
|
79
71
|
.transform(TxSimulationResult.from);
|
|
80
72
|
}
|
|
81
73
|
|
|
82
74
|
static from(fields: Omit<FieldsOf<TxSimulationResult>, 'gasUsed'>) {
|
|
83
|
-
return new TxSimulationResult(
|
|
84
|
-
fields.privateExecutionResult,
|
|
85
|
-
fields.publicInputs,
|
|
86
|
-
fields.publicOutput,
|
|
87
|
-
fields.profileResult,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
getPublicReturnValues() {
|
|
92
|
-
return this.publicOutput ? this.publicOutput.publicReturnValues : [];
|
|
75
|
+
return new TxSimulationResult(fields.privateExecutionResult, fields.publicInputs, fields.publicOutput);
|
|
93
76
|
}
|
|
94
77
|
|
|
95
78
|
static fromPrivateSimulationResultAndPublicOutput(
|
|
96
79
|
privateSimulationResult: PrivateSimulationResult,
|
|
97
80
|
publicOutput?: PublicSimulationOutput,
|
|
98
|
-
profileResult?: PrivateKernelProverProfileResult,
|
|
99
81
|
) {
|
|
100
82
|
return new TxSimulationResult(
|
|
101
83
|
privateSimulationResult.privateExecutionResult,
|
|
102
84
|
privateSimulationResult.publicInputs,
|
|
103
85
|
publicOutput,
|
|
104
|
-
profileResult,
|
|
105
86
|
);
|
|
106
87
|
}
|
|
107
88
|
|
|
@@ -112,50 +93,17 @@ export class TxSimulationResult extends PrivateSimulationResult {
|
|
|
112
93
|
await PublicSimulationOutput.random(),
|
|
113
94
|
);
|
|
114
95
|
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export class TxProvingResult {
|
|
118
|
-
constructor(
|
|
119
|
-
public privateExecutionResult: PrivateExecutionResult,
|
|
120
|
-
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
121
|
-
public clientIvcProof: ClientIvcProof,
|
|
122
|
-
) {}
|
|
123
96
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const enqueuedPublicFunctions = collectEnqueuedPublicFunctionCalls(this.privateExecutionResult);
|
|
127
|
-
const teardownPublicFunction = collectPublicTeardownFunctionCall(this.privateExecutionResult);
|
|
128
|
-
|
|
129
|
-
const tx = new Tx(
|
|
130
|
-
this.publicInputs,
|
|
131
|
-
this.clientIvcProof,
|
|
132
|
-
contractClassLogs,
|
|
133
|
-
enqueuedPublicFunctions,
|
|
134
|
-
teardownPublicFunction,
|
|
135
|
-
);
|
|
136
|
-
return tx;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
static get schema() {
|
|
140
|
-
return z
|
|
141
|
-
.object({
|
|
142
|
-
privateExecutionResult: PrivateExecutionResult.schema,
|
|
143
|
-
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
144
|
-
clientIvcProof: ClientIvcProof.schema,
|
|
145
|
-
})
|
|
146
|
-
.transform(TxProvingResult.from);
|
|
97
|
+
getPrivateReturnValues() {
|
|
98
|
+
return new PrivateSimulationResult(this.privateExecutionResult, this.publicInputs).getPrivateReturnValues();
|
|
147
99
|
}
|
|
148
100
|
|
|
149
|
-
|
|
150
|
-
return new
|
|
101
|
+
toSimulatedTx(): Tx {
|
|
102
|
+
return new PrivateSimulationResult(this.privateExecutionResult, this.publicInputs).toSimulatedTx();
|
|
151
103
|
}
|
|
152
104
|
|
|
153
|
-
|
|
154
|
-
return
|
|
155
|
-
await PrivateExecutionResult.random(),
|
|
156
|
-
PrivateKernelTailCircuitPublicInputs.empty(),
|
|
157
|
-
ClientIvcProof.empty(),
|
|
158
|
-
);
|
|
105
|
+
getPublicReturnValues() {
|
|
106
|
+
return this.publicOutput ? this.publicOutput.publicReturnValues : [];
|
|
159
107
|
}
|
|
160
108
|
}
|
|
161
109
|
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -158,6 +158,28 @@ export class TxEffect {
|
|
|
158
158
|
]);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
equals(other: TxEffect): boolean {
|
|
162
|
+
return (
|
|
163
|
+
this.revertCode.equals(other.revertCode) &&
|
|
164
|
+
this.txHash.equals(other.txHash) &&
|
|
165
|
+
this.transactionFee.equals(other.transactionFee) &&
|
|
166
|
+
this.noteHashes.length === other.noteHashes.length &&
|
|
167
|
+
this.noteHashes.every((h, i) => h.equals(other.noteHashes[i])) &&
|
|
168
|
+
this.nullifiers.length === other.nullifiers.length &&
|
|
169
|
+
this.nullifiers.every((h, i) => h.equals(other.nullifiers[i])) &&
|
|
170
|
+
this.l2ToL1Msgs.length === other.l2ToL1Msgs.length &&
|
|
171
|
+
this.l2ToL1Msgs.every((h, i) => h.equals(other.l2ToL1Msgs[i])) &&
|
|
172
|
+
this.publicDataWrites.length === other.publicDataWrites.length &&
|
|
173
|
+
this.publicDataWrites.every((h, i) => h.equals(other.publicDataWrites[i])) &&
|
|
174
|
+
this.privateLogs.length === other.privateLogs.length &&
|
|
175
|
+
this.privateLogs.every((h, i) => h.equals(other.privateLogs[i])) &&
|
|
176
|
+
this.publicLogs.length === other.publicLogs.length &&
|
|
177
|
+
this.publicLogs.every((h, i) => h.equals(other.publicLogs[i])) &&
|
|
178
|
+
this.contractClassLogs.length === other.contractClassLogs.length &&
|
|
179
|
+
this.contractClassLogs.every((h, i) => h.equals(other.contractClassLogs[i]))
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
161
183
|
/** Returns the size of this tx effect in bytes as serialized onto DA. */
|
|
162
184
|
getDASize() {
|
|
163
185
|
return this.toBlobFields().length * Fr.SIZE_IN_BYTES;
|
|
@@ -223,7 +245,7 @@ export class TxEffect {
|
|
|
223
245
|
makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, Fr.random),
|
|
224
246
|
makeTuple(MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, () => new PublicDataWrite(Fr.random(), Fr.random())),
|
|
225
247
|
makeTuple(MAX_PRIVATE_LOGS_PER_TX, () => new PrivateLog(makeTuple(PRIVATE_LOG_SIZE_IN_FIELDS, Fr.random))),
|
|
226
|
-
await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, PublicLog.random),
|
|
248
|
+
await makeTupleAsync(numPublicCallsPerTx * numPublicLogsPerCall, async () => await PublicLog.random()),
|
|
227
249
|
await makeTupleAsync(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLog.random),
|
|
228
250
|
);
|
|
229
251
|
}
|
package/src/tx/tx_receipt.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
2
|
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
|
|
6
|
-
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
7
5
|
import { RevertCode } from '../avm/revert_code.js';
|
|
8
6
|
import { L2BlockHash } from '../block/block_hash.js';
|
|
9
7
|
import { type ZodFor, schemas } from '../schemas/schemas.js';
|
|
@@ -41,8 +39,6 @@ export class TxReceipt {
|
|
|
41
39
|
public blockHash?: L2BlockHash,
|
|
42
40
|
/** The block number in which the transaction was included. */
|
|
43
41
|
public blockNumber?: number,
|
|
44
|
-
/** Information useful for testing/debugging, set when test flag is set to true in `waitOpts`. */
|
|
45
|
-
public debugInfo?: DebugInfo,
|
|
46
42
|
) {}
|
|
47
43
|
|
|
48
44
|
static empty() {
|
|
@@ -58,7 +54,6 @@ export class TxReceipt {
|
|
|
58
54
|
blockHash: L2BlockHash.schema.optional(),
|
|
59
55
|
blockNumber: z.number().int().nonnegative().optional(),
|
|
60
56
|
transactionFee: schemas.BigInt.optional(),
|
|
61
|
-
debugInfo: DebugInfoSchema.optional(),
|
|
62
57
|
})
|
|
63
58
|
.transform(TxReceipt.from);
|
|
64
59
|
}
|
|
@@ -71,7 +66,6 @@ export class TxReceipt {
|
|
|
71
66
|
fields.transactionFee,
|
|
72
67
|
fields.blockHash,
|
|
73
68
|
fields.blockNumber,
|
|
74
|
-
fields.debugInfo,
|
|
75
69
|
);
|
|
76
70
|
}
|
|
77
71
|
|
|
@@ -89,33 +83,3 @@ export class TxReceipt {
|
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Information useful for debugging/testing purposes included in the receipt when the debug flag is set to true
|
|
95
|
-
* in `WaitOpts`.
|
|
96
|
-
*/
|
|
97
|
-
interface DebugInfo {
|
|
98
|
-
/**
|
|
99
|
-
* New note hashes created by the transaction.
|
|
100
|
-
*/
|
|
101
|
-
noteHashes: Fr[];
|
|
102
|
-
/**
|
|
103
|
-
* New nullifiers created by the transaction.
|
|
104
|
-
*/
|
|
105
|
-
nullifiers: Fr[];
|
|
106
|
-
/**
|
|
107
|
-
* New public data writes created by the transaction.
|
|
108
|
-
*/
|
|
109
|
-
publicDataWrites: PublicDataWrite[];
|
|
110
|
-
/**
|
|
111
|
-
* New L2 to L1 messages created by the transaction.
|
|
112
|
-
*/
|
|
113
|
-
l2ToL1Msgs: Fr[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const DebugInfoSchema = z.object({
|
|
117
|
-
noteHashes: z.array(schemas.Fr),
|
|
118
|
-
nullifiers: z.array(schemas.Fr),
|
|
119
|
-
publicDataWrites: z.array(PublicDataWrite.schema),
|
|
120
|
-
l2ToL1Msgs: z.array(schemas.Fr),
|
|
121
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { InBlock } from './in_block.js';
|
|
3
|
-
export interface NullifierWithBlockSource {
|
|
4
|
-
findNullifiersIndexesWithBlock(blockNumber: number, nullifiers: Fr[]): Promise<(InBlock<bigint> | undefined)[]>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=nullifier_with_block_source.d.ts.map
|