@aztec/stdlib 3.0.0-nightly.20250917 → 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 +6 -0
- package/dest/avm/avm.d.ts.map +1 -1
- 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 +7 -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/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 +170 -61
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +101 -39
- 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/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 +15 -40
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +70 -78
- 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/package.json +8 -8
- 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/block-builder.ts +1 -6
- package/src/interfaces/epoch-prover.ts +34 -10
- package/src/interfaces/proving-job.ts +166 -51
- 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/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 +124 -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/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,
|
|
@@ -31,7 +29,6 @@ import {
|
|
|
31
29
|
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
32
30
|
MAX_PUBLIC_LOGS_PER_TX,
|
|
33
31
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
34
|
-
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
35
32
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
36
33
|
NOTE_HASH_SUBTREE_SIBLING_PATH_LENGTH,
|
|
37
34
|
NULLIFIER_SUBTREE_SIBLING_PATH_LENGTH,
|
|
@@ -50,7 +47,7 @@ import { type FieldsOf, makeHalfFullTuple, makeTuple } from '@aztec/foundation/a
|
|
|
50
47
|
import { compact, padArrayEnd } from '@aztec/foundation/collection';
|
|
51
48
|
import { SchnorrSignature, poseidon2HashWithSeparator, sha256 } from '@aztec/foundation/crypto';
|
|
52
49
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
53
|
-
import {
|
|
50
|
+
import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
|
|
54
51
|
import type { Bufferable, Serializable, Tuple } from '@aztec/foundation/serialize';
|
|
55
52
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
56
53
|
|
|
@@ -85,6 +82,7 @@ import { PublicDataHint } from '../avm/public_data_hint.js';
|
|
|
85
82
|
import { PublicDataRead } from '../avm/public_data_read.js';
|
|
86
83
|
import { PublicDataWrite } from '../avm/public_data_write.js';
|
|
87
84
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
85
|
+
import { L2BlockHeader } from '../block/index.js';
|
|
88
86
|
import {
|
|
89
87
|
type ContractClassPublic,
|
|
90
88
|
type ContractInstanceWithAddress,
|
|
@@ -140,23 +138,22 @@ import { makeRecursiveProof } from '../proofs/recursive_proof.js';
|
|
|
140
138
|
import { AvmProofData } from '../rollup/avm_proof_data.js';
|
|
141
139
|
import { BaseOrMergeRollupPublicInputs } from '../rollup/base_or_merge_rollup_public_inputs.js';
|
|
142
140
|
import { PrivateBaseRollupHints, PublicBaseRollupHints } from '../rollup/base_rollup_hints.js';
|
|
143
|
-
import {
|
|
144
|
-
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';
|
|
145
144
|
import {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
BlockRootRollupInputs,
|
|
149
|
-
SingleTxBlockRootRollupInputs,
|
|
145
|
+
BlockRootFirstRollupPrivateInputs,
|
|
146
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
150
147
|
} from '../rollup/block_root_rollup.js';
|
|
151
|
-
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';
|
|
152
151
|
import { EpochConstantData } from '../rollup/epoch_constant_data.js';
|
|
153
|
-
import { BlockConstantData } from '../rollup/index.js';
|
|
154
152
|
import { MergeRollupInputs } from '../rollup/merge_rollup.js';
|
|
155
|
-
import { PreviousRollupBlockData } from '../rollup/previous_rollup_block_data.js';
|
|
156
153
|
import { PreviousRollupData } from '../rollup/previous_rollup_data.js';
|
|
157
154
|
import { PrivateBaseRollupInputs } from '../rollup/private_base_rollup_inputs.js';
|
|
158
155
|
import { PublicBaseRollupInputs } from '../rollup/public_base_rollup_inputs.js';
|
|
159
|
-
import {
|
|
156
|
+
import { RootRollupPublicInputs } from '../rollup/root_rollup.js';
|
|
160
157
|
import { PrivateBaseStateDiffHints } from '../rollup/state_diff_hints.js';
|
|
161
158
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
162
159
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
@@ -447,6 +444,7 @@ export function makePrivateToRollupKernelCircuitPublicInputs(
|
|
|
447
444
|
function makeAvmCircuitPublicInputs(seed = 1) {
|
|
448
445
|
return new AvmCircuitPublicInputs(
|
|
449
446
|
makeGlobalVariables(seed),
|
|
447
|
+
fr(seed + 0x100),
|
|
450
448
|
makeTreeSnapshots(seed + 0x10),
|
|
451
449
|
makeGas(seed + 0x20),
|
|
452
450
|
makeGasSettings(),
|
|
@@ -599,7 +597,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
599
597
|
contractClassLogsHashes: makeClaimedLengthArray(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeCountedLogHash, seed + 0xa00),
|
|
600
598
|
startSideEffectCounter: fr(seed + 0x849),
|
|
601
599
|
endSideEffectCounter: fr(seed + 0x850),
|
|
602
|
-
|
|
600
|
+
anchorBlockHeader: makeHeader(seed + 0xd00, undefined),
|
|
603
601
|
txContext: makeTxContext(seed + 0x1400),
|
|
604
602
|
isFeePayer: false,
|
|
605
603
|
});
|
|
@@ -619,11 +617,11 @@ export function makeGlobalVariables(seed = 1, overrides: Partial<FieldsOf<Global
|
|
|
619
617
|
});
|
|
620
618
|
}
|
|
621
619
|
|
|
622
|
-
|
|
620
|
+
function makeGasFees(seed = 1) {
|
|
623
621
|
return new GasFees(seed, seed + 1);
|
|
624
622
|
}
|
|
625
623
|
|
|
626
|
-
|
|
624
|
+
function makeFeeRecipient(seed = 1) {
|
|
627
625
|
return new FeeRecipient(EthAddress.fromField(fr(seed)), fr(seed + 1));
|
|
628
626
|
}
|
|
629
627
|
|
|
@@ -680,9 +678,28 @@ function makeBlockConstantData(seed = 1, globalVariables?: GlobalVariables) {
|
|
|
680
678
|
fr(seed + 0x300),
|
|
681
679
|
fr(seed + 0x400),
|
|
682
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),
|
|
683
696
|
);
|
|
684
697
|
}
|
|
685
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
|
+
|
|
686
703
|
/**
|
|
687
704
|
* Makes arbitrary base or merge rollup circuit public inputs.
|
|
688
705
|
* @param seed - The seed to use for generating the base rollup circuit public inputs.
|
|
@@ -706,30 +723,41 @@ export function makeBaseOrMergeRollupPublicInputs(
|
|
|
706
723
|
);
|
|
707
724
|
}
|
|
708
725
|
|
|
709
|
-
function makeEpochConstantData(seed = 1) {
|
|
710
|
-
return new EpochConstantData(fr(seed), fr(seed + 1), fr(seed + 2));
|
|
711
|
-
}
|
|
712
|
-
|
|
713
726
|
/**
|
|
714
727
|
* Makes arbitrary block merge or block root rollup circuit public inputs.
|
|
715
728
|
* @param seed - The seed to use for generating the block merge or block root rollup circuit public inputs.
|
|
716
729
|
* @param blockNumber - The block number to use for generating the block merge or block root rollup circuit public inputs.
|
|
717
730
|
* @returns A block merge or block root rollup circuit public inputs.
|
|
718
731
|
*/
|
|
719
|
-
export function
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
): BlockRootOrBlockMergePublicInputs {
|
|
723
|
-
return new BlockRootOrBlockMergePublicInputs(
|
|
724
|
-
makeEpochConstantData(seed + 0x100),
|
|
732
|
+
export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
733
|
+
return new BlockRollupPublicInputs(
|
|
734
|
+
makeCheckpointConstantData(seed + 0x100),
|
|
725
735
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
726
736
|
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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),
|
|
731
757
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x700),
|
|
732
|
-
|
|
758
|
+
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(startBlobAccumulator),
|
|
759
|
+
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 1)),
|
|
760
|
+
startBlobAccumulator.finalBlobChallenges,
|
|
733
761
|
);
|
|
734
762
|
}
|
|
735
763
|
|
|
@@ -753,98 +781,6 @@ export function makePreviousRollupData(
|
|
|
753
781
|
);
|
|
754
782
|
}
|
|
755
783
|
|
|
756
|
-
/**
|
|
757
|
-
* Makes arbitrary previous rollup block data.
|
|
758
|
-
* @param seed - The seed to use for generating the previous rollup block data.
|
|
759
|
-
* @param globalVariables - The global variables to use when generating the previous rollup block data.
|
|
760
|
-
* @returns A previous rollup block data.
|
|
761
|
-
*/
|
|
762
|
-
export function makePreviousRollupBlockData(
|
|
763
|
-
seed = 0,
|
|
764
|
-
globalVariables: GlobalVariables | undefined = undefined,
|
|
765
|
-
): PreviousRollupBlockData {
|
|
766
|
-
return new PreviousRollupBlockData(
|
|
767
|
-
makeBlockRootOrBlockMergeRollupPublicInputs(seed, globalVariables),
|
|
768
|
-
makeRecursiveProof<typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>(
|
|
769
|
-
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
770
|
-
seed + 0x50,
|
|
771
|
-
),
|
|
772
|
-
makeVkData(seed + 0x100),
|
|
773
|
-
);
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* Makes root rollup inputs.
|
|
778
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
779
|
-
* @param globalVariables - The global variables to use.
|
|
780
|
-
* @returns A root rollup inputs.
|
|
781
|
-
*/
|
|
782
|
-
export function makeRootRollupInputs(seed = 0, globalVariables?: GlobalVariables): RootRollupInputs {
|
|
783
|
-
return new RootRollupInputs([
|
|
784
|
-
makePreviousRollupBlockData(seed, globalVariables),
|
|
785
|
-
makePreviousRollupBlockData(seed + 0x1000, globalVariables),
|
|
786
|
-
]);
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
function makeBlockRootRollupData(seed = 0) {
|
|
790
|
-
return new BlockRootRollupData(
|
|
791
|
-
makeRootParityInput<typeof NESTED_RECURSIVE_PROOF_LENGTH>(NESTED_RECURSIVE_PROOF_LENGTH, seed + 0x2000),
|
|
792
|
-
makeTuple(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, fr, 0x2100),
|
|
793
|
-
makeTuple(ARCHIVE_HEIGHT, fr, 0x2200),
|
|
794
|
-
makeTuple(ARCHIVE_HEIGHT, fr, 0x2300),
|
|
795
|
-
makeHeader(seed + 0x2400),
|
|
796
|
-
BlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed + 0x2500)),
|
|
797
|
-
makeBatchedBlobAccumulator(seed + 0x2600).finalBlobChallenges,
|
|
798
|
-
fr(seed + 0x2700),
|
|
799
|
-
);
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
function makeBlockRootRollupBlobData(seed = 0) {
|
|
803
|
-
return new BlockRootRollupBlobData(
|
|
804
|
-
makeTuple(FIELDS_PER_BLOB * BLOBS_PER_BLOCK, fr, 0x2500),
|
|
805
|
-
makeTuple(BLOBS_PER_BLOCK, () => BLS12Point.random()),
|
|
806
|
-
fr(seed + 0x2700),
|
|
807
|
-
);
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
/**
|
|
811
|
-
* Makes block root rollup inputs.
|
|
812
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
813
|
-
* @param globalVariables - The global variables to use.
|
|
814
|
-
* @returns A block root rollup inputs.
|
|
815
|
-
*/
|
|
816
|
-
export function makeBlockRootRollupInputs(seed = 0, globalVariables?: GlobalVariables): BlockRootRollupInputs {
|
|
817
|
-
return new BlockRootRollupInputs(
|
|
818
|
-
[makePreviousRollupData(seed, globalVariables), makePreviousRollupData(seed + 0x1000, globalVariables)],
|
|
819
|
-
makeBlockRootRollupData(seed + 0x2000),
|
|
820
|
-
makeBlockRootRollupBlobData(seed + 0x4000),
|
|
821
|
-
);
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
export function makeSingleTxBlockRootRollupInputs(seed = 0, globalVariables?: GlobalVariables) {
|
|
825
|
-
return new SingleTxBlockRootRollupInputs(
|
|
826
|
-
[makePreviousRollupData(seed, globalVariables)],
|
|
827
|
-
makeBlockRootRollupData(seed + 0x2000),
|
|
828
|
-
makeBlockRootRollupBlobData(seed + 0x4000),
|
|
829
|
-
);
|
|
830
|
-
}
|
|
831
|
-
|
|
832
|
-
/**
|
|
833
|
-
* Makes empty block root rollup inputs.
|
|
834
|
-
* @param seed - The seed to use for generating the root rollup inputs.
|
|
835
|
-
* @param globalVariables - The global variables to use.
|
|
836
|
-
* @returns A block root rollup inputs.
|
|
837
|
-
*/
|
|
838
|
-
export function makeEmptyBlockRootRollupInputs(
|
|
839
|
-
seed = 0,
|
|
840
|
-
globalVariables?: GlobalVariables,
|
|
841
|
-
): EmptyBlockRootRollupInputs {
|
|
842
|
-
return new EmptyBlockRootRollupInputs(
|
|
843
|
-
makeBlockRootRollupData(seed + 0x1000),
|
|
844
|
-
makeBlockConstantData(0x2500, globalVariables),
|
|
845
|
-
);
|
|
846
|
-
}
|
|
847
|
-
|
|
848
784
|
export function makeRootParityInput<PROOF_LENGTH extends number>(
|
|
849
785
|
proofSize: PROOF_LENGTH,
|
|
850
786
|
seed = 0,
|
|
@@ -891,11 +827,7 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
891
827
|
fr(seed + 0x200),
|
|
892
828
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => fr(seed), 0x300),
|
|
893
829
|
makeTuple(AZTEC_MAX_EPOCH_DURATION, () => makeFeeRecipient(seed), 0x500),
|
|
894
|
-
|
|
895
|
-
fr(seed + 0x701),
|
|
896
|
-
fr(seed + 0x702),
|
|
897
|
-
fr(seed + 0x703),
|
|
898
|
-
fr(seed + 0x704),
|
|
830
|
+
makeEpochConstantData(seed + 0x600),
|
|
899
831
|
FinalBlobAccumulatorPublicInputs.fromBatchedBlobAccumulator(makeBatchedBlobAccumulator(seed)),
|
|
900
832
|
);
|
|
901
833
|
}
|
|
@@ -918,8 +850,8 @@ export function makeHeader(
|
|
|
918
850
|
): BlockHeader {
|
|
919
851
|
return BlockHeader.from({
|
|
920
852
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x100),
|
|
921
|
-
|
|
922
|
-
|
|
853
|
+
state: makeStateReference(seed + 0x200),
|
|
854
|
+
spongeBlobHash: fr(seed + 0x300),
|
|
923
855
|
globalVariables: makeGlobalVariables((seed += 0x700), {
|
|
924
856
|
...(blockNumber ? { blockNumber } : {}),
|
|
925
857
|
...(slotNumber ? { slotNumber: new Fr(slotNumber) } : {}),
|
|
@@ -930,6 +862,39 @@ export function makeHeader(
|
|
|
930
862
|
});
|
|
931
863
|
}
|
|
932
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
|
+
|
|
933
898
|
/**
|
|
934
899
|
* Makes arbitrary state reference.
|
|
935
900
|
* @param seed - The seed to use for generating the state reference.
|
|
@@ -993,13 +958,36 @@ export function makeMergeRollupInputs(seed = 0): MergeRollupInputs {
|
|
|
993
958
|
return new MergeRollupInputs([makePreviousRollupData(seed), makePreviousRollupData(seed + 0x1000)]);
|
|
994
959
|
}
|
|
995
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
|
+
|
|
996
981
|
/**
|
|
997
982
|
* Makes arbitrary block merge rollup inputs.
|
|
998
983
|
* @param seed - The seed to use for generating the merge rollup inputs.
|
|
999
984
|
* @returns A block merge rollup inputs.
|
|
1000
985
|
*/
|
|
1001
|
-
export function
|
|
1002
|
-
return new
|
|
986
|
+
export function makeBlockMergeRollupPrivateInputs(seed = 0) {
|
|
987
|
+
return new BlockMergeRollupPrivateInputs([
|
|
988
|
+
makeProofData(seed, makeBlockRollupPublicInputs),
|
|
989
|
+
makeProofData(seed + 0x1000, makeBlockRollupPublicInputs),
|
|
990
|
+
]);
|
|
1003
991
|
}
|
|
1004
992
|
|
|
1005
993
|
/**
|
|
@@ -1133,6 +1121,7 @@ function makePublicBaseRollupHints(seed = 1) {
|
|
|
1133
1121
|
lastArchive: makeAppendOnlyTreeSnapshot(seed + 0x1000),
|
|
1134
1122
|
archiveRootMembershipWitness: makeMembershipWitness(ARCHIVE_HEIGHT, seed + 0x2000),
|
|
1135
1123
|
contractClassLogsFields: makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, makeContractClassLogFields, seed + 0x3000),
|
|
1124
|
+
proverId: fr(seed + 0x4000),
|
|
1136
1125
|
});
|
|
1137
1126
|
}
|
|
1138
1127
|
|
|
@@ -1643,7 +1632,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1643
1632
|
feePayer ??= await AztecAddress.random();
|
|
1644
1633
|
|
|
1645
1634
|
const txConstantData = TxConstantData.empty();
|
|
1646
|
-
txConstantData.
|
|
1635
|
+
txConstantData.anchorBlockHeader = header!;
|
|
1647
1636
|
txConstantData.txContext.chainId = chainId;
|
|
1648
1637
|
txConstantData.txContext.version = version;
|
|
1649
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
|
});
|