@aztec/stdlib 0.86.0-nightly.20250509 → 0.86.0-nightly.20250511
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/avm/avm.js +5 -5
- package/dest/avm/public_data_write.d.ts +2 -0
- package/dest/avm/public_data_write.d.ts.map +1 -1
- package/dest/avm/public_data_write.js +10 -0
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +5 -11
- package/dest/block/l2_block.js +1 -1
- package/dest/kernel/log_hash.d.ts +27 -6
- package/dest/kernel/log_hash.d.ts.map +1 -1
- package/dest/kernel/log_hash.js +72 -13
- package/dest/kernel/private_accumulated_data.d.ts +3 -3
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -2
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +4 -2
- package/dest/logs/contract_class_log.d.ts +53 -9
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +129 -66
- package/dest/logs/log_with_tx_data.d.ts.map +1 -1
- package/dest/logs/log_with_tx_data.js +8 -3
- package/dest/logs/private_log.d.ts +13 -4
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +44 -30
- package/dest/logs/public_log.d.ts +9 -6
- package/dest/logs/public_log.d.ts.map +1 -1
- package/dest/logs/public_log.js +45 -32
- package/dest/logs/tx_scoped_l2_log.d.ts +6 -2
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +1 -2
- package/dest/rollup/base_rollup_hints.d.ts +7 -7
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +5 -5
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +15 -13
- package/dest/tx/private_execution_result.d.ts +6 -4
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -2
- package/dest/tx/tx.d.ts +4 -7
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +17 -14
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +29 -59
- package/dest/tx/validator/error_texts.d.ts +1 -1
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/package.json +7 -7
- package/src/avm/avm.ts +5 -5
- package/src/avm/public_data_write.ts +9 -0
- package/src/block/body.ts +5 -11
- package/src/block/l2_block.ts +1 -1
- package/src/kernel/log_hash.ts +74 -14
- package/src/kernel/private_accumulated_data.ts +4 -4
- package/src/kernel/private_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +13 -2
- package/src/logs/contract_class_log.ts +156 -57
- package/src/logs/log_with_tx_data.ts +7 -2
- package/src/logs/private_log.ts +52 -30
- package/src/logs/public_log.ts +62 -38
- package/src/logs/tx_scoped_l2_log.ts +1 -2
- package/src/rollup/base_rollup_hints.ts +7 -7
- package/src/tests/factories.ts +30 -18
- package/src/tx/private_execution_result.ts +5 -4
- package/src/tx/tx.ts +17 -16
- package/src/tx/tx_effect.ts +25 -72
- package/src/tx/validator/error_texts.ts +1 -1
package/dest/avm/avm.js
CHANGED
|
@@ -132,7 +132,7 @@ export class AvmGetPreviousValueIndexHint {
|
|
|
132
132
|
// NOTE: I need this factory because in order to get hold of the schema, I need an actual instance of the class,
|
|
133
133
|
// having the type doesn't suffice since TS does type erasure in the end.
|
|
134
134
|
function AvmGetLeafPreimageHintFactory(klass) {
|
|
135
|
-
return class
|
|
135
|
+
return class {
|
|
136
136
|
hintKey;
|
|
137
137
|
index;
|
|
138
138
|
leafPreimage;
|
|
@@ -148,7 +148,7 @@ function AvmGetLeafPreimageHintFactory(klass) {
|
|
|
148
148
|
hintKey: AppendOnlyTreeSnapshot.schema,
|
|
149
149
|
index: schemas.BigInt,
|
|
150
150
|
leafPreimage: klass.schema
|
|
151
|
-
}).transform(({ hintKey, index, leafPreimage })=>new
|
|
151
|
+
}).transform(({ hintKey, index, leafPreimage })=>new this(hintKey, index, leafPreimage));
|
|
152
152
|
}
|
|
153
153
|
};
|
|
154
154
|
}
|
|
@@ -185,7 +185,7 @@ export class AvmGetLeafValueHint {
|
|
|
185
185
|
// NOTE: I need this factory because in order to get hold of the schema, I need an actual instance of the class,
|
|
186
186
|
// having the type doesn't suffice since TS does type erasure in the end.
|
|
187
187
|
function AvmSequentialInsertHintFactory(klass) {
|
|
188
|
-
return class
|
|
188
|
+
return class {
|
|
189
189
|
hintKey;
|
|
190
190
|
stateAfter;
|
|
191
191
|
treeId;
|
|
@@ -218,7 +218,7 @@ function AvmSequentialInsertHintFactory(klass) {
|
|
|
218
218
|
index: schemas.BigInt,
|
|
219
219
|
path: schemas.Fr.array()
|
|
220
220
|
})
|
|
221
|
-
}).transform(({ hintKey, stateAfter, treeId, leaf, lowLeavesWitnessData, insertionWitnessData })=>new
|
|
221
|
+
}).transform(({ hintKey, stateAfter, treeId, leaf, lowLeavesWitnessData, insertionWitnessData })=>new this(hintKey, stateAfter, treeId, leaf, lowLeavesWitnessData, insertionWitnessData));
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
}
|
|
@@ -267,7 +267,7 @@ class AvmCheckpointActionNoStateChangeHint {
|
|
|
267
267
|
actionCounter: z.number().int().nonnegative(),
|
|
268
268
|
oldCheckpointId: z.number().int().nonnegative(),
|
|
269
269
|
newCheckpointId: z.number().int().nonnegative()
|
|
270
|
-
}).transform(({ actionCounter, oldCheckpointId, newCheckpointId })=>new
|
|
270
|
+
}).transform(({ actionCounter, oldCheckpointId, newCheckpointId })=>new this(actionCounter, oldCheckpointId, newCheckpointId));
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
// Hint for MerkleTreeDB.createCheckpoint.
|
|
@@ -43,6 +43,8 @@ export declare class PublicDataWrite {
|
|
|
43
43
|
static getFields(fields: FieldsOf<PublicDataWrite>): readonly [Fr, Fr];
|
|
44
44
|
static fromFields(fields: Fr[] | FieldReader): PublicDataWrite;
|
|
45
45
|
toFields(): Fr[];
|
|
46
|
+
static fromBlobFields(fields: Fr[] | FieldReader): PublicDataWrite;
|
|
47
|
+
toBlobFields(): Fr[];
|
|
46
48
|
static fromBuffer(buffer: Buffer | BufferReader): PublicDataWrite;
|
|
47
49
|
toBuffer(): Buffer;
|
|
48
50
|
static fromString(str: string): PublicDataWrite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_data_write.d.ts","sourceRoot":"","sources":["../../src/avm/public_data_write.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,qBAAa,eAAe;IAIxB;;OAEG;aACa,QAAQ,EAAE,EAAE;IAC5B;;OAEG;aACa,KAAK,EAAE,EAAE;IAV3B,MAAM,CAAC,aAAa,SAAwB;;IAG1C;;OAEG;IACa,QAAQ,EAAE,EAAE;IAC5B;;OAEG;IACa,KAAK,EAAE,EAAE;IAG3B,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;IAI7C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;IAIlD,MAAM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AAE;IAUhB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAKhD,YAAY,IAAI,EAAE,EAAE;IAIpB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;IAIR,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO;IAI9C,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;CAGxC"}
|
|
@@ -44,6 +44,16 @@ import { z } from 'zod';
|
|
|
44
44
|
}
|
|
45
45
|
return fields;
|
|
46
46
|
}
|
|
47
|
+
static fromBlobFields(fields) {
|
|
48
|
+
const reader = FieldReader.asReader(fields);
|
|
49
|
+
return new PublicDataWrite(reader.readField(), reader.readField());
|
|
50
|
+
}
|
|
51
|
+
toBlobFields() {
|
|
52
|
+
return [
|
|
53
|
+
this.leafSlot,
|
|
54
|
+
this.value
|
|
55
|
+
];
|
|
56
|
+
}
|
|
47
57
|
static fromBuffer(buffer) {
|
|
48
58
|
const reader = BufferReader.asReader(buffer);
|
|
49
59
|
return new PublicDataWrite(Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
package/dest/block/body.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../src/block/body.ts"],"names":[],"mappings":";;;AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../src/block/body.ts"],"names":[],"mappings":";;;AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAkC,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,qBAAa,IAAI;IACI,SAAS,EAAE,QAAQ,EAAE;gBAArB,SAAS,EAAE,QAAQ,EAAE;IAQxC,MAAM,CAAC,KAAK,EAAE,IAAI;IAMlB,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,CAMhC;IAED;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAM5C;;OAEG;IACH,YAAY;IAgBZ;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE;IASlC,CAAC,OAAO,CAAC,MAAM,CAAC;WAMH,MAAM,CAAC,WAAW,SAAI,EAAE,mBAAmB,SAAI,EAAE,oBAAoB,SAAI;IAQtF,MAAM,CAAC,KAAK;CAGb"}
|
package/dest/block/body.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BLOBS_PER_BLOCK, FIELDS_PER_BLOB } from '@aztec/constants';
|
|
2
2
|
import { timesParallel } from '@aztec/foundation/collection';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
+
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { inspect } from 'util';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
@@ -50,17 +50,11 @@ export class Body {
|
|
|
50
50
|
/**
|
|
51
51
|
* Decodes a block from blob fields.
|
|
52
52
|
*/ static fromBlobFields(fields) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
while(
|
|
56
|
-
|
|
57
|
-
throw new Error('Invalid fields given to Body.fromBlobFields(): First field invalid.');
|
|
58
|
-
}
|
|
59
|
-
const len = TxEffect.decodeFirstField(fields[checkedFields]).length;
|
|
60
|
-
txEffectsFields.push(fields.slice(checkedFields, checkedFields + len));
|
|
61
|
-
checkedFields += len;
|
|
53
|
+
const txEffects = [];
|
|
54
|
+
const reader = new FieldReader(fields);
|
|
55
|
+
while(!reader.isFinished()){
|
|
56
|
+
txEffects.push(TxEffect.fromBlobFields(reader));
|
|
62
57
|
}
|
|
63
|
-
const txEffects = txEffectsFields.filter((effect)=>effect.length).map((effect)=>TxEffect.fromBlobFields(effect));
|
|
64
58
|
return new this(txEffects);
|
|
65
59
|
}
|
|
66
60
|
[inspect.custom]() {
|
package/dest/block/l2_block.js
CHANGED
|
@@ -87,7 +87,7 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
|
|
|
87
87
|
privateLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.privateLogs.length, 0),
|
|
88
88
|
publicLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.publicLogs.length, 0),
|
|
89
89
|
contractClassLogCount: this.body.txEffects.reduce((logCount, txEffect)=>logCount + txEffect.contractClassLogs.length, 0),
|
|
90
|
-
contractClassLogSize: this.body.txEffects.reduce((totalLogSize, txEffect)=>totalLogSize + txEffect.contractClassLogs.reduce((
|
|
90
|
+
contractClassLogSize: this.body.txEffects.reduce((totalLogSize, txEffect)=>totalLogSize + txEffect.contractClassLogs.reduce((acc, log)=>acc + log.emittedLength, 0), 0)
|
|
91
91
|
};
|
|
92
92
|
return {
|
|
93
93
|
txCount: this.body.txEffects.length,
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
/// <reference types="node" resolution-mode="require"/>
|
|
4
4
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
5
|
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
6
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
7
|
import { inspect } from 'util';
|
|
7
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
8
|
-
|
|
9
|
-
export declare class LogHash implements Ordered {
|
|
9
|
+
export declare class LogHash {
|
|
10
10
|
value: Fr;
|
|
11
|
-
counter: number;
|
|
12
11
|
length: number;
|
|
13
|
-
constructor(value: Fr,
|
|
12
|
+
constructor(value: Fr, length: number);
|
|
13
|
+
static from(fields: FieldsOf<LogHash>): LogHash;
|
|
14
14
|
toFields(): Fr[];
|
|
15
15
|
static fromFields(fields: Fr[] | FieldReader): LogHash;
|
|
16
16
|
isEmpty(): boolean;
|
|
@@ -21,11 +21,21 @@ export declare class LogHash implements Ordered {
|
|
|
21
21
|
scope(contractAddress: AztecAddress): ScopedLogHash;
|
|
22
22
|
[inspect.custom](): string;
|
|
23
23
|
}
|
|
24
|
-
export declare class
|
|
24
|
+
export declare class CountedLogHash {
|
|
25
|
+
logHash: LogHash;
|
|
26
|
+
counter: number;
|
|
27
|
+
constructor(logHash: LogHash, counter: number);
|
|
28
|
+
toFields(): Fr[];
|
|
29
|
+
static fromFields(fields: Fr[] | FieldReader): CountedLogHash;
|
|
30
|
+
isEmpty(): boolean;
|
|
31
|
+
static empty(): CountedLogHash;
|
|
32
|
+
toBuffer(): Buffer;
|
|
33
|
+
static fromBuffer(buffer: Buffer | BufferReader): CountedLogHash;
|
|
34
|
+
}
|
|
35
|
+
export declare class ScopedLogHash {
|
|
25
36
|
logHash: LogHash;
|
|
26
37
|
contractAddress: AztecAddress;
|
|
27
38
|
constructor(logHash: LogHash, contractAddress: AztecAddress);
|
|
28
|
-
get counter(): number;
|
|
29
39
|
get value(): Fr;
|
|
30
40
|
toFields(): Fr[];
|
|
31
41
|
static fromFields(fields: Fr[] | FieldReader): ScopedLogHash;
|
|
@@ -35,4 +45,15 @@ export declare class ScopedLogHash implements Ordered {
|
|
|
35
45
|
static fromBuffer(buffer: Buffer | BufferReader): ScopedLogHash;
|
|
36
46
|
toString(): string;
|
|
37
47
|
}
|
|
48
|
+
export declare class ScopedCountedLogHash {
|
|
49
|
+
inner: CountedLogHash;
|
|
50
|
+
contractAddress: AztecAddress;
|
|
51
|
+
constructor(inner: CountedLogHash, contractAddress: AztecAddress);
|
|
52
|
+
toFields(): Fr[];
|
|
53
|
+
static fromFields(fields: Fr[] | FieldReader): ScopedCountedLogHash;
|
|
54
|
+
toBuffer(): Buffer;
|
|
55
|
+
static fromBuffer(buffer: Buffer | BufferReader): ScopedCountedLogHash;
|
|
56
|
+
isEmpty(): boolean;
|
|
57
|
+
static empty(): ScopedCountedLogHash;
|
|
58
|
+
}
|
|
38
59
|
//# sourceMappingURL=log_hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log_hash.d.ts","sourceRoot":"","sources":["../../src/kernel/log_hash.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"log_hash.d.ts","sourceRoot":"","sources":["../../src/kernel/log_hash.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAC3F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBAAa,OAAO;IACC,KAAK,EAAE,EAAE;IAAS,MAAM,EAAE,MAAM;gBAAhC,KAAK,EAAE,EAAE,EAAS,MAAM,EAAE,MAAM;IAEnD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IAIrC,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,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AAE,EAAE,EAAE,GAAG,WAAW;IAK5C,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAK/C,OAAO;IAIP,MAAM,CAAC,KAAK;CAGb"}
|
package/dest/kernel/log_hash.js
CHANGED
|
@@ -4,39 +4,39 @@ import { inspect } from 'util';
|
|
|
4
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
export class LogHash {
|
|
6
6
|
value;
|
|
7
|
-
counter;
|
|
8
7
|
length;
|
|
9
|
-
constructor(value,
|
|
8
|
+
constructor(value, length){
|
|
10
9
|
this.value = value;
|
|
11
|
-
this.counter = counter;
|
|
12
10
|
this.length = length;
|
|
13
11
|
}
|
|
12
|
+
static from(fields) {
|
|
13
|
+
return new LogHash(fields.value, fields.length);
|
|
14
|
+
}
|
|
14
15
|
toFields() {
|
|
15
16
|
return [
|
|
16
17
|
this.value,
|
|
17
|
-
new Fr(this.counter),
|
|
18
18
|
new Fr(this.length)
|
|
19
19
|
];
|
|
20
20
|
}
|
|
21
21
|
static fromFields(fields) {
|
|
22
22
|
const reader = FieldReader.asReader(fields);
|
|
23
|
-
return new LogHash(reader.readField(), reader.readU32()
|
|
23
|
+
return new LogHash(reader.readField(), reader.readU32());
|
|
24
24
|
}
|
|
25
25
|
isEmpty() {
|
|
26
|
-
return this.value.isZero() && !this.length
|
|
26
|
+
return this.value.isZero() && !this.length;
|
|
27
27
|
}
|
|
28
28
|
static empty() {
|
|
29
|
-
return new LogHash(Fr.zero(), 0
|
|
29
|
+
return new LogHash(Fr.zero(), 0);
|
|
30
30
|
}
|
|
31
31
|
toBuffer() {
|
|
32
|
-
return serializeToBuffer(this.value, this.
|
|
32
|
+
return serializeToBuffer(this.value, this.length);
|
|
33
33
|
}
|
|
34
34
|
static fromBuffer(buffer) {
|
|
35
35
|
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new LogHash(Fr.fromBuffer(reader), reader.readNumber()
|
|
36
|
+
return new LogHash(Fr.fromBuffer(reader), reader.readNumber());
|
|
37
37
|
}
|
|
38
38
|
toString() {
|
|
39
|
-
return `value=${this.value}
|
|
39
|
+
return `value=${this.value} length=${this.length}`;
|
|
40
40
|
}
|
|
41
41
|
scope(contractAddress) {
|
|
42
42
|
return new ScopedLogHash(this, contractAddress);
|
|
@@ -45,6 +45,37 @@ export class LogHash {
|
|
|
45
45
|
return `LogHash { ${this.toString()} }`;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
export class CountedLogHash {
|
|
49
|
+
logHash;
|
|
50
|
+
counter;
|
|
51
|
+
constructor(logHash, counter){
|
|
52
|
+
this.logHash = logHash;
|
|
53
|
+
this.counter = counter;
|
|
54
|
+
}
|
|
55
|
+
toFields() {
|
|
56
|
+
return [
|
|
57
|
+
...this.logHash.toFields(),
|
|
58
|
+
new Fr(this.counter)
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
static fromFields(fields) {
|
|
62
|
+
const reader = FieldReader.asReader(fields);
|
|
63
|
+
return new CountedLogHash(reader.readObject(LogHash), reader.readU32());
|
|
64
|
+
}
|
|
65
|
+
isEmpty() {
|
|
66
|
+
return this.logHash.isEmpty() && !this.counter;
|
|
67
|
+
}
|
|
68
|
+
static empty() {
|
|
69
|
+
return new CountedLogHash(LogHash.empty(), 0);
|
|
70
|
+
}
|
|
71
|
+
toBuffer() {
|
|
72
|
+
return serializeToBuffer(this.logHash, this.counter);
|
|
73
|
+
}
|
|
74
|
+
static fromBuffer(buffer) {
|
|
75
|
+
const reader = BufferReader.asReader(buffer);
|
|
76
|
+
return new CountedLogHash(LogHash.fromBuffer(reader), reader.readNumber());
|
|
77
|
+
}
|
|
78
|
+
}
|
|
48
79
|
export class ScopedLogHash {
|
|
49
80
|
logHash;
|
|
50
81
|
contractAddress;
|
|
@@ -52,9 +83,6 @@ export class ScopedLogHash {
|
|
|
52
83
|
this.logHash = logHash;
|
|
53
84
|
this.contractAddress = contractAddress;
|
|
54
85
|
}
|
|
55
|
-
get counter() {
|
|
56
|
-
return this.logHash.counter;
|
|
57
|
-
}
|
|
58
86
|
get value() {
|
|
59
87
|
return this.logHash.value;
|
|
60
88
|
}
|
|
@@ -85,3 +113,34 @@ export class ScopedLogHash {
|
|
|
85
113
|
return `logHash=${this.logHash} contractAddress=${this.contractAddress}`;
|
|
86
114
|
}
|
|
87
115
|
}
|
|
116
|
+
export class ScopedCountedLogHash {
|
|
117
|
+
inner;
|
|
118
|
+
contractAddress;
|
|
119
|
+
constructor(inner, contractAddress){
|
|
120
|
+
this.inner = inner;
|
|
121
|
+
this.contractAddress = contractAddress;
|
|
122
|
+
}
|
|
123
|
+
toFields() {
|
|
124
|
+
return [
|
|
125
|
+
...this.inner.toFields(),
|
|
126
|
+
this.contractAddress.toField()
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
static fromFields(fields) {
|
|
130
|
+
const reader = FieldReader.asReader(fields);
|
|
131
|
+
return new ScopedCountedLogHash(reader.readObject(CountedLogHash), AztecAddress.fromField(reader.readField()));
|
|
132
|
+
}
|
|
133
|
+
toBuffer() {
|
|
134
|
+
return serializeToBuffer(this.inner, this.contractAddress);
|
|
135
|
+
}
|
|
136
|
+
static fromBuffer(buffer) {
|
|
137
|
+
const reader = BufferReader.asReader(buffer);
|
|
138
|
+
return new ScopedCountedLogHash(CountedLogHash.fromBuffer(reader), AztecAddress.fromBuffer(reader));
|
|
139
|
+
}
|
|
140
|
+
isEmpty() {
|
|
141
|
+
return this.inner.isEmpty() && this.contractAddress.isZero();
|
|
142
|
+
}
|
|
143
|
+
static empty() {
|
|
144
|
+
return new ScopedCountedLogHash(CountedLogHash.empty(), AztecAddress.ZERO);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
4
4
|
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
5
5
|
import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ScopedCountedLogHash } from './log_hash.js';
|
|
7
7
|
import { ScopedNoteHash } from './note_hash.js';
|
|
8
8
|
import { ScopedNullifier } from './nullifier.js';
|
|
9
9
|
import { PrivateCallRequest } from './private_call_request.js';
|
|
@@ -34,7 +34,7 @@ export declare class PrivateAccumulatedData {
|
|
|
34
34
|
* Accumulated contract class logs from all the previous kernel iterations.
|
|
35
35
|
* Note: Truncated to 31 bytes to fit in Fr.
|
|
36
36
|
*/
|
|
37
|
-
contractClassLogsHashes: Tuple<
|
|
37
|
+
contractClassLogsHashes: Tuple<ScopedCountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>;
|
|
38
38
|
/**
|
|
39
39
|
* Accumulated public call requests from all the previous kernel iterations.
|
|
40
40
|
*/
|
|
@@ -64,7 +64,7 @@ export declare class PrivateAccumulatedData {
|
|
|
64
64
|
* Accumulated contract class logs from all the previous kernel iterations.
|
|
65
65
|
* Note: Truncated to 31 bytes to fit in Fr.
|
|
66
66
|
*/
|
|
67
|
-
contractClassLogsHashes: Tuple<
|
|
67
|
+
contractClassLogsHashes: Tuple<ScopedCountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>,
|
|
68
68
|
/**
|
|
69
69
|
* Accumulated public call requests from all the previous kernel iterations.
|
|
70
70
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_accumulated_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_accumulated_data.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oCAAoC,EACpC,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"private_accumulated_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_accumulated_data.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oCAAoC,EACpC,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,sBAAsB;IAE/B;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,sBAAsB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,eAAe,EAAE,OAAO,qBAAqB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,mBAAmB,EAAE,OAAO,wBAAwB,CAAC;IAC9E;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,uBAAuB,CAAC;IAC/E;;;OAGG;IACI,uBAAuB,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,8BAA8B,CAAC;IAClG;;OAEG;IACI,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,EAAE,OAAO,yBAAyB,CAAC;IAC5F;;OAEG;IACI,gBAAgB,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,oCAAoC,CAAC;;IA5B/F;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,sBAAsB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,eAAe,EAAE,OAAO,qBAAqB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,mBAAmB,EAAE,OAAO,wBAAwB,CAAC;IAC9E;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,uBAAuB,CAAC;IAC/E;;;OAGG;IACI,uBAAuB,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,8BAA8B,CAAC;IAClG;;OAEG;IACI,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,EAAE,OAAO,yBAAyB,CAAC;IAC5F;;OAEG;IACI,gBAAgB,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,oCAAoC,CAAC;IAGjG,QAAQ;IAYR,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,sBAAsB;IAaxE;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;CAWb"}
|
|
@@ -3,7 +3,7 @@ import { makeTuple } from '@aztec/foundation/array';
|
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
5
|
import { ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
6
|
-
import {
|
|
6
|
+
import { ScopedCountedLogHash } from './log_hash.js';
|
|
7
7
|
import { ScopedNoteHash } from './note_hash.js';
|
|
8
8
|
import { ScopedNullifier } from './nullifier.js';
|
|
9
9
|
import { PrivateCallRequest } from './private_call_request.js';
|
|
@@ -56,7 +56,7 @@ import { CountedPublicCallRequest } from './public_call_request.js';
|
|
|
56
56
|
* @returns Deserialized object.
|
|
57
57
|
*/ static fromBuffer(buffer) {
|
|
58
58
|
const reader = BufferReader.asReader(buffer);
|
|
59
|
-
return new PrivateAccumulatedData(reader.readArray(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash), reader.readArray(MAX_NULLIFIERS_PER_TX, ScopedNullifier), reader.readArray(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
59
|
+
return new PrivateAccumulatedData(reader.readArray(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash), reader.readArray(MAX_NULLIFIERS_PER_TX, ScopedNullifier), reader.readArray(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedCountedLogHash), reader.readArray(MAX_ENQUEUED_CALLS_PER_TX, CountedPublicCallRequest), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, PrivateCallRequest));
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Deserializes from a string, corresponding to a write in cpp.
|
|
@@ -66,6 +66,6 @@ import { CountedPublicCallRequest } from './public_call_request.js';
|
|
|
66
66
|
return PrivateAccumulatedData.fromBuffer(hexToBuffer(str));
|
|
67
67
|
}
|
|
68
68
|
static empty() {
|
|
69
|
-
return new PrivateAccumulatedData(makeTuple(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_TX, ScopedNullifier.empty), makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
69
|
+
return new PrivateAccumulatedData(makeTuple(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_TX, ScopedNullifier.empty), makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedL2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedCountedLogHash.empty), makeTuple(MAX_ENQUEUED_CALLS_PER_TX, CountedPublicCallRequest.empty), makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, PrivateCallRequest.empty));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -5,7 +5,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
5
5
|
import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
|
|
6
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
7
|
import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
|
|
8
|
-
import {
|
|
8
|
+
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
9
9
|
import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
10
10
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
11
11
|
import { L2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
@@ -88,7 +88,7 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
88
88
|
/**
|
|
89
89
|
* Hash of the contract class logs emitted in this function call.
|
|
90
90
|
*/
|
|
91
|
-
contractClassLogsHashes: Tuple<
|
|
91
|
+
contractClassLogsHashes: Tuple<CountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_CALL>;
|
|
92
92
|
/**
|
|
93
93
|
* The side effect counter at the start of this call.
|
|
94
94
|
*/
|
|
@@ -177,7 +177,7 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
177
177
|
/**
|
|
178
178
|
* Hash of the contract class logs emitted in this function call.
|
|
179
179
|
*/
|
|
180
|
-
contractClassLogsHashes: Tuple<
|
|
180
|
+
contractClassLogsHashes: Tuple<CountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_CALL>,
|
|
181
181
|
/**
|
|
182
182
|
* The side effect counter at the start of this call.
|
|
183
183
|
*/
|
|
@@ -222,7 +222,7 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
222
222
|
* @param fields - Object with fields.
|
|
223
223
|
* @returns The array.
|
|
224
224
|
*/
|
|
225
|
-
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, Fr, boolean, MaxBlockNumber, [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator], [NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash], [Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier], [PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest], [CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest], PublicCallRequest, [L2ToL1Message, L2ToL1Message], [PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData], [
|
|
225
|
+
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, Fr, boolean, MaxBlockNumber, [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator], [NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash], [Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier], [PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest], [CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest], PublicCallRequest, [L2ToL1Message, L2ToL1Message], [PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData], [CountedLogHash], Fr, Fr, BlockHeader, TxContext];
|
|
226
226
|
/**
|
|
227
227
|
* Serialize this as a buffer.
|
|
228
228
|
* @returns The buffer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_circuit_public_inputs.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,wBAAwB,EACxB,oCAAoC,EACpC,uBAAuB,EACvB,oCAAoC,EACpC,sCAAsC,EACtC,yBAAyB,EAE1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yDAAyD,CAAC;AAC3G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"private_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_circuit_public_inputs.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,wBAAwB,EACxB,oCAAoC,EACpC,uBAAuB,EACvB,oCAAoC,EACpC,sCAAsC,EACtC,yBAAyB,EAE1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,gCAAgC,EAAE,MAAM,yDAAyD,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAA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F;;OAEG;IACI,sBAAsB,EAAE,EAAE;IACjC;;OAEG;IACI,oBAAoB,EAAE,EAAE;IAC/B;;OAEG;IACI,gBAAgB,EAAE,WAAW;IACpC;;;;;;OAMG;IACI,SAAS,EAAE,SAAS;IAG7B;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;IAIrF;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,0BAA0B;IA2B5E,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,0BAA0B;IA2BzE;;;OAGG;WACW,KAAK,IAAI,0BAA0B;IA0BjD,OAAO;IA0BP;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,0BAA0B,CAAC;IA0B7D;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,QAAQ,IAAI,EAAE,EAAE;IAUT,MAAM;IAIb,MAAM,KAAK,MAAM,mEAEhB;CACF"}
|
|
@@ -4,7 +4,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
4
4
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
5
5
|
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
6
6
|
import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
|
|
7
|
-
import {
|
|
7
|
+
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
8
8
|
import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
9
9
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
10
10
|
import { L2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
@@ -123,17 +123,17 @@ import { isEmptyArray } from './utils/order_and_comparison.js';
|
|
|
123
123
|
* @returns The deserialized instance.
|
|
124
124
|
*/ static fromBuffer(buffer) {
|
|
125
125
|
const reader = BufferReader.asReader(buffer);
|
|
126
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readBoolean(), reader.readObject(MaxBlockNumber), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL,
|
|
126
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readBoolean(), reader.readObject(MaxBlockNumber), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext));
|
|
127
127
|
}
|
|
128
128
|
static fromFields(fields) {
|
|
129
129
|
const reader = FieldReader.asReader(fields);
|
|
130
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readField(), reader.readBoolean(), reader.readObject(MaxBlockNumber), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL,
|
|
130
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readField(), reader.readBoolean(), reader.readObject(MaxBlockNumber), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext));
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Create an empty PrivateCircuitPublicInputs.
|
|
134
134
|
* @returns An empty PrivateCircuitPublicInputs object.
|
|
135
135
|
*/ static empty() {
|
|
136
|
-
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, Fr.ZERO, false, MaxBlockNumber.empty(), makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator.empty), makeTuple(MAX_NOTE_HASHES_PER_CALL, NoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_CALL, Nullifier.empty), makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest.empty), makeTuple(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest.empty), PublicCallRequest.empty(), makeTuple(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_CALL,
|
|
136
|
+
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, Fr.ZERO, false, MaxBlockNumber.empty(), makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator.empty), makeTuple(MAX_NOTE_HASHES_PER_CALL, NoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_CALL, Nullifier.empty), makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest.empty), makeTuple(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest.empty), PublicCallRequest.empty(), makeTuple(MAX_L2_TO_L1_MSGS_PER_CALL, L2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash.empty), Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty());
|
|
137
137
|
}
|
|
138
138
|
isEmpty() {
|
|
139
139
|
return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && this.maxBlockNumber.isEmpty() && isEmptyArray(this.noteHashReadRequests) && isEmptyArray(this.nullifierReadRequests) && isEmptyArray(this.keyValidationRequestsAndGenerators) && isEmptyArray(this.noteHashes) && isEmptyArray(this.nullifiers) && isEmptyArray(this.privateCallRequests) && isEmptyArray(this.publicCallRequests) && this.publicTeardownCallRequest.isEmpty() && isEmptyArray(this.l2ToL1Msgs) && isEmptyArray(this.privateLogs) && isEmptyArray(this.contractClassLogsHashes) && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.historicalHeader.isEmpty() && this.txContext.isEmpty();
|
|
@@ -4,8 +4,10 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
4
4
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
5
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
6
|
import { Gas } from '../gas/gas.js';
|
|
7
|
+
import type { PrivateLog } from '../logs/index.js';
|
|
7
8
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
8
9
|
import { RollupValidationRequests } from './hints/rollup_validation_requests.js';
|
|
10
|
+
import type { ScopedLogHash } from './log_hash.js';
|
|
9
11
|
import { PrivateToPublicAccumulatedData } from './private_to_public_accumulated_data.js';
|
|
10
12
|
import { PrivateToPublicKernelCircuitPublicInputs } from './private_to_public_kernel_circuit_public_inputs.js';
|
|
11
13
|
import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_data.js';
|
|
@@ -98,8 +100,8 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
98
100
|
getTeardownPublicCallRequest(): PublicCallRequest | undefined;
|
|
99
101
|
getNonEmptyNoteHashes(): Fr[];
|
|
100
102
|
getNonEmptyNullifiers(): Fr[];
|
|
101
|
-
getNonEmptyPrivateLogs():
|
|
102
|
-
getNonEmptyContractClassLogsHashes():
|
|
103
|
+
getNonEmptyPrivateLogs(): PrivateLog[];
|
|
104
|
+
getNonEmptyContractClassLogsHashes(): ScopedLogHash[];
|
|
103
105
|
getEmittedContractClassLogsLength(): number;
|
|
104
106
|
getEmittedPrivateLogsLength(): number;
|
|
105
107
|
static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelTailCircuitPublicInputs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_tail_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_public_inputs.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE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AAG;IACnB;;OAEG;IACI,QAAQ,EAAE,YAAY,EAEtB,SAAS,CAAC,qDAAyC,EACnD,SAAS,CAAC,qDAAyC;IAY5D,MAAM,KAAK,MAAM,6EAEhB;IAED,MAAM;IAIN,OAAO;IAUP,0CAA0C;IAe1C,0CAA0C;IAmB1C,0BAA0B;IAQ1B,uCAAuC;IAIvC,oCAAoC;IAIpC,4BAA4B;IAI5B,kCAAkC;IAMlC,+BAA+B;IAI/B,4BAA4B;IAK5B,qBAAqB;IAUrB,qBAAqB;IAUrB,sBAAsB;IAUtB,kCAAkC;IAUlC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"private_kernel_tail_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_public_inputs.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,wCAAwC,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,wCAAwC,EAAE,MAAM,qDAAqD,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,qBAAa,uCAAuC;IAEhD;;OAEG;IACI,4BAA4B,E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qBAAqB;IAUrB,qBAAqB;IAUrB,sBAAsB;IAUtB,kCAAkC;IAUlC,iCAAiC;IASjC,2BAA2B;IAQ3B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,oCAAoC;IAatF,QAAQ;IAYR,MAAM,CAAC,KAAK;IAWZ;;;;OAIG;IACH,MAAM,CAAC,kBAAkB;CAY1B"}
|
|
@@ -157,10 +157,12 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
157
157
|
return contractClassLogsHashes.filter((h)=>!h.isEmpty());
|
|
158
158
|
}
|
|
159
159
|
getEmittedContractClassLogsLength() {
|
|
160
|
-
|
|
160
|
+
const accumulateLengths = (logHashes)=>logHashes.reduce((acc, log)=>acc + log.logHash.length, 0);
|
|
161
|
+
return this.forPublic ? accumulateLengths(this.forPublic.nonRevertibleAccumulatedData.contractClassLogsHashes) + accumulateLengths(this.forPublic.revertibleAccumulatedData.contractClassLogsHashes) : accumulateLengths(this.forRollup.end.contractClassLogsHashes);
|
|
161
162
|
}
|
|
162
163
|
getEmittedPrivateLogsLength() {
|
|
163
|
-
|
|
164
|
+
const accumulateLengths = (logs)=>logs.reduce((acc, log)=>acc + log.emittedLength, 0);
|
|
165
|
+
return this.forPublic ? accumulateLengths(this.forPublic.nonRevertibleAccumulatedData.privateLogs) + accumulateLengths(this.forPublic.revertibleAccumulatedData.privateLogs) : accumulateLengths(this.forRollup.end.privateLogs);
|
|
164
166
|
}
|
|
165
167
|
static fromBuffer(buffer) {
|
|
166
168
|
const reader = BufferReader.asReader(buffer);
|