@aztec/stdlib 3.0.0-nightly.20251223 → 3.0.0-nightly.20251224

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.
Files changed (36) hide show
  1. package/dest/contract/contract_class_id.js +1 -1
  2. package/dest/hash/hash.d.ts +1 -9
  3. package/dest/hash/hash.d.ts.map +1 -1
  4. package/dest/hash/hash.js +0 -12
  5. package/dest/interfaces/archiver.d.ts +1 -1
  6. package/dest/interfaces/archiver.d.ts.map +1 -1
  7. package/dest/interfaces/archiver.js +4 -1
  8. package/dest/interfaces/aztec-node.d.ts +10 -10
  9. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  10. package/dest/interfaces/aztec-node.js +3 -3
  11. package/dest/interfaces/l2_logs_source.d.ts +12 -8
  12. package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
  13. package/dest/kernel/private_circuit_public_inputs.d.ts +47 -47
  14. package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
  15. package/dest/kernel/private_circuit_public_inputs.js +59 -59
  16. package/dest/logs/index.d.ts +3 -1
  17. package/dest/logs/index.d.ts.map +1 -1
  18. package/dest/logs/index.js +2 -0
  19. package/dest/logs/siloed_tag.d.ts +23 -0
  20. package/dest/logs/siloed_tag.d.ts.map +1 -0
  21. package/dest/logs/siloed_tag.js +30 -0
  22. package/dest/logs/tag.d.ts +21 -0
  23. package/dest/logs/tag.d.ts.map +1 -0
  24. package/dest/logs/tag.js +30 -0
  25. package/dest/logs/tx_scoped_l2_log.js +1 -1
  26. package/package.json +8 -8
  27. package/src/contract/contract_class_id.ts +1 -1
  28. package/src/hash/hash.ts +0 -11
  29. package/src/interfaces/archiver.ts +8 -2
  30. package/src/interfaces/aztec-node.ts +17 -14
  31. package/src/interfaces/l2_logs_source.ts +12 -7
  32. package/src/kernel/private_circuit_public_inputs.ts +85 -85
  33. package/src/logs/index.ts +2 -0
  34. package/src/logs/siloed_tag.ts +44 -0
  35. package/src/logs/tag.ts +42 -0
  36. package/src/logs/tx_scoped_l2_log.ts +1 -1
@@ -21,26 +21,26 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
21
21
  callContext;
22
22
  argsHash;
23
23
  returnsHash;
24
+ anchorBlockHeader;
25
+ txContext;
24
26
  minRevertibleSideEffectCounter;
25
27
  isFeePayer;
26
28
  includeByTimestamp;
29
+ startSideEffectCounter;
30
+ endSideEffectCounter;
31
+ expectedNonRevertibleSideEffectCounter;
32
+ expectedRevertibleSideEffectCounter;
27
33
  noteHashReadRequests;
28
34
  nullifierReadRequests;
29
35
  keyValidationRequestsAndGenerators;
30
- noteHashes;
31
- nullifiers;
32
36
  privateCallRequests;
33
37
  publicCallRequests;
34
38
  publicTeardownCallRequest;
39
+ noteHashes;
40
+ nullifiers;
35
41
  l2ToL1Msgs;
36
42
  privateLogs;
37
43
  contractClassLogsHashes;
38
- startSideEffectCounter;
39
- endSideEffectCounter;
40
- expectedNonRevertibleSideEffectCounter;
41
- expectedRevertibleSideEffectCounter;
42
- anchorBlockHeader;
43
- txContext;
44
44
  constructor(/**
45
45
  * Context of the call corresponding to this private circuit execution.
46
46
  */ callContext, /**
@@ -48,73 +48,73 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
48
48
  */ argsHash, /**
49
49
  * Pedersen hash of the return values of the corresponding function call.
50
50
  */ returnsHash, /**
51
+ * Header of a block whose state is used during private execution (not the block the transaction is included in).
52
+ */ anchorBlockHeader, /**
53
+ * Transaction context.
54
+ *
55
+ * Note: The chainId and version in the txContext are not redundant to the values in self.anchor_block_header.global_variables because
56
+ * they can be different in case of a protocol upgrade. In such a situation we could be using header from a block
57
+ * before the upgrade took place but be using the updated protocol to execute and prove the transaction.
58
+ */ txContext, /**
51
59
  * The side-effect counter under which all side effects are non-revertible.
52
60
  */ minRevertibleSideEffectCounter, /**
53
61
  * Whether the caller of the function is the fee payer.
54
62
  */ isFeePayer, /**
55
63
  * The highest timestamp of a block in which the transaction can still be included.
56
64
  */ includeByTimestamp, /**
65
+ * The side effect counter at the start of this call.
66
+ */ startSideEffectCounter, /**
67
+ * The end side effect counter for this call.
68
+ */ endSideEffectCounter, /**
69
+ * The expected non revertible side effect counter for this call.
70
+ */ expectedNonRevertibleSideEffectCounter, /**
71
+ * The expected revertible side effect counter for this call.
72
+ */ expectedRevertibleSideEffectCounter, /**
57
73
  * Read requests created by the corresponding function call.
58
74
  */ noteHashReadRequests, /**
59
75
  * Nullifier read requests created by the corresponding function call.
60
76
  */ nullifierReadRequests, /**
61
77
  * Key validation requests and generators created by the corresponding function call.
62
78
  */ keyValidationRequestsAndGenerators, /**
63
- * New note hashes created by the corresponding function call.
64
- */ noteHashes, /**
65
- * New nullifiers created by the corresponding function call.
66
- */ nullifiers, /**
67
79
  * Private call requests made within the current kernel iteration.
68
80
  */ privateCallRequests, /**
69
81
  * Public call stack at the current kernel iteration.
70
82
  */ publicCallRequests, /**
71
83
  * Hash of the public teardown function.
72
84
  */ publicTeardownCallRequest, /**
85
+ * New note hashes created by the corresponding function call.
86
+ */ noteHashes, /**
87
+ * New nullifiers created by the corresponding function call.
88
+ */ nullifiers, /**
73
89
  * New L2 to L1 messages created by the corresponding function call.
74
90
  */ l2ToL1Msgs, /**
75
91
  * Logs emitted in this function call.
76
92
  */ privateLogs, /**
77
93
  * Hash of the contract class logs emitted in this function call.
78
- */ contractClassLogsHashes, /**
79
- * The side effect counter at the start of this call.
80
- */ startSideEffectCounter, /**
81
- * The end side effect counter for this call.
82
- */ endSideEffectCounter, /**
83
- * The expected non revertible side effect counter for this call.
84
- */ expectedNonRevertibleSideEffectCounter, /**
85
- * The expected revertible side effect counter for this call.
86
- */ expectedRevertibleSideEffectCounter, /**
87
- * Header of a block whose state is used during private execution (not the block the transaction is included in).
88
- */ anchorBlockHeader, /**
89
- * Transaction context.
90
- *
91
- * Note: The chainId and version in the txContext are not redundant to the values in self.anchor_block_header.global_variables because
92
- * they can be different in case of a protocol upgrade. In such a situation we could be using header from a block
93
- * before the upgrade took place but be using the updated protocol to execute and prove the transaction.
94
- */ txContext){
94
+ */ contractClassLogsHashes){
95
95
  this.callContext = callContext;
96
96
  this.argsHash = argsHash;
97
97
  this.returnsHash = returnsHash;
98
+ this.anchorBlockHeader = anchorBlockHeader;
99
+ this.txContext = txContext;
98
100
  this.minRevertibleSideEffectCounter = minRevertibleSideEffectCounter;
99
101
  this.isFeePayer = isFeePayer;
100
102
  this.includeByTimestamp = includeByTimestamp;
103
+ this.startSideEffectCounter = startSideEffectCounter;
104
+ this.endSideEffectCounter = endSideEffectCounter;
105
+ this.expectedNonRevertibleSideEffectCounter = expectedNonRevertibleSideEffectCounter;
106
+ this.expectedRevertibleSideEffectCounter = expectedRevertibleSideEffectCounter;
101
107
  this.noteHashReadRequests = noteHashReadRequests;
102
108
  this.nullifierReadRequests = nullifierReadRequests;
103
109
  this.keyValidationRequestsAndGenerators = keyValidationRequestsAndGenerators;
104
- this.noteHashes = noteHashes;
105
- this.nullifiers = nullifiers;
106
110
  this.privateCallRequests = privateCallRequests;
107
111
  this.publicCallRequests = publicCallRequests;
108
112
  this.publicTeardownCallRequest = publicTeardownCallRequest;
113
+ this.noteHashes = noteHashes;
114
+ this.nullifiers = nullifiers;
109
115
  this.l2ToL1Msgs = l2ToL1Msgs;
110
116
  this.privateLogs = privateLogs;
111
117
  this.contractClassLogsHashes = contractClassLogsHashes;
112
- this.startSideEffectCounter = startSideEffectCounter;
113
- this.endSideEffectCounter = endSideEffectCounter;
114
- this.expectedNonRevertibleSideEffectCounter = expectedNonRevertibleSideEffectCounter;
115
- this.expectedRevertibleSideEffectCounter = expectedRevertibleSideEffectCounter;
116
- this.anchorBlockHeader = anchorBlockHeader;
117
- this.txContext = txContext;
118
118
  }
119
119
  /**
120
120
  * Create PrivateCircuitPublicInputs from a fields dictionary.
@@ -129,20 +129,20 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
129
129
  * @returns The deserialized instance.
130
130
  */ static fromBuffer(buffer) {
131
131
  const reader = BufferReader.asReader(buffer);
132
- return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readBoolean(), reader.readUInt64(), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromBuffer(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext));
132
+ return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readObject(Fr), reader.readBoolean(), reader.readUInt64(), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromBuffer(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)));
133
133
  }
134
134
  static fromFields(fields) {
135
135
  const reader = FieldReader.asReader(fields);
136
- return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readField(), reader.readBoolean(), reader.readU64(), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromFields(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)), reader.readField(), reader.readField(), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext));
136
+ return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readField(), reader.readBoolean(), reader.readU64(), reader.readField(), reader.readField(), reader.readField(), reader.readField(), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromFields(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)));
137
137
  }
138
138
  /**
139
139
  * Create an empty PrivateCircuitPublicInputs.
140
140
  * @returns An empty PrivateCircuitPublicInputs object.
141
141
  */ static empty() {
142
- return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, Fr.ZERO, false, 0n, ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL), ClaimedLengthArray.empty(NoteHash, MAX_NOTE_HASHES_PER_CALL), ClaimedLengthArray.empty(Nullifier, MAX_NULLIFIERS_PER_CALL), ClaimedLengthArray.empty(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL), ClaimedLengthArray.empty(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL), PublicCallRequest.empty(), ClaimedLengthArray.empty(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL), ClaimedLengthArray.empty(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL), ClaimedLengthArray.empty(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL), Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty());
142
+ return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty(), Fr.ZERO, false, 0n, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL), ClaimedLengthArray.empty(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL), ClaimedLengthArray.empty(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL), PublicCallRequest.empty(), ClaimedLengthArray.empty(NoteHash, MAX_NOTE_HASHES_PER_CALL), ClaimedLengthArray.empty(Nullifier, MAX_NULLIFIERS_PER_CALL), ClaimedLengthArray.empty(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL), ClaimedLengthArray.empty(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL), ClaimedLengthArray.empty(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL));
143
143
  }
144
144
  isEmpty() {
145
- return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && !this.includeByTimestamp && this.noteHashReadRequests.isEmpty() && this.nullifierReadRequests.isEmpty() && this.keyValidationRequestsAndGenerators.isEmpty() && this.noteHashes.isEmpty() && this.nullifiers.isEmpty() && this.privateCallRequests.isEmpty() && this.publicCallRequests.isEmpty() && this.publicTeardownCallRequest.isEmpty() && this.l2ToL1Msgs.isEmpty() && this.privateLogs.isEmpty() && this.contractClassLogsHashes.isEmpty() && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.expectedNonRevertibleSideEffectCounter.isZero() && this.expectedRevertibleSideEffectCounter.isZero() && this.anchorBlockHeader.isEmpty() && this.txContext.isEmpty();
145
+ return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.anchorBlockHeader.isEmpty() && this.txContext.isEmpty() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && !this.includeByTimestamp && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.expectedNonRevertibleSideEffectCounter.isZero() && this.expectedRevertibleSideEffectCounter.isZero() && this.noteHashReadRequests.isEmpty() && this.nullifierReadRequests.isEmpty() && this.keyValidationRequestsAndGenerators.isEmpty() && this.privateCallRequests.isEmpty() && this.publicCallRequests.isEmpty() && this.publicTeardownCallRequest.isEmpty() && this.noteHashes.isEmpty() && this.nullifiers.isEmpty() && this.l2ToL1Msgs.isEmpty() && this.privateLogs.isEmpty() && this.contractClassLogsHashes.isEmpty();
146
146
  }
147
147
  /**
148
148
  * Serialize into a field array. Low-level utility.
@@ -153,26 +153,26 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
153
153
  fields.callContext,
154
154
  fields.argsHash,
155
155
  fields.returnsHash,
156
+ fields.anchorBlockHeader,
157
+ fields.txContext,
156
158
  fields.minRevertibleSideEffectCounter,
157
159
  fields.isFeePayer,
158
160
  fields.includeByTimestamp,
161
+ fields.startSideEffectCounter,
162
+ fields.endSideEffectCounter,
163
+ fields.expectedNonRevertibleSideEffectCounter,
164
+ fields.expectedRevertibleSideEffectCounter,
159
165
  fields.noteHashReadRequests,
160
166
  fields.nullifierReadRequests,
161
167
  fields.keyValidationRequestsAndGenerators,
162
- fields.noteHashes,
163
- fields.nullifiers,
164
168
  fields.privateCallRequests,
165
169
  fields.publicCallRequests,
166
170
  fields.publicTeardownCallRequest,
171
+ fields.noteHashes,
172
+ fields.nullifiers,
167
173
  fields.l2ToL1Msgs,
168
174
  fields.privateLogs,
169
- fields.contractClassLogsHashes,
170
- fields.startSideEffectCounter,
171
- fields.endSideEffectCounter,
172
- fields.expectedNonRevertibleSideEffectCounter,
173
- fields.expectedRevertibleSideEffectCounter,
174
- fields.anchorBlockHeader,
175
- fields.txContext
175
+ fields.contractClassLogsHashes
176
176
  ];
177
177
  }
178
178
  /**
@@ -185,26 +185,26 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
185
185
  this.callContext,
186
186
  this.argsHash,
187
187
  this.returnsHash,
188
+ this.anchorBlockHeader,
189
+ this.txContext,
188
190
  this.minRevertibleSideEffectCounter,
189
191
  this.isFeePayer,
190
192
  bigintToUInt64BE(this.includeByTimestamp),
193
+ this.startSideEffectCounter,
194
+ this.endSideEffectCounter,
195
+ this.expectedNonRevertibleSideEffectCounter,
196
+ this.expectedRevertibleSideEffectCounter,
191
197
  this.noteHashReadRequests,
192
198
  this.nullifierReadRequests,
193
199
  this.keyValidationRequestsAndGenerators,
194
- this.noteHashes,
195
- this.nullifiers,
196
200
  this.privateCallRequests,
197
201
  this.publicCallRequests,
198
202
  this.publicTeardownCallRequest,
203
+ this.noteHashes,
204
+ this.nullifiers,
199
205
  this.l2ToL1Msgs,
200
206
  this.privateLogs,
201
- this.contractClassLogsHashes,
202
- this.startSideEffectCounter,
203
- this.endSideEffectCounter,
204
- this.expectedNonRevertibleSideEffectCounter,
205
- this.expectedRevertibleSideEffectCounter,
206
- this.anchorBlockHeader,
207
- this.txContext
207
+ this.contractClassLogsHashes
208
208
  ]);
209
209
  }
210
210
  /**
@@ -13,4 +13,6 @@ export * from './shared_secret_derivation.js';
13
13
  export * from './tx_scoped_l2_log.js';
14
14
  export * from './message_context.js';
15
15
  export * from './debug_log.js';
16
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsZ0JBQWdCLENBQUMifQ==
16
+ export * from './tag.js';
17
+ export * from './siloed_tag.js';
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsK0JBQStCLENBQUM7QUFDOUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxpQkFBaUIsQ0FBQyJ9
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logs/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logs/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qCAAqC,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
@@ -13,3 +13,5 @@ export * from './shared_secret_derivation.js';
13
13
  export * from './tx_scoped_l2_log.js';
14
14
  export * from './message_context.js';
15
15
  export * from './debug_log.js';
16
+ export * from './tag.js';
17
+ export * from './siloed_tag.js';
@@ -0,0 +1,23 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { ZodFor } from '@aztec/foundation/schemas';
3
+ import type { AztecAddress } from '../aztec-address/index.js';
4
+ import type { Tag } from './tag.js';
5
+ /** Branding to ensure fields are not interchangeable types. */
6
+ export interface SiloedTag {
7
+ /** Brand. */
8
+ _branding: 'SiloedTag';
9
+ }
10
+ /**
11
+ * Represents a tag used in private log as it "appears on the chain" - that is the tag is siloed with a contract
12
+ * address that emitted the log.
13
+ */
14
+ export declare class SiloedTag {
15
+ readonly value: Fr;
16
+ constructor(value: Fr);
17
+ static compute(tag: Tag, app: AztecAddress): Promise<SiloedTag>;
18
+ toString(): string;
19
+ toJSON(): string;
20
+ equals(other: SiloedTag): boolean;
21
+ static get schema(): ZodFor<SiloedTag>;
22
+ }
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lsb2VkX3RhZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvZ3Mvc2lsb2VkX3RhZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUV4RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUU5RCxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFJcEMsK0RBQStEO0FBQy9ELE1BQU0sV0FBVyxTQUFTO0lBQ3hCLGFBQWE7SUFDYixTQUFTLEVBQUUsV0FBVyxDQUFDO0NBQ3hCO0FBRUQ7OztHQUdHO0FBQ0gscUJBQWEsU0FBUzthQUNRLEtBQUssRUFBRSxFQUFFO0lBQXJDLFlBQTRCLEtBQUssRUFBRSxFQUFFLEVBQUk7SUFFekMsT0FBYSxPQUFPLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRSxHQUFHLEVBQUUsWUFBWSxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FHcEU7SUFFRCxRQUFRLElBQUksTUFBTSxDQUVqQjtJQUVELE1BQU0sSUFBSSxNQUFNLENBRWY7SUFFRCxNQUFNLENBQUMsS0FBSyxFQUFFLFNBQVMsR0FBRyxPQUFPLENBRWhDO0lBRUQsTUFBTSxLQUFLLE1BQU0sSUFBSSxNQUFNLENBQUMsU0FBUyxDQUFDLENBRXJDO0NBQ0YifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"siloed_tag.d.ts","sourceRoot":"","sources":["../../src/logs/siloed_tag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAIpC,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,aAAa;IACb,SAAS,EAAE,WAAW,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,SAAS;aACQ,KAAK,EAAE,EAAE;IAArC,YAA4B,KAAK,EAAE,EAAE,EAAI;IAEzC,OAAa,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAGpE;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAEhC;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,CAErC;CACF"}
@@ -0,0 +1,30 @@
1
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
2
+ import { schemas } from '../schemas/schemas.js';
3
+ /**
4
+ * Represents a tag used in private log as it "appears on the chain" - that is the tag is siloed with a contract
5
+ * address that emitted the log.
6
+ */ export class SiloedTag {
7
+ value;
8
+ constructor(value){
9
+ this.value = value;
10
+ }
11
+ static async compute(tag, app) {
12
+ const siloedTag = await poseidon2Hash([
13
+ app,
14
+ tag.value
15
+ ]);
16
+ return new SiloedTag(siloedTag);
17
+ }
18
+ toString() {
19
+ return this.value.toString();
20
+ }
21
+ toJSON() {
22
+ return this.value.toString();
23
+ }
24
+ equals(other) {
25
+ return this.value.equals(other.value);
26
+ }
27
+ static get schema() {
28
+ return schemas.Fr.transform((fr)=>new SiloedTag(fr));
29
+ }
30
+ }
@@ -0,0 +1,21 @@
1
+ import type { Fr } from '@aztec/foundation/curves/bn254';
2
+ import type { ZodFor } from '@aztec/foundation/schemas';
3
+ import type { PreTag } from './pre_tag.js';
4
+ export interface Tag {
5
+ /** Brand. */
6
+ _branding: 'Tag';
7
+ }
8
+ /**
9
+ * Represents a tag of a private log. This is not the tag that "appears" on the chain as this tag is first siloed
10
+ * with a contract address by kernels before being included in the final log.
11
+ */
12
+ export declare class Tag {
13
+ readonly value: Fr;
14
+ constructor(value: Fr);
15
+ static compute(preTag: PreTag): Promise<Tag>;
16
+ toString(): string;
17
+ toJSON(): string;
18
+ equals(other: Tag): boolean;
19
+ static get schema(): ZodFor<Tag>;
20
+ }
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbG9ncy90YWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFHeEQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBSTNDLE1BQU0sV0FBVyxHQUFHO0lBQ2xCLGFBQWE7SUFDYixTQUFTLEVBQUUsS0FBSyxDQUFDO0NBQ2xCO0FBRUQ7OztHQUdHO0FBQ0gscUJBQWEsR0FBRzthQUNjLEtBQUssRUFBRSxFQUFFO0lBQXJDLFlBQTRCLEtBQUssRUFBRSxFQUFFLEVBQUk7SUFFekMsT0FBYSxPQUFPLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLENBR2pEO0lBRUQsUUFBUSxJQUFJLE1BQU0sQ0FFakI7SUFFRCxNQUFNLElBQUksTUFBTSxDQUVmO0lBRUQsTUFBTSxDQUFDLEtBQUssRUFBRSxHQUFHLEdBQUcsT0FBTyxDQUUxQjtJQUVELE1BQU0sS0FBSyxNQUFNLElBQUksTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUUvQjtDQUNGIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/logs/tag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,MAAM,WAAW,GAAG;IAClB,aAAa;IACb,SAAS,EAAE,KAAK,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,GAAG;aACc,KAAK,EAAE,EAAE;IAArC,YAA4B,KAAK,EAAE,EAAE,EAAI;IAEzC,OAAa,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAGjD;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAE1B;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,GAAG,CAAC,CAE/B;CACF"}
@@ -0,0 +1,30 @@
1
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
2
+ import { schemas } from '../schemas/schemas.js';
3
+ /**
4
+ * Represents a tag of a private log. This is not the tag that "appears" on the chain as this tag is first siloed
5
+ * with a contract address by kernels before being included in the final log.
6
+ */ export class Tag {
7
+ value;
8
+ constructor(value){
9
+ this.value = value;
10
+ }
11
+ static async compute(preTag) {
12
+ const tag = await poseidon2Hash([
13
+ preTag.secret.value,
14
+ preTag.index
15
+ ]);
16
+ return new Tag(tag);
17
+ }
18
+ toString() {
19
+ return this.value.toString();
20
+ }
21
+ toJSON() {
22
+ return this.value.toString();
23
+ }
24
+ equals(other) {
25
+ return this.value.equals(other.value);
26
+ }
27
+ static get schema() {
28
+ return schemas.Fr.transform((fr)=>new Tag(fr));
29
+ }
30
+ }
@@ -83,7 +83,7 @@ export class TxScopedL2Log {
83
83
  }
84
84
  static async random(isFromPublic = Math.random() < 0.5) {
85
85
  const log = isFromPublic ? await PublicLog.random() : PrivateLog.random();
86
- return new TxScopedL2Log(TxHash.random(), 1, 1, BlockNumber(1), L2BlockHash.random(), BigInt(1), log);
86
+ return new TxScopedL2Log(TxHash.random(), 1, 1, BlockNumber(1), L2BlockHash.random(), 1n, log);
87
87
  }
88
88
  equals(other) {
89
89
  return this.txHash.equals(other.txHash) && this.dataStartIndexForTx === other.dataStartIndexForTx && this.logIndexInTx === other.logIndexInTx && this.blockNumber === other.blockNumber && this.blockHash.equals(other.blockHash) && this.blockTimestamp === other.blockTimestamp && (this.log instanceof PublicLog && other.log instanceof PublicLog || this.log instanceof PrivateLog && other.log instanceof PrivateLog) && this.log.equals(other.log);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/stdlib",
3
- "version": "3.0.0-nightly.20251223",
3
+ "version": "3.0.0-nightly.20251224",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -77,13 +77,13 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@aws-sdk/client-s3": "^3.892.0",
80
- "@aztec/bb.js": "3.0.0-nightly.20251223",
81
- "@aztec/blob-lib": "3.0.0-nightly.20251223",
82
- "@aztec/constants": "3.0.0-nightly.20251223",
83
- "@aztec/ethereum": "3.0.0-nightly.20251223",
84
- "@aztec/foundation": "3.0.0-nightly.20251223",
85
- "@aztec/l1-artifacts": "3.0.0-nightly.20251223",
86
- "@aztec/noir-noirc_abi": "3.0.0-nightly.20251223",
80
+ "@aztec/bb.js": "3.0.0-nightly.20251224",
81
+ "@aztec/blob-lib": "3.0.0-nightly.20251224",
82
+ "@aztec/constants": "3.0.0-nightly.20251224",
83
+ "@aztec/ethereum": "3.0.0-nightly.20251224",
84
+ "@aztec/foundation": "3.0.0-nightly.20251224",
85
+ "@aztec/l1-artifacts": "3.0.0-nightly.20251224",
86
+ "@aztec/noir-noirc_abi": "3.0.0-nightly.20251224",
87
87
  "@google-cloud/storage": "^7.15.0",
88
88
  "axios": "^1.12.0",
89
89
  "json-stringify-deterministic": "1.0.12",
@@ -40,7 +40,7 @@ export async function computeContractClassIdWithPreimage(
40
40
  : await computePublicBytecodeCommitment(contractClass.packedBytecode);
41
41
  const id = await poseidon2HashWithSeparator(
42
42
  [artifactHash, privateFunctionsRoot, publicBytecodeCommitment],
43
- GeneratorIndex.CONTRACT_LEAF, // TODO(@spalladino): Review all generator indices in this file
43
+ GeneratorIndex.CONTRACT_CLASS_ID,
44
44
  );
45
45
  return { id, artifactHash, privateFunctionsRoot, publicBytecodeCommitment };
46
46
  }
package/src/hash/hash.ts CHANGED
@@ -69,17 +69,6 @@ export function computeProtocolNullifier(txRequestHash: Fr): Promise<Fr> {
69
69
  return siloNullifier(AztecAddress.fromBigInt(NULL_MSG_SENDER_CONTRACT_ADDRESS), txRequestHash);
70
70
  }
71
71
 
72
- /**
73
- * Computes a siloed private log tag, given the contract address and the unsiloed tag.
74
- * A siloed private log tag effectively namespaces a log to a specific contract.
75
- * @param contract - The contract address.
76
- * @param unsiloedTag - The unsiloed tag.
77
- * @returns A siloed private log tag.
78
- */
79
- export function siloPrivateLog(contract: AztecAddress, unsiloedTag: Fr): Promise<Fr> {
80
- return poseidon2Hash([contract, unsiloedTag]);
81
- }
82
-
83
72
  /**
84
73
  * Computes a public data tree value ready for insertion.
85
74
  * @param value - Raw public data tree value to hash into a tree-insertion-ready value.
@@ -17,6 +17,8 @@ import {
17
17
  } from '../contract/index.js';
18
18
  import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
19
19
  import { LogFilterSchema } from '../logs/log_filter.js';
20
+ import { SiloedTag } from '../logs/siloed_tag.js';
21
+ import { Tag } from '../logs/tag.js';
20
22
  import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
21
23
  import type { L1ToL2MessageSource } from '../messaging/l1_to_l2_message_source.js';
22
24
  import { optional, schemas } from '../schemas/schemas.js';
@@ -111,9 +113,13 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
111
113
  getBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
112
114
  isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
113
115
  getL2Tips: z.function().args().returns(L2TipsSchema),
114
- getLogsByTags: z
116
+ getPrivateLogsByTags: z
115
117
  .function()
116
- .args(z.array(schemas.Fr))
118
+ .args(z.array(SiloedTag.schema))
119
+ .returns(z.array(z.array(TxScopedL2Log.schema))),
120
+ getPublicLogsByTagsFromContract: z
121
+ .function()
122
+ .args(schemas.AztecAddress, z.array(Tag.schema))
117
123
  .returns(z.array(z.array(TxScopedL2Log.schema))),
118
124
  getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
119
125
  getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
@@ -36,8 +36,8 @@ import {
36
36
  ProtocolContractAddressesSchema,
37
37
  } from '../contract/index.js';
38
38
  import { GasFees } from '../gas/gas_fees.js';
39
+ import { SiloedTag, Tag, TxScopedL2Log } from '../logs/index.js';
39
40
  import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
40
- import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
41
41
  import { type ApiSchemaFor, optional, schemas } from '../schemas/schemas.js';
42
42
  import { MerkleTreeId } from '../trees/merkle_tree_id.js';
43
43
  import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
@@ -338,14 +338,16 @@ export interface AztecNode
338
338
  getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
339
339
 
340
340
  /**
341
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
342
- * @param tags - The tags to filter the logs by.
343
- * @param logsPerTag - How many logs to return per tag. Default 10 logs are returned for each tag
344
- * @returns For each received tag, an array of matching logs and metadata (e.g. tx hash) is returned. An empty
345
- * array implies no logs match that tag. There can be multiple logs for 1 tag because tag reuse can happen
346
- * --> e.g. when sending a note from multiple unsynched devices.
341
+ * Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
342
+ * array implies no logs match that tag.
347
343
  */
348
- getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
344
+ getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
345
+
346
+ /**
347
+ * Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
348
+ * logs is returned. An empty array implies no logs match that tag.
349
+ */
350
+ getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
349
351
 
350
352
  /**
351
353
  * Method to submit a transaction to the p2p pool.
@@ -481,7 +483,6 @@ export interface AztecNode
481
483
  getAllowedPublicSetup(): Promise<AllowedElement[]>;
482
484
  }
483
485
 
484
- export const MAX_LOGS_PER_TAG = 10;
485
486
  const MAX_SIGNATURES_PER_REGISTER_CALL = 100;
486
487
  const MAX_SIGNATURE_LEN = 10000;
487
488
 
@@ -601,12 +602,14 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
601
602
 
602
603
  getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
603
604
 
604
- getLogsByTags: z
605
+ getPrivateLogsByTags: z
605
606
  .function()
606
- .args(
607
- z.array(schemas.Fr).max(MAX_RPC_LEN),
608
- optional(z.number().gte(1).lte(MAX_LOGS_PER_TAG).default(MAX_LOGS_PER_TAG)),
609
- )
607
+ .args(z.array(SiloedTag.schema).max(MAX_RPC_LEN))
608
+ .returns(z.array(z.array(TxScopedL2Log.schema))),
609
+
610
+ getPublicLogsByTagsFromContract: z
611
+ .function()
612
+ .args(schemas.AztecAddress, z.array(Tag.schema).max(MAX_RPC_LEN))
610
613
  .returns(z.array(z.array(TxScopedL2Log.schema))),
611
614
 
612
615
  sendTx: z.function().args(Tx.schema).returns(z.void()),
@@ -1,7 +1,9 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
- import type { Fr } from '@aztec/foundation/curves/bn254';
3
2
 
3
+ import type { AztecAddress } from '../aztec-address/index.js';
4
4
  import type { LogFilter } from '../logs/log_filter.js';
5
+ import type { SiloedTag } from '../logs/siloed_tag.js';
6
+ import type { Tag } from '../logs/tag.js';
5
7
  import type { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
6
8
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_logs_response.js';
7
9
 
@@ -10,13 +12,16 @@ import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_
10
12
  */
11
13
  export interface L2LogsSource {
12
14
  /**
13
- * Gets all logs that match any of the received tags (i.e. logs with their first field equal to a tag).
14
- * @param tags - The tags to filter the logs by.
15
- * @param logsPerTag - The maximum number of logs to return for each tag. Default returns everything
16
- * @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
17
- * that tag.
15
+ * Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
16
+ * array implies no logs match that tag.
18
17
  */
19
- getLogsByTags(tags: Fr[], logsPerTag?: number): Promise<TxScopedL2Log[][]>;
18
+ getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
19
+
20
+ /**
21
+ * Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
22
+ * logs is returned. An empty array implies no logs match that tag.
23
+ */
24
+ getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
20
25
 
21
26
  /**
22
27
  * Gets public logs based on the provided filter.