@aztec/stdlib 3.0.0-nightly.20250916 → 3.0.0-nightly.20250918
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/avm/avm.d.ts +78 -1
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +20 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +6 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +11 -6
- package/dest/avm/avm_proving_request.d.ts +41 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +4 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +16 -5
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +8 -5
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +14 -7
- package/dest/block/l2_block_code_to_purge.d.ts +3 -14
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +23 -13
- package/dest/block/l2_block_header.d.ts +100 -0
- package/dest/block/l2_block_header.d.ts.map +1 -0
- package/dest/block/l2_block_header.js +146 -0
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +1 -1
- package/dest/block/published_l2_block.d.ts +2 -2
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +1 -3
- package/dest/interfaces/aztec-node.d.ts +5 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +1 -0
- package/dest/interfaces/block-builder.d.ts +1 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/epoch-prover.d.ts +25 -8
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +204 -61
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +101 -39
- package/dest/interfaces/pxe.d.ts +8 -1
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +1 -0
- package/dest/interfaces/server_circuit_prover.d.ts +19 -16
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +3 -2
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_context_inputs.d.ts +2 -2
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
- package/dest/messaging/inbox_leaf.d.ts +2 -0
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/inbox_leaf.js +3 -0
- package/dest/p2p/consensus_payload.d.ts +7 -6
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +7 -6
- package/dest/parity/root_parity_input.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proof_data.js +2 -2
- package/dest/proofs/proving_request_type.d.ts +13 -8
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +13 -8
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.js +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +12 -3
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +11 -5
- package/dest/rollup/block_constant_data.d.ts +20 -6
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.js +15 -7
- package/dest/rollup/block_merge_rollup.d.ts +10 -9
- package/dest/rollup/block_merge_rollup.d.ts.map +1 -1
- package/dest/rollup/block_merge_rollup.js +14 -13
- package/dest/rollup/block_rollup_public_inputs.d.ts +124 -0
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/block_rollup_public_inputs.js +85 -0
- package/dest/rollup/block_root_rollup.d.ts +148 -184
- package/dest/rollup/block_root_rollup.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup.js +211 -260
- package/dest/rollup/checkpoint_constant_data.d.ts +54 -0
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -0
- package/dest/rollup/checkpoint_constant_data.js +55 -0
- package/dest/{tx/proposed_block_header.d.ts → rollup/checkpoint_header.d.ts} +11 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -0
- package/dest/{tx/proposed_block_header.js → rollup/checkpoint_header.js} +9 -9
- package/dest/rollup/checkpoint_merge_rollup.d.ts +30 -0
- package/dest/rollup/checkpoint_merge_rollup.d.ts.map +1 -0
- package/dest/rollup/checkpoint_merge_rollup.js +37 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +105 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.js +105 -0
- package/dest/rollup/checkpoint_root_rollup.d.ts +117 -0
- package/dest/rollup/checkpoint_root_rollup.d.ts.map +1 -0
- package/dest/rollup/checkpoint_root_rollup.js +178 -0
- package/dest/rollup/epoch_constant_data.d.ts +19 -2
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.js +20 -7
- package/dest/rollup/index.d.ts +8 -5
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +8 -5
- package/dest/rollup/rollup_proof_data.d.ts +10 -0
- package/dest/rollup/rollup_proof_data.d.ts.map +1 -0
- package/dest/rollup/rollup_proof_data.js +1 -0
- package/dest/rollup/root_rollup.d.ts +26 -23
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +28 -39
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +17 -41
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +76 -80
- package/dest/tests/mocks.d.ts +3 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -3
- package/dest/tx/block_header.d.ts +12 -13
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +16 -21
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +0 -1
- package/dest/tx/index.d.ts +0 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -3
- package/dest/tx/tx_constant_data.d.ts +4 -4
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +6 -6
- package/dest/tx/tx_effect.d.ts +0 -3
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -7
- package/dest/zkpassport/index.d.ts +3 -3
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +7 -7
- package/package.json +8 -8
- package/src/avm/avm.ts +22 -0
- package/src/avm/avm_circuit_public_inputs.ts +10 -0
- package/src/block/body.ts +23 -6
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +18 -8
- package/src/block/l2_block_code_to_purge.ts +30 -31
- package/src/block/l2_block_header.ts +232 -0
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +1 -1
- package/src/block/test/l2_tips_store_test_suite.ts +1 -2
- package/src/interfaces/aztec-node.ts +8 -2
- package/src/interfaces/block-builder.ts +1 -6
- package/src/interfaces/epoch-prover.ts +34 -10
- package/src/interfaces/proving-job.ts +166 -51
- package/src/interfaces/pxe.ts +10 -1
- package/src/interfaces/server_circuit_prover.ts +65 -29
- package/src/interfaces/validator.ts +3 -2
- package/src/kernel/private_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_context_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
- package/src/messaging/inbox_leaf.ts +5 -0
- package/src/p2p/consensus_payload.ts +8 -7
- package/src/proofs/proof_data.ts +1 -6
- package/src/proofs/proving_request_type.ts +8 -3
- package/src/rollup/base_or_merge_rollup_public_inputs.ts +1 -1
- package/src/rollup/base_rollup_hints.ts +9 -1
- package/src/rollup/block_constant_data.ts +13 -3
- package/src/rollup/block_merge_rollup.ts +13 -11
- package/src/rollup/block_rollup_public_inputs.ts +123 -0
- package/src/rollup/block_root_rollup.ts +209 -264
- package/src/rollup/checkpoint_constant_data.ts +84 -0
- package/src/{tx/proposed_block_header.ts → rollup/checkpoint_header.ts} +16 -17
- package/src/rollup/checkpoint_merge_rollup.ts +50 -0
- package/src/rollup/{block_root_or_block_merge_public_inputs.ts → checkpoint_rollup_public_inputs.ts} +26 -52
- package/src/rollup/checkpoint_root_rollup.ts +216 -0
- package/src/rollup/epoch_constant_data.ts +32 -8
- package/src/rollup/index.ts +8 -5
- package/src/rollup/rollup_proof_data.ts +12 -0
- package/src/rollup/root_rollup.ts +30 -41
- package/src/stats/stats.ts +8 -3
- package/src/tests/factories.ts +139 -135
- package/src/tests/mocks.ts +6 -13
- package/src/tx/block_header.ts +17 -32
- package/src/tx/global_variables.ts +0 -1
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +3 -3
- package/src/tx/tx_constant_data.ts +4 -4
- package/src/tx/tx_effect.ts +2 -7
- package/src/zkpassport/index.ts +6 -6
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +0 -134
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +0 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +0 -125
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +0 -51
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/empty_block_root_rollup_inputs.js +0 -65
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
- package/dest/rollup/previous_rollup_block_data.d.ts +0 -47
- package/dest/rollup/previous_rollup_block_data.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_block_data.js +0 -37
- package/dest/tx/proposed_block_header.d.ts.map +0 -1
- package/src/rollup/empty_block_root_rollup_inputs.ts +0 -80
- package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
- package/src/rollup/previous_rollup_block_data.ts +0 -48
|
@@ -7,20 +7,25 @@ import { BufferReader, type Tuple, serializeToBuffer, serializeToFields } from '
|
|
|
7
7
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { ProofData } from '../proofs/proof_data.js';
|
|
11
|
+
import { CheckpointRollupPublicInputs, FeeRecipient } from './checkpoint_rollup_public_inputs.js';
|
|
12
|
+
import { EpochConstantData } from './epoch_constant_data.js';
|
|
13
|
+
import type { RollupProofData } from './rollup_proof_data.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Represents inputs of the root rollup circuit.
|
|
15
17
|
*/
|
|
16
|
-
export class
|
|
18
|
+
export class RootRollupPrivateInputs {
|
|
17
19
|
constructor(
|
|
18
20
|
/**
|
|
19
21
|
* The previous rollup data.
|
|
20
22
|
* Note: Root rollup circuit is the latest circuit the chain of circuits and the previous rollup data is the data
|
|
21
|
-
* from 2
|
|
23
|
+
* from 2 checkpoint root/merge/padding circuits.
|
|
22
24
|
*/
|
|
23
|
-
public
|
|
25
|
+
public previousRollups: [
|
|
26
|
+
RollupProofData<CheckpointRollupPublicInputs>,
|
|
27
|
+
RollupProofData<CheckpointRollupPublicInputs>,
|
|
28
|
+
],
|
|
24
29
|
) {}
|
|
25
30
|
|
|
26
31
|
/**
|
|
@@ -28,7 +33,7 @@ export class RootRollupInputs {
|
|
|
28
33
|
* @returns - The inputs serialized to a buffer.
|
|
29
34
|
*/
|
|
30
35
|
toBuffer() {
|
|
31
|
-
return serializeToBuffer(...
|
|
36
|
+
return serializeToBuffer(...RootRollupPrivateInputs.getFields(this));
|
|
32
37
|
}
|
|
33
38
|
|
|
34
39
|
/**
|
|
@@ -42,10 +47,10 @@ export class RootRollupInputs {
|
|
|
42
47
|
/**
|
|
43
48
|
* Creates a new instance from fields.
|
|
44
49
|
* @param fields - Fields to create the instance from.
|
|
45
|
-
* @returns A new
|
|
50
|
+
* @returns A new RootRollupPrivateInputs instance.
|
|
46
51
|
*/
|
|
47
|
-
static from(fields: FieldsOf<
|
|
48
|
-
return new
|
|
52
|
+
static from(fields: FieldsOf<RootRollupPrivateInputs>) {
|
|
53
|
+
return new RootRollupPrivateInputs(...RootRollupPrivateInputs.getFields(fields));
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
/**
|
|
@@ -53,30 +58,30 @@ export class RootRollupInputs {
|
|
|
53
58
|
* @param fields - Fields to create the instance from.
|
|
54
59
|
* @returns An array of fields.
|
|
55
60
|
*/
|
|
56
|
-
static getFields(fields: FieldsOf<
|
|
57
|
-
return [fields.
|
|
61
|
+
static getFields(fields: FieldsOf<RootRollupPrivateInputs>) {
|
|
62
|
+
return [fields.previousRollups] as const;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
/**
|
|
61
66
|
* Deserializes the inputs from a buffer.
|
|
62
67
|
* @param buffer - A buffer to deserialize from.
|
|
63
|
-
* @returns A new
|
|
68
|
+
* @returns A new RootRollupPrivateInputs instance.
|
|
64
69
|
*/
|
|
65
|
-
static fromBuffer(buffer: Buffer | BufferReader)
|
|
70
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
66
71
|
const reader = BufferReader.asReader(buffer);
|
|
67
|
-
return new
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
return new RootRollupPrivateInputs([
|
|
73
|
+
ProofData.fromBuffer(reader, CheckpointRollupPublicInputs),
|
|
74
|
+
ProofData.fromBuffer(reader, CheckpointRollupPublicInputs),
|
|
70
75
|
]);
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
/**
|
|
74
79
|
* Deserializes the inputs from a hex string.
|
|
75
80
|
* @param str - A hex string to deserialize from.
|
|
76
|
-
* @returns A new
|
|
81
|
+
* @returns A new RootRollupPrivateInputs instance.
|
|
77
82
|
*/
|
|
78
83
|
static fromString(str: string) {
|
|
79
|
-
return
|
|
84
|
+
return RootRollupPrivateInputs.fromBuffer(hexToBuffer(str));
|
|
80
85
|
}
|
|
81
86
|
|
|
82
87
|
/** Returns a representation for JSON serialization. */
|
|
@@ -86,7 +91,7 @@ export class RootRollupInputs {
|
|
|
86
91
|
|
|
87
92
|
/** Creates an instance from a string. */
|
|
88
93
|
static get schema() {
|
|
89
|
-
return bufferSchemaFor(
|
|
94
|
+
return bufferSchemaFor(RootRollupPrivateInputs);
|
|
90
95
|
}
|
|
91
96
|
}
|
|
92
97
|
|
|
@@ -101,13 +106,9 @@ export class RootRollupPublicInputs {
|
|
|
101
106
|
public previousArchiveRoot: Fr,
|
|
102
107
|
/** Root of the archive tree after this rollup is processed */
|
|
103
108
|
public endArchiveRoot: Fr,
|
|
104
|
-
public
|
|
109
|
+
public checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
105
110
|
public fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
106
|
-
public
|
|
107
|
-
public version: Fr,
|
|
108
|
-
public vkTreeRoot: Fr,
|
|
109
|
-
public protocolContractTreeRoot: Fr,
|
|
110
|
-
public proverId: Fr,
|
|
111
|
+
public constants: EpochConstantData,
|
|
111
112
|
public blobPublicInputs: FinalBlobAccumulatorPublicInputs,
|
|
112
113
|
) {}
|
|
113
114
|
|
|
@@ -115,13 +116,9 @@ export class RootRollupPublicInputs {
|
|
|
115
116
|
return [
|
|
116
117
|
fields.previousArchiveRoot,
|
|
117
118
|
fields.endArchiveRoot,
|
|
118
|
-
fields.
|
|
119
|
+
fields.checkpointHeaderHashes,
|
|
119
120
|
fields.fees,
|
|
120
|
-
fields.
|
|
121
|
-
fields.version,
|
|
122
|
-
fields.vkTreeRoot,
|
|
123
|
-
fields.protocolContractTreeRoot,
|
|
124
|
-
fields.proverId,
|
|
121
|
+
fields.constants,
|
|
125
122
|
fields.blobPublicInputs,
|
|
126
123
|
] as const;
|
|
127
124
|
}
|
|
@@ -150,11 +147,7 @@ export class RootRollupPublicInputs {
|
|
|
150
147
|
Fr.fromBuffer(reader),
|
|
151
148
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, Fr),
|
|
152
149
|
reader.readArray(AZTEC_MAX_EPOCH_DURATION, FeeRecipient),
|
|
153
|
-
|
|
154
|
-
Fr.fromBuffer(reader),
|
|
155
|
-
Fr.fromBuffer(reader),
|
|
156
|
-
Fr.fromBuffer(reader),
|
|
157
|
-
Fr.fromBuffer(reader),
|
|
150
|
+
EpochConstantData.fromBuffer(reader),
|
|
158
151
|
reader.readObject(FinalBlobAccumulatorPublicInputs),
|
|
159
152
|
);
|
|
160
153
|
}
|
|
@@ -184,11 +177,7 @@ export class RootRollupPublicInputs {
|
|
|
184
177
|
Fr.random(),
|
|
185
178
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, Fr.random),
|
|
186
179
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, FeeRecipient.random),
|
|
187
|
-
Fr.random(),
|
|
188
|
-
Fr.random(),
|
|
189
|
-
Fr.random(),
|
|
190
|
-
Fr.random(),
|
|
191
|
-
Fr.random(),
|
|
180
|
+
new EpochConstantData(Fr.random(), Fr.random(), Fr.random(), Fr.random(), Fr.random()),
|
|
192
181
|
FinalBlobAccumulatorPublicInputs.random(),
|
|
193
182
|
);
|
|
194
183
|
}
|
package/src/stats/stats.ts
CHANGED
|
@@ -92,11 +92,16 @@ export type ServerCircuitName =
|
|
|
92
92
|
| 'private-base-rollup'
|
|
93
93
|
| 'public-base-rollup'
|
|
94
94
|
| 'merge-rollup'
|
|
95
|
+
| 'block-root-first-rollup'
|
|
96
|
+
| 'block-root-single-tx-first-rollup'
|
|
97
|
+
| 'block-root-empty-tx-first-rollup'
|
|
95
98
|
| 'block-root-rollup'
|
|
96
|
-
| 'single-tx-
|
|
97
|
-
| 'empty-block-root-rollup'
|
|
98
|
-
| 'padding-block-root-rollup'
|
|
99
|
+
| 'block-root-single-tx-rollup'
|
|
99
100
|
| 'block-merge-rollup'
|
|
101
|
+
| 'checkpoint-root-rollup'
|
|
102
|
+
| 'checkpoint-root-single-block-rollup'
|
|
103
|
+
| 'checkpoint-padding-rollup'
|
|
104
|
+
| 'checkpoint-merge-rollup'
|
|
100
105
|
| 'root-rollup'
|
|
101
106
|
| 'avm-circuit';
|
|
102
107
|
|
package/src/tests/factories.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { BlobAccumulatorPublicInputs, FinalBlobAccumulatorPublicInputs } from '@aztec/blob-lib';
|
|
2
|
-
import { makeBatchedBlobAccumulator,
|
|
2
|
+
import { makeBatchedBlobAccumulator, makeSpongeBlob } from '@aztec/blob-lib/testing';
|
|
3
3
|
import {
|
|
4
4
|
ARCHIVE_HEIGHT,
|
|
5
5
|
AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
|
|
6
6
|
AZTEC_MAX_EPOCH_DURATION,
|
|
7
|
-
BLOBS_PER_BLOCK,
|
|
8
7
|
CIVC_PROOF_LENGTH,
|
|
9
8
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
10
|
-
FIELDS_PER_BLOB,
|
|
11
9
|
FIXED_DA_GAS,
|
|
12
10
|
FIXED_L2_GAS,
|
|
13
11
|
GeneratorIndex,
|
|
@@ -27,10 +25,10 @@ import {
|
|
|
27
25
|
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,
|
|
28
26
|
MAX_PRIVATE_LOGS_PER_CALL,
|
|
29
27
|
MAX_PRIVATE_LOGS_PER_TX,
|
|
28
|
+
MAX_PROTOCOL_CONTRACTS,
|
|
30
29
|
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
31
30
|
MAX_PUBLIC_LOGS_PER_TX,
|
|
32
31
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
33
|
-
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
34
32
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
35
33
|
NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH,
|
|
36
34
|
NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH,
|
|
@@ -49,7 +47,7 @@ import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/a
|
|
|
49
47
|
import { compact, padArrayEnd } from '@aztec/foundation/collection';
|
|
50
48
|
import { SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
|
|
51
49
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
52
|
-
import {
|
|
50
|
+
import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
|
|
53
51
|
import type { Bufferable, Serializable, Tuple } from '@aztec/foundation/serialize';
|
|
54
52
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
55
53
|
|
|
@@ -73,6 +71,7 @@ import {
|
|
|
73
71
|
AvmGetLeafValueHint,
|
|
74
72
|
AvmGetPreviousValueIndexHint,
|
|
75
73
|
AvmGetSiblingPathHint,
|
|
74
|
+
AvmProtocolContractAddressHint,
|
|
76
75
|
AvmRevertCheckpointHint,
|
|
77
76
|
AvmSequentialInsertHintNullifierTree,
|
|
78
77
|
AvmSequentialInsertHintPublicDataTree,
|
|
@@ -83,6 +82,7 @@ import { PublicDataHint } from '../avm/public_data_hint.js';
|
|
|
83
82
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
84
83
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
85
84
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
85
|
+
import { L2BlockHeader } from '../block/index.js';
|
|
86
86
|
import {
|
|
87
87
|
type ContractClassPublic,
|
|
88
88
|
type ContractInstanceWithAddress,
|
|
@@ -138,23 +138,22 @@ import { makeRecursiveProof } from '../proofs/recursive_proof.js';
|
|
|
138
138
|
import { AvmProofData } from '../rollup/avm_proof_data.js';
|
|
139
139
|
import { BaseOrMergeRollupPublicInputs } from '../rollup/base_or_merge_rollup_public_inputs.js';
|
|
140
140
|
import { PrivateBaseRollupHints, PublicBaseRollupHints } from '../rollup/base_rollup_hints.js';
|
|
141
|
-
import {
|
|
142
|
-
import {
|
|
141
|
+
import { BlockConstantData } from '../rollup/block_constant_data.js';
|
|
142
|
+
import { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup.js';
|
|
143
|
+
import { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
143
144
|
import {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
BlockRootRollupInputs,
|
|
147
|
-
SingleTxBlockRootRollupInputs,
|
|
145
|
+
BlockRootFirstRollupPrivateInputs,
|
|
146
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
148
147
|
} from '../rollup/block_root_rollup.js';
|
|
149
|
-
import {
|
|
148
|
+
import { CheckpointConstantData } from '../rollup/checkpoint_constant_data.js';
|
|
149
|
+
import { CheckpointHeader } from '../rollup/checkpoint_header.js';
|
|
150
|
+
import { CheckpointRollupPublicInputs, FeeRecipient } from '../rollup/checkpoint_rollup_public_inputs.js';
|
|
150
151
|
import { EpochConstantData } from '../rollup/epoch_constant_data.js';
|
|
151
|
-
import { BlockConstantData } from '../rollup/index.js';
|
|
152
152
|
import { MergeRollupInputs } from '../rollup/merge_rollup.js';
|
|
153
|
-
import { PreviousRollupBlockData } from '../rollup/previous_rollup_block_data.js';
|
|
154
153
|
import { PreviousRollupData } from '../rollup/previous_rollup_data.js';
|
|
155
154
|
import { PrivateBaseRollupInputs } from '../rollup/private_base_rollup_inputs.js';
|
|
156
155
|
import { PublicBaseRollupInputs } from '../rollup/public_base_rollup_inputs.js';
|
|
157
|
-
import {
|
|
156
|
+
import { RootRollupPublicInputs } from '../rollup/root_rollup.js';
|
|
158
157
|
import { PrivateBaseStateDiffHints } from '../rollup/state_diff_hints.js';
|
|
159
158
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
160
159
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
@@ -445,6 +444,7 @@ export function makePrivateToRollupKernelCircuitPublicInputs(
|
|
|
445
444
|
function makeAvmCircuitPublicInputs(seed = 1) {
|
|
446
445
|
return new AvmCircuitPublicInputs(
|
|
447
446
|
makeGlobalVariables(seed),
|
|
447
|
+
fr(seed + 0x100),
|
|
448
448
|
makeTreeSnapshots(seed + 0x10),
|
|
449
449
|
makeGas(seed + 0x20),
|
|
450
450
|
makeGasSettings(),
|
|
@@ -597,7 +597,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
597
597
|
contractClassLogsHashes: makeClaimedLengthArray(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeCountedLogHash, seed + 0xa00),
|
|
598
598
|
startSideEffectCounter: fr(seed + 0x849),
|
|
599
599
|
endSideEffectCounter: fr(seed + 0x850),
|
|
600
|
-
|
|
600
|
+
anchorBlockHeader: makeHeader(seed + 0xd00, undefined),
|
|
601
601
|
txContext: makeTxContext(seed + 0x1400),
|
|
602
602
|
isFeePayer: false,
|
|
603
603
|
});
|
|
@@ -617,11 +617,11 @@ export function makeGlobalVariables(seed = 1, overrides: Partial<FieldsOf<Global
|
|
|
617
617
|
});
|
|
618
618
|
}
|
|
619
619
|
|
|
620
|
-
|
|
620
|
+
function makeGasFees(seed = 1) {
|
|
621
621
|
return new GasFees(seed, seed + 1);
|
|
622
622
|
}
|
|
623
623
|
|
|
624
|
-
|
|
624
|
+
function makeFeeRecipient(seed = 1) {
|
|
625
625
|
return new FeeRecipient(EthAddress.fromField(fr(seed)), fr(seed + 1));
|
|
626
626
|
}
|
|
627
627
|
|
|
@@ -678,9 +678,28 @@ function makeBlockConstantData(seed = 1, globalVariables?: GlobalVariables) {
|
|
|
678
678
|
fr(seed + 0x300),
|
|
679
679
|
fr(seed + 0x400),
|
|
680
680
|
globalVariables ?? makeGlobalVariables(seed + 0x500),
|
|
681
|
+
fr(seed + 0x600),
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function makeCheckpointConstantData(seed = 1) {
|
|
686
|
+
return new CheckpointConstantData(
|
|
687
|
+
fr(seed),
|
|
688
|
+
fr(seed + 1),
|
|
689
|
+
fr(seed + 2),
|
|
690
|
+
fr(seed + 3),
|
|
691
|
+
fr(seed + 4),
|
|
692
|
+
fr(seed + 5),
|
|
693
|
+
makeEthAddress(seed + 6),
|
|
694
|
+
makeAztecAddress(seed + 7),
|
|
695
|
+
makeGasFees(seed + 8),
|
|
681
696
|
);
|
|
682
697
|
}
|
|
683
698
|
|
|
699
|
+
function makeEpochConstantData(seed = 1) {
|
|
700
|
+
return new EpochConstantData(fr(seed), fr(seed + 1), fr(seed + 2), fr(seed + 3), fr(seed + 4));
|
|
701
|
+
}
|
|
702
|
+
|
|
684
703
|
/**
|
|
685
704
|
* Makes arbitrary base or merge rollup circuit public inputs.
|
|
686
705
|
* @param seed - The seed to use for generating the base rollup circuit public inputs.
|
|
@@ -704,30 +723,41 @@ export function makeBaseOrMergeRollupPublicInputs(
|
|
|
704
723
|
);
|
|
705
724
|
}
|
|
706
725
|
|
|
707
|
-
function makeEpochConstantData(seed = 1) {
|
|
708
|
-
return new EpochConstantData(fr(seed), fr(seed + 1), fr(seed + 2));
|
|
709
|
-
}
|
|
710
|
-
|
|
711
726
|
/**
|
|
712
727
|
* Makes arbitrary block merge or block root rollup circuit public inputs.
|
|
713
728
|
* @param seed - The seed to use for generating the block merge or block root rollup circuit public inputs.
|
|
714
729
|
* @param blockNumber - The block number to use for generating the block merge or block root rollup circuit public inputs.
|
|
715
730
|
* @returns A block merge or block root rollup circuit public inputs.
|
|
716
731
|
*/
|
|
717
|
-
export function
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
): BlockRootOrBlockMergePublicInputs {
|
|
721
|
-
return new BlockRootOrBlockMergePublicInputs(
|
|
722
|
-
makeEpochConstantData(seed + 0x100),
|
|
732
|
+
export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
733
|
+
return new BlockRollupPublicInputs(
|
|
734
|
+
makeCheckpointConstantData(seed + 0x100),
|
|
723
735
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
724
736
|
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
737
|
+
makeStateReference(seed + 0x400),
|
|
738
|
+
makeStateReference(seed + 0x500),
|
|
739
|
+
makeSpongeBlob(seed + 0x600),
|
|
740
|
+
makeSpongeBlob(seed + 0x700),
|
|
741
|
+
BigInt(seed + 0x810),
|
|
742
|
+
BigInt(seed + 0x820),
|
|
743
|
+
fr(seed + 0x830),
|
|
744
|
+
fr(seed + 0x840),
|
|
745
|
+
fr(seed + 0x850),
|
|
746
|
+
fr(seed + 0x860),
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
751
|
+
const startBlobAccumulator = makeBatchedBlobAccumulator(seed);
|
|
752
|
+
return new CheckpointRollupPublicInputs(
|
|
753
|
+
makeEpochConstantData(seed),
|
|
754
|
+
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
755
|
+
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
756
|
+
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
729
757
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x700),
|
|
730
|
-
|
|
758
|
+
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(startBlobAccumulator),
|
|
759
|
+
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)),
|
|
760
|
+
startBlobAccumulator.finalBlobChallenges,
|
|
731
761
|
);
|
|
732
762
|
}
|
|
733
763
|
|
|
@@ -751,98 +781,6 @@ export function makePreviousRollupData(
|
|
|
751
781
|
);
|
|
752
782
|
}
|
|
753
783
|
|
|
754
|
-
/**
|
|
755
|
-
* Makes arbitrary previous rollup block data.
|
|
756
|
-
* @param seed - The seed to use for generating the previous rollup block data.
|
|
757
|
-
* @param globalVariables - The global variables to use when generating the previous rollup block data.
|
|
758
|
-
* @returns A previous rollup block data.
|
|
759
|
-
*/
|
|
760
|
-
export function makePreviousRollupBlockData(
|
|
761
|
-
seed = 0,
|
|
762
|
-
globalVariables: GlobalVariables | undefined = undefined,
|
|
763
|
-
): PreviousRollupBlockData {
|
|
764
|
-
return new PreviousRollupBlockData(
|
|
765
|
-
makeBlockRootOrBlockMergeRollupPublicInputs(seed, globalVariables),
|
|
766
|
-
makeRecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>(
|
|
767
|
-
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
768
|
-
seed + 0x50,
|
|
769
|
-
),
|
|
770
|
-
makeVkData(seed + 0x100),
|
|
771
|
-
);
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Makes root rollup inputs.
|
|
776
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
777
|
-
* @param globalVariables - The global variables to use.
|
|
778
|
-
* @returns A root rollup inputs.
|
|
779
|
-
*/
|
|
780
|
-
export function makeRootRollupInputs(seed = 0, globalVariables?: GlobalVariables): RootRollupInputs {
|
|
781
|
-
return new RootRollupInputs([
|
|
782
|
-
makePreviousRollupBlockData(seed, globalVariables),
|
|
783
|
-
makePreviousRollupBlockData(seed + 0x1000, globalVariables),
|
|
784
|
-
]);
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
function makeBlockRootRollupData(seed = 0) {
|
|
788
|
-
return new BlockRootRollupData(
|
|
789
|
-
makeRootParityInput<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH, seed + 0x2000),
|
|
790
|
-
makeTuple(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, fr, 0x2100),
|
|
791
|
-
makeTuple(ARCHIVE_HEIGHT, fr, 0x2200),
|
|
792
|
-
makeTuple(ARCHIVE_HEIGHT, fr, 0x2300),
|
|
793
|
-
makeHeader(seed + 0x2400),
|
|
794
|
-
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 0x2500)),
|
|
795
|
-
makeBatchedBlobAccumulator(seed + 0x2600).finalBlobChallenges,
|
|
796
|
-
fr(seed + 0x2700),
|
|
797
|
-
);
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
function makeBlockRootRollupBlobData(seed = 0) {
|
|
801
|
-
return new BlockRootRollupBlobData(
|
|
802
|
-
makeTuple(FIELDS_PER_BLOB * BLOBS_PER_BLOCK, fr, 0x2500),
|
|
803
|
-
makeTuple(BLOBS_PER_BLOCK, () => BLS12Point.random()),
|
|
804
|
-
fr(seed + 0x2700),
|
|
805
|
-
);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Makes block root rollup inputs.
|
|
810
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
811
|
-
* @param globalVariables - The global variables to use.
|
|
812
|
-
* @returns A block root rollup inputs.
|
|
813
|
-
*/
|
|
814
|
-
export function makeBlockRootRollupInputs(seed = 0, globalVariables?: GlobalVariables): BlockRootRollupInputs {
|
|
815
|
-
return new BlockRootRollupInputs(
|
|
816
|
-
[makePreviousRollupData(seed, globalVariables), makePreviousRollupData(seed + 0x1000, globalVariables)],
|
|
817
|
-
makeBlockRootRollupData(seed + 0x2000),
|
|
818
|
-
makeBlockRootRollupBlobData(seed + 0x4000),
|
|
819
|
-
);
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
export function makeSingleTxBlockRootRollupInputs(seed = 0, globalVariables?: GlobalVariables) {
|
|
823
|
-
return new SingleTxBlockRootRollupInputs(
|
|
824
|
-
[makePreviousRollupData(seed, globalVariables)],
|
|
825
|
-
makeBlockRootRollupData(seed + 0x2000),
|
|
826
|
-
makeBlockRootRollupBlobData(seed + 0x4000),
|
|
827
|
-
);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* Makes empty block root rollup inputs.
|
|
832
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
833
|
-
* @param globalVariables - The global variables to use.
|
|
834
|
-
* @returns A block root rollup inputs.
|
|
835
|
-
*/
|
|
836
|
-
export function makeEmptyBlockRootRollupInputs(
|
|
837
|
-
seed = 0,
|
|
838
|
-
globalVariables?: GlobalVariables,
|
|
839
|
-
): EmptyBlockRootRollupInputs {
|
|
840
|
-
return new EmptyBlockRootRollupInputs(
|
|
841
|
-
makeBlockRootRollupData(seed + 0x1000),
|
|
842
|
-
makeBlockConstantData(0x2500, globalVariables),
|
|
843
|
-
);
|
|
844
|
-
}
|
|
845
|
-
|
|
846
784
|
export function makeRootParityInput<PROOF_LENGTH extends number>(
|
|
847
785
|
proofSize: PROOF_LENGTH,
|
|
848
786
|
seed = 0,
|
|
@@ -889,11 +827,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
889
827
|
fr(seed + 0x200),
|
|
890
828
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
891
829
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
892
|
-
|
|
893
|
-
fr(seed + 0x701),
|
|
894
|
-
fr(seed + 0x702),
|
|
895
|
-
fr(seed + 0x703),
|
|
896
|
-
fr(seed + 0x704),
|
|
830
|
+
makeEpochConstantData(seed + 0x600),
|
|
897
831
|
FinalBlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)),
|
|
898
832
|
);
|
|
899
833
|
}
|
|
@@ -916,8 +850,8 @@ export function makeHeader(
|
|
|
916
850
|
): BlockHeader {
|
|
917
851
|
return BlockHeader.from({
|
|
918
852
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
919
|
-
|
|
920
|
-
|
|
853
|
+
state: makeStateReference(seed + 0x200),
|
|
854
|
+
spongeBlobHash: fr(seed + 0x300),
|
|
921
855
|
globalVariables: makeGlobalVariables((seed += 0x700), {
|
|
922
856
|
...(blockNumber ? { blockNumber } : {}),
|
|
923
857
|
...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
|
|
@@ -928,6 +862,39 @@ export function makeHeader(
|
|
|
928
862
|
});
|
|
929
863
|
}
|
|
930
864
|
|
|
865
|
+
export function makeL2BlockHeader(
|
|
866
|
+
seed = 0,
|
|
867
|
+
blockNumber?: number,
|
|
868
|
+
slotNumber?: number,
|
|
869
|
+
overrides: Partial<FieldsOf<L2BlockHeader>> = {},
|
|
870
|
+
) {
|
|
871
|
+
return new L2BlockHeader(
|
|
872
|
+
makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
873
|
+
overrides?.contentCommitment ?? makeContentCommitment(seed + 0x200),
|
|
874
|
+
overrides?.state ?? makeStateReference(seed + 0x600),
|
|
875
|
+
makeGlobalVariables((seed += 0x700), {
|
|
876
|
+
...(blockNumber ? { blockNumber } : {}),
|
|
877
|
+
...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
|
|
878
|
+
}),
|
|
879
|
+
new Fr(seed + 0x800),
|
|
880
|
+
new Fr(seed + 0x900),
|
|
881
|
+
new Fr(seed + 0xa00),
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export function makeCheckpointHeader(seed = 0) {
|
|
886
|
+
return CheckpointHeader.from({
|
|
887
|
+
lastArchiveRoot: fr(seed + 0x100),
|
|
888
|
+
contentCommitment: makeContentCommitment(seed + 0x200),
|
|
889
|
+
slotNumber: new Fr(seed + 0x300),
|
|
890
|
+
timestamp: BigInt(seed + 0x400),
|
|
891
|
+
coinbase: makeEthAddress(seed + 0x500),
|
|
892
|
+
feeRecipient: makeAztecAddress(seed + 0x600),
|
|
893
|
+
gasFees: makeGasFees(seed + 0x700),
|
|
894
|
+
totalManaUsed: fr(seed + 0x800),
|
|
895
|
+
});
|
|
896
|
+
}
|
|
897
|
+
|
|
931
898
|
/**
|
|
932
899
|
* Makes arbitrary state reference.
|
|
933
900
|
* @param seed - The seed to use for generating the state reference.
|
|
@@ -991,13 +958,36 @@ export function makeMergeRollupInputs(seed = 0): MergeRollupInputs {
|
|
|
991
958
|
return new MergeRollupInputs([makePreviousRollupData(seed), makePreviousRollupData(seed + 0x1000)]);
|
|
992
959
|
}
|
|
993
960
|
|
|
961
|
+
export function makeBlockRootFirstRollupPrivateInputs(seed = 0) {
|
|
962
|
+
return new BlockRootFirstRollupPrivateInputs(
|
|
963
|
+
makeProofData(seed, makeParityPublicInputs),
|
|
964
|
+
[
|
|
965
|
+
makeProofData(seed + 0x1000, makeBaseOrMergeRollupPublicInputs),
|
|
966
|
+
makeProofData(seed + 0x2000, makeBaseOrMergeRollupPublicInputs),
|
|
967
|
+
],
|
|
968
|
+
makeAppendOnlyTreeSnapshot(seed + 0x3000),
|
|
969
|
+
makeSiblingPath(seed + 0x4000, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH),
|
|
970
|
+
makeSiblingPath(seed + 0x5000, ARCHIVE_HEIGHT),
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export function makeBlockRootSingleTxRollupPrivateInputs(seed = 0) {
|
|
975
|
+
return new BlockRootSingleTxRollupPrivateInputs(
|
|
976
|
+
makeProofData(seed + 0x1000, makeBaseOrMergeRollupPublicInputs),
|
|
977
|
+
makeSiblingPath(seed + 0x4000, ARCHIVE_HEIGHT),
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
|
|
994
981
|
/**
|
|
995
982
|
* Makes arbitrary block merge rollup inputs.
|
|
996
983
|
* @param seed - The seed to use for generating the merge rollup inputs.
|
|
997
984
|
* @returns A block merge rollup inputs.
|
|
998
985
|
*/
|
|
999
|
-
export function
|
|
1000
|
-
return new
|
|
986
|
+
export function makeBlockMergeRollupPrivateInputs(seed = 0) {
|
|
987
|
+
return new BlockMergeRollupPrivateInputs([
|
|
988
|
+
makeProofData(seed, makeBlockRollupPublicInputs),
|
|
989
|
+
makeProofData(seed + 0x1000, makeBlockRollupPublicInputs),
|
|
990
|
+
]);
|
|
1001
991
|
}
|
|
1002
992
|
|
|
1003
993
|
/**
|
|
@@ -1131,6 +1121,7 @@ function makePublicBaseRollupHints(seed = 1) {
|
|
|
1131
1121
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x1000),
|
|
1132
1122
|
archiveRootMembershipWitness: makeMembershipWitness(ARCHIVE_HEIGHT, seed + 0x2000),
|
|
1133
1123
|
contractClassLogsFields: makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x3000),
|
|
1124
|
+
proverId: fr(seed + 0x4000),
|
|
1134
1125
|
});
|
|
1135
1126
|
}
|
|
1136
1127
|
|
|
@@ -1498,6 +1489,13 @@ export async function makeAvmTxHint(seed = 0): Promise<AvmTxHint> {
|
|
|
1498
1489
|
);
|
|
1499
1490
|
}
|
|
1500
1491
|
|
|
1492
|
+
export function makeAvmProtocolContractDerivedAddressesHint(seed = 0): AvmProtocolContractAddressHint {
|
|
1493
|
+
return new AvmProtocolContractAddressHint(
|
|
1494
|
+
/*canonicalAddress=*/ new AztecAddress(new Fr(seed + 1)),
|
|
1495
|
+
/*derivedAddress=*/ new AztecAddress(new Fr(seed + 0x1001)),
|
|
1496
|
+
);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1501
1499
|
/**
|
|
1502
1500
|
* Creates arbitrary AvmExecutionHints.
|
|
1503
1501
|
* @param seed - The seed to use for generating the hints.
|
|
@@ -1514,6 +1512,11 @@ export async function makeAvmExecutionHints(
|
|
|
1514
1512
|
const fields = {
|
|
1515
1513
|
globalVariables: makeGlobalVariables(seed + 0x4000),
|
|
1516
1514
|
tx: await makeAvmTxHint(seed + 0x4100),
|
|
1515
|
+
protocolContractDerivedAddresses: makeArray(
|
|
1516
|
+
MAX_PROTOCOL_CONTRACTS,
|
|
1517
|
+
makeAvmProtocolContractDerivedAddressesHint,
|
|
1518
|
+
seed + 0x4600,
|
|
1519
|
+
),
|
|
1517
1520
|
contractInstances: makeArray(baseLength + 2, makeAvmContractInstanceHint, seed + 0x4700),
|
|
1518
1521
|
contractClasses: makeArray(baseLength + 5, makeAvmContractClassHint, seed + 0x4900),
|
|
1519
1522
|
bytecodeCommitments: await makeArrayAsync(baseLength + 5, makeAvmBytecodeCommitmentHint, seed + 0x4900),
|
|
@@ -1547,6 +1550,7 @@ export async function makeAvmExecutionHints(
|
|
|
1547
1550
|
return new AvmExecutionHints(
|
|
1548
1551
|
fields.globalVariables,
|
|
1549
1552
|
fields.tx,
|
|
1553
|
+
fields.protocolContractDerivedAddresses,
|
|
1550
1554
|
fields.contractInstances,
|
|
1551
1555
|
fields.contractClasses,
|
|
1552
1556
|
fields.bytecodeCommitments,
|
|
@@ -1628,7 +1632,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1628
1632
|
feePayer ??= await AztecAddress.random();
|
|
1629
1633
|
|
|
1630
1634
|
const txConstantData = TxConstantData.empty();
|
|
1631
|
-
txConstantData.
|
|
1635
|
+
txConstantData.anchorBlockHeader = header!;
|
|
1632
1636
|
txConstantData.txContext.chainId = chainId;
|
|
1633
1637
|
txConstantData.txContext.version = version;
|
|
1634
1638
|
txConstantData.txContext.gasSettings = gasSettings;
|
package/src/tests/mocks.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
6
6
|
|
|
7
7
|
import type { ContractArtifact } from '../abi/abi.js';
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
|
-
import { CommitteeAttestation, L1PublishedData } from '../block/index.js';
|
|
9
|
+
import { CommitteeAttestation, L1PublishedData, L2BlockHeader } from '../block/index.js';
|
|
10
10
|
import { L2Block } from '../block/l2_block.js';
|
|
11
11
|
import type { CommitteeAttestationsAndSigners } from '../block/proposal/attestations_and_signers.js';
|
|
12
12
|
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
@@ -30,19 +30,12 @@ import { BlockProposal } from '../p2p/block_proposal.js';
|
|
|
30
30
|
import { ConsensusPayload } from '../p2p/consensus_payload.js';
|
|
31
31
|
import { SignatureDomainSeparator, getHashedSignaturePayloadEthSignedMessage } from '../p2p/signature_utils.js';
|
|
32
32
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
33
|
-
import {
|
|
34
|
-
BlockHeader,
|
|
35
|
-
HashedValues,
|
|
36
|
-
PrivateCallExecutionResult,
|
|
37
|
-
PrivateExecutionResult,
|
|
38
|
-
StateReference,
|
|
39
|
-
Tx,
|
|
40
|
-
} from '../tx/index.js';
|
|
33
|
+
import { HashedValues, PrivateCallExecutionResult, PrivateExecutionResult, StateReference, Tx } from '../tx/index.js';
|
|
41
34
|
import { PublicSimulationOutput } from '../tx/public_simulation_output.js';
|
|
42
35
|
import { TxSimulationResult, accumulatePrivateReturnValues } from '../tx/simulated_tx.js';
|
|
43
36
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
44
37
|
import { TxHash } from '../tx/tx_hash.js';
|
|
45
|
-
import { makeGas, makeGlobalVariables,
|
|
38
|
+
import { makeGas, makeGlobalVariables, makeL2BlockHeader, makePublicCallRequest } from './factories.js';
|
|
46
39
|
|
|
47
40
|
export const randomTxHash = (): TxHash => TxHash.random();
|
|
48
41
|
|
|
@@ -248,7 +241,7 @@ export const randomDeployedContract = async () => {
|
|
|
248
241
|
|
|
249
242
|
export interface MakeConsensusPayloadOptions {
|
|
250
243
|
signer?: Secp256k1Signer;
|
|
251
|
-
header?:
|
|
244
|
+
header?: L2BlockHeader;
|
|
252
245
|
archive?: Fr;
|
|
253
246
|
stateReference?: StateReference;
|
|
254
247
|
txHashes?: TxHash[];
|
|
@@ -259,11 +252,11 @@ const makeAndSignConsensusPayload = (
|
|
|
259
252
|
domainSeparator: SignatureDomainSeparator,
|
|
260
253
|
options?: MakeConsensusPayloadOptions,
|
|
261
254
|
) => {
|
|
262
|
-
const header = options?.header ??
|
|
255
|
+
const header = options?.header ?? makeL2BlockHeader(1);
|
|
263
256
|
const { signer = Secp256k1Signer.random(), archive = Fr.random(), stateReference = header.state } = options ?? {};
|
|
264
257
|
|
|
265
258
|
const payload = ConsensusPayload.fromFields({
|
|
266
|
-
header: header.
|
|
259
|
+
header: header.toCheckpointHeader(),
|
|
267
260
|
archive,
|
|
268
261
|
stateReference,
|
|
269
262
|
});
|