@aztec/stdlib 5.0.0-nightly.20260714 → 5.0.0-nightly.20260715
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/interfaces/private_kernel_prover.d.ts +9 -11
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +4 -4
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +8 -2
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +12 -74
- package/dest/kernel/index.d.ts +2 -2
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +13 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +14 -7
- package/dest/kernel/private_context_inputs.d.ts +4 -3
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +7 -3
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +7 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +7 -0
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_2_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts +2 -3
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_3_circuit_private_inputs.js +3 -5
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts +1 -9
- package/dest/kernel/private_kernel_init_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_init_circuit_private_inputs.js +2 -6
- package/dest/kernel/private_kernel_reset_dimensions.d.ts +7 -8
- package/dest/kernel/private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts +29 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.d.ts.map +1 -0
- package/dest/kernel/private_kernel_reset_tail_circuit_private_inputs.js +36 -0
- package/dest/rollup/avm_proof_data.d.ts +3 -3
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +1 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +4 -3
- package/dest/tx/private_tx_constant_data.d.ts +18 -2
- package/dest/tx/private_tx_constant_data.d.ts.map +1 -1
- package/dest/tx/private_tx_constant_data.js +13 -4
- package/package.json +8 -8
- package/src/interfaces/private_kernel_prover.ts +10 -12
- package/src/interfaces/proving-job.ts +3 -3
- package/src/interfaces/server_circuit_prover.ts +2 -2
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +22 -112
- package/src/kernel/index.ts +1 -1
- package/src/kernel/private_circuit_public_inputs.ts +12 -1
- package/src/kernel/private_context_inputs.ts +10 -3
- package/src/kernel/private_kernel_circuit_public_inputs.ts +9 -0
- package/src/kernel/private_kernel_init_2_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_3_circuit_private_inputs.ts +0 -3
- package/src/kernel/private_kernel_init_circuit_private_inputs.ts +0 -6
- package/src/kernel/private_kernel_reset_dimensions.ts +15 -5
- package/src/kernel/private_kernel_reset_tail_circuit_private_inputs.ts +69 -0
- package/src/rollup/avm_proof_data.ts +2 -2
- package/src/stats/stats.ts +2 -2
- package/src/tests/factories.ts +3 -6
- package/src/tx/private_tx_constant_data.ts +25 -2
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +0 -47
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +0 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +0 -38
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +0 -58
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { serializeToFields } from '@aztec/foundation/serialize';
|
|
3
3
|
|
|
4
4
|
import { BlockHeader } from '../tx/block_header.js';
|
|
@@ -11,13 +11,20 @@ export class PrivateContextInputs {
|
|
|
11
11
|
public anchorBlockHeader: BlockHeader,
|
|
12
12
|
public txContext: TxContext,
|
|
13
13
|
public startSideEffectCounter: number,
|
|
14
|
+
public txRequestSalt: Fr,
|
|
14
15
|
) {}
|
|
15
16
|
|
|
16
17
|
public static empty(): PrivateContextInputs {
|
|
17
|
-
return new PrivateContextInputs(CallContext.empty(), BlockHeader.empty(), TxContext.empty(), 0);
|
|
18
|
+
return new PrivateContextInputs(CallContext.empty(), BlockHeader.empty(), TxContext.empty(), 0, Fr.ZERO);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
public toFields(): Fr[] {
|
|
21
|
-
return serializeToFields([
|
|
22
|
+
return serializeToFields([
|
|
23
|
+
this.callContext,
|
|
24
|
+
this.anchorBlockHeader,
|
|
25
|
+
this.txContext,
|
|
26
|
+
this.startSideEffectCounter,
|
|
27
|
+
this.txRequestSalt,
|
|
28
|
+
]);
|
|
22
29
|
}
|
|
23
30
|
}
|
|
@@ -115,3 +115,12 @@ export class PrivateKernelCircuitPublicInputs {
|
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Returns true iff the tx requires the public-bound terminal path: it has either un-processed
|
|
121
|
+
* public-call requests in the side-effect stream or a pending public-teardown call request. Every
|
|
122
|
+
* site picking between the rollup-bound and public-bound terminal artifact must route through this.
|
|
123
|
+
*/
|
|
124
|
+
export function kernelStateIsForPublic(publicInputs: PrivateKernelCircuitPublicInputs): boolean {
|
|
125
|
+
return publicInputs.end.publicCallRequests.claimedLength > 0 || !publicInputs.publicTeardownCallRequest.isEmpty();
|
|
126
|
+
}
|
|
@@ -17,7 +17,6 @@ export class PrivateKernelInit2CircuitPrivateInputs {
|
|
|
17
17
|
public privateCall0: PrivateCallData,
|
|
18
18
|
public privateCall1: PrivateCallData,
|
|
19
19
|
public isPrivateOnly: boolean,
|
|
20
|
-
public firstNullifierHint: Fr,
|
|
21
20
|
public revertibleCounterHint: number,
|
|
22
21
|
) {}
|
|
23
22
|
|
|
@@ -28,7 +27,6 @@ export class PrivateKernelInit2CircuitPrivateInputs {
|
|
|
28
27
|
this.protocolContracts,
|
|
29
28
|
this.privateCall0,
|
|
30
29
|
this.privateCall1,
|
|
31
|
-
this.firstNullifierHint,
|
|
32
30
|
this.revertibleCounterHint,
|
|
33
31
|
);
|
|
34
32
|
}
|
|
@@ -42,7 +40,6 @@ export class PrivateKernelInit2CircuitPrivateInputs {
|
|
|
42
40
|
reader.readObject(PrivateCallData),
|
|
43
41
|
reader.readObject(PrivateCallData),
|
|
44
42
|
reader.readBoolean(),
|
|
45
|
-
Fr.fromBuffer(reader),
|
|
46
43
|
reader.readNumber(),
|
|
47
44
|
);
|
|
48
45
|
}
|
|
@@ -18,7 +18,6 @@ export class PrivateKernelInit3CircuitPrivateInputs {
|
|
|
18
18
|
public privateCall1: PrivateCallData,
|
|
19
19
|
public privateCall2: PrivateCallData,
|
|
20
20
|
public isPrivateOnly: boolean,
|
|
21
|
-
public firstNullifierHint: Fr,
|
|
22
21
|
public revertibleCounterHint: number,
|
|
23
22
|
) {}
|
|
24
23
|
|
|
@@ -30,7 +29,6 @@ export class PrivateKernelInit3CircuitPrivateInputs {
|
|
|
30
29
|
this.privateCall0,
|
|
31
30
|
this.privateCall1,
|
|
32
31
|
this.privateCall2,
|
|
33
|
-
this.firstNullifierHint,
|
|
34
32
|
this.revertibleCounterHint,
|
|
35
33
|
);
|
|
36
34
|
}
|
|
@@ -45,7 +43,6 @@ export class PrivateKernelInit3CircuitPrivateInputs {
|
|
|
45
43
|
reader.readObject(PrivateCallData),
|
|
46
44
|
reader.readObject(PrivateCallData),
|
|
47
45
|
reader.readBoolean(),
|
|
48
|
-
Fr.fromBuffer(reader),
|
|
49
46
|
reader.readNumber(),
|
|
50
47
|
);
|
|
51
48
|
}
|
|
@@ -30,10 +30,6 @@ export class PrivateKernelInitCircuitPrivateInputs {
|
|
|
30
30
|
* Wether this tx will make public calls or not.
|
|
31
31
|
*/
|
|
32
32
|
public isPrivateOnly: boolean,
|
|
33
|
-
/**
|
|
34
|
-
* A hint to what will be the first nullifier of the transaction, used for nonce generation.
|
|
35
|
-
*/
|
|
36
|
-
public firstNullifierHint: Fr,
|
|
37
33
|
/**
|
|
38
34
|
* A claim to the final min revertible side effect counter of a tx.
|
|
39
35
|
*/
|
|
@@ -50,7 +46,6 @@ export class PrivateKernelInitCircuitPrivateInputs {
|
|
|
50
46
|
this.vkTreeRoot,
|
|
51
47
|
this.protocolContracts,
|
|
52
48
|
this.privateCall,
|
|
53
|
-
this.firstNullifierHint,
|
|
54
49
|
this.revertibleCounterHint,
|
|
55
50
|
);
|
|
56
51
|
}
|
|
@@ -68,7 +63,6 @@ export class PrivateKernelInitCircuitPrivateInputs {
|
|
|
68
63
|
reader.readObject(ProtocolContracts),
|
|
69
64
|
reader.readObject(PrivateCallData),
|
|
70
65
|
reader.readBoolean(),
|
|
71
|
-
Fr.fromBuffer(reader),
|
|
72
66
|
reader.readNumber(),
|
|
73
67
|
);
|
|
74
68
|
}
|
|
@@ -68,14 +68,24 @@ export const privateKernelResetDimensionNames: DimensionName[] = [
|
|
|
68
68
|
'PRIVATE_LOG_SILOING',
|
|
69
69
|
];
|
|
70
70
|
|
|
71
|
-
export interface
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
export interface ResetCatalogEntry {
|
|
72
|
+
name: string;
|
|
73
|
+
dimensions: number[];
|
|
74
|
+
// Measured gate count (circuit_size) of the compiled variant. Used by the selector to pick the
|
|
75
|
+
// cheapest variant that covers the requested dimensions, e.g. if the required dimensions are
|
|
76
|
+
// `6 - 2 - 2` then a variant with capacity `8 - 2 - 2` might be cheaper than one with capacity
|
|
77
|
+
// `6 - 4 - 4`.
|
|
74
78
|
cost: number;
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
// Must match the config in noir-projects/noir-protocol-circuits/private_kernel_reset_config.json
|
|
78
82
|
export interface PrivateKernelResetDimensionsConfig {
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
// Variants used for mid-tx resets that prevent overflow. Never the last kernel in the chain.
|
|
84
|
+
inner: ResetCatalogEntry[];
|
|
85
|
+
// Variants used as the terminal kernel for the rollup-bound private-only path. Each runs
|
|
86
|
+
// final-reset siloing and tail finalisation in one proof.
|
|
87
|
+
finalTail: ResetCatalogEntry[];
|
|
88
|
+
// Terminal variants for the public-bound path (transactions with public function calls). Runs
|
|
89
|
+
// final-reset siloing and tail-to-public partitioning by revertibility in one proof.
|
|
90
|
+
finalTailToPublic: ResetCatalogEntry[];
|
|
81
91
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
MAX_KEY_VALIDATION_REQUESTS_PER_TX,
|
|
3
|
+
MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
4
|
+
MAX_NULLIFIERS_PER_TX,
|
|
5
|
+
MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
6
|
+
} from '@aztec/constants';
|
|
7
|
+
import { bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
8
|
+
|
|
9
|
+
import type { UInt64 } from '../types/shared.js';
|
|
10
|
+
import type { PrivateKernelResetHints } from './hints/private_kernel_reset_hints.js';
|
|
11
|
+
import type { PaddedSideEffectAmounts, PaddedSideEffects } from './padded_side_effects.js';
|
|
12
|
+
import { kernelStateIsForPublic } from './private_kernel_circuit_public_inputs.js';
|
|
13
|
+
import type { PrivateKernelData } from './private_kernel_data.js';
|
|
14
|
+
import { PrivateKernelResetCircuitPrivateInputsVariants } from './private_kernel_reset_circuit_private_inputs.js';
|
|
15
|
+
import type { PrivateKernelResetDimensions } from './private_kernel_reset_dimensions.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Input to a terminal reset+tail circuit. `isForPublic()` selects the rollup-bound (`reset_tail`)
|
|
19
|
+
* or public-bound (`reset_tail_to_public`) family.
|
|
20
|
+
*/
|
|
21
|
+
export class PrivateKernelResetTailCircuitPrivateInputs {
|
|
22
|
+
constructor(
|
|
23
|
+
public previousKernel: PrivateKernelData,
|
|
24
|
+
public paddedSideEffects: PaddedSideEffects,
|
|
25
|
+
public hints: PrivateKernelResetHints<
|
|
26
|
+
typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
27
|
+
typeof MAX_NOTE_HASH_READ_REQUESTS_PER_TX,
|
|
28
|
+
typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
29
|
+
typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX,
|
|
30
|
+
typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX,
|
|
31
|
+
typeof MAX_NULLIFIERS_PER_TX
|
|
32
|
+
>,
|
|
33
|
+
public dimensions: PrivateKernelResetDimensions,
|
|
34
|
+
public paddedSideEffectAmounts: PaddedSideEffectAmounts,
|
|
35
|
+
public expirationTimestampUpperBound: UInt64,
|
|
36
|
+
) {}
|
|
37
|
+
|
|
38
|
+
isForPublic() {
|
|
39
|
+
return kernelStateIsForPublic(this.previousKernel.publicInputs);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns a dimension-trimmed view of the reset portion of these inputs (without the tail
|
|
44
|
+
* fields). The prover uses this to feed witness generation of the variant matching the chosen
|
|
45
|
+
* dimensions.
|
|
46
|
+
*/
|
|
47
|
+
trimResetToSizes() {
|
|
48
|
+
const hints = this.hints.trimToSizes(
|
|
49
|
+
this.dimensions.NOTE_HASH_PENDING_READ,
|
|
50
|
+
this.dimensions.NOTE_HASH_SETTLED_READ,
|
|
51
|
+
this.dimensions.NULLIFIER_PENDING_READ,
|
|
52
|
+
this.dimensions.NULLIFIER_SETTLED_READ,
|
|
53
|
+
this.dimensions.KEY_VALIDATION,
|
|
54
|
+
this.dimensions.TRANSIENT_DATA_SQUASHING,
|
|
55
|
+
);
|
|
56
|
+
return new PrivateKernelResetCircuitPrivateInputsVariants(this.previousKernel, this.paddedSideEffects, hints);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
toBuffer() {
|
|
60
|
+
return serializeToBuffer(
|
|
61
|
+
this.previousKernel,
|
|
62
|
+
this.paddedSideEffects,
|
|
63
|
+
this.hints,
|
|
64
|
+
this.dimensions,
|
|
65
|
+
this.paddedSideEffectAmounts,
|
|
66
|
+
bigintToUInt64BE(this.expirationTimestampUpperBound),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AVM_V2_PROOF_LENGTH_IN_FIELDS } from '@aztec/constants';
|
|
2
2
|
|
|
3
3
|
import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
4
4
|
import type { ProofDataForFixedVk } from '../proofs/proof_data.js';
|
|
5
5
|
|
|
6
|
-
export type AvmProofData = ProofDataForFixedVk<AvmCircuitPublicInputs, typeof
|
|
6
|
+
export type AvmProofData = ProofDataForFixedVk<AvmCircuitPublicInputs, typeof AVM_V2_PROOF_LENGTH_IN_FIELDS>;
|
package/src/stats/stats.ts
CHANGED
|
@@ -90,8 +90,8 @@ export type ClientCircuitName =
|
|
|
90
90
|
| 'private-kernel-inner-2'
|
|
91
91
|
| 'private-kernel-inner-3'
|
|
92
92
|
| 'private-kernel-reset'
|
|
93
|
-
| 'private-kernel-tail'
|
|
94
|
-
| 'private-kernel-tail-to-public'
|
|
93
|
+
| 'private-kernel-reset-tail'
|
|
94
|
+
| 'private-kernel-reset-tail-to-public'
|
|
95
95
|
| 'hiding-kernel-to-rollup'
|
|
96
96
|
| 'hiding-kernel-to-public'
|
|
97
97
|
| 'app-circuit';
|
package/src/tests/factories.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from '@aztec/blob-lib/testing';
|
|
7
7
|
import {
|
|
8
8
|
ARCHIVE_HEIGHT,
|
|
9
|
-
|
|
9
|
+
AVM_V2_PROOF_LENGTH_IN_FIELDS,
|
|
10
10
|
CHONK_PROOF_LENGTH,
|
|
11
11
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
12
12
|
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
@@ -692,6 +692,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
692
692
|
anchorBlockHeader: makeBlockHeader(seed + 0xd00),
|
|
693
693
|
txContext: makeTxContext(seed + 0x1400),
|
|
694
694
|
isFeePayer: false,
|
|
695
|
+
txRequestSalt: fr(seed + 0x1500),
|
|
695
696
|
});
|
|
696
697
|
}
|
|
697
698
|
|
|
@@ -1162,11 +1163,7 @@ export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
|
|
|
1162
1163
|
makePublicChonkVerifierPublicInputs,
|
|
1163
1164
|
RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
1164
1165
|
);
|
|
1165
|
-
const avmProofData = makeProofDataForFixedVk(
|
|
1166
|
-
seed + 0x100,
|
|
1167
|
-
makeAvmCircuitPublicInputs,
|
|
1168
|
-
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
1169
|
-
);
|
|
1166
|
+
const avmProofData = makeProofDataForFixedVk(seed + 0x100, makeAvmCircuitPublicInputs, AVM_V2_PROOF_LENGTH_IN_FIELDS);
|
|
1170
1167
|
const hints = makePublicBaseRollupHints(seed + 0x200);
|
|
1171
1168
|
|
|
1172
1169
|
return PublicTxBaseRollupPrivateInputs.from({
|
|
@@ -23,6 +23,14 @@ export class PrivateTxConstantData {
|
|
|
23
23
|
* protocol to execute and prove the transaction.
|
|
24
24
|
*/
|
|
25
25
|
public txContext: TxContext,
|
|
26
|
+
/**
|
|
27
|
+
* Salt of the transaction request (`TxRequest.salt`).
|
|
28
|
+
*
|
|
29
|
+
* Bound to the user's `tx_request` by the Init circuit and kept constant by every subsequent kernel so that each
|
|
30
|
+
* app circuit's `txRequestSalt` public input can be checked against it. It is intentionally not carried into
|
|
31
|
+
* `TxConstantData`: it is dropped by the Tail circuits rather than being exposed by the final (hiding) kernel.
|
|
32
|
+
*/
|
|
33
|
+
public txRequestSalt: Fr,
|
|
26
34
|
/**
|
|
27
35
|
* Root of the vk tree for the protocol circuits.
|
|
28
36
|
*/
|
|
@@ -38,7 +46,13 @@ export class PrivateTxConstantData {
|
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
static getFields(fields: FieldsOf<PrivateTxConstantData>) {
|
|
41
|
-
return [
|
|
49
|
+
return [
|
|
50
|
+
fields.anchorBlockHeader,
|
|
51
|
+
fields.txContext,
|
|
52
|
+
fields.txRequestSalt,
|
|
53
|
+
fields.vkTreeRoot,
|
|
54
|
+
fields.protocolContracts,
|
|
55
|
+
] as const;
|
|
42
56
|
}
|
|
43
57
|
|
|
44
58
|
static fromFields(fields: Fr[] | FieldReader): PrivateTxConstantData {
|
|
@@ -47,6 +61,7 @@ export class PrivateTxConstantData {
|
|
|
47
61
|
reader.readObject(BlockHeader),
|
|
48
62
|
reader.readObject(TxContext),
|
|
49
63
|
reader.readField(),
|
|
64
|
+
reader.readField(),
|
|
50
65
|
reader.readObject(ProtocolContracts),
|
|
51
66
|
);
|
|
52
67
|
}
|
|
@@ -67,6 +82,7 @@ export class PrivateTxConstantData {
|
|
|
67
82
|
reader.readObject(BlockHeader),
|
|
68
83
|
reader.readObject(TxContext),
|
|
69
84
|
Fr.fromBuffer(reader),
|
|
85
|
+
Fr.fromBuffer(reader),
|
|
70
86
|
reader.readObject(ProtocolContracts),
|
|
71
87
|
);
|
|
72
88
|
}
|
|
@@ -76,13 +92,20 @@ export class PrivateTxConstantData {
|
|
|
76
92
|
}
|
|
77
93
|
|
|
78
94
|
static empty() {
|
|
79
|
-
return new PrivateTxConstantData(
|
|
95
|
+
return new PrivateTxConstantData(
|
|
96
|
+
BlockHeader.empty(),
|
|
97
|
+
TxContext.empty(),
|
|
98
|
+
Fr.ZERO,
|
|
99
|
+
Fr.ZERO,
|
|
100
|
+
ProtocolContracts.empty(),
|
|
101
|
+
);
|
|
80
102
|
}
|
|
81
103
|
|
|
82
104
|
getSize() {
|
|
83
105
|
return (
|
|
84
106
|
this.anchorBlockHeader.getSize() +
|
|
85
107
|
this.txContext.getSize() +
|
|
108
|
+
this.txRequestSalt.size +
|
|
86
109
|
this.vkTreeRoot.size +
|
|
87
110
|
this.protocolContracts.getSize()
|
|
88
111
|
);
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
-
import type { UInt64 } from '../types/shared.js';
|
|
3
|
-
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
4
|
-
import { PrivateKernelData } from './private_kernel_data.js';
|
|
5
|
-
/**
|
|
6
|
-
* Input to the private kernel circuit - tail call.
|
|
7
|
-
*/
|
|
8
|
-
export declare class PrivateKernelTailCircuitPrivateInputs {
|
|
9
|
-
/**
|
|
10
|
-
* The previous kernel data
|
|
11
|
-
*/
|
|
12
|
-
previousKernel: PrivateKernelData;
|
|
13
|
-
/**
|
|
14
|
-
* The number of the padded side effects.
|
|
15
|
-
*/
|
|
16
|
-
paddedSideEffectAmounts: PaddedSideEffectAmounts;
|
|
17
|
-
/**
|
|
18
|
-
* The timestamp by which the transaction must be included in a block.
|
|
19
|
-
*/
|
|
20
|
-
expirationTimestampUpperBound: UInt64;
|
|
21
|
-
constructor(
|
|
22
|
-
/**
|
|
23
|
-
* The previous kernel data
|
|
24
|
-
*/
|
|
25
|
-
previousKernel: PrivateKernelData,
|
|
26
|
-
/**
|
|
27
|
-
* The number of the padded side effects.
|
|
28
|
-
*/
|
|
29
|
-
paddedSideEffectAmounts: PaddedSideEffectAmounts,
|
|
30
|
-
/**
|
|
31
|
-
* The timestamp by which the transaction must be included in a block.
|
|
32
|
-
*/
|
|
33
|
-
expirationTimestampUpperBound: UInt64);
|
|
34
|
-
isForPublic(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Serialize this as a buffer.
|
|
37
|
-
* @returns The buffer.
|
|
38
|
-
*/
|
|
39
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
40
|
-
/**
|
|
41
|
-
* Deserializes from a buffer or reader.
|
|
42
|
-
* @param buffer - Buffer or reader to read from.
|
|
43
|
-
* @returns The deserialized instance.
|
|
44
|
-
*/
|
|
45
|
-
static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelTailCircuitPrivateInputs;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfdGFpbF9jaXJjdWl0X3ByaXZhdGVfaW5wdXRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMva2VybmVsL3ByaXZhdGVfa2VybmVsX3RhaWxfY2lyY3VpdF9wcml2YXRlX2lucHV0cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUF1QyxNQUFNLDZCQUE2QixDQUFDO0FBRWhHLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ2pELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQ25FLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBRTdEOztHQUVHO0FBQ0gscUJBQWEscUNBQXFDO0lBRTlDOztPQUVHO0lBQ0ksY0FBYyxFQUFFLGlCQUFpQjtJQUN4Qzs7T0FFRztJQUNJLHVCQUF1QixFQUFFLHVCQUF1QjtJQUN2RDs7T0FFRztJQUNJLDZCQUE2QixFQUFFLE1BQU07SUFaOUM7SUFDRTs7T0FFRztJQUNJLGNBQWMsRUFBRSxpQkFBaUI7SUFDeEM7O09BRUc7SUFDSSx1QkFBdUIsRUFBRSx1QkFBdUI7SUFDdkQ7O09BRUc7SUFDSSw2QkFBNkIsRUFBRSxNQUFNLEVBQzFDO0lBRUosV0FBVyxZQUtWO0lBRUQ7OztPQUdHO0lBQ0gsUUFBUSw0QkFNUDtJQUVEOzs7O09BSUc7SUFDSCxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxNQUFNLEdBQUcsWUFBWSxHQUFHLHFDQUFxQyxDQU90RjtDQUNGIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_tail_circuit_private_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuC,MAAM,6BAA6B,CAAC;AAEhG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,qBAAa,qCAAqC;IAE9C;;OAEG;IACI,cAAc,EAAE,iBAAiB;IACxC;;OAEG;IACI,uBAAuB,EAAE,uBAAuB;IACvD;;OAEG;IACI,6BAA6B,EAAE,MAAM;IAZ9C;IACE;;OAEG;IACI,cAAc,EAAE,iBAAiB;IACxC;;OAEG;IACI,uBAAuB,EAAE,uBAAuB;IACvD;;OAEG;IACI,6BAA6B,EAAE,MAAM,EAC1C;IAEJ,WAAW,YAKV;IAED;;;OAGG;IACH,QAAQ,4BAMP;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,qCAAqC,CAOtF;CACF"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
|
-
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
3
|
-
import { PrivateKernelData } from './private_kernel_data.js';
|
|
4
|
-
/**
|
|
5
|
-
* Input to the private kernel circuit - tail call.
|
|
6
|
-
*/ export class PrivateKernelTailCircuitPrivateInputs {
|
|
7
|
-
previousKernel;
|
|
8
|
-
paddedSideEffectAmounts;
|
|
9
|
-
expirationTimestampUpperBound;
|
|
10
|
-
constructor(/**
|
|
11
|
-
* The previous kernel data
|
|
12
|
-
*/ previousKernel, /**
|
|
13
|
-
* The number of the padded side effects.
|
|
14
|
-
*/ paddedSideEffectAmounts, /**
|
|
15
|
-
* The timestamp by which the transaction must be included in a block.
|
|
16
|
-
*/ expirationTimestampUpperBound){
|
|
17
|
-
this.previousKernel = previousKernel;
|
|
18
|
-
this.paddedSideEffectAmounts = paddedSideEffectAmounts;
|
|
19
|
-
this.expirationTimestampUpperBound = expirationTimestampUpperBound;
|
|
20
|
-
}
|
|
21
|
-
isForPublic() {
|
|
22
|
-
return this.previousKernel.publicInputs.end.publicCallRequests.claimedLength > 0 || !this.previousKernel.publicInputs.publicTeardownCallRequest.isEmpty();
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Serialize this as a buffer.
|
|
26
|
-
* @returns The buffer.
|
|
27
|
-
*/ toBuffer() {
|
|
28
|
-
return serializeToBuffer(this.previousKernel, this.paddedSideEffectAmounts, bigintToUInt64BE(this.expirationTimestampUpperBound));
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Deserializes from a buffer or reader.
|
|
32
|
-
* @param buffer - Buffer or reader to read from.
|
|
33
|
-
* @returns The deserialized instance.
|
|
34
|
-
*/ static fromBuffer(buffer) {
|
|
35
|
-
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new PrivateKernelTailCircuitPrivateInputs(reader.readObject(PrivateKernelData), reader.readObject(PaddedSideEffectAmounts), reader.readUInt64());
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
|
-
|
|
3
|
-
import type { UInt64 } from '../types/shared.js';
|
|
4
|
-
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
5
|
-
import { PrivateKernelData } from './private_kernel_data.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Input to the private kernel circuit - tail call.
|
|
9
|
-
*/
|
|
10
|
-
export class PrivateKernelTailCircuitPrivateInputs {
|
|
11
|
-
constructor(
|
|
12
|
-
/**
|
|
13
|
-
* The previous kernel data
|
|
14
|
-
*/
|
|
15
|
-
public previousKernel: PrivateKernelData,
|
|
16
|
-
/**
|
|
17
|
-
* The number of the padded side effects.
|
|
18
|
-
*/
|
|
19
|
-
public paddedSideEffectAmounts: PaddedSideEffectAmounts,
|
|
20
|
-
/**
|
|
21
|
-
* The timestamp by which the transaction must be included in a block.
|
|
22
|
-
*/
|
|
23
|
-
public expirationTimestampUpperBound: UInt64,
|
|
24
|
-
) {}
|
|
25
|
-
|
|
26
|
-
isForPublic() {
|
|
27
|
-
return (
|
|
28
|
-
this.previousKernel.publicInputs.end.publicCallRequests.claimedLength > 0 ||
|
|
29
|
-
!this.previousKernel.publicInputs.publicTeardownCallRequest.isEmpty()
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Serialize this as a buffer.
|
|
35
|
-
* @returns The buffer.
|
|
36
|
-
*/
|
|
37
|
-
toBuffer() {
|
|
38
|
-
return serializeToBuffer(
|
|
39
|
-
this.previousKernel,
|
|
40
|
-
this.paddedSideEffectAmounts,
|
|
41
|
-
bigintToUInt64BE(this.expirationTimestampUpperBound),
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Deserializes from a buffer or reader.
|
|
47
|
-
* @param buffer - Buffer or reader to read from.
|
|
48
|
-
* @returns The deserialized instance.
|
|
49
|
-
*/
|
|
50
|
-
static fromBuffer(buffer: Buffer | BufferReader): PrivateKernelTailCircuitPrivateInputs {
|
|
51
|
-
const reader = BufferReader.asReader(buffer);
|
|
52
|
-
return new PrivateKernelTailCircuitPrivateInputs(
|
|
53
|
-
reader.readObject(PrivateKernelData),
|
|
54
|
-
reader.readObject(PaddedSideEffectAmounts),
|
|
55
|
-
reader.readUInt64(),
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|