@aztec/stdlib 3.0.0-nightly.20250925 → 3.0.0-nightly.20250927
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/abi/event_metadata_definition.d.ts +8 -0
- package/dest/abi/event_metadata_definition.d.ts.map +1 -0
- package/dest/abi/event_metadata_definition.js +1 -0
- package/dest/abi/index.d.ts +1 -0
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +1 -0
- package/dest/avm/avm_accumulated_data.d.ts +1 -0
- package/dest/avm/avm_accumulated_data.d.ts.map +1 -1
- package/dest/avm/avm_accumulated_data.js +4 -0
- package/dest/avm/index.d.ts +0 -1
- package/dest/avm/index.d.ts.map +1 -1
- package/dest/avm/index.js +0 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +0 -5
- package/dest/contract/contract_class_metadata.d.ts +8 -0
- package/dest/contract/contract_class_metadata.d.ts.map +1 -0
- package/dest/contract/contract_class_metadata.js +1 -0
- package/dest/contract/contract_metadata.d.ts +7 -0
- package/dest/contract/contract_metadata.d.ts.map +1 -0
- package/dest/contract/contract_metadata.js +1 -0
- package/dest/contract/index.d.ts +2 -0
- package/dest/contract/index.d.ts.map +1 -1
- package/dest/contract/index.js +2 -0
- package/dest/file-store/factory.d.ts.map +1 -1
- package/dest/file-store/factory.js +18 -0
- package/dest/file-store/s3.d.ts +25 -0
- package/dest/file-store/s3.d.ts.map +1 -0
- package/dest/file-store/s3.js +187 -0
- package/dest/interfaces/aztec-node-admin.d.ts +6 -0
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/client.d.ts +0 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +0 -1
- package/dest/interfaces/proving-job.d.ts +5 -5
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +3 -3
- package/dest/interfaces/server_circuit_prover.d.ts +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +4 -0
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -0
- package/dest/interfaces/validator.d.ts +6 -1
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +2 -1
- package/dest/logs/contract_class_log.d.ts +1 -1
- package/dest/logs/contract_class_log.d.ts.map +1 -1
- package/dest/logs/contract_class_log.js +1 -3
- package/dest/rollup/avm_proof_data.d.ts +2 -12
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +0 -24
- package/dest/rollup/base_rollup_hints.d.ts +16 -25
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +26 -32
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +13 -13
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.js +20 -20
- package/dest/rollup/index.d.ts +2 -1
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +2 -1
- package/dest/rollup/public_tube_private_inputs.d.ts +4 -2
- package/dest/rollup/public_tube_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tube_private_inputs.js +7 -3
- package/dest/rollup/public_tube_public_inputs.d.ts +20 -0
- package/dest/rollup/public_tube_public_inputs.d.ts.map +1 -0
- package/dest/rollup/public_tube_public_inputs.js +41 -0
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts +5 -5
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/public_tx_base_rollup_private_inputs.js +3 -3
- package/dest/rollup/{state_diff_hints.d.ts → tree_snapshot_diff_hints.d.ts} +22 -38
- package/dest/rollup/tree_snapshot_diff_hints.d.ts.map +1 -0
- package/dest/rollup/tree_snapshot_diff_hints.js +75 -0
- package/dest/rollup/tx_rollup_public_inputs.d.ts +4 -4
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/tx_rollup_public_inputs.js +7 -7
- package/dest/tests/factories.d.ts +6 -4
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +26 -28
- package/dest/tx/tx_effect.d.ts +3 -33
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +58 -191
- package/package.json +9 -8
- package/src/abi/event_metadata_definition.ts +8 -0
- package/src/abi/index.ts +1 -0
- package/src/avm/avm_accumulated_data.ts +10 -0
- package/src/avm/index.ts +0 -1
- package/src/block/body.ts +1 -7
- package/src/contract/contract_class_metadata.ts +8 -0
- package/src/contract/contract_metadata.ts +7 -0
- package/src/contract/index.ts +2 -0
- package/src/file-store/factory.ts +15 -0
- package/src/file-store/s3.ts +186 -0
- package/src/interfaces/client.ts +0 -1
- package/src/interfaces/proving-job.ts +4 -4
- package/src/interfaces/server_circuit_prover.ts +2 -7
- package/src/interfaces/slasher.ts +2 -0
- package/src/interfaces/validator.ts +5 -1
- package/src/logs/contract_class_log.ts +2 -3
- package/src/rollup/avm_proof_data.ts +2 -31
- package/src/rollup/base_rollup_hints.ts +20 -28
- package/src/rollup/block_root_rollup_private_inputs.ts +14 -14
- package/src/rollup/index.ts +2 -1
- package/src/rollup/public_tube_private_inputs.ts +10 -3
- package/src/rollup/public_tube_public_inputs.ts +52 -0
- package/src/rollup/public_tx_base_rollup_private_inputs.ts +6 -5
- package/src/rollup/{state_diff_hints.ts → tree_snapshot_diff_hints.ts} +26 -41
- package/src/rollup/tx_rollup_public_inputs.ts +4 -4
- package/src/tests/factories.ts +31 -43
- package/src/tx/tx_effect.ts +59 -204
- package/dest/avm/public_data_hint.d.ts +0 -16
- package/dest/avm/public_data_hint.d.ts.map +0 -1
- package/dest/avm/public_data_hint.js +0 -27
- package/dest/interfaces/pxe.d.ts +0 -235
- package/dest/interfaces/pxe.d.ts.map +0 -1
- package/dest/interfaces/pxe.js +0 -13
- package/dest/rollup/state_diff_hints.d.ts.map +0 -1
- package/dest/rollup/state_diff_hints.js +0 -85
- package/src/avm/public_data_hint.ts +0 -38
- package/src/interfaces/pxe.ts +0 -284
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
|
-
import { ARCHIVE_HEIGHT,
|
|
2
|
+
import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH } from '@aztec/constants';
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
5
5
|
import { BufferReader, type Tuple, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
@@ -28,9 +28,9 @@ export class BlockRootFirstRollupPrivateInputs {
|
|
|
28
28
|
*/
|
|
29
29
|
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
30
30
|
/**
|
|
31
|
-
* Hint for inserting the new l1 to l2 message subtree into `previousL1ToL2`.
|
|
31
|
+
* Hint for inserting the new l1 to l2 message subtree root into `previousL1ToL2`.
|
|
32
32
|
*/
|
|
33
|
-
public
|
|
33
|
+
public newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
34
34
|
/**
|
|
35
35
|
* Hint for inserting the new block hash to the last archive.
|
|
36
36
|
*/
|
|
@@ -46,7 +46,7 @@ export class BlockRootFirstRollupPrivateInputs {
|
|
|
46
46
|
fields.l1ToL2Roots,
|
|
47
47
|
fields.previousRollups,
|
|
48
48
|
fields.previousL1ToL2,
|
|
49
|
-
fields.
|
|
49
|
+
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
50
50
|
fields.newArchiveSiblingPath,
|
|
51
51
|
] as const;
|
|
52
52
|
}
|
|
@@ -61,7 +61,7 @@ export class BlockRootFirstRollupPrivateInputs {
|
|
|
61
61
|
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
62
62
|
[ProofData.fromBuffer(reader, TxRollupPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs)],
|
|
63
63
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
64
|
-
reader.readArray(
|
|
64
|
+
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
65
65
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
66
66
|
);
|
|
67
67
|
}
|
|
@@ -90,9 +90,9 @@ export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
90
90
|
*/
|
|
91
91
|
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
92
92
|
/**
|
|
93
|
-
* Hint for inserting the new l1 to l2 message subtree.
|
|
93
|
+
* Hint for inserting the new l1 to l2 message subtree root.
|
|
94
94
|
*/
|
|
95
|
-
public
|
|
95
|
+
public newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
96
96
|
/**
|
|
97
97
|
* Hint for inserting the new block hash to the last archive.
|
|
98
98
|
*/
|
|
@@ -110,7 +110,7 @@ export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
110
110
|
fields.l1ToL2Roots,
|
|
111
111
|
fields.previousRollup,
|
|
112
112
|
fields.previousL1ToL2,
|
|
113
|
-
fields.
|
|
113
|
+
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
114
114
|
fields.newArchiveSiblingPath,
|
|
115
115
|
] as const;
|
|
116
116
|
}
|
|
@@ -125,7 +125,7 @@ export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
|
125
125
|
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
126
126
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
127
127
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
128
|
-
reader.readArray(
|
|
128
|
+
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
129
129
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
130
130
|
);
|
|
131
131
|
}
|
|
@@ -167,9 +167,9 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
167
167
|
*/
|
|
168
168
|
public timestamp: UInt64,
|
|
169
169
|
/**
|
|
170
|
-
* Hint for inserting the new l1 to l2 message subtree.
|
|
170
|
+
* Hint for inserting the new l1 to l2 message subtree root.
|
|
171
171
|
*/
|
|
172
|
-
public
|
|
172
|
+
public newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
173
173
|
/**
|
|
174
174
|
* Hint for inserting the new block hash to the last archive.
|
|
175
175
|
*/
|
|
@@ -188,7 +188,7 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
188
188
|
fields.constants,
|
|
189
189
|
fields.startSpongeBlob,
|
|
190
190
|
fields.timestamp,
|
|
191
|
-
fields.
|
|
191
|
+
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
192
192
|
fields.newArchiveSiblingPath,
|
|
193
193
|
] as const;
|
|
194
194
|
}
|
|
@@ -201,7 +201,7 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
201
201
|
this.constants,
|
|
202
202
|
this.startSpongeBlob,
|
|
203
203
|
bigintToUInt64BE(this.timestamp),
|
|
204
|
-
this.
|
|
204
|
+
this.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
205
205
|
this.newArchiveSiblingPath,
|
|
206
206
|
]);
|
|
207
207
|
}
|
|
@@ -215,7 +215,7 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
215
215
|
CheckpointConstantData.fromBuffer(reader),
|
|
216
216
|
SpongeBlob.fromBuffer(reader),
|
|
217
217
|
reader.readUInt64(),
|
|
218
|
-
reader.readArray(
|
|
218
|
+
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
219
219
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
220
220
|
);
|
|
221
221
|
}
|
package/src/rollup/index.ts
CHANGED
|
@@ -13,8 +13,9 @@ export * from './epoch_constant_data.js';
|
|
|
13
13
|
export * from './private_tx_base_rollup_private_inputs.js';
|
|
14
14
|
export * from './public_tx_base_rollup_private_inputs.js';
|
|
15
15
|
export * from './public_tube_private_inputs.js';
|
|
16
|
+
export * from './public_tube_public_inputs.js';
|
|
16
17
|
export * from './root_rollup_private_inputs.js';
|
|
17
18
|
export * from './root_rollup_public_inputs.js';
|
|
18
|
-
export * from './
|
|
19
|
+
export * from './tree_snapshot_diff_hints.js';
|
|
19
20
|
export * from './tx_merge_rollup_private_inputs.js';
|
|
20
21
|
export * from './tx_rollup_public_inputs.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
1
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
2
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
@@ -7,19 +8,25 @@ import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_p
|
|
|
7
8
|
import { type CivcProofData, ProofData } from '../proofs/proof_data.js';
|
|
8
9
|
|
|
9
10
|
export class PublicTubePrivateInputs {
|
|
10
|
-
constructor(
|
|
11
|
+
constructor(
|
|
12
|
+
public hidingKernelProofData: CivcProofData<PrivateToPublicKernelCircuitPublicInputs>,
|
|
13
|
+
public proverId: Fr,
|
|
14
|
+
) {}
|
|
11
15
|
|
|
12
16
|
static from(fields: FieldsOf<PublicTubePrivateInputs>) {
|
|
13
17
|
return new PublicTubePrivateInputs(...PublicTubePrivateInputs.getFields(fields));
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
static getFields(fields: FieldsOf<PublicTubePrivateInputs>) {
|
|
17
|
-
return [fields.hidingKernelProofData] as const;
|
|
21
|
+
return [fields.hidingKernelProofData, fields.proverId] as const;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
21
25
|
const reader = BufferReader.asReader(buffer);
|
|
22
|
-
return new PublicTubePrivateInputs(
|
|
26
|
+
return new PublicTubePrivateInputs(
|
|
27
|
+
ProofData.fromBuffer(reader, PrivateToPublicKernelCircuitPublicInputs),
|
|
28
|
+
Fr.fromBuffer(reader),
|
|
29
|
+
);
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
toBuffer() {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
|
+
|
|
7
|
+
import { PrivateToPublicKernelCircuitPublicInputs } from '../kernel/private_to_public_kernel_circuit_public_inputs.js';
|
|
8
|
+
|
|
9
|
+
export class PublicTubePublicInputs {
|
|
10
|
+
constructor(
|
|
11
|
+
public privateTail: PrivateToPublicKernelCircuitPublicInputs,
|
|
12
|
+
public proverId: Fr,
|
|
13
|
+
) {}
|
|
14
|
+
|
|
15
|
+
static from(fields: FieldsOf<PublicTubePublicInputs>) {
|
|
16
|
+
return new PublicTubePublicInputs(...PublicTubePublicInputs.getFields(fields));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getFields(fields: FieldsOf<PublicTubePublicInputs>) {
|
|
20
|
+
return [fields.privateTail, fields.proverId] as const;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
24
|
+
const reader = BufferReader.asReader(buffer);
|
|
25
|
+
return new PublicTubePublicInputs(
|
|
26
|
+
reader.readObject(PrivateToPublicKernelCircuitPublicInputs),
|
|
27
|
+
reader.readObject(Fr),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
toBuffer() {
|
|
32
|
+
return serializeToBuffer(...PublicTubePublicInputs.getFields(this));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static fromString(str: string) {
|
|
36
|
+
return PublicTubePublicInputs.fromBuffer(hexToBuffer(str));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
toString() {
|
|
40
|
+
return bufferToHex(this.toBuffer());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Returns a representation for JSON serialization. */
|
|
44
|
+
toJSON() {
|
|
45
|
+
return this.toBuffer();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Creates an instance from a string. */
|
|
49
|
+
static get schema() {
|
|
50
|
+
return bufferSchemaFor(PublicTubePublicInputs);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -3,14 +3,15 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
3
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { AvmCircuitPublicInputs } from '../avm/avm_circuit_public_inputs.js';
|
|
7
7
|
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
8
|
-
import { AvmProofData } from './avm_proof_data.js';
|
|
8
|
+
import type { AvmProofData } from './avm_proof_data.js';
|
|
9
9
|
import { PublicBaseRollupHints } from './base_rollup_hints.js';
|
|
10
|
+
import { PublicTubePublicInputs } from './public_tube_public_inputs.js';
|
|
10
11
|
|
|
11
12
|
export class PublicTxBaseRollupPrivateInputs {
|
|
12
13
|
constructor(
|
|
13
|
-
public publicTubeProofData: RollupHonkProofData<
|
|
14
|
+
public publicTubeProofData: RollupHonkProofData<PublicTubePublicInputs>,
|
|
14
15
|
public avmProofData: AvmProofData,
|
|
15
16
|
public hints: PublicBaseRollupHints,
|
|
16
17
|
) {}
|
|
@@ -26,8 +27,8 @@ export class PublicTxBaseRollupPrivateInputs {
|
|
|
26
27
|
static fromBuffer(buffer: Buffer | BufferReader): PublicTxBaseRollupPrivateInputs {
|
|
27
28
|
const reader = BufferReader.asReader(buffer);
|
|
28
29
|
return new PublicTxBaseRollupPrivateInputs(
|
|
29
|
-
ProofData.fromBuffer(reader,
|
|
30
|
-
|
|
30
|
+
ProofData.fromBuffer(reader, PublicTubePublicInputs),
|
|
31
|
+
ProofData.fromBuffer(reader, AvmCircuitPublicInputs),
|
|
31
32
|
reader.readObject(PublicBaseRollupHints),
|
|
32
33
|
);
|
|
33
34
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAX_NULLIFIERS_PER_TX,
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
4
|
+
NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
5
5
|
NULLIFIER_TREE_HEIGHT,
|
|
6
6
|
PUBLIC_DATA_TREE_HEIGHT,
|
|
7
7
|
} from '@aztec/constants';
|
|
@@ -11,13 +11,17 @@ import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/s
|
|
|
11
11
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
12
12
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
13
13
|
|
|
14
|
-
import { NullifierLeafPreimage
|
|
14
|
+
import { NullifierLeafPreimage } from '../trees/index.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Hints used while proving state diff validity for the private base rollup.
|
|
18
18
|
*/
|
|
19
|
-
export class
|
|
19
|
+
export class TreeSnapshotDiffHints {
|
|
20
20
|
constructor(
|
|
21
|
+
/**
|
|
22
|
+
* Sibling path "pointing to" where the new note hash subtree should be inserted into the note hash tree.
|
|
23
|
+
*/
|
|
24
|
+
public noteHashSubtreeRootSiblingPath: Tuple<Fr, typeof NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
21
25
|
/**
|
|
22
26
|
* The nullifiers which need to be updated to perform the batch insertion of the new nullifiers.
|
|
23
27
|
* See `StandardIndexedTree.batchInsert` function for more details.
|
|
@@ -39,44 +43,29 @@ export class PrivateBaseStateDiffHints {
|
|
|
39
43
|
* The indexes of the sorted nullifiers to the original ones.
|
|
40
44
|
*/
|
|
41
45
|
public sortedNullifierIndexes: Tuple<number, typeof MAX_NULLIFIERS_PER_TX>,
|
|
42
|
-
/**
|
|
43
|
-
* Sibling path "pointing to" where the new note hash subtree should be inserted into the note hash tree.
|
|
44
|
-
*/
|
|
45
|
-
public noteHashSubtreeSiblingPath: Tuple<Fr, typeof NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
46
46
|
/**
|
|
47
47
|
* Sibling path "pointing to" where the new nullifiers subtree should be inserted into the nullifier tree.
|
|
48
48
|
*/
|
|
49
|
-
public
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Low leaf for the fee write in the public data tree.
|
|
53
|
-
*/
|
|
54
|
-
public feeWriteLowLeafPreimage: PublicDataTreeLeafPreimage,
|
|
55
|
-
/**
|
|
56
|
-
* Membership witness for the low leaf for the fee write in the public data tree.
|
|
57
|
-
*/
|
|
58
|
-
public feeWriteLowLeafMembershipWitness: MembershipWitness<typeof PUBLIC_DATA_TREE_HEIGHT>,
|
|
49
|
+
public nullifierSubtreeRootSiblingPath: Tuple<Fr, typeof NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
59
50
|
/**
|
|
60
|
-
*
|
|
51
|
+
* Membership witness for the fee payer's balance leaf in the public data tree.
|
|
61
52
|
*/
|
|
62
|
-
public
|
|
53
|
+
public feePayerBalanceMembershipWitness: MembershipWitness<typeof PUBLIC_DATA_TREE_HEIGHT>,
|
|
63
54
|
) {}
|
|
64
55
|
|
|
65
|
-
static from(fields: FieldsOf<
|
|
66
|
-
return new
|
|
56
|
+
static from(fields: FieldsOf<TreeSnapshotDiffHints>): TreeSnapshotDiffHints {
|
|
57
|
+
return new TreeSnapshotDiffHints(...TreeSnapshotDiffHints.getFields(fields));
|
|
67
58
|
}
|
|
68
59
|
|
|
69
|
-
static getFields(fields: FieldsOf<
|
|
60
|
+
static getFields(fields: FieldsOf<TreeSnapshotDiffHints>) {
|
|
70
61
|
return [
|
|
62
|
+
fields.noteHashSubtreeRootSiblingPath,
|
|
71
63
|
fields.nullifierPredecessorPreimages,
|
|
72
64
|
fields.nullifierPredecessorMembershipWitnesses,
|
|
73
65
|
fields.sortedNullifiers,
|
|
74
66
|
fields.sortedNullifierIndexes,
|
|
75
|
-
fields.
|
|
76
|
-
fields.
|
|
77
|
-
fields.feeWriteLowLeafPreimage,
|
|
78
|
-
fields.feeWriteLowLeafMembershipWitness,
|
|
79
|
-
fields.feeWriteSiblingPath,
|
|
67
|
+
fields.nullifierSubtreeRootSiblingPath,
|
|
68
|
+
fields.feePayerBalanceMembershipWitness,
|
|
80
69
|
] as const;
|
|
81
70
|
}
|
|
82
71
|
|
|
@@ -85,42 +74,38 @@ export class PrivateBaseStateDiffHints {
|
|
|
85
74
|
* @returns A buffer of the serialized state diff hints.
|
|
86
75
|
*/
|
|
87
76
|
toBuffer(): Buffer {
|
|
88
|
-
return serializeToBuffer(...
|
|
77
|
+
return serializeToBuffer(...TreeSnapshotDiffHints.getFields(this));
|
|
89
78
|
}
|
|
90
79
|
|
|
91
80
|
/**
|
|
92
81
|
* Deserializes the state diff hints from a buffer.
|
|
93
82
|
* @param buffer - A buffer to deserialize from.
|
|
94
|
-
* @returns A new
|
|
83
|
+
* @returns A new TreeSnapshotDiffHints instance.
|
|
95
84
|
*/
|
|
96
|
-
static fromBuffer(buffer: Buffer | BufferReader):
|
|
85
|
+
static fromBuffer(buffer: Buffer | BufferReader): TreeSnapshotDiffHints {
|
|
97
86
|
const reader = BufferReader.asReader(buffer);
|
|
98
|
-
return new
|
|
87
|
+
return new TreeSnapshotDiffHints(
|
|
88
|
+
reader.readArray(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
99
89
|
reader.readArray(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage),
|
|
100
90
|
reader.readArray(MAX_NULLIFIERS_PER_TX, {
|
|
101
91
|
fromBuffer: buffer => MembershipWitness.fromBuffer(buffer, NULLIFIER_TREE_HEIGHT),
|
|
102
92
|
}),
|
|
103
93
|
reader.readArray(MAX_NULLIFIERS_PER_TX, Fr),
|
|
104
94
|
reader.readNumbers(MAX_NULLIFIERS_PER_TX),
|
|
105
|
-
reader.readArray(
|
|
106
|
-
reader.readArray(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, Fr),
|
|
107
|
-
reader.readObject(PublicDataTreeLeafPreimage),
|
|
95
|
+
reader.readArray(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
108
96
|
MembershipWitness.fromBuffer(reader, PUBLIC_DATA_TREE_HEIGHT),
|
|
109
|
-
reader.readArray(PUBLIC_DATA_TREE_HEIGHT, Fr),
|
|
110
97
|
);
|
|
111
98
|
}
|
|
112
99
|
|
|
113
100
|
static empty() {
|
|
114
|
-
return new
|
|
101
|
+
return new TreeSnapshotDiffHints(
|
|
102
|
+
makeTuple(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr.zero),
|
|
115
103
|
makeTuple(MAX_NULLIFIERS_PER_TX, NullifierLeafPreimage.empty),
|
|
116
104
|
makeTuple(MAX_NULLIFIERS_PER_TX, () => MembershipWitness.empty(NULLIFIER_TREE_HEIGHT)),
|
|
117
105
|
makeTuple(MAX_NULLIFIERS_PER_TX, Fr.zero),
|
|
118
106
|
makeTuple(MAX_NULLIFIERS_PER_TX, () => 0),
|
|
119
|
-
makeTuple(
|
|
120
|
-
makeTuple(NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH, Fr.zero),
|
|
121
|
-
PublicDataTreeLeafPreimage.empty(),
|
|
107
|
+
makeTuple(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr.zero),
|
|
122
108
|
MembershipWitness.empty(PUBLIC_DATA_TREE_HEIGHT),
|
|
123
|
-
makeTuple(PUBLIC_DATA_TREE_HEIGHT, Fr.zero),
|
|
124
109
|
);
|
|
125
110
|
}
|
|
126
111
|
}
|
|
@@ -23,11 +23,11 @@ export class TxRollupPublicInputs {
|
|
|
23
23
|
/**
|
|
24
24
|
* Partial state reference at the start of the rollup circuit.
|
|
25
25
|
*/
|
|
26
|
-
public
|
|
26
|
+
public startTreeSnapshots: PartialStateReference,
|
|
27
27
|
/**
|
|
28
28
|
* Partial state reference at the end of the rollup circuit.
|
|
29
29
|
*/
|
|
30
|
-
public
|
|
30
|
+
public endTreeSnapshots: PartialStateReference,
|
|
31
31
|
/**
|
|
32
32
|
* Sponge state to absorb blob inputs at the start of the rollup circuit.
|
|
33
33
|
*/
|
|
@@ -96,8 +96,8 @@ export class TxRollupPublicInputs {
|
|
|
96
96
|
this.numTxs,
|
|
97
97
|
this.constants,
|
|
98
98
|
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
99
|
+
this.startTreeSnapshots,
|
|
100
|
+
this.endTreeSnapshots,
|
|
101
101
|
|
|
102
102
|
this.startSpongeBlob,
|
|
103
103
|
this.endSpongeBlob,
|
package/src/tests/factories.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
FIXED_DA_GAS,
|
|
10
10
|
FIXED_L2_GAS,
|
|
11
11
|
GeneratorIndex,
|
|
12
|
-
|
|
12
|
+
L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
13
13
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
14
14
|
MAX_ENQUEUED_CALLS_PER_CALL,
|
|
15
15
|
MAX_ENQUEUED_CALLS_PER_TX,
|
|
@@ -29,8 +29,8 @@ import {
|
|
|
29
29
|
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
30
30
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
31
31
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
33
|
+
NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
34
34
|
NULLIFIER_TREE_HEIGHT,
|
|
35
35
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
36
36
|
NUM_BASE_PARITY_PER_ROOT_PARITY,
|
|
@@ -75,7 +75,6 @@ import {
|
|
|
75
75
|
AvmTxHint,
|
|
76
76
|
RevertCode,
|
|
77
77
|
} from '../avm/index.js';
|
|
78
|
-
import { PublicDataHint } from '../avm/public_data_hint.js';
|
|
79
78
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
80
79
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
81
80
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
@@ -131,7 +130,6 @@ import { ProofData } from '../proofs/index.js';
|
|
|
131
130
|
import { Proof } from '../proofs/proof.js';
|
|
132
131
|
import { ProvingRequestType } from '../proofs/proving_request_type.js';
|
|
133
132
|
import { makeRecursiveProof } from '../proofs/recursive_proof.js';
|
|
134
|
-
import { AvmProofData } from '../rollup/avm_proof_data.js';
|
|
135
133
|
import { PrivateBaseRollupHints, PublicBaseRollupHints } from '../rollup/base_rollup_hints.js';
|
|
136
134
|
import { BlockConstantData } from '../rollup/block_constant_data.js';
|
|
137
135
|
import { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
@@ -145,9 +143,10 @@ import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
|
145
143
|
import { CheckpointRollupPublicInputs, FeeRecipient } from '../rollup/checkpoint_rollup_public_inputs.js';
|
|
146
144
|
import { EpochConstantData } from '../rollup/epoch_constant_data.js';
|
|
147
145
|
import { PrivateTxBaseRollupPrivateInputs } from '../rollup/private_tx_base_rollup_private_inputs.js';
|
|
146
|
+
import { PublicTubePublicInputs } from '../rollup/public_tube_public_inputs.js';
|
|
148
147
|
import { PublicTxBaseRollupPrivateInputs } from '../rollup/public_tx_base_rollup_private_inputs.js';
|
|
149
148
|
import { RootRollupPublicInputs } from '../rollup/root_rollup_public_inputs.js';
|
|
150
|
-
import {
|
|
149
|
+
import { TreeSnapshotDiffHints } from '../rollup/tree_snapshot_diff_hints.js';
|
|
151
150
|
import { TxMergeRollupPrivateInputs } from '../rollup/tx_merge_rollup_private_inputs.js';
|
|
152
151
|
import { TxRollupPublicInputs } from '../rollup/tx_rollup_public_inputs.js';
|
|
153
152
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
@@ -417,6 +416,10 @@ export function makePrivateToPublicKernelCircuitPublicInputs(seed = 1) {
|
|
|
417
416
|
);
|
|
418
417
|
}
|
|
419
418
|
|
|
419
|
+
export function makePublicTubePublicInputs(seed = 1) {
|
|
420
|
+
return new PublicTubePublicInputs(makePrivateToPublicKernelCircuitPublicInputs(seed), fr(seed + 0x1000));
|
|
421
|
+
}
|
|
422
|
+
|
|
420
423
|
/**
|
|
421
424
|
* Creates arbitrary public kernel circuit public inputs.
|
|
422
425
|
* @param seed - The seed to use for generating the kernel circuit public inputs.
|
|
@@ -919,7 +922,7 @@ export function makeBlockRootFirstRollupPrivateInputs(seed = 0) {
|
|
|
919
922
|
makeProofData(seed, makeParityPublicInputs),
|
|
920
923
|
[makeProofData(seed + 0x1000, makeTxRollupPublicInputs), makeProofData(seed + 0x2000, makeTxRollupPublicInputs)],
|
|
921
924
|
makeAppendOnlyTreeSnapshot(seed + 0x3000),
|
|
922
|
-
makeSiblingPath(seed + 0x4000,
|
|
925
|
+
makeSiblingPath(seed + 0x4000, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH),
|
|
923
926
|
makeSiblingPath(seed + 0x5000, ARCHIVE_HEIGHT),
|
|
924
927
|
);
|
|
925
928
|
}
|
|
@@ -980,11 +983,11 @@ export function makePublicDataTreeLeafPreimage(seed = 0): PublicDataTreeLeafPrei
|
|
|
980
983
|
}
|
|
981
984
|
|
|
982
985
|
/**
|
|
983
|
-
* Creates an instance of
|
|
986
|
+
* Creates an instance of TreeSnapshotDiffHints with arbitrary values based on the provided seed.
|
|
984
987
|
* @param seed - The seed to use for generating the hints.
|
|
985
|
-
* @returns A
|
|
988
|
+
* @returns A TreeSnapshotDiffHints object.
|
|
986
989
|
*/
|
|
987
|
-
export function
|
|
990
|
+
export function makeTreeSnapshotDiffHints(seed = 1): TreeSnapshotDiffHints {
|
|
988
991
|
const nullifierPredecessorPreimages = makeTuple(
|
|
989
992
|
MAX_NULLIFIERS_PER_TX,
|
|
990
993
|
x => makeNullifierLeafPreimage(x),
|
|
@@ -1001,24 +1004,20 @@ export function makePrivateBaseStateDiffHints(seed = 1): PrivateBaseStateDiffHin
|
|
|
1001
1004
|
|
|
1002
1005
|
const sortedNullifierIndexes = makeTuple(MAX_NULLIFIERS_PER_TX, i => i, seed + 0x4000);
|
|
1003
1006
|
|
|
1004
|
-
const
|
|
1007
|
+
const noteHashSubtreeRootSiblingPath = makeTuple(NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH, fr, seed + 0x5000);
|
|
1005
1008
|
|
|
1006
|
-
const
|
|
1009
|
+
const nullifierSubtreeRootSiblingPath = makeTuple(NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH, fr, seed + 0x6000);
|
|
1007
1010
|
|
|
1008
|
-
const
|
|
1009
|
-
const feeWriteLowLeafMembershipWitness = makeMembershipWitness(PUBLIC_DATA_TREE_HEIGHT, seed + 0x8000);
|
|
1010
|
-
const feeWriteSiblingPath = makeTuple(PUBLIC_DATA_TREE_HEIGHT, fr, seed + 0x9000);
|
|
1011
|
+
const feePayerBalanceMembershipWitness = makeMembershipWitness(PUBLIC_DATA_TREE_HEIGHT, seed + 0x8000);
|
|
1011
1012
|
|
|
1012
|
-
return new
|
|
1013
|
+
return new TreeSnapshotDiffHints(
|
|
1014
|
+
noteHashSubtreeRootSiblingPath,
|
|
1013
1015
|
nullifierPredecessorPreimages,
|
|
1014
1016
|
nullifierPredecessorMembershipWitnesses,
|
|
1015
1017
|
sortedNullifiers,
|
|
1016
1018
|
sortedNullifierIndexes,
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
feeWriteLowLeafPreimage,
|
|
1020
|
-
feeWriteLowLeafMembershipWitness,
|
|
1021
|
-
feeWriteSiblingPath,
|
|
1019
|
+
nullifierSubtreeRootSiblingPath,
|
|
1020
|
+
feePayerBalanceMembershipWitness,
|
|
1022
1021
|
);
|
|
1023
1022
|
}
|
|
1024
1023
|
|
|
@@ -1047,22 +1046,22 @@ function makePrivateBaseRollupHints(seed = 1) {
|
|
|
1047
1046
|
|
|
1048
1047
|
const startSpongeBlob = makeSpongeBlob(seed + 0x200);
|
|
1049
1048
|
|
|
1050
|
-
const
|
|
1049
|
+
const treeSnapshotDiffHints = makeTreeSnapshotDiffHints(seed + 0x600);
|
|
1051
1050
|
|
|
1052
|
-
const
|
|
1051
|
+
const anchorBlockArchiveSiblingPath = makeSiblingPath(seed + 0x9000, ARCHIVE_HEIGHT);
|
|
1053
1052
|
|
|
1054
1053
|
const contractClassLogsFields = makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x800);
|
|
1055
1054
|
|
|
1056
1055
|
const constants = makeBlockConstantData(0x100);
|
|
1057
1056
|
|
|
1058
|
-
const
|
|
1057
|
+
const feePayerBalanceLeafPreimage = PublicDataTreeLeafPreimage.empty();
|
|
1059
1058
|
|
|
1060
1059
|
return PrivateBaseRollupHints.from({
|
|
1061
1060
|
start,
|
|
1062
1061
|
startSpongeBlob,
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1062
|
+
treeSnapshotDiffHints,
|
|
1063
|
+
feePayerBalanceLeafPreimage,
|
|
1064
|
+
anchorBlockArchiveSiblingPath,
|
|
1066
1065
|
contractClassLogsFields,
|
|
1067
1066
|
constants,
|
|
1068
1067
|
});
|
|
@@ -1072,9 +1071,8 @@ function makePublicBaseRollupHints(seed = 1) {
|
|
|
1072
1071
|
return PublicBaseRollupHints.from({
|
|
1073
1072
|
startSpongeBlob: makeSpongeBlob(seed),
|
|
1074
1073
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x1000),
|
|
1075
|
-
|
|
1074
|
+
anchorBlockArchiveSiblingPath: makeSiblingPath(seed + 0x2000, ARCHIVE_HEIGHT),
|
|
1076
1075
|
contractClassLogsFields: makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x3000),
|
|
1077
|
-
proverId: fr(seed + 0x4000),
|
|
1078
1076
|
});
|
|
1079
1077
|
}
|
|
1080
1078
|
|
|
@@ -1085,21 +1083,9 @@ export function makePrivateTxBaseRollupPrivateInputs(seed = 0) {
|
|
|
1085
1083
|
});
|
|
1086
1084
|
}
|
|
1087
1085
|
|
|
1088
|
-
function makeAvmProofData(seed = 1) {
|
|
1089
|
-
return new AvmProofData(
|
|
1090
|
-
makeAvmCircuitPublicInputs(seed),
|
|
1091
|
-
makeRecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>(AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, seed + 0x100),
|
|
1092
|
-
makeVkData(seed + 0x200),
|
|
1093
|
-
);
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
1086
|
export function makePublicTxBaseRollupPrivateInputs(seed = 0) {
|
|
1097
|
-
const publicTubeProofData = makeProofData(
|
|
1098
|
-
|
|
1099
|
-
makePrivateToPublicKernelCircuitPublicInputs,
|
|
1100
|
-
RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
1101
|
-
);
|
|
1102
|
-
const avmProofData = makeAvmProofData(seed + 0x100);
|
|
1087
|
+
const publicTubeProofData = makeProofData(seed, makePublicTubePublicInputs, RECURSIVE_ROLLUP_HONK_PROOF_LENGTH);
|
|
1088
|
+
const avmProofData = makeProofData(seed + 0x100, makeAvmCircuitPublicInputs, AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED);
|
|
1103
1089
|
const hints = makePublicBaseRollupHints(seed + 0x200);
|
|
1104
1090
|
|
|
1105
1091
|
return PublicTxBaseRollupPrivateInputs.from({
|
|
@@ -1629,6 +1615,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1629
1615
|
// Create avm output.
|
|
1630
1616
|
const avmOutput = AvmCircuitPublicInputs.empty();
|
|
1631
1617
|
// Assign data from hints.
|
|
1618
|
+
avmOutput.protocolContractTreeRoot = protocolContractTreeRoot;
|
|
1632
1619
|
avmOutput.startTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1633
1620
|
avmOutput.endTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1634
1621
|
// Assign data from private.
|
|
@@ -1671,6 +1658,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1671
1658
|
i => new PublicDataWrite(new Fr(i), new Fr(i + 10)),
|
|
1672
1659
|
seed + 0x2000,
|
|
1673
1660
|
);
|
|
1661
|
+
avmOutput.accumulatedDataArrayLengths = avmOutput.accumulatedData.getArrayLengths();
|
|
1674
1662
|
avmOutput.gasSettings = gasSettings;
|
|
1675
1663
|
|
|
1676
1664
|
const avmCircuitInputs = await makeAvmCircuitInputs(seed + 0x3000, { publicInputs: avmOutput });
|