@aztec-labs/stdlib 6.1.0-nightly.20261028 → 6.1.0-nightly.20261030
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/delayed_public_mutable/delayed_public_mutable_values.d.ts +8 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
- package/dest/delayed_public_mutable/delayed_public_mutable_values.js +7 -0
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts +9 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.d.ts.map +1 -1
- package/dest/delayed_public_mutable/scheduled_delay_change.js +18 -0
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts +6 -1
- package/dest/delayed_public_mutable/scheduled_value_change.d.ts.map +1 -1
- package/dest/delayed_public_mutable/scheduled_value_change.js +15 -0
- package/dest/interfaces/proving-job.d.ts +70 -70
- package/dest/kernel/padded_side_effects.d.ts +6 -1
- package/dest/kernel/padded_side_effects.d.ts.map +1 -1
- package/dest/kernel/padded_side_effects.js +5 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_kernel_circuit_public_inputs.js +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +2 -2
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -1
- package/package.json +5 -5
- package/src/delayed_public_mutable/delayed_public_mutable_values.ts +13 -0
- package/src/delayed_public_mutable/scheduled_delay_change.ts +21 -0
- package/src/delayed_public_mutable/scheduled_value_change.ts +17 -0
- package/src/kernel/padded_side_effects.ts +5 -0
- package/src/kernel/private_kernel_circuit_public_inputs.ts +1 -1
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
2
|
import { BufferReader, FieldReader } from '@aztec-labs/foundation/serialize';
|
|
3
|
+
import type { UInt64 } from '../types/shared.js';
|
|
3
4
|
import { ScheduledDelayChange } from './scheduled_delay_change.js';
|
|
4
5
|
import { ScheduledValueChange } from './scheduled_value_change.js';
|
|
5
6
|
export declare const DELAYED_PUBLIC_MUTABLE_VALUES_LEN: number;
|
|
@@ -14,7 +15,13 @@ export declare class DelayedPublicMutableValues {
|
|
|
14
15
|
static empty(valueSize: number): DelayedPublicMutableValues;
|
|
15
16
|
static readFromTree(delayedPublicMutableSlot: Fr, readStorage: (storageSlot: Fr) => Promise<Fr>): Promise<DelayedPublicMutableValues>;
|
|
16
17
|
isEmpty(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current.
|
|
20
|
+
* A tx that reads this value in private must not be included after it. `initialDelay` is the delay in effect before
|
|
21
|
+
* any change to it.
|
|
22
|
+
*/
|
|
23
|
+
getTimeHorizon(anchorBlockTimestamp: UInt64, initialDelay: UInt64): UInt64;
|
|
17
24
|
writeToTree(delayedPublicMutableSlot: Fr, storageWrite: (storageSlot: Fr, value: Fr) => Promise<void>): Promise<void[]>;
|
|
18
25
|
hash(): Promise<Fr>;
|
|
19
26
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsYXllZF9wdWJsaWNfbXV0YWJsZV92YWx1ZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWxheWVkX3B1YmxpY19tdXRhYmxlL2RlbGF5ZWRfcHVibGljX211dGFibGVfdmFsdWVzLnRzIl0sIm5hbWVzIjpb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0FBTyxDQUVqQjtJQUVEOzs7O09BSUc7SUFDSCxjQUFjLENBQUMsb0JBQW9CLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLEdBQUcsTUFBTSxDQUt6RTtJQUVELFdBQVcsQ0FBQyx3QkFBd0IsRUFBRSxFQUFFLEVBQUUsWUFBWSxFQUFFLENBQUMsV0FBVyxFQUFFLEVBQUUsRUFBRSxLQUFLLEVBQUUsRUFBRSxLQUFLLE9BQU8sQ0FBQyxJQUFJLENBQUMsbUJBTXBHO0lBRUssSUFBSSxJQUFJLE9BQU8sQ0FBQyxFQUFFLENBQUMsQ0FJeEI7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delayed_public_mutable_values.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/delayed_public_mutable_values.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,kCAAkC,CAAC;AAEhG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,eAAO,MAAM,iCAAiC,QAA6B,CAAC;AAE5E,qBAAa,0BAA0B;IAE5B,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,oBAAoB;IAFlC,YACS,GAAG,EAAE,oBAAoB,EACzB,GAAG,EAAE,oBAAoB,EAC9B;IAEJ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,8BAyB3C;IAED,QAAQ,IAAI,EAAE,EAAE,CAWf;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,0BAA0B,CAG9F;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,8BAE7B;IAED,OAAa,YAAY,CAAC,wBAAwB,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC,uCAKpG;IAED,OAAO,IAAI,OAAO,CAEjB;IAED,WAAW,CAAC,wBAAwB,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,mBAMpG;IAEK,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,CAIxB;CACF"}
|
|
1
|
+
{"version":3,"file":"delayed_public_mutable_values.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/delayed_public_mutable_values.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,kCAAkC,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,eAAO,MAAM,iCAAiC,QAA6B,CAAC;AAE5E,qBAAa,0BAA0B;IAE5B,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,oBAAoB;IAFlC,YACS,GAAG,EAAE,oBAAoB,EACzB,GAAG,EAAE,oBAAoB,EAC9B;IAEJ,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,8BAyB3C;IAED,QAAQ,IAAI,EAAE,EAAE,CAWf;IAED,QAAQ,IAAI,MAAM,CAEjB;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE,SAAS,EAAE,MAAM,GAAG,0BAA0B,CAG9F;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,8BAE7B;IAED,OAAa,YAAY,CAAC,wBAAwB,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,KAAK,OAAO,CAAC,EAAE,CAAC,uCAKpG;IAED,OAAO,IAAI,OAAO,CAEjB;IAED;;;;OAIG;IACH,cAAc,CAAC,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKzE;IAED,WAAW,CAAC,wBAAwB,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,mBAMpG;IAEK,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC,CAIxB;CACF"}
|
|
@@ -63,6 +63,13 @@ export class DelayedPublicMutableValues {
|
|
|
63
63
|
isEmpty() {
|
|
64
64
|
return this.svc.isEmpty() && this.sdc.isEmpty();
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current.
|
|
68
|
+
* A tx that reads this value in private must not be included after it. `initialDelay` is the delay in effect before
|
|
69
|
+
* any change to it.
|
|
70
|
+
*/ getTimeHorizon(anchorBlockTimestamp, initialDelay) {
|
|
71
|
+
return this.svc.getTimeHorizon(anchorBlockTimestamp, this.sdc.getEffectiveMinimumDelayAt(anchorBlockTimestamp, initialDelay));
|
|
72
|
+
}
|
|
66
73
|
writeToTree(delayedPublicMutableSlot, storageWrite) {
|
|
67
74
|
const fieldPromises = this.toFields().map((field, i)=>storageWrite(delayedPublicMutableSlot.add(new Fr(i)), field));
|
|
68
75
|
return Promise.all(fieldPromises);
|
|
@@ -6,5 +6,13 @@ export declare class ScheduledDelayChange {
|
|
|
6
6
|
constructor(pre: UInt64 | undefined, post: UInt64 | undefined, timestampOfChange: UInt64);
|
|
7
7
|
static empty(): ScheduledDelayChange;
|
|
8
8
|
isEmpty(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns how many seconds after `anchorBlockTimestamp` a value read at that anchor block is guaranteed to remain
|
|
11
|
+
* current, considering any scheduled delay change. `initialDelay` is the delay in effect before any change to it.
|
|
12
|
+
*
|
|
13
|
+
* This is one second less than the earliest time after the anchor at which a value change could take effect: a block
|
|
14
|
+
* sharing the anchor's timestamp can schedule a change, and the change is in effect at its own timestamp.
|
|
15
|
+
*/
|
|
16
|
+
getEffectiveMinimumDelayAt(anchorBlockTimestamp: UInt64, initialDelay: UInt64): UInt64;
|
|
9
17
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZWR1bGVkX2RlbGF5X2NoYW5nZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlbGF5ZWRfcHVibGljX211dGFibGUvc2NoZWR1bGVkX2RlbGF5X2NoYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVqRCxxQkFBYSxvQkFBb0I7SUFFdEIsR0FBRyxFQUFFLE1BQU0sR0FBRyxTQUFTO0lBQ3ZCLElBQUksRUFBRSxNQUFNLEdBQUcsU0FBUztJQUN4QixpQkFBaUIsRUFBRSxNQUFNO0lBSGxDLFlBQ1MsR0FBRyxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQ3ZCLElBQUksRUFBRSxNQUFNLEdBQUcsU0FBUyxFQUN4QixpQkFBaUIsRUFBRSxNQUFNLEVBQzlCO0lBRUosTUFBTSxDQUFDLEtBQUsseUJBRVg7SUFFRCxPQUFPLElBQUksT0FBTyxDQUVqQjtJQUVEOzs7Ozs7T0FNRztJQUNILDBCQUEwQixDQUFDLG9CQUFvQixFQUFFLE1BQU0sRUFBRSxZQUFZLEVBQUUsTUFBTSxHQUFHLE1BQU0sQ0FVckY7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled_delay_change.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/scheduled_delay_change.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduled_delay_change.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/scheduled_delay_change.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,oBAAoB;IAEtB,GAAG,EAAE,MAAM,GAAG,SAAS;IACvB,IAAI,EAAE,MAAM,GAAG,SAAS;IACxB,iBAAiB,EAAE,MAAM;IAHlC,YACS,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,iBAAiB,EAAE,MAAM,EAC9B;IAEJ,MAAM,CAAC,KAAK,yBAEX;IAED,OAAO,IAAI,OAAO,CAEjB;IAED;;;;;;OAMG;IACH,0BAA0B,CAAC,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAUrF;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { minBigint } from '@aztec-labs/foundation/bigint';
|
|
1
2
|
export class ScheduledDelayChange {
|
|
2
3
|
pre;
|
|
3
4
|
post;
|
|
@@ -13,4 +14,21 @@ export class ScheduledDelayChange {
|
|
|
13
14
|
isEmpty() {
|
|
14
15
|
return this.pre === undefined && this.post === undefined && this.timestampOfChange === 0n;
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns how many seconds after `anchorBlockTimestamp` a value read at that anchor block is guaranteed to remain
|
|
19
|
+
* current, considering any scheduled delay change. `initialDelay` is the delay in effect before any change to it.
|
|
20
|
+
*
|
|
21
|
+
* This is one second less than the earliest time after the anchor at which a value change could take effect: a block
|
|
22
|
+
* sharing the anchor's timestamp can schedule a change, and the change is in effect at its own timestamp.
|
|
23
|
+
*/ getEffectiveMinimumDelayAt(anchorBlockTimestamp, initialDelay) {
|
|
24
|
+
if (this.timestampOfChange <= anchorBlockTimestamp) {
|
|
25
|
+
return (this.post ?? initialDelay) - 1n;
|
|
26
|
+
}
|
|
27
|
+
// A pending delay reduction can let a value change land sooner than the current delay would. The current delay
|
|
28
|
+
// still bounds it, since the pending delay change might be cancelled before it takes effect.
|
|
29
|
+
const timeUntilDelayChange = this.timestampOfChange - anchorBlockTimestamp;
|
|
30
|
+
const currentDelay = this.pre ?? initialDelay;
|
|
31
|
+
const delayAfterChange = timeUntilDelayChange + (this.post ?? initialDelay);
|
|
32
|
+
return minBigint(currentDelay, delayAfterChange) - 1n;
|
|
33
|
+
}
|
|
16
34
|
}
|
|
@@ -8,5 +8,10 @@ export declare class ScheduledValueChange {
|
|
|
8
8
|
static empty(valueSize: number): ScheduledValueChange;
|
|
9
9
|
isEmpty(): boolean;
|
|
10
10
|
getCurrentAt(timestamp: UInt64): Fr[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current,
|
|
13
|
+
* given the `minimumDelay` (from {@link ScheduledDelayChange.getEffectiveMinimumDelayAt}) for a newly scheduled change.
|
|
14
|
+
*/
|
|
15
|
+
getTimeHorizon(anchorBlockTimestamp: UInt64, minimumDelay: UInt64): UInt64;
|
|
11
16
|
}
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZWR1bGVkX3ZhbHVlX2NoYW5nZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlbGF5ZWRfcHVibGljX211dGFibGUvc2NoZWR1bGVkX3ZhbHVlX2NoYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFFekQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFakQscUJBQWEsb0JBQW9CO0lBRXRCLFFBQVEsRUFBRSxFQUFFLEVBQUU7SUFDZCxJQUFJLEVBQUUsRUFBRSxFQUFFO0lBQ1YsaUJBQWlCLEVBQUUsTUFBTTtJQUhsQyxZQUNTLFFBQVEsRUFBRSxFQUFFLEVBQUUsRUFDZCxJQUFJLEVBQUUsRUFBRSxFQUFFLEVBQ1YsaUJBQWlCLEVBQUUsTUFBTSxFQUtqQztJQUVELE1BQU0sQ0FBQyxLQUFLLENBQUMsU0FBUyxFQUFFLE1BQU0sd0JBRTdCO0lBRUQsT0FBTyxJQUFJLE9BQU8sQ0FFakI7SUFFRCxZQUFZLENBQUMsU0FBUyxFQUFFLE1BQU0sUUFNN0I7SUFFRDs7O09BR0c7SUFDSCxjQUFjLENBQUMsb0JBQW9CLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLEdBQUcsTUFBTSxDQVV6RTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled_value_change.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/scheduled_value_change.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduled_value_change.d.ts","sourceRoot":"","sources":["../../src/delayed_public_mutable/scheduled_value_change.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,oBAAoB;IAEtB,QAAQ,EAAE,EAAE,EAAE;IACd,IAAI,EAAE,EAAE,EAAE;IACV,iBAAiB,EAAE,MAAM;IAHlC,YACS,QAAQ,EAAE,EAAE,EAAE,EACd,IAAI,EAAE,EAAE,EAAE,EACV,iBAAiB,EAAE,MAAM,EAKjC;IAED,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,wBAE7B;IAED,OAAO,IAAI,OAAO,CAEjB;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,QAM7B;IAED;;;OAGG;IACH,cAAc,CAAC,oBAAoB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAUzE;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { minBigint } from '@aztec-labs/foundation/bigint';
|
|
1
2
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
3
|
export class ScheduledValueChange {
|
|
3
4
|
previous;
|
|
@@ -24,4 +25,18 @@ export class ScheduledValueChange {
|
|
|
24
25
|
return this.post;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current,
|
|
30
|
+
* given the `minimumDelay` (from {@link ScheduledDelayChange.getEffectiveMinimumDelayAt}) for a newly scheduled change.
|
|
31
|
+
*/ getTimeHorizon(anchorBlockTimestamp, minimumDelay) {
|
|
32
|
+
const delayHorizon = anchorBlockTimestamp + minimumDelay;
|
|
33
|
+
// A change that already took effect, or one that keeps the same value (e.g. a cancellation), cannot change the
|
|
34
|
+
// current value, so only a change scheduled after the anchor block limits the horizon.
|
|
35
|
+
const keepsValue = this.previous.every((value, i)=>value.equals(this.post[i]));
|
|
36
|
+
if (anchorBlockTimestamp >= this.timestampOfChange || keepsValue) {
|
|
37
|
+
return delayHorizon;
|
|
38
|
+
}
|
|
39
|
+
const changeHorizon = this.timestampOfChange - 1n;
|
|
40
|
+
return minBigint(changeHorizon, delayHorizon);
|
|
41
|
+
}
|
|
27
42
|
}
|
|
@@ -414,18 +414,6 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
414
414
|
}>>;
|
|
415
415
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
416
416
|
leafPreimage: z.ZodPipe<z.ZodObject<{
|
|
417
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
418
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
419
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
420
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
421
|
-
}>>;
|
|
422
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
423
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
424
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
425
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
426
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
427
|
-
nextIndex: bigint;
|
|
428
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
429
417
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
430
418
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
431
419
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -439,6 +427,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
439
427
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
440
428
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
441
429
|
nextIndex: bigint;
|
|
430
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
431
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
432
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
433
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
434
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
435
|
+
}>>;
|
|
436
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
437
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
438
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
439
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
440
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
441
|
+
nextIndex: bigint;
|
|
442
442
|
}>>;
|
|
443
443
|
}, z.core.$strip>, z.ZodTransform<{
|
|
444
444
|
readonly hintKey: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
@@ -459,18 +459,6 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
459
459
|
}>>;
|
|
460
460
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
461
461
|
leafPreimage: z.ZodPipe<z.ZodObject<{
|
|
462
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
463
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
464
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
465
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
466
|
-
}>>;
|
|
467
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
468
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
469
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
470
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
471
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
472
|
-
nextIndex: bigint;
|
|
473
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
474
462
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
475
463
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
476
464
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -484,6 +472,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
484
472
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
485
473
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
486
474
|
nextIndex: bigint;
|
|
475
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
476
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
477
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
478
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
479
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
480
|
+
}>>;
|
|
481
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
482
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
483
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
484
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
485
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
486
|
+
nextIndex: bigint;
|
|
487
487
|
}>>;
|
|
488
488
|
}, z.core.$strip>, z.ZodTransform<{
|
|
489
489
|
readonly hintKey: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
|
|
@@ -528,30 +528,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
528
528
|
}>>;
|
|
529
529
|
treeId: z.ZodNumber;
|
|
530
530
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
531
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
532
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
533
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
534
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
535
531
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
536
532
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
537
533
|
}, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
|
|
538
534
|
slot: import("@aztec-labs/foundation/schemas").Fr;
|
|
539
535
|
value: import("@aztec-labs/foundation/schemas").Fr;
|
|
536
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
537
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
538
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
539
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
540
540
|
}>>;
|
|
541
541
|
lowLeavesWitnessData: z.ZodObject<{
|
|
542
542
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
543
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
544
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
545
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
546
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
547
|
-
}>>;
|
|
548
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
549
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
550
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
551
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
552
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
553
|
-
nextIndex: bigint;
|
|
554
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
555
543
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
556
544
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
557
545
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -565,12 +553,7 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
565
553
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
566
554
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
567
555
|
nextIndex: bigint;
|
|
568
|
-
}
|
|
569
|
-
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
570
|
-
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
571
|
-
}, z.core.$strip>;
|
|
572
|
-
insertionWitnessData: z.ZodObject<{
|
|
573
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
556
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
574
557
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
575
558
|
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
576
559
|
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
@@ -582,7 +565,12 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
582
565
|
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
583
566
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
584
567
|
nextIndex: bigint;
|
|
585
|
-
}
|
|
568
|
+
}>>;
|
|
569
|
+
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
570
|
+
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
571
|
+
}, z.core.$strip>;
|
|
572
|
+
insertionWitnessData: z.ZodObject<{
|
|
573
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
586
574
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
587
575
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
588
576
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -596,6 +584,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
596
584
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
597
585
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
598
586
|
nextIndex: bigint;
|
|
587
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
588
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
589
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
590
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
591
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
592
|
+
}>>;
|
|
593
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
594
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
595
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
596
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
597
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
598
|
+
nextIndex: bigint;
|
|
599
599
|
}>>;
|
|
600
600
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
601
601
|
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
@@ -648,30 +648,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
648
648
|
}>>;
|
|
649
649
|
treeId: z.ZodNumber;
|
|
650
650
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
651
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
652
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
653
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
654
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
655
651
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
656
652
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
657
653
|
}, z.core.$strip>, z.ZodTransform<import("../trees/public_data_leaf.js").PublicDataTreeLeaf, {
|
|
658
654
|
slot: import("@aztec-labs/foundation/schemas").Fr;
|
|
659
655
|
value: import("@aztec-labs/foundation/schemas").Fr;
|
|
656
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
657
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
658
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
659
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
660
660
|
}>>;
|
|
661
661
|
lowLeavesWitnessData: z.ZodObject<{
|
|
662
662
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
663
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
664
|
-
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
665
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
666
|
-
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
667
|
-
}>>;
|
|
668
|
-
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
669
|
-
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
670
|
-
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
671
|
-
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
672
|
-
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
673
|
-
nextIndex: bigint;
|
|
674
|
-
}>> | z.ZodPipe<z.ZodObject<{
|
|
675
663
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
676
664
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
677
665
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -685,12 +673,7 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
685
673
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
686
674
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
687
675
|
nextIndex: bigint;
|
|
688
|
-
}
|
|
689
|
-
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
690
|
-
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
691
|
-
}, z.core.$strip>;
|
|
692
|
-
insertionWitnessData: z.ZodObject<{
|
|
693
|
-
leaf: z.ZodPipe<z.ZodObject<{
|
|
676
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
694
677
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
695
678
|
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
696
679
|
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
@@ -702,7 +685,12 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
702
685
|
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
703
686
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
704
687
|
nextIndex: bigint;
|
|
705
|
-
}
|
|
688
|
+
}>>;
|
|
689
|
+
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
690
|
+
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
691
|
+
}, z.core.$strip>;
|
|
692
|
+
insertionWitnessData: z.ZodObject<{
|
|
693
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
706
694
|
leaf: z.ZodPipe<z.ZodObject<{
|
|
707
695
|
slot: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
708
696
|
value: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
@@ -716,6 +704,18 @@ export declare const ProvingJobInputs: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
716
704
|
leaf: import("../trees/public_data_leaf.js").PublicDataTreeLeaf;
|
|
717
705
|
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
718
706
|
nextIndex: bigint;
|
|
707
|
+
}>> | z.ZodPipe<z.ZodObject<{
|
|
708
|
+
leaf: z.ZodPipe<z.ZodObject<{
|
|
709
|
+
nullifier: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
710
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeaf, {
|
|
711
|
+
nullifier: import("@aztec-labs/foundation/schemas").Fr;
|
|
712
|
+
}>>;
|
|
713
|
+
nextKey: z.ZodType<import("@aztec-labs/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec-labs/foundation/schemas").Fr, string>>;
|
|
714
|
+
nextIndex: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
715
|
+
}, z.core.$strip>, z.ZodTransform<import("../trees/nullifier_leaf.js").NullifierLeafPreimage, {
|
|
716
|
+
leaf: import("../trees/nullifier_leaf.js").NullifierLeaf;
|
|
717
|
+
nextKey: import("@aztec-labs/foundation/schemas").Fr;
|
|
718
|
+
nextIndex: bigint;
|
|
719
719
|
}>>;
|
|
720
720
|
index: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
721
721
|
path: z.ZodArray<ZodFor<import("@aztec-labs/foundation/schemas").Fr>>;
|
|
@@ -11,6 +11,11 @@ export declare class PaddedSideEffects {
|
|
|
11
11
|
static fromBuffer(buffer: Buffer | BufferReader): PaddedSideEffects;
|
|
12
12
|
static empty(): PaddedSideEffects;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* How many padding items the final kernel appends to each side effect array, per phase. Despite the name, which mirrors
|
|
16
|
+
* the struct in the kernel circuits, these are not the lengths the arrays are padded up to: a tx with 3 revertible note
|
|
17
|
+
* hashes padded up to 8 has `revertibleNoteHashes` of 5 in `PaddedSideEffectAmounts`.
|
|
18
|
+
*/
|
|
14
19
|
export declare class PaddedSideEffectAmounts {
|
|
15
20
|
nonRevertibleNoteHashes: number;
|
|
16
21
|
revertibleNoteHashes: number;
|
|
@@ -23,4 +28,4 @@ export declare class PaddedSideEffectAmounts {
|
|
|
23
28
|
static fromBuffer(buffer: Buffer | BufferReader): PaddedSideEffectAmounts;
|
|
24
29
|
static empty(): PaddedSideEffectAmounts;
|
|
25
30
|
}
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFkZGVkX3NpZGVfZWZmZWN0cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2tlcm5lbC9wYWRkZWRfc2lkZV9lZmZlY3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxxQkFBcUIsRUFBRSx1QkFBdU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AAC,EAAE,EAAE,OAAO,qBAAqB,CAAC,EACnD,WAAW,EAAE,KAAK,CAAC,UAAU,EAAE,OAAO,uBAAuB,CAAC,EACnE;IAEJ,QAAQ,4BAEP;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,qBAO9C;IAED,MAAM,CAAC,KAAK,sBAMX;CACF;AAED;;;;GAIG;AACH,qBAAa,uBAAuB;IAEzB,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,uBAAuB,EAAE,MAAM;IAC/B,oBAAoB,EAAE,MAAM;IAC5B,wBAAwB,EAAE,MAAM;IAChC,qBAAqB,EAAE,MAAM;IANtC,YACS,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,EAAE,MAAM,EAC5B,uBAAuB,EAAE,MAAM,EAC/B,oBAAoB,EAAE,MAAM,EAC5B,wBAAwB,EAAE,MAAM,EAChC,qBAAqB,EAAE,MAAM,EAClC;IAEJ,QAAQ,4BASP;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,2BAU9C;IAED,MAAM,CAAC,KAAK,4BAEX;CACF"}
|
|
@@ -23,7 +23,11 @@ export class PaddedSideEffects {
|
|
|
23
23
|
return new PaddedSideEffects(makeTuple(MAX_NOTE_HASHES_PER_TX, Fr.zero), makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero), makeTuple(MAX_PRIVATE_LOGS_PER_TX, PrivateLog.empty));
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* How many padding items the final kernel appends to each side effect array, per phase. Despite the name, which mirrors
|
|
28
|
+
* the struct in the kernel circuits, these are not the lengths the arrays are padded up to: a tx with 3 revertible note
|
|
29
|
+
* hashes padded up to 8 has `revertibleNoteHashes` of 5 in `PaddedSideEffectAmounts`.
|
|
30
|
+
*/ export class PaddedSideEffectAmounts {
|
|
27
31
|
nonRevertibleNoteHashes;
|
|
28
32
|
revertibleNoteHashes;
|
|
29
33
|
nonRevertibleNullifiers;
|
|
@@ -35,7 +35,7 @@ export declare class PrivateKernelCircuitPublicInputs {
|
|
|
35
35
|
*/
|
|
36
36
|
feePayer: AztecAddress;
|
|
37
37
|
/**
|
|
38
|
-
* The timestamp
|
|
38
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
39
39
|
*/
|
|
40
40
|
expirationTimestamp: UInt64;
|
|
41
41
|
/**
|
|
@@ -72,7 +72,7 @@ export declare class PrivateKernelCircuitPublicInputs {
|
|
|
72
72
|
*/
|
|
73
73
|
feePayer: AztecAddress,
|
|
74
74
|
/**
|
|
75
|
-
* The timestamp
|
|
75
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
76
76
|
*/
|
|
77
77
|
expirationTimestamp: UInt64,
|
|
78
78
|
/**
|
|
@@ -31,7 +31,7 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
31
31
|
*/ publicTeardownCallRequest, /**
|
|
32
32
|
* The address of the fee payer for the transaction
|
|
33
33
|
*/ feePayer, /**
|
|
34
|
-
* The timestamp
|
|
34
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
35
35
|
*/ expirationTimestamp, /**
|
|
36
36
|
* Wether this is a private only tx or not
|
|
37
37
|
*/ isPrivateOnly, /**
|
|
@@ -70,7 +70,7 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
70
70
|
*/
|
|
71
71
|
feePayer: AztecAddress;
|
|
72
72
|
/**
|
|
73
|
-
* The timestamp
|
|
73
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
74
74
|
*/
|
|
75
75
|
expirationTimestamp: UInt64;
|
|
76
76
|
forPublic?: PartialPrivateTailPublicInputsForPublic | undefined;
|
|
@@ -90,7 +90,7 @@ export declare class PrivateKernelTailCircuitPublicInputs {
|
|
|
90
90
|
*/
|
|
91
91
|
feePayer: AztecAddress,
|
|
92
92
|
/**
|
|
93
|
-
* The timestamp
|
|
93
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
94
94
|
*/
|
|
95
95
|
expirationTimestamp: UInt64, forPublic?: PartialPrivateTailPublicInputsForPublic | undefined, forRollup?: PartialPrivateTailPublicInputsForRollup | undefined);
|
|
96
96
|
static get schema(): import("zod").ZodType<PrivateKernelTailCircuitPublicInputs, string, import("zod/v4/core").$ZodTypeInternals<PrivateKernelTailCircuitPublicInputs, string>>;
|
|
@@ -88,7 +88,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
88
88
|
*/ gasUsed, /**
|
|
89
89
|
* The address of the fee payer for the transaction.
|
|
90
90
|
*/ feePayer, /**
|
|
91
|
-
* The timestamp
|
|
91
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
92
92
|
*/ expirationTimestamp, forPublic, forRollup){
|
|
93
93
|
this.constants = constants;
|
|
94
94
|
this.gasUsed = gasUsed;
|
|
@@ -28,7 +28,7 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
28
28
|
*/
|
|
29
29
|
feePayer: AztecAddress;
|
|
30
30
|
/**
|
|
31
|
-
* The timestamp
|
|
31
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
32
32
|
*/
|
|
33
33
|
expirationTimestamp: UInt64;
|
|
34
34
|
constructor(
|
|
@@ -49,7 +49,7 @@ export declare class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
49
49
|
*/
|
|
50
50
|
feePayer: AztecAddress,
|
|
51
51
|
/**
|
|
52
|
-
* The timestamp
|
|
52
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
53
53
|
*/
|
|
54
54
|
expirationTimestamp: UInt64);
|
|
55
55
|
getNonEmptyNullifiers(): Fr[];
|
|
@@ -25,7 +25,7 @@ import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_
|
|
|
25
25
|
*/ gasUsed, /**
|
|
26
26
|
* The address of the fee payer for the transaction.
|
|
27
27
|
*/ feePayer, /**
|
|
28
|
-
* The timestamp
|
|
28
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
29
29
|
*/ expirationTimestamp){
|
|
30
30
|
this.constants = constants;
|
|
31
31
|
this.end = end;
|
|
@@ -138,8 +138,8 @@ export declare class FeeRecipient {
|
|
|
138
138
|
static empty(): FeeRecipient;
|
|
139
139
|
isEmpty(): boolean;
|
|
140
140
|
toFriendlyJSON(): {
|
|
141
|
-
value?: undefined;
|
|
142
141
|
recipient?: undefined;
|
|
142
|
+
value?: undefined;
|
|
143
143
|
} | {
|
|
144
144
|
recipient: `0x${string}`;
|
|
145
145
|
value: `0x${string}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec-labs/stdlib",
|
|
3
|
-
"version": "6.1.0-nightly.
|
|
3
|
+
"version": "6.1.0-nightly.20261030",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
95
95
|
"@aztec-foundation/bb.js": "6.0.0-rc.7",
|
|
96
96
|
"@aztec-foundation/noir-noirc_abi": "6.0.0-rc.7",
|
|
97
|
-
"@aztec-labs/blob-lib": "6.1.0-nightly.
|
|
98
|
-
"@aztec-labs/constants": "6.1.0-nightly.
|
|
99
|
-
"@aztec-labs/ethereum": "6.1.0-nightly.
|
|
100
|
-
"@aztec-labs/foundation": "6.1.0-nightly.
|
|
97
|
+
"@aztec-labs/blob-lib": "6.1.0-nightly.20261030",
|
|
98
|
+
"@aztec-labs/constants": "6.1.0-nightly.20261030",
|
|
99
|
+
"@aztec-labs/ethereum": "6.1.0-nightly.20261030",
|
|
100
|
+
"@aztec-labs/foundation": "6.1.0-nightly.20261030",
|
|
101
101
|
"@google-cloud/storage": "^7.15.0",
|
|
102
102
|
"axios": "^1.15.1",
|
|
103
103
|
"buffer": "^6.0.3",
|
|
@@ -3,6 +3,7 @@ import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
|
|
|
3
3
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
4
4
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
|
|
5
5
|
|
|
6
|
+
import type { UInt64 } from '../types/shared.js';
|
|
6
7
|
import { ScheduledDelayChange } from './scheduled_delay_change.js';
|
|
7
8
|
import { ScheduledValueChange } from './scheduled_value_change.js';
|
|
8
9
|
|
|
@@ -78,6 +79,18 @@ export class DelayedPublicMutableValues {
|
|
|
78
79
|
return this.svc.isEmpty() && this.sdc.isEmpty();
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current.
|
|
84
|
+
* A tx that reads this value in private must not be included after it. `initialDelay` is the delay in effect before
|
|
85
|
+
* any change to it.
|
|
86
|
+
*/
|
|
87
|
+
getTimeHorizon(anchorBlockTimestamp: UInt64, initialDelay: UInt64): UInt64 {
|
|
88
|
+
return this.svc.getTimeHorizon(
|
|
89
|
+
anchorBlockTimestamp,
|
|
90
|
+
this.sdc.getEffectiveMinimumDelayAt(anchorBlockTimestamp, initialDelay),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
81
94
|
writeToTree(delayedPublicMutableSlot: Fr, storageWrite: (storageSlot: Fr, value: Fr) => Promise<void>) {
|
|
82
95
|
const fieldPromises = this.toFields().map((field, i) =>
|
|
83
96
|
storageWrite(delayedPublicMutableSlot.add(new Fr(i)), field),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { minBigint } from '@aztec-labs/foundation/bigint';
|
|
2
|
+
|
|
1
3
|
import type { UInt64 } from '../types/shared.js';
|
|
2
4
|
|
|
3
5
|
export class ScheduledDelayChange {
|
|
@@ -14,4 +16,23 @@ export class ScheduledDelayChange {
|
|
|
14
16
|
isEmpty(): boolean {
|
|
15
17
|
return this.pre === undefined && this.post === undefined && this.timestampOfChange === 0n;
|
|
16
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns how many seconds after `anchorBlockTimestamp` a value read at that anchor block is guaranteed to remain
|
|
22
|
+
* current, considering any scheduled delay change. `initialDelay` is the delay in effect before any change to it.
|
|
23
|
+
*
|
|
24
|
+
* This is one second less than the earliest time after the anchor at which a value change could take effect: a block
|
|
25
|
+
* sharing the anchor's timestamp can schedule a change, and the change is in effect at its own timestamp.
|
|
26
|
+
*/
|
|
27
|
+
getEffectiveMinimumDelayAt(anchorBlockTimestamp: UInt64, initialDelay: UInt64): UInt64 {
|
|
28
|
+
if (this.timestampOfChange <= anchorBlockTimestamp) {
|
|
29
|
+
return (this.post ?? initialDelay) - 1n;
|
|
30
|
+
}
|
|
31
|
+
// A pending delay reduction can let a value change land sooner than the current delay would. The current delay
|
|
32
|
+
// still bounds it, since the pending delay change might be cancelled before it takes effect.
|
|
33
|
+
const timeUntilDelayChange = this.timestampOfChange - anchorBlockTimestamp;
|
|
34
|
+
const currentDelay = this.pre ?? initialDelay;
|
|
35
|
+
const delayAfterChange = timeUntilDelayChange + (this.post ?? initialDelay);
|
|
36
|
+
return minBigint(currentDelay, delayAfterChange) - 1n;
|
|
37
|
+
}
|
|
17
38
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { minBigint } from '@aztec-labs/foundation/bigint';
|
|
1
2
|
import { Fr } from '@aztec-labs/foundation/curves/bn254';
|
|
2
3
|
|
|
3
4
|
import type { UInt64 } from '../types/shared.js';
|
|
@@ -28,4 +29,20 @@ export class ScheduledValueChange {
|
|
|
28
29
|
return this.post;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Returns the last timestamp at which the value current at `anchorBlockTimestamp` is guaranteed to still be current,
|
|
35
|
+
* given the `minimumDelay` (from {@link ScheduledDelayChange.getEffectiveMinimumDelayAt}) for a newly scheduled change.
|
|
36
|
+
*/
|
|
37
|
+
getTimeHorizon(anchorBlockTimestamp: UInt64, minimumDelay: UInt64): UInt64 {
|
|
38
|
+
const delayHorizon = anchorBlockTimestamp + minimumDelay;
|
|
39
|
+
// A change that already took effect, or one that keeps the same value (e.g. a cancellation), cannot change the
|
|
40
|
+
// current value, so only a change scheduled after the anchor block limits the horizon.
|
|
41
|
+
const keepsValue = this.previous.every((value, i) => value.equals(this.post[i]));
|
|
42
|
+
if (anchorBlockTimestamp >= this.timestampOfChange || keepsValue) {
|
|
43
|
+
return delayHorizon;
|
|
44
|
+
}
|
|
45
|
+
const changeHorizon = this.timestampOfChange - 1n;
|
|
46
|
+
return minBigint(changeHorizon, delayHorizon);
|
|
47
|
+
}
|
|
31
48
|
}
|
|
@@ -34,6 +34,11 @@ export class PaddedSideEffects {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* How many padding items the final kernel appends to each side effect array, per phase. Despite the name, which mirrors
|
|
39
|
+
* the struct in the kernel circuits, these are not the lengths the arrays are padded up to: a tx with 3 revertible note
|
|
40
|
+
* hashes padded up to 8 has `revertibleNoteHashes` of 5 in `PaddedSideEffectAmounts`.
|
|
41
|
+
*/
|
|
37
42
|
export class PaddedSideEffectAmounts {
|
|
38
43
|
constructor(
|
|
39
44
|
public nonRevertibleNoteHashes: number,
|
|
@@ -39,7 +39,7 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
39
39
|
*/
|
|
40
40
|
public feePayer: AztecAddress,
|
|
41
41
|
/**
|
|
42
|
-
* The timestamp
|
|
42
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
43
43
|
*/
|
|
44
44
|
public expirationTimestamp: UInt64,
|
|
45
45
|
/**
|
|
@@ -125,7 +125,7 @@ export class PrivateKernelTailCircuitPublicInputs {
|
|
|
125
125
|
*/
|
|
126
126
|
public feePayer: AztecAddress,
|
|
127
127
|
/**
|
|
128
|
-
* The timestamp
|
|
128
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
129
129
|
*/
|
|
130
130
|
public expirationTimestamp: UInt64,
|
|
131
131
|
|
|
@@ -35,7 +35,7 @@ export class PrivateToRollupKernelCircuitPublicInputs {
|
|
|
35
35
|
*/
|
|
36
36
|
public feePayer: AztecAddress,
|
|
37
37
|
/**
|
|
38
|
-
* The timestamp
|
|
38
|
+
* The highest timestamp of a block in which the transaction can still be included.
|
|
39
39
|
*/
|
|
40
40
|
public expirationTimestamp: UInt64,
|
|
41
41
|
) {}
|