@aztec/stdlib 3.0.0-devnet.2 → 3.0.0-manual.20251030
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/block/l2_block_source.d.ts +5 -5
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +3 -3
- package/dest/interfaces/epoch-prover.d.ts +3 -3
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/private_kernel_prover.d.ts +2 -2
- package/dest/interfaces/private_kernel_prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +15 -15
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +8 -8
- package/dest/interfaces/server_circuit_prover.d.ts +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/kernel/private_kernel_data.js +2 -2
- package/dest/kernel/private_kernel_prover_output.d.ts +4 -4
- package/dest/kernel/private_kernel_prover_output.d.ts.map +1 -1
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +2 -3
- package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -1
- package/dest/logs/directional_app_tagging_secret.js +1 -2
- package/dest/logs/shared_secret_derivation.d.ts.map +1 -1
- package/dest/logs/shared_secret_derivation.js +2 -4
- package/dest/p2p/gossipable.d.ts +4 -12
- package/dest/p2p/gossipable.d.ts.map +1 -1
- package/dest/p2p/gossipable.js +4 -7
- package/dest/p2p/topic_type.d.ts +4 -8
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +14 -8
- package/dest/proofs/chonk_proof.d.ts +28 -0
- package/dest/proofs/chonk_proof.d.ts.map +1 -0
- package/dest/proofs/{client_ivc_proof.js → chonk_proof.js} +22 -21
- package/dest/proofs/index.d.ts +1 -1
- package/dest/proofs/index.d.ts.map +1 -1
- package/dest/proofs/index.js +1 -1
- package/dest/proofs/proof_data.d.ts +2 -2
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.d.ts +1 -1
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +1 -1
- package/dest/rollup/index.d.ts +2 -2
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +2 -2
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts +4 -4
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts +21 -0
- package/dest/rollup/public_chonk_verifier_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{public_tube_private_inputs.js → public_chonk_verifier_private_inputs.js} +7 -6
- package/dest/rollup/{public_tube_public_inputs.d.ts → public_chonk_verifier_public_inputs.d.ts} +7 -7
- package/dest/rollup/public_chonk_verifier_public_inputs.d.ts.map +1 -0
- package/dest/rollup/{public_tube_public_inputs.js → public_chonk_verifier_public_inputs.js} +7 -6
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +4 -4
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.js +6 -6
- package/dest/stats/stats.d.ts +3 -3
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +3 -3
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +13 -12
- package/dest/tests/mocks.d.ts +3 -3
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -3
- package/dest/tx/processed_tx.d.ts +2 -2
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +2 -2
- package/dest/tx/proven_tx.d.ts +7 -7
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +8 -8
- package/dest/tx/simulated_tx.js +2 -2
- package/dest/tx/tx.d.ts +3 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +13 -13
- package/package.json +8 -8
- package/src/block/l2_block_source.ts +5 -5
- package/src/interfaces/archiver.ts +3 -3
- package/src/interfaces/epoch-prover.ts +3 -3
- package/src/interfaces/private_kernel_prover.ts +2 -2
- package/src/interfaces/proving-job.ts +13 -10
- package/src/interfaces/server_circuit_prover.ts +7 -5
- package/src/kernel/private_kernel_data.ts +2 -2
- package/src/kernel/private_kernel_prover_output.ts +4 -4
- package/src/keys/derivation.ts +2 -3
- package/src/logs/directional_app_tagging_secret.ts +1 -2
- package/src/logs/shared_secret_derivation.ts +2 -4
- package/src/p2p/gossipable.ts +4 -12
- package/src/p2p/topic_type.ts +15 -8
- package/src/proofs/{client_ivc_proof.ts → chonk_proof.ts} +25 -24
- package/src/proofs/index.ts +1 -1
- package/src/proofs/proof_data.ts +2 -2
- package/src/proofs/proving_request_type.ts +1 -1
- package/src/rollup/index.ts +2 -2
- package/src/rollup/private_tx_base_rollup_private_inputs.ts +2 -2
- package/src/rollup/{public_tube_private_inputs.ts → public_chonk_verifier_private_inputs.ts} +11 -10
- package/src/rollup/{public_tube_public_inputs.ts → public_chonk_verifier_public_inputs.ts} +9 -8
- package/src/rollup/public_tx_base_rollup_private_inputs.ts +4 -4
- package/src/stats/stats.ts +3 -3
- package/src/tests/factories.ts +18 -17
- package/src/tests/mocks.ts +4 -4
- package/src/tx/processed_tx.ts +4 -4
- package/src/tx/proven_tx.ts +6 -6
- package/src/tx/simulated_tx.ts +2 -2
- package/src/tx/tx.ts +11 -11
- package/dest/proofs/client_ivc_proof.d.ts +0 -28
- package/dest/proofs/client_ivc_proof.d.ts.map +0 -1
- package/dest/rollup/public_tube_private_inputs.d.ts +0 -21
- package/dest/rollup/public_tube_private_inputs.d.ts.map +0 -1
- package/dest/rollup/public_tube_public_inputs.d.ts.map +0 -1
package/src/stats/stats.ts
CHANGED
|
@@ -88,7 +88,7 @@ export type ClientCircuitName =
|
|
|
88
88
|
export type ServerCircuitName =
|
|
89
89
|
| 'parity-base'
|
|
90
90
|
| 'parity-root'
|
|
91
|
-
| '
|
|
91
|
+
| 'chonk-verifier-public'
|
|
92
92
|
| 'rollup-tx-base-private'
|
|
93
93
|
| 'rollup-tx-base-public'
|
|
94
94
|
| 'rollup-tx-merge'
|
|
@@ -181,8 +181,8 @@ export type CircuitVerificationStats = {
|
|
|
181
181
|
eventName: 'circuit-verification';
|
|
182
182
|
/** Name of the circuit. */
|
|
183
183
|
circuitName: CircuitName;
|
|
184
|
-
/** Type of proof (
|
|
185
|
-
proofType: '
|
|
184
|
+
/** Type of proof (chonk, honk, etc) */
|
|
185
|
+
proofType: 'chonk' | 'ultra-honk';
|
|
186
186
|
/** Duration in ms. */
|
|
187
187
|
duration: number;
|
|
188
188
|
};
|
package/src/tests/factories.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ARCHIVE_HEIGHT,
|
|
4
4
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
5
5
|
AZTEC_MAX_EPOCH_DURATION,
|
|
6
|
-
|
|
6
|
+
CHONK_PROOF_LENGTH,
|
|
7
7
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
8
8
|
FIXED_DA_GAS,
|
|
9
9
|
FIXED_L2_GAS,
|
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
} from '@aztec/constants';
|
|
42
42
|
import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/array';
|
|
43
43
|
import { compact, padArrayEnd } from '@aztec/foundation/collection';
|
|
44
|
-
import { SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
|
|
44
|
+
import { Grumpkin, SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
|
|
45
45
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
46
|
-
import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
|
|
46
|
+
import { Fq, Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
|
|
47
47
|
import type { Bufferable, Serializable, Tuple } from '@aztec/foundation/serialize';
|
|
48
48
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
49
49
|
|
|
@@ -142,7 +142,7 @@ import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
|
142
142
|
import { CheckpointRollupPublicInputs, FeeRecipient } from '../rollup/checkpoint_rollup_public_inputs.js';
|
|
143
143
|
import { EpochConstantData } from '../rollup/epoch_constant_data.js';
|
|
144
144
|
import { PrivateTxBaseRollupPrivateInputs } from '../rollup/private_tx_base_rollup_private_inputs.js';
|
|
145
|
-
import {
|
|
145
|
+
import { PublicChonkVerifierPublicInputs } from '../rollup/public_chonk_verifier_public_inputs.js';
|
|
146
146
|
import { PublicTxBaseRollupPrivateInputs } from '../rollup/public_tx_base_rollup_private_inputs.js';
|
|
147
147
|
import { RootRollupPublicInputs } from '../rollup/root_rollup_public_inputs.js';
|
|
148
148
|
import { TreeSnapshotDiffHints } from '../rollup/tree_snapshot_diff_hints.js';
|
|
@@ -416,8 +416,8 @@ export function makePrivateToPublicKernelCircuitPublicInputs(seed = 1) {
|
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
export function
|
|
420
|
-
return new
|
|
419
|
+
export function makePublicChonkVerifierPublicInputs(seed = 1) {
|
|
420
|
+
return new PublicChonkVerifierPublicInputs(makePrivateToPublicKernelCircuitPublicInputs(seed), fr(seed + 0x1000));
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
export function makeProtocolContracts(seed = 1) {
|
|
@@ -1083,18 +1083,22 @@ function makePublicBaseRollupHints(seed = 1) {
|
|
|
1083
1083
|
|
|
1084
1084
|
export function makePrivateTxBaseRollupPrivateInputs(seed = 0) {
|
|
1085
1085
|
return PrivateTxBaseRollupPrivateInputs.from({
|
|
1086
|
-
hidingKernelProofData: makeProofData(seed, makePrivateToRollupKernelCircuitPublicInputs,
|
|
1086
|
+
hidingKernelProofData: makeProofData(seed, makePrivateToRollupKernelCircuitPublicInputs, CHONK_PROOF_LENGTH),
|
|
1087
1087
|
hints: makePrivateBaseRollupHints(seed + 0x100),
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
1090
|
|
|
1091
1091
|
export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
|
|
1092
|
-
const
|
|
1092
|
+
const publicChonkVerifierProofData = makeProofData(
|
|
1093
|
+
seed,
|
|
1094
|
+
makePublicChonkVerifierPublicInputs,
|
|
1095
|
+
RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
1096
|
+
);
|
|
1093
1097
|
const avmProofData = makeProofData(seed + 0x100, makeAvmCircuitPublicInputs, AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED);
|
|
1094
1098
|
const hints = makePublicBaseRollupHints(seed + 0x200);
|
|
1095
1099
|
|
|
1096
1100
|
return PublicTxBaseRollupPrivateInputs.from({
|
|
1097
|
-
|
|
1101
|
+
publicChonkVerifierProofData,
|
|
1098
1102
|
avmProofData,
|
|
1099
1103
|
hints,
|
|
1100
1104
|
});
|
|
@@ -1182,13 +1186,10 @@ export async function makeMapAsync<T>(size: number, fn: (i: number) => Promise<[
|
|
|
1182
1186
|
return new Map(await makeArrayAsync(size, i => fn(i + offset)));
|
|
1183
1187
|
}
|
|
1184
1188
|
|
|
1185
|
-
export function makePublicKeys(seed = 0): PublicKeys {
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
new Point(new Fr(seed + 4), new Fr(seed + 5), false),
|
|
1190
|
-
new Point(new Fr(seed + 6), new Fr(seed + 7), false),
|
|
1191
|
-
);
|
|
1189
|
+
export async function makePublicKeys(seed = 0): Promise<PublicKeys> {
|
|
1190
|
+
const f = (offset: number) => Grumpkin.mul(Grumpkin.generator, new Fq(seed + offset));
|
|
1191
|
+
|
|
1192
|
+
return new PublicKeys(await f(0), await f(1), await f(2), await f(3));
|
|
1192
1193
|
}
|
|
1193
1194
|
|
|
1194
1195
|
export async function makeContractInstanceFromClassId(
|
|
@@ -1204,7 +1205,7 @@ export async function makeContractInstanceFromClassId(
|
|
|
1204
1205
|
const salt = new Fr(seed);
|
|
1205
1206
|
const initializationHash = overrides?.initializationHash ?? new Fr(seed + 1);
|
|
1206
1207
|
const deployer = overrides?.deployer ?? new AztecAddress(new Fr(seed + 2));
|
|
1207
|
-
const publicKeys = overrides?.publicKeys ?? makePublicKeys(seed + 3);
|
|
1208
|
+
const publicKeys = overrides?.publicKeys ?? (await makePublicKeys(seed + 3));
|
|
1208
1209
|
|
|
1209
1210
|
const saltedInitializationHash = await poseidon2HashWithSeparator(
|
|
1210
1211
|
[salt, initializationHash, deployer],
|
package/src/tests/mocks.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { BlockAttestation } from '../p2p/block_attestation.js';
|
|
|
30
30
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
31
31
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
32
32
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
33
|
-
import {
|
|
33
|
+
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
34
34
|
import { HashedValues, PrivateCallExecutionResult, PrivateExecutionResult, StateReference, Tx } from '../tx/index.js';
|
|
35
35
|
import { PublicSimulationOutput } from '../tx/public_simulation_output.js';
|
|
36
36
|
import { TxSimulationResult, accumulatePrivateReturnValues } from '../tx/simulated_tx.js';
|
|
@@ -67,7 +67,7 @@ export const mockTx = async (
|
|
|
67
67
|
hasPublicTeardownCallRequest = false,
|
|
68
68
|
publicCalldataSize = 2,
|
|
69
69
|
feePayer,
|
|
70
|
-
|
|
70
|
+
chonkProof = ChonkProof.random(),
|
|
71
71
|
maxPriorityFeesPerGas,
|
|
72
72
|
gasUsed = Gas.empty(),
|
|
73
73
|
chainId = Fr.ZERO,
|
|
@@ -81,7 +81,7 @@ export const mockTx = async (
|
|
|
81
81
|
hasPublicTeardownCallRequest?: boolean;
|
|
82
82
|
publicCalldataSize?: number;
|
|
83
83
|
feePayer?: AztecAddress;
|
|
84
|
-
|
|
84
|
+
chonkProof?: ChonkProof;
|
|
85
85
|
maxPriorityFeesPerGas?: GasFees;
|
|
86
86
|
gasUsed?: Gas;
|
|
87
87
|
chainId?: Fr;
|
|
@@ -150,7 +150,7 @@ export const mockTx = async (
|
|
|
150
150
|
|
|
151
151
|
return await Tx.create({
|
|
152
152
|
data,
|
|
153
|
-
|
|
153
|
+
chonkProof,
|
|
154
154
|
contractClassLogFields: [],
|
|
155
155
|
publicFunctionCalldata,
|
|
156
156
|
});
|
package/src/tx/processed_tx.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Gas } from '../gas/gas.js';
|
|
|
8
8
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
9
9
|
import { computeL2ToL1MessageHash } from '../hash/hash.js';
|
|
10
10
|
import type { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
11
|
-
import type {
|
|
11
|
+
import type { ChonkProof } from '../proofs/chonk_proof.js';
|
|
12
12
|
import type { GlobalVariables } from './global_variables.js';
|
|
13
13
|
import type { Tx } from './tx.js';
|
|
14
14
|
import { TxEffect } from './tx_effect.js';
|
|
@@ -36,7 +36,7 @@ export type ProcessedTx = {
|
|
|
36
36
|
/**
|
|
37
37
|
* Proof for the private execution.
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
chonkProof: ChonkProof;
|
|
40
40
|
/**
|
|
41
41
|
* The request for AVM proving.
|
|
42
42
|
*/
|
|
@@ -118,7 +118,7 @@ export function makeProcessedTxFromPrivateOnlyTx(
|
|
|
118
118
|
return {
|
|
119
119
|
hash: txEffect.txHash,
|
|
120
120
|
data: tx.data,
|
|
121
|
-
|
|
121
|
+
chonkProof: tx.chonkProof,
|
|
122
122
|
avmProvingRequest: undefined,
|
|
123
123
|
globalVariables,
|
|
124
124
|
txEffect,
|
|
@@ -176,7 +176,7 @@ export function makeProcessedTxFromTxWithPublicCalls(
|
|
|
176
176
|
return {
|
|
177
177
|
hash: txEffect.txHash,
|
|
178
178
|
data: tx.data,
|
|
179
|
-
|
|
179
|
+
chonkProof: tx.chonkProof,
|
|
180
180
|
avmProvingRequest,
|
|
181
181
|
globalVariables,
|
|
182
182
|
txEffect,
|
package/src/tx/proven_tx.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
7
|
-
import {
|
|
7
|
+
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
8
8
|
import type { OffchainEffect } from './offchain_effect.js';
|
|
9
9
|
import {
|
|
10
10
|
PrivateExecutionResult,
|
|
@@ -18,7 +18,7 @@ export class TxProvingResult {
|
|
|
18
18
|
constructor(
|
|
19
19
|
public privateExecutionResult: PrivateExecutionResult,
|
|
20
20
|
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
21
|
-
public
|
|
21
|
+
public chonkProof: ChonkProof,
|
|
22
22
|
public stats?: ProvingStats,
|
|
23
23
|
) {}
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ export class TxProvingResult {
|
|
|
27
27
|
|
|
28
28
|
return await Tx.create({
|
|
29
29
|
data: this.publicInputs,
|
|
30
|
-
|
|
30
|
+
chonkProof: this.chonkProof,
|
|
31
31
|
contractClassLogFields: contractClassLogs,
|
|
32
32
|
publicFunctionCalldata: this.privateExecutionResult.publicFunctionCalldata,
|
|
33
33
|
});
|
|
@@ -42,21 +42,21 @@ export class TxProvingResult {
|
|
|
42
42
|
.object({
|
|
43
43
|
privateExecutionResult: PrivateExecutionResult.schema,
|
|
44
44
|
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
45
|
-
|
|
45
|
+
chonkProof: ChonkProof.schema,
|
|
46
46
|
timings: optional(ProvingTimingsSchema),
|
|
47
47
|
})
|
|
48
48
|
.transform(TxProvingResult.from);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
static from(fields: FieldsOf<TxProvingResult>) {
|
|
52
|
-
return new TxProvingResult(fields.privateExecutionResult, fields.publicInputs, fields.
|
|
52
|
+
return new TxProvingResult(fields.privateExecutionResult, fields.publicInputs, fields.chonkProof);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
static async random() {
|
|
56
56
|
return new TxProvingResult(
|
|
57
57
|
await PrivateExecutionResult.random(),
|
|
58
58
|
PrivateKernelTailCircuitPublicInputs.empty(),
|
|
59
|
-
|
|
59
|
+
ChonkProof.empty(),
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
}
|
package/src/tx/simulated_tx.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { Gas } from '../gas/gas.js';
|
|
12
12
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
13
13
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
14
|
-
import {
|
|
14
|
+
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
15
15
|
import {
|
|
16
16
|
PrivateCallExecutionResult,
|
|
17
17
|
PrivateExecutionResult,
|
|
@@ -69,7 +69,7 @@ export class PrivateSimulationResult {
|
|
|
69
69
|
|
|
70
70
|
return await Tx.create({
|
|
71
71
|
data: this.publicInputs,
|
|
72
|
-
|
|
72
|
+
chonkProof: ChonkProof.empty(),
|
|
73
73
|
contractClassLogFields: contractClassLogs,
|
|
74
74
|
publicFunctionCalldata: this.privateExecutionResult.publicFunctionCalldata,
|
|
75
75
|
});
|
package/src/tx/tx.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_t
|
|
|
15
15
|
import { ContractClassLog, ContractClassLogFields } from '../logs/contract_class_log.js';
|
|
16
16
|
import { Gossipable } from '../p2p/gossipable.js';
|
|
17
17
|
import { TopicType } from '../p2p/topic_type.js';
|
|
18
|
-
import {
|
|
18
|
+
import { ChonkProof } from '../proofs/chonk_proof.js';
|
|
19
19
|
import type { TxStats } from '../stats/stats.js';
|
|
20
20
|
import { HashedValues } from './hashed_values.js';
|
|
21
21
|
import { PublicCallRequestWithCalldata } from './public_call_request_with_calldata.js';
|
|
@@ -39,7 +39,7 @@ export class Tx extends Gossipable {
|
|
|
39
39
|
/**
|
|
40
40
|
* Proof from the private kernel circuit.
|
|
41
41
|
*/
|
|
42
|
-
public readonly
|
|
42
|
+
public readonly chonkProof: ChonkProof,
|
|
43
43
|
/**
|
|
44
44
|
* Contract class log fields emitted from the tx.
|
|
45
45
|
* Their order should match the order of the log hashes returned from `this.data.getNonEmptyContractClassLogsHashes`.
|
|
@@ -108,7 +108,7 @@ export class Tx extends Gossipable {
|
|
|
108
108
|
return new Tx(
|
|
109
109
|
reader.readObject(TxHash),
|
|
110
110
|
reader.readObject(PrivateKernelTailCircuitPublicInputs),
|
|
111
|
-
reader.readObject(
|
|
111
|
+
reader.readObject(ChonkProof),
|
|
112
112
|
reader.readVectorUint8Prefix(ContractClassLogFields),
|
|
113
113
|
reader.readVectorUint8Prefix(HashedValues),
|
|
114
114
|
);
|
|
@@ -122,7 +122,7 @@ export class Tx extends Gossipable {
|
|
|
122
122
|
return serializeToBuffer([
|
|
123
123
|
this.txHash,
|
|
124
124
|
this.data,
|
|
125
|
-
this.
|
|
125
|
+
this.chonkProof,
|
|
126
126
|
serializeArrayOfBufferableToVector(this.contractClassLogFields, 1),
|
|
127
127
|
serializeArrayOfBufferableToVector(this.publicFunctionCalldata, 1),
|
|
128
128
|
]);
|
|
@@ -132,7 +132,7 @@ export class Tx extends Gossipable {
|
|
|
132
132
|
return z
|
|
133
133
|
.object({
|
|
134
134
|
data: PrivateKernelTailCircuitPublicInputs.schema,
|
|
135
|
-
|
|
135
|
+
chonkProof: ChonkProof.schema,
|
|
136
136
|
contractClassLogFields: z.array(ContractClassLogFields.schema),
|
|
137
137
|
publicFunctionCalldata: z.array(HashedValues.schema),
|
|
138
138
|
})
|
|
@@ -155,7 +155,7 @@ export class Tx extends Gossipable {
|
|
|
155
155
|
return new Tx(
|
|
156
156
|
fields.txHash,
|
|
157
157
|
fields.data,
|
|
158
|
-
fields.
|
|
158
|
+
fields.chonkProof,
|
|
159
159
|
fields.contractClassLogFields,
|
|
160
160
|
fields.publicFunctionCalldata,
|
|
161
161
|
);
|
|
@@ -237,7 +237,7 @@ export class Tx extends Gossipable {
|
|
|
237
237
|
classPublishedCount: this.data.getNonEmptyContractClassLogsHashes().length,
|
|
238
238
|
contractClassLogSize: this.data.getEmittedContractClassLogsLength(),
|
|
239
239
|
|
|
240
|
-
proofSize: this.
|
|
240
|
+
proofSize: this.chonkProof.fields.length,
|
|
241
241
|
size: this.toBuffer().length,
|
|
242
242
|
|
|
243
243
|
feePaymentMethod:
|
|
@@ -249,7 +249,7 @@ export class Tx extends Gossipable {
|
|
|
249
249
|
getSize() {
|
|
250
250
|
return (
|
|
251
251
|
this.data.getSize() +
|
|
252
|
-
this.
|
|
252
|
+
this.chonkProof.fields.length * Fr.SIZE_IN_BYTES +
|
|
253
253
|
arraySerializedSizeOfNonEmpty(this.contractClassLogFields) +
|
|
254
254
|
this.publicFunctionCalldata.reduce((accum, cd) => accum + cd.getSize(), 0)
|
|
255
255
|
);
|
|
@@ -275,10 +275,10 @@ export class Tx extends Gossipable {
|
|
|
275
275
|
*/
|
|
276
276
|
static clone(tx: Tx): Tx {
|
|
277
277
|
const publicInputs = PrivateKernelTailCircuitPublicInputs.fromBuffer(tx.data.toBuffer());
|
|
278
|
-
const
|
|
278
|
+
const chonkProof = ChonkProof.fromBuffer(tx.chonkProof.toBuffer());
|
|
279
279
|
const contractClassLogFields = tx.contractClassLogFields.map(p => p.clone());
|
|
280
280
|
const publicFunctionCalldata = tx.publicFunctionCalldata.map(cd => HashedValues.fromBuffer(cd.toBuffer()));
|
|
281
|
-
const clonedTx = new Tx(tx.txHash, publicInputs,
|
|
281
|
+
const clonedTx = new Tx(tx.txHash, publicInputs, chonkProof, contractClassLogFields, publicFunctionCalldata);
|
|
282
282
|
|
|
283
283
|
return clonedTx;
|
|
284
284
|
}
|
|
@@ -292,7 +292,7 @@ export class Tx extends Gossipable {
|
|
|
292
292
|
return Tx.from({
|
|
293
293
|
txHash: (typeof args.txHash === 'string' ? TxHash.fromString(args.txHash) : args.txHash) ?? TxHash.random(),
|
|
294
294
|
data: PrivateKernelTailCircuitPublicInputs.emptyWithNullifier(),
|
|
295
|
-
|
|
295
|
+
chonkProof: args.randomProof ? ChonkProof.random() : ChonkProof.empty(),
|
|
296
296
|
contractClassLogFields: [ContractClassLogFields.random()],
|
|
297
297
|
publicFunctionCalldata: [HashedValues.random()],
|
|
298
298
|
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
export declare class ClientIvcProof {
|
|
4
|
-
fields: Fr[];
|
|
5
|
-
constructor(fields: Fr[]);
|
|
6
|
-
attachPublicInputs(publicInputs: Fr[]): ClientIvcProofWithPublicInputs;
|
|
7
|
-
isEmpty(): boolean;
|
|
8
|
-
static empty(): ClientIvcProof;
|
|
9
|
-
static random(): ClientIvcProof;
|
|
10
|
-
static get schema(): import("zod").ZodType<ClientIvcProof, any, string>;
|
|
11
|
-
toJSON(): Buffer<ArrayBufferLike>;
|
|
12
|
-
static fromBuffer(buffer: Buffer | BufferReader): ClientIvcProof;
|
|
13
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
14
|
-
}
|
|
15
|
-
export declare class ClientIvcProofWithPublicInputs {
|
|
16
|
-
fieldsWithPublicInputs: Fr[];
|
|
17
|
-
constructor(fieldsWithPublicInputs: Fr[]);
|
|
18
|
-
getPublicInputs(): Fr[];
|
|
19
|
-
removePublicInputs(): ClientIvcProof;
|
|
20
|
-
isEmpty(): boolean;
|
|
21
|
-
static empty(): ClientIvcProofWithPublicInputs;
|
|
22
|
-
static get schema(): import("zod").ZodType<ClientIvcProofWithPublicInputs, any, string>;
|
|
23
|
-
toJSON(): Buffer<ArrayBufferLike>;
|
|
24
|
-
static fromBuffer(buffer: Buffer | BufferReader): ClientIvcProofWithPublicInputs;
|
|
25
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
26
|
-
static fromBufferArray(fields: Uint8Array[]): ClientIvcProofWithPublicInputs;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=client_ivc_proof.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client_ivc_proof.d.ts","sourceRoot":"","sources":["../../src/proofs/client_ivc_proof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,qBAAa,cAAc;IAKhB,MAAM,EAAE,EAAE,EAAE;gBAAZ,MAAM,EAAE,EAAE,EAAE;IAOd,kBAAkB,CAAC,YAAY,EAAE,EAAE,EAAE;IAIrC,OAAO;IAId,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,MAAM;IAWb,MAAM,KAAK,MAAM,uDAEhB;IAGD,MAAM;IAIN,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc;IAOzD,QAAQ;CAGhB;AAED,qBAAa,8BAA8B;IAIhC,sBAAsB,EAAE,EAAE,EAAE;gBAA5B,sBAAsB,EAAE,EAAE,EAAE;IAO9B,eAAe;IAKf,kBAAkB;IAKlB,OAAO;IAId,MAAM,CAAC,KAAK;IAIZ,MAAM,KAAK,MAAM,uEAEhB;IAGD,MAAM;IAIN,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,8BAA8B;IAOzE,QAAQ;IAKf,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,8BAA8B;CAI7E"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import type { FieldsOf } from '@aztec/foundation/types';
|
|
4
|
-
import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
|
|
5
|
-
import { type CivcProofData } from '../proofs/proof_data.js';
|
|
6
|
-
export declare class PublicTubePrivateInputs {
|
|
7
|
-
hidingKernelProofData: CivcProofData<PrivateToPublicKernelCircuitPublicInputs>;
|
|
8
|
-
proverId: Fr;
|
|
9
|
-
constructor(hidingKernelProofData: CivcProofData<PrivateToPublicKernelCircuitPublicInputs>, proverId: Fr);
|
|
10
|
-
static from(fields: FieldsOf<PublicTubePrivateInputs>): PublicTubePrivateInputs;
|
|
11
|
-
static getFields(fields: FieldsOf<PublicTubePrivateInputs>): readonly [CivcProofData<PrivateToPublicKernelCircuitPublicInputs>, Fr];
|
|
12
|
-
static fromBuffer(buffer: Buffer | BufferReader): PublicTubePrivateInputs;
|
|
13
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
14
|
-
static fromString(str: string): PublicTubePrivateInputs;
|
|
15
|
-
toString(): `0x${string}`;
|
|
16
|
-
/** Returns a representation for JSON serialization. */
|
|
17
|
-
toJSON(): Buffer<ArrayBufferLike>;
|
|
18
|
-
/** Creates an instance from a string. */
|
|
19
|
-
static get schema(): import("zod").ZodType<PublicTubePrivateInputs, any, string>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=public_tube_private_inputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public_tube_private_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/public_tube_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,wCAAwC,EAAE,MAAM,6DAA6D,CAAC;AACvH,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAExE,qBAAa,uBAAuB;IAEzB,qBAAqB,EAAE,aAAa,CAAC,wCAAwC,CAAC;IAC9E,QAAQ,EAAE,EAAE;gBADZ,qBAAqB,EAAE,aAAa,CAAC,wCAAwC,CAAC,EAC9E,QAAQ,EAAE,EAAE;IAGrB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,uBAAuB,CAAC;IAIrD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,uBAAuB,CAAC;IAI1D,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAQ/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;IAIR,uDAAuD;IACvD,MAAM;IAIN,yCAAyC;IACzC,MAAM,KAAK,MAAM,gEAEhB;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public_tube_public_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/public_tube_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,wCAAwC,EAAE,MAAM,6DAA6D,CAAC;AAEvH,qBAAa,sBAAsB;IAExB,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,EAAE;gBADZ,WAAW,EAAE,wCAAwC,EACrD,QAAQ,EAAE,EAAE;IAGrB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIpD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIzD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAQ/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,QAAQ;IAIR,uDAAuD;IACvD,MAAM;IAIN,yCAAyC;IACzC,MAAM,KAAK,MAAM,+DAEhB;CACF"}
|