@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
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import { BufferReader, boolToBuffer, numToUInt32BE } from '@aztec/foundation/serialize';
|
|
3
2
|
import { z } from 'zod';
|
|
4
|
-
import { schemas } from '../schemas/schemas.js';
|
|
5
3
|
import { TxHash } from '../tx/tx_hash.js';
|
|
4
|
+
import { PrivateLog } from './private_log.js';
|
|
5
|
+
import { PublicLog } from './public_log.js';
|
|
6
6
|
export class TxScopedL2Log {
|
|
7
7
|
txHash;
|
|
8
8
|
dataStartIndexForTx;
|
|
9
9
|
blockNumber;
|
|
10
|
-
|
|
11
|
-
logData;
|
|
10
|
+
log;
|
|
12
11
|
constructor(/*
|
|
13
12
|
* Hash of the tx where the log is included
|
|
14
13
|
*/ txHash, /*
|
|
@@ -17,42 +16,52 @@ export class TxScopedL2Log {
|
|
|
17
16
|
*/ dataStartIndexForTx, /*
|
|
18
17
|
* The block this log is included in
|
|
19
18
|
*/ blockNumber, /*
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
* The log data
|
|
23
|
-
*/ logData){
|
|
19
|
+
* The log data as either a PrivateLog or PublicLog
|
|
20
|
+
*/ log){
|
|
24
21
|
this.txHash = txHash;
|
|
25
22
|
this.dataStartIndexForTx = dataStartIndexForTx;
|
|
26
23
|
this.blockNumber = blockNumber;
|
|
27
|
-
this.
|
|
28
|
-
|
|
24
|
+
this.log = log;
|
|
25
|
+
}
|
|
26
|
+
get isFromPublic() {
|
|
27
|
+
return this.log instanceof PublicLog;
|
|
29
28
|
}
|
|
30
29
|
static get schema() {
|
|
31
30
|
return z.object({
|
|
32
31
|
txHash: TxHash.schema,
|
|
33
32
|
dataStartIndexForTx: z.number(),
|
|
34
33
|
blockNumber: z.number(),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
log: z.union([
|
|
35
|
+
PrivateLog.schema,
|
|
36
|
+
PublicLog.schema
|
|
37
|
+
])
|
|
38
|
+
}).transform(({ txHash, dataStartIndexForTx, blockNumber, log })=>new TxScopedL2Log(txHash, dataStartIndexForTx, blockNumber, log));
|
|
38
39
|
}
|
|
39
40
|
toBuffer() {
|
|
41
|
+
const isFromPublic = this.log instanceof PublicLog;
|
|
40
42
|
return Buffer.concat([
|
|
41
43
|
this.txHash.toBuffer(),
|
|
42
44
|
numToUInt32BE(this.dataStartIndexForTx),
|
|
43
45
|
numToUInt32BE(this.blockNumber),
|
|
44
|
-
boolToBuffer(
|
|
45
|
-
this.
|
|
46
|
+
boolToBuffer(isFromPublic),
|
|
47
|
+
this.log.toBuffer()
|
|
46
48
|
]);
|
|
47
49
|
}
|
|
48
50
|
static fromBuffer(buffer) {
|
|
49
51
|
const reader = BufferReader.asReader(buffer);
|
|
50
|
-
|
|
52
|
+
const txHash = reader.readObject(TxHash);
|
|
53
|
+
const dataStartIndexForTx = reader.readNumber();
|
|
54
|
+
const blockNumber = reader.readNumber();
|
|
55
|
+
const isFromPublic = reader.readBoolean();
|
|
56
|
+
const log = isFromPublic ? PublicLog.fromBuffer(reader) : PrivateLog.fromBuffer(reader);
|
|
57
|
+
return new TxScopedL2Log(txHash, dataStartIndexForTx, blockNumber, log);
|
|
51
58
|
}
|
|
52
|
-
static random() {
|
|
53
|
-
|
|
59
|
+
static async random() {
|
|
60
|
+
const isFromPublic = Math.random() < 0.5;
|
|
61
|
+
const log = isFromPublic ? await PublicLog.random() : PrivateLog.random();
|
|
62
|
+
return new TxScopedL2Log(TxHash.random(), 1, 1, log);
|
|
54
63
|
}
|
|
55
64
|
equals(other) {
|
|
56
|
-
return this.txHash.equals(other.txHash) && this.dataStartIndexForTx === other.dataStartIndexForTx && this.blockNumber === other.blockNumber && this.
|
|
65
|
+
return this.txHash.equals(other.txHash) && this.dataStartIndexForTx === other.dataStartIndexForTx && this.blockNumber === other.blockNumber && (this.log instanceof PublicLog && other.log instanceof PublicLog || this.log instanceof PrivateLog && other.log instanceof PrivateLog) && this.log.equals(other.log);
|
|
57
66
|
}
|
|
58
67
|
}
|
package/dest/noir/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export interface NoirCompiledContract {
|
|
|
62
62
|
file_map: DebugFileMap;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* The compilation result of
|
|
65
|
+
* The compilation result of a protocol (non-contract) circuit.
|
|
66
66
|
*/
|
|
67
67
|
export interface NoirCompiledCircuit {
|
|
68
68
|
/** The hash of the circuit. */
|
|
@@ -78,6 +78,10 @@ export interface NoirCompiledCircuit {
|
|
|
78
78
|
/** The map of file ID to the source code and path of the file. */
|
|
79
79
|
file_map: DebugFileMap;
|
|
80
80
|
}
|
|
81
|
+
export interface NoirCompiledCircuitWithName extends NoirCompiledCircuit {
|
|
82
|
+
/** The name of the circuit. */
|
|
83
|
+
name: string;
|
|
84
|
+
}
|
|
81
85
|
/**
|
|
82
86
|
* The debug metadata of an Aztec.nr contract.
|
|
83
87
|
*/
|
package/dest/noir/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/noir/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,wBAAwB,aAAa,CAAC;AACnD,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AACzD,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,uCAAuC;IACvC,WAAW,EAAE;QACX;;WAEG;QACH,QAAQ,EAAE,OAAO,CAAC;QAClB;;WAEG;QACH,UAAU,EAAE,sBAAsB,CAAC;KAC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AAa,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C;;OAEG;IACH,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,gCAAgC,GAAG,+BAA+B,CAAC;AAEvG;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,qBAAqB,GAC9B,QAAQ,IAAI,gCAAgC,CAE9C;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,qBAAqB,GAC9B,QAAQ,IAAI,+BAA+B,CAE7C"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import { NoteSelector } from '../abi/note_selector.js';
|
|
7
6
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
7
|
import { type ZodFor } from '../schemas/index.js';
|
|
9
8
|
import { TxHash } from '../tx/tx_hash.js';
|
|
@@ -14,27 +13,23 @@ import { Note } from './note.js';
|
|
|
14
13
|
export declare class ExtendedNote {
|
|
15
14
|
/** The note as emitted from the Noir contract. */
|
|
16
15
|
note: Note;
|
|
17
|
-
/** The
|
|
18
|
-
|
|
16
|
+
/** The address whose public key was used to encrypt the note. */
|
|
17
|
+
recipient: AztecAddress;
|
|
19
18
|
/** The contract address this note is created in. */
|
|
20
19
|
contractAddress: AztecAddress;
|
|
21
20
|
/** The specific storage location of the note on the contract. */
|
|
22
21
|
storageSlot: Fr;
|
|
23
|
-
/** The type identifier of the note on the contract. */
|
|
24
|
-
noteTypeId: NoteSelector;
|
|
25
22
|
/** The hash of the tx the note was created in. */
|
|
26
23
|
txHash: TxHash;
|
|
27
24
|
constructor(
|
|
28
25
|
/** The note as emitted from the Noir contract. */
|
|
29
26
|
note: Note,
|
|
30
|
-
/** The
|
|
31
|
-
|
|
27
|
+
/** The address whose public key was used to encrypt the note. */
|
|
28
|
+
recipient: AztecAddress,
|
|
32
29
|
/** The contract address this note is created in. */
|
|
33
30
|
contractAddress: AztecAddress,
|
|
34
31
|
/** The specific storage location of the note on the contract. */
|
|
35
32
|
storageSlot: Fr,
|
|
36
|
-
/** The type identifier of the note on the contract. */
|
|
37
|
-
noteTypeId: NoteSelector,
|
|
38
33
|
/** The hash of the tx the note was created in. */
|
|
39
34
|
txHash: TxHash);
|
|
40
35
|
toBuffer(): Buffer;
|
|
@@ -50,14 +45,12 @@ export declare class UniqueNote extends ExtendedNote {
|
|
|
50
45
|
constructor(
|
|
51
46
|
/** The note as emitted from the Noir contract. */
|
|
52
47
|
note: Note,
|
|
53
|
-
/** The
|
|
54
|
-
|
|
48
|
+
/** The recipient whose public key was used to encrypt the note. */
|
|
49
|
+
recipient: AztecAddress,
|
|
55
50
|
/** The contract address this note is created in. */
|
|
56
51
|
contractAddress: AztecAddress,
|
|
57
52
|
/** The specific storage location of the note on the contract. */
|
|
58
53
|
storageSlot: Fr,
|
|
59
|
-
/** The type identifier of the note on the contract. */
|
|
60
|
-
noteTypeId: NoteSelector,
|
|
61
54
|
/** The hash of the tx the note was created in. */
|
|
62
55
|
txHash: TxHash,
|
|
63
56
|
/** The nonce of the note. */
|
|
@@ -79,19 +72,17 @@ export declare class UniqueNote extends ExtendedNote {
|
|
|
79
72
|
type: "Buffer";
|
|
80
73
|
data: number[];
|
|
81
74
|
}>;
|
|
82
|
-
|
|
75
|
+
recipient: ZodFor<AztecAddress>;
|
|
83
76
|
contractAddress: ZodFor<AztecAddress>;
|
|
84
77
|
storageSlot: ZodFor<Fr>;
|
|
85
|
-
noteTypeId: z.ZodType<NoteSelector, any, string>;
|
|
86
78
|
txHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer, string>, TxHash, string>;
|
|
87
79
|
nonce: ZodFor<Fr>;
|
|
88
80
|
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
owner: AztecAddress;
|
|
90
81
|
storageSlot: Fr;
|
|
91
82
|
contractAddress: AztecAddress;
|
|
83
|
+
recipient: AztecAddress;
|
|
92
84
|
txHash: TxHash;
|
|
93
85
|
note: Note;
|
|
94
|
-
noteTypeId: NoteSelector;
|
|
95
86
|
nonce: Fr;
|
|
96
87
|
}, {
|
|
97
88
|
txHash: string;
|
|
@@ -99,10 +90,9 @@ export declare class UniqueNote extends ExtendedNote {
|
|
|
99
90
|
type: "Buffer";
|
|
100
91
|
data: number[];
|
|
101
92
|
};
|
|
102
|
-
noteTypeId: string;
|
|
103
|
-
owner?: any;
|
|
104
93
|
storageSlot?: any;
|
|
105
94
|
contractAddress?: any;
|
|
95
|
+
recipient?: any;
|
|
106
96
|
nonce?: any;
|
|
107
97
|
}>, UniqueNote, {
|
|
108
98
|
txHash: string;
|
|
@@ -110,10 +100,9 @@ export declare class UniqueNote extends ExtendedNote {
|
|
|
110
100
|
type: "Buffer";
|
|
111
101
|
data: number[];
|
|
112
102
|
};
|
|
113
|
-
noteTypeId: string;
|
|
114
|
-
owner?: any;
|
|
115
103
|
storageSlot?: any;
|
|
116
104
|
contractAddress?: any;
|
|
105
|
+
recipient?: any;
|
|
117
106
|
nonce?: any;
|
|
118
107
|
}>;
|
|
119
108
|
toBuffer(): Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extended_note.d.ts","sourceRoot":"","sources":["../../src/note/extended_note.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"extended_note.d.ts","sourceRoot":"","sources":["../../src/note/extended_note.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;GAEG;AACH,qBAAa,YAAY;IAErB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,iEAAiE;IAC1D,SAAS,EAAE,YAAY;IAC9B,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;;IATrB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,iEAAiE;IAC1D,SAAS,EAAE,YAAY;IAC9B,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IAGvB,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAY/C,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAYxC;IAED,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;WAIhB,MAAM;CASpB;AAED,qBAAa,UAAW,SAAQ,YAAY;IAYxC,6BAA6B;IACtB,KAAK,EAAE,EAAE;;IAXhB,kDAAkD;IAClD,IAAI,EAAE,IAAI;IACV,mEAAmE;IACnE,SAAS,EAAE,YAAY;IACvB,oDAAoD;IACpD,eAAe,EAAE,YAAY;IAC7B,iEAAiE;IACjE,WAAW,EAAE,EAAE;IACf,kDAAkD;IAClD,MAAM,EAAE,MAAM;IACd,6BAA6B;IACtB,KAAK,EAAE,EAAE;IAKlB,WAAoB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAazB;IAEQ,QAAQ,IAAI,MAAM;WAWL,MAAM;WAWZ,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;WAaxC,UAAU,CAAC,GAAG,EAAE,MAAM;CAGvC"}
|
|
@@ -2,7 +2,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { NoteSelector } from '../abi/note_selector.js';
|
|
6
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
6
|
import { schemas } from '../schemas/index.js';
|
|
8
7
|
import { TxHash } from '../tx/tx_hash.js';
|
|
@@ -11,49 +10,44 @@ import { Note } from './note.js';
|
|
|
11
10
|
* A note with contextual data.
|
|
12
11
|
*/ export class ExtendedNote {
|
|
13
12
|
note;
|
|
14
|
-
|
|
13
|
+
recipient;
|
|
15
14
|
contractAddress;
|
|
16
15
|
storageSlot;
|
|
17
|
-
noteTypeId;
|
|
18
16
|
txHash;
|
|
19
|
-
constructor(/** The note as emitted from the Noir contract. */ note, /** The
|
|
17
|
+
constructor(/** The note as emitted from the Noir contract. */ note, /** The address whose public key was used to encrypt the note. */ recipient, /** The contract address this note is created in. */ contractAddress, /** The specific storage location of the note on the contract. */ storageSlot, /** The hash of the tx the note was created in. */ txHash){
|
|
20
18
|
this.note = note;
|
|
21
|
-
this.
|
|
19
|
+
this.recipient = recipient;
|
|
22
20
|
this.contractAddress = contractAddress;
|
|
23
21
|
this.storageSlot = storageSlot;
|
|
24
|
-
this.noteTypeId = noteTypeId;
|
|
25
22
|
this.txHash = txHash;
|
|
26
23
|
}
|
|
27
24
|
toBuffer() {
|
|
28
25
|
return serializeToBuffer([
|
|
29
26
|
this.note,
|
|
30
|
-
this.
|
|
27
|
+
this.recipient,
|
|
31
28
|
this.contractAddress,
|
|
32
29
|
this.storageSlot,
|
|
33
|
-
this.noteTypeId,
|
|
34
30
|
this.txHash
|
|
35
31
|
]);
|
|
36
32
|
}
|
|
37
33
|
static fromBuffer(buffer) {
|
|
38
34
|
const reader = BufferReader.asReader(buffer);
|
|
39
35
|
const note = reader.readObject(Note);
|
|
40
|
-
const
|
|
36
|
+
const recipient = reader.readObject(AztecAddress);
|
|
41
37
|
const contractAddress = reader.readObject(AztecAddress);
|
|
42
38
|
const storageSlot = reader.readObject(Fr);
|
|
43
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
44
39
|
const txHash = reader.readObject(TxHash);
|
|
45
|
-
return new this(note,
|
|
40
|
+
return new this(note, recipient, contractAddress, storageSlot, txHash);
|
|
46
41
|
}
|
|
47
42
|
static get schema() {
|
|
48
43
|
return z.object({
|
|
49
44
|
note: Note.schema,
|
|
50
|
-
|
|
45
|
+
recipient: schemas.AztecAddress,
|
|
51
46
|
contractAddress: schemas.AztecAddress,
|
|
52
47
|
storageSlot: schemas.Fr,
|
|
53
|
-
noteTypeId: schemas.NoteSelector,
|
|
54
48
|
txHash: TxHash.schema
|
|
55
|
-
}).transform(({ note,
|
|
56
|
-
return new ExtendedNote(note,
|
|
49
|
+
}).transform(({ note, recipient, contractAddress, storageSlot, txHash })=>{
|
|
50
|
+
return new ExtendedNote(note, recipient, contractAddress, storageSlot, txHash);
|
|
57
51
|
});
|
|
58
52
|
}
|
|
59
53
|
toString() {
|
|
@@ -63,51 +57,48 @@ import { Note } from './note.js';
|
|
|
63
57
|
return ExtendedNote.fromBuffer(hexToBuffer(str));
|
|
64
58
|
}
|
|
65
59
|
static async random() {
|
|
66
|
-
return new ExtendedNote(Note.random(), await AztecAddress.random(), await AztecAddress.random(), Fr.random(),
|
|
60
|
+
return new ExtendedNote(Note.random(), await AztecAddress.random(), await AztecAddress.random(), Fr.random(), TxHash.random());
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
export class UniqueNote extends ExtendedNote {
|
|
70
64
|
nonce;
|
|
71
|
-
constructor(/** The note as emitted from the Noir contract. */ note, /** The
|
|
72
|
-
super(note,
|
|
65
|
+
constructor(/** The note as emitted from the Noir contract. */ note, /** The recipient whose public key was used to encrypt the note. */ recipient, /** The contract address this note is created in. */ contractAddress, /** The specific storage location of the note on the contract. */ storageSlot, /** The hash of the tx the note was created in. */ txHash, /** The nonce of the note. */ nonce){
|
|
66
|
+
super(note, recipient, contractAddress, storageSlot, txHash), this.nonce = nonce;
|
|
73
67
|
}
|
|
74
68
|
static get schema() {
|
|
75
69
|
return z.object({
|
|
76
70
|
note: Note.schema,
|
|
77
|
-
|
|
71
|
+
recipient: schemas.AztecAddress,
|
|
78
72
|
contractAddress: schemas.AztecAddress,
|
|
79
73
|
storageSlot: schemas.Fr,
|
|
80
|
-
noteTypeId: schemas.NoteSelector,
|
|
81
74
|
txHash: TxHash.schema,
|
|
82
75
|
nonce: schemas.Fr
|
|
83
|
-
}).transform(({ note,
|
|
84
|
-
return new UniqueNote(note,
|
|
76
|
+
}).transform(({ note, recipient, contractAddress, storageSlot, txHash, nonce })=>{
|
|
77
|
+
return new UniqueNote(note, recipient, contractAddress, storageSlot, txHash, nonce);
|
|
85
78
|
});
|
|
86
79
|
}
|
|
87
80
|
toBuffer() {
|
|
88
81
|
return serializeToBuffer([
|
|
89
82
|
this.note,
|
|
90
|
-
this.
|
|
83
|
+
this.recipient,
|
|
91
84
|
this.contractAddress,
|
|
92
85
|
this.storageSlot,
|
|
93
|
-
this.noteTypeId,
|
|
94
86
|
this.txHash,
|
|
95
87
|
this.nonce
|
|
96
88
|
]);
|
|
97
89
|
}
|
|
98
90
|
static async random() {
|
|
99
|
-
return new UniqueNote(Note.random(), await AztecAddress.random(), await AztecAddress.random(), Fr.random(),
|
|
91
|
+
return new UniqueNote(Note.random(), await AztecAddress.random(), await AztecAddress.random(), Fr.random(), TxHash.random(), Fr.random());
|
|
100
92
|
}
|
|
101
93
|
static fromBuffer(buffer) {
|
|
102
94
|
const reader = BufferReader.asReader(buffer);
|
|
103
95
|
const note = reader.readObject(Note);
|
|
104
|
-
const
|
|
96
|
+
const recipient = reader.readObject(AztecAddress);
|
|
105
97
|
const contractAddress = reader.readObject(AztecAddress);
|
|
106
98
|
const storageSlot = reader.readObject(Fr);
|
|
107
|
-
const noteTypeId = reader.readObject(NoteSelector);
|
|
108
99
|
const txHash = reader.readObject(TxHash);
|
|
109
100
|
const nonce = reader.readObject(Fr);
|
|
110
|
-
return new this(note,
|
|
101
|
+
return new this(note, recipient, contractAddress, storageSlot, txHash, nonce);
|
|
111
102
|
}
|
|
112
103
|
static fromString(str) {
|
|
113
104
|
return UniqueNote.fromBuffer(hexToBuffer(str));
|
|
@@ -14,8 +14,8 @@ export type NotesFilter = {
|
|
|
14
14
|
contractAddress?: AztecAddress;
|
|
15
15
|
/** The specific storage location of the note on the contract. */
|
|
16
16
|
storageSlot?: Fr;
|
|
17
|
-
/** The
|
|
18
|
-
|
|
17
|
+
/** The recipient of the note (whose public key was used to encrypt the note). */
|
|
18
|
+
recipient?: AztecAddress;
|
|
19
19
|
/** The status of the note. Defaults to 'ACTIVE'. */
|
|
20
20
|
status?: NoteStatus;
|
|
21
21
|
/** The siloed nullifier for the note. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../../src/note/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iEAAiE;IACjE,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../../src/note/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAInD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,eAAe,CAAC,EAAE,YAAY,CAAC;IAC/B,iEAAiE;IACjE,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,iFAAiF;IACjF,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,oDAAoD;IACpD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,eAAe,CAAC,EAAE,EAAE,CAAC;IACrB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,WAAW,CAQhD,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const NotesFilterSchema = z.object({
|
|
|
6
6
|
txHash: TxHash.schema.optional(),
|
|
7
7
|
contractAddress: schemas.AztecAddress.optional(),
|
|
8
8
|
storageSlot: schemas.Fr.optional(),
|
|
9
|
-
|
|
9
|
+
recipient: schemas.AztecAddress.optional(),
|
|
10
10
|
status: z.nativeEnum(NoteStatus).optional(),
|
|
11
11
|
siloedNullifier: schemas.Fr.optional(),
|
|
12
12
|
scopes: z.array(schemas.AztecAddress).optional()
|
|
@@ -4,6 +4,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
4
4
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
5
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
+
import type { L2Block } from '../block/l2_block.js';
|
|
7
8
|
import { BlockHeader } from '../tx/block_header.js';
|
|
8
9
|
import { TxHash } from '../tx/tx_hash.js';
|
|
9
10
|
import type { Signable, SignatureDomainSeparator } from './signature_utils.js';
|
|
@@ -24,8 +25,8 @@ export declare class ConsensusPayload implements Signable {
|
|
|
24
25
|
archive: z.ZodType<Fr, any, string>;
|
|
25
26
|
txHashes: z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer, string>, TxHash, string>, "many">;
|
|
26
27
|
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
header: BlockHeader;
|
|
28
28
|
archive: Fr;
|
|
29
|
+
header: BlockHeader;
|
|
29
30
|
txHashes: TxHash[];
|
|
30
31
|
}, {
|
|
31
32
|
archive: string;
|
|
@@ -41,6 +42,7 @@ export declare class ConsensusPayload implements Signable {
|
|
|
41
42
|
toBuffer(): Buffer;
|
|
42
43
|
static fromBuffer(buf: Buffer | BufferReader): ConsensusPayload;
|
|
43
44
|
static fromFields(fields: FieldsOf<ConsensusPayload>): ConsensusPayload;
|
|
45
|
+
static fromBlock(block: L2Block): ConsensusPayload;
|
|
44
46
|
static empty(): ConsensusPayload;
|
|
45
47
|
/**
|
|
46
48
|
* Get the size of the consensus payload in bytes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consensus_payload.d.ts","sourceRoot":"","sources":["../../src/p2p/consensus_payload.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,qBAAa,gBAAiB,YAAW,QAAQ;IAI7C,oDAAoD;aACpC,MAAM,EAAE,WAAW;aAEnB,OAAO,EAAE,EAAE;IAC3B,gDAAgD;aAChC,QAAQ,EAAE,MAAM,EAAE;IARpC,OAAO,CAAC,IAAI,CAAqB;;IAG/B,oDAAoD;IACpC,MAAM,EAAE,WAAW,EAEnB,OAAO,EAAE,EAAE;IAC3B,gDAAgD;IAChC,QAAQ,EAAE,MAAM,EAAE;IAGpC,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;OAQhB;IAED,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,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IAED,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAI7C,gBAAgB,CAAC,eAAe,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBlF,QAAQ,IAAI,MAAM;IAMlB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB;IAS/D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,gBAAgB;IAIvE,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB;IAQlD,MAAM,CAAC,KAAK,IAAI,gBAAgB;IAIhC;;;OAGG;IACH,OAAO,IAAI,MAAM;CAQlB"}
|
|
@@ -65,6 +65,9 @@ export class ConsensusPayload {
|
|
|
65
65
|
static fromFields(fields) {
|
|
66
66
|
return new ConsensusPayload(fields.header, fields.archive, fields.txHashes);
|
|
67
67
|
}
|
|
68
|
+
static fromBlock(block) {
|
|
69
|
+
return new ConsensusPayload(block.header, block.archive.root, block.body.txEffects.map((tx)=>tx.txHash));
|
|
70
|
+
}
|
|
68
71
|
static empty() {
|
|
69
72
|
return new ConsensusPayload(BlockHeader.empty(), Fr.ZERO, []);
|
|
70
73
|
}
|
|
@@ -7,8 +7,7 @@ import { BufferReader } from '@aztec/foundation/serialize';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class ClientIvcProof {
|
|
9
9
|
clientIvcProofBuffer: Buffer;
|
|
10
|
-
|
|
11
|
-
constructor(clientIvcProofBuffer: Buffer, clientIvcVkBuffer: Buffer);
|
|
10
|
+
constructor(clientIvcProofBuffer: Buffer);
|
|
12
11
|
isEmpty(): boolean;
|
|
13
12
|
static empty(): ClientIvcProof;
|
|
14
13
|
static fake(fill?: number): ClientIvcProof;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_ivc_proof.d.ts","sourceRoot":"","sources":["../../src/proofs/client_ivc_proof.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"client_ivc_proof.d.ts","sourceRoot":"","sources":["../../src/proofs/client_ivc_proof.ts"],"names":[],"mappings":";;AAEA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E;;;GAGG;AACH,qBAAa,cAAc;IAKhB,oBAAoB,EAAE,MAAM;gBAA5B,oBAAoB,EAAE,MAAM;IAG9B,OAAO;IAId,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,IAAI,CAAC,IAAI,SAAkC;IAIlD,MAAM,CAAC,MAAM;IAIb,MAAM,KAAK,MAAM,uDAEhB;IAED,MAAM;IAIN,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc;IAKzD,QAAQ;CAGhB"}
|
|
@@ -2,31 +2,28 @@ import { randomBytes } from '@aztec/foundation/crypto';
|
|
|
2
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
const CLIENT_IVC_PROOF_LENGTH = 172052;
|
|
5
|
-
const CLIENT_IVC_VK_LENGTH = 2730;
|
|
6
5
|
/**
|
|
7
6
|
* TODO(https://github.com/AztecProtocol/aztec-packages/issues/7370) refactor this to
|
|
8
7
|
* eventually we read all these VKs from the data tree instead of passing them
|
|
9
8
|
*/ export class ClientIvcProof {
|
|
10
9
|
clientIvcProofBuffer;
|
|
11
|
-
clientIvcVkBuffer;
|
|
12
10
|
constructor(// produced by the sequencer when making the tube proof
|
|
13
11
|
// 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
|
|
14
12
|
// which parts of these are needed to quickly verify that we have a correct IVC proof
|
|
15
|
-
clientIvcProofBuffer
|
|
13
|
+
clientIvcProofBuffer){
|
|
16
14
|
this.clientIvcProofBuffer = clientIvcProofBuffer;
|
|
17
|
-
this.clientIvcVkBuffer = clientIvcVkBuffer;
|
|
18
15
|
}
|
|
19
16
|
isEmpty() {
|
|
20
17
|
return this.clientIvcProofBuffer.length === 0;
|
|
21
18
|
}
|
|
22
19
|
static empty() {
|
|
23
|
-
return new ClientIvcProof(Buffer.from('')
|
|
20
|
+
return new ClientIvcProof(Buffer.from(''));
|
|
24
21
|
}
|
|
25
22
|
static fake(fill = Math.floor(Math.random() * 255)) {
|
|
26
|
-
return new ClientIvcProof(Buffer.alloc(1, fill)
|
|
23
|
+
return new ClientIvcProof(Buffer.alloc(1, fill));
|
|
27
24
|
}
|
|
28
25
|
static random() {
|
|
29
|
-
return new ClientIvcProof(Buffer.from(randomBytes(CLIENT_IVC_PROOF_LENGTH))
|
|
26
|
+
return new ClientIvcProof(Buffer.from(randomBytes(CLIENT_IVC_PROOF_LENGTH)));
|
|
30
27
|
}
|
|
31
28
|
static get schema() {
|
|
32
29
|
return bufferSchemaFor(ClientIvcProof);
|
|
@@ -36,9 +33,9 @@ const CLIENT_IVC_VK_LENGTH = 2730;
|
|
|
36
33
|
}
|
|
37
34
|
static fromBuffer(buffer) {
|
|
38
35
|
const reader = BufferReader.asReader(buffer);
|
|
39
|
-
return new ClientIvcProof(reader.readBuffer()
|
|
36
|
+
return new ClientIvcProof(reader.readBuffer());
|
|
40
37
|
}
|
|
41
38
|
toBuffer() {
|
|
42
|
-
return serializeToBuffer(this.clientIvcProofBuffer.length, this.clientIvcProofBuffer
|
|
39
|
+
return serializeToBuffer(this.clientIvcProofBuffer.length, this.clientIvcProofBuffer);
|
|
43
40
|
}
|
|
44
41
|
}
|
package/dest/proofs/proof.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/proofs/proof.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAK9E;;;;;GAKG;AACH,qBAAa,KAAK;
|
|
1
|
+
{"version":3,"file":"proof.d.ts","sourceRoot":"","sources":["../../src/proofs/proof.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAK9E;;;;;GAKG;AACH,qBAAa,KAAK;IASd;;OAEG;IACI,MAAM,EAAE,MAAM;IAEd,eAAe,EAAE,MAAM;IAZhC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC;IAI3B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAK;;IAGlC;;OAEG;IACI,MAAM,EAAE,MAAM,EAEd,eAAe,EAAE,MAAM;IAGhC;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,KAAK;IAQvD;;;;;OAKG;IACI,QAAQ;IAIf;;;OAGG;IACI,QAAQ;IAIR,mBAAmB,IAAI,MAAM;IAI7B,mBAAmB,IAAI,EAAE,EAAE;IAO3B,wBAAwB,IAAI,EAAE,EAAE;IAKvC;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,oDAAoD;IAC7C,OAAO;IAMd,8BAA8B;IAC9B,MAAM,CAAC,KAAK;CAGb;AAED;;;;GAIG;AACH,wBAAgB,cAAc,UAE7B"}
|
package/dest/proofs/proof.js
CHANGED
|
@@ -16,16 +16,12 @@ const EMPTY_PROOF_SIZE = 42;
|
|
|
16
16
|
// Honk proofs start with a 4 byte length prefix
|
|
17
17
|
// the proof metadata starts immediately after
|
|
18
18
|
metadataOffset;
|
|
19
|
-
// the metadata is 3 Frs long
|
|
20
|
-
// the public inputs are after it
|
|
21
|
-
publicInputsOffset;
|
|
22
19
|
constructor(/**
|
|
23
20
|
* Holds the serialized proof data in a binary buffer format.
|
|
24
21
|
*/ buffer, numPublicInputs){
|
|
25
22
|
this.buffer = buffer;
|
|
26
23
|
this.numPublicInputs = numPublicInputs;
|
|
27
24
|
this.metadataOffset = 4;
|
|
28
|
-
this.publicInputsOffset = 100;
|
|
29
25
|
}
|
|
30
26
|
/**
|
|
31
27
|
* Create a Proof from a Buffer or BufferReader.
|
|
@@ -56,12 +52,11 @@ const EMPTY_PROOF_SIZE = 42;
|
|
|
56
52
|
}
|
|
57
53
|
withoutPublicInputs() {
|
|
58
54
|
return Buffer.concat([
|
|
59
|
-
this.buffer.subarray(this.metadataOffset
|
|
60
|
-
this.buffer.subarray(this.publicInputsOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs)
|
|
55
|
+
this.buffer.subarray(this.metadataOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs)
|
|
61
56
|
]);
|
|
62
57
|
}
|
|
63
58
|
extractPublicInputs() {
|
|
64
|
-
const reader = BufferReader.asReader(this.buffer.subarray(this.
|
|
59
|
+
const reader = BufferReader.asReader(this.buffer.subarray(this.metadataOffset, this.metadataOffset + Fr.SIZE_IN_BYTES * this.numPublicInputs));
|
|
65
60
|
return reader.readArray(this.numPublicInputs, Fr);
|
|
66
61
|
}
|
|
67
62
|
extractAggregationObject() {
|
|
@@ -70,7 +70,7 @@ export declare class BlockRootRollupData {
|
|
|
70
70
|
* @param fields - Fields to create the instance from.
|
|
71
71
|
* @returns An array of fields.
|
|
72
72
|
*/
|
|
73
|
-
static getFields(fields: FieldsOf<BlockRootRollupData>): readonly [RootParityInput<
|
|
73
|
+
static getFields(fields: FieldsOf<BlockRootRollupData>): readonly [RootParityInput<456>, [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], [Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr, Fr], BlockHeader, Fr];
|
|
74
74
|
/**
|
|
75
75
|
* Deserializes the inputs from a buffer.
|
|
76
76
|
* @param buffer - A buffer to deserialize from.
|
|
@@ -3,11 +3,16 @@
|
|
|
3
3
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
5
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
6
|
+
/**
|
|
7
|
+
* Inputs for the tube circuit, which turns a client IVC proof folding stack into an ultrahonk proof.
|
|
8
|
+
* 'usePublicTailVk' signifies if we should prove this with the public or private kernel tail client IVC VKs.
|
|
9
|
+
*/
|
|
6
10
|
export declare class TubeInputs {
|
|
11
|
+
usePublicTailVk: boolean;
|
|
7
12
|
clientIVCData: ClientIvcProof;
|
|
8
|
-
constructor(clientIVCData: ClientIvcProof);
|
|
13
|
+
constructor(usePublicTailVk: boolean, clientIVCData: ClientIvcProof);
|
|
9
14
|
static from(fields: FieldsOf<TubeInputs>): TubeInputs;
|
|
10
|
-
static getFields(fields: FieldsOf<TubeInputs>): readonly [ClientIvcProof];
|
|
15
|
+
static getFields(fields: FieldsOf<TubeInputs>): readonly [boolean, ClientIvcProof];
|
|
11
16
|
/**
|
|
12
17
|
* Serializes the inputs to a buffer.
|
|
13
18
|
* @returns The inputs serialized to a buffer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tube_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/tube_inputs.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,qBAAa,UAAU;IACF,aAAa,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"tube_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/tube_inputs.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;GAGG;AACH,qBAAa,UAAU;IACF,eAAe,EAAE,OAAO;IAAS,aAAa,EAAE,cAAc;gBAA9D,eAAe,EAAE,OAAO,EAAS,aAAa,EAAE,cAAc;IAEjF,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,UAAU;IAIrD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI7C;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU;IAK5D,OAAO,IAAI,OAAO;IAGlB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;IAIZ,2DAA2D;IAC3D,MAAM;IAIN,6CAA6C;IAC7C,MAAM,KAAK,MAAM,mDAEhB;CACF"}
|
|
@@ -2,9 +2,14 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
|
2
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
4
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Inputs for the tube circuit, which turns a client IVC proof folding stack into an ultrahonk proof.
|
|
7
|
+
* 'usePublicTailVk' signifies if we should prove this with the public or private kernel tail client IVC VKs.
|
|
8
|
+
*/ export class TubeInputs {
|
|
9
|
+
usePublicTailVk;
|
|
6
10
|
clientIVCData;
|
|
7
|
-
constructor(clientIVCData){
|
|
11
|
+
constructor(usePublicTailVk, clientIVCData){
|
|
12
|
+
this.usePublicTailVk = usePublicTailVk;
|
|
8
13
|
this.clientIVCData = clientIVCData;
|
|
9
14
|
}
|
|
10
15
|
static from(fields) {
|
|
@@ -12,6 +17,7 @@ export class TubeInputs {
|
|
|
12
17
|
}
|
|
13
18
|
static getFields(fields) {
|
|
14
19
|
return [
|
|
20
|
+
fields.usePublicTailVk,
|
|
15
21
|
fields.clientIVCData
|
|
16
22
|
];
|
|
17
23
|
}
|
|
@@ -33,7 +39,7 @@ export class TubeInputs {
|
|
|
33
39
|
* @returns A new TubeInputs instance.
|
|
34
40
|
*/ static fromBuffer(buffer) {
|
|
35
41
|
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new TubeInputs(reader.readObject(ClientIvcProof));
|
|
42
|
+
return new TubeInputs(reader.readBoolean(), reader.readObject(ClientIvcProof));
|
|
37
43
|
}
|
|
38
44
|
isEmpty() {
|
|
39
45
|
return this.clientIVCData.isEmpty();
|
|
@@ -46,7 +52,7 @@ export class TubeInputs {
|
|
|
46
52
|
return TubeInputs.fromBuffer(hexToBuffer(str));
|
|
47
53
|
}
|
|
48
54
|
static empty() {
|
|
49
|
-
return new TubeInputs(ClientIvcProof.empty());
|
|
55
|
+
return new TubeInputs(false, ClientIvcProof.empty());
|
|
50
56
|
}
|
|
51
57
|
/** Returns a hex representation for JSON serialization. */ toJSON() {
|
|
52
58
|
return this.toBuffer();
|