@aztec/stdlib 3.0.0-nightly.20251120 → 3.0.0-nightly.20251122
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +5 -6
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +1 -1
- package/dest/block/l2_block_header.d.ts +7 -2
- package/dest/block/l2_block_header.d.ts.map +1 -1
- package/dest/block/l2_block_header.js +17 -10
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +3 -5
- package/dest/interfaces/epoch-prover.d.ts +1 -2
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +6 -6
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +4 -4
- package/dest/messaging/in_hash.d.ts +1 -1
- package/dest/messaging/in_hash.d.ts.map +1 -1
- package/dest/messaging/in_hash.js +3 -10
- package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_membership.js +2 -2
- package/dest/messaging/out_hash.js +2 -2
- package/dest/p2p/block_attestation.d.ts +1 -0
- package/dest/p2p/block_attestation.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.d.ts +1 -0
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/rollup/block_headers_hash.d.ts +4 -0
- package/dest/rollup/block_headers_hash.d.ts.map +1 -0
- package/dest/rollup/block_headers_hash.js +9 -0
- package/dest/rollup/block_rollup_public_inputs.d.ts +12 -0
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +8 -2
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +1 -12
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.js +1 -9
- package/dest/rollup/checkpoint_header.d.ts +6 -1
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +15 -6
- package/dest/rollup/index.d.ts +1 -0
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +1 -0
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +8 -7
- package/dest/tx/tx_effect.d.ts +0 -4
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +1 -4
- package/package.json +8 -8
- package/src/block/l2_block.ts +3 -3
- package/src/block/l2_block_code_to_purge.ts +1 -0
- package/src/block/l2_block_header.ts +16 -3
- package/src/checkpoint/checkpoint.ts +4 -3
- package/src/interfaces/epoch-prover.ts +0 -2
- package/src/kernel/private_circuit_public_inputs.ts +9 -9
- package/src/messaging/in_hash.ts +3 -8
- package/src/messaging/l2_to_l1_membership.ts +2 -2
- package/src/messaging/out_hash.ts +2 -2
- package/src/rollup/block_headers_hash.ts +12 -0
- package/src/rollup/block_rollup_public_inputs.ts +8 -0
- package/src/rollup/block_root_rollup_private_inputs.ts +0 -9
- package/src/rollup/checkpoint_header.ts +14 -0
- package/src/rollup/index.ts +1 -0
- package/src/tests/factories.ts +17 -6
- package/src/tx/tx_effect.ts +0 -4
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
ClaimedLengthArrayFromBuffer,
|
|
36
36
|
ClaimedLengthArrayFromFields,
|
|
37
37
|
} from './claimed_length_array.js';
|
|
38
|
-
import {
|
|
38
|
+
import { ScopedReadRequest } from './hints/read_request.js';
|
|
39
39
|
import { NoteHash } from './note_hash.js';
|
|
40
40
|
import { Nullifier } from './nullifier.js';
|
|
41
41
|
import { CountedPublicCallRequest, PublicCallRequest } from './public_call_request.js';
|
|
@@ -72,11 +72,11 @@ export class PrivateCircuitPublicInputs {
|
|
|
72
72
|
/**
|
|
73
73
|
* Read requests created by the corresponding function call.
|
|
74
74
|
*/
|
|
75
|
-
public noteHashReadRequests: ClaimedLengthArray<
|
|
75
|
+
public noteHashReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,
|
|
76
76
|
/**
|
|
77
77
|
* Nullifier read requests created by the corresponding function call.
|
|
78
78
|
*/
|
|
79
|
-
public nullifierReadRequests: ClaimedLengthArray<
|
|
79
|
+
public nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,
|
|
80
80
|
/**
|
|
81
81
|
* Key validation requests and generators created by the corresponding function call.
|
|
82
82
|
*/
|
|
@@ -169,8 +169,8 @@ export class PrivateCircuitPublicInputs {
|
|
|
169
169
|
reader.readObject(Fr),
|
|
170
170
|
reader.readBoolean(),
|
|
171
171
|
reader.readUInt64(),
|
|
172
|
-
reader.readObject(ClaimedLengthArrayFromBuffer(
|
|
173
|
-
reader.readObject(ClaimedLengthArrayFromBuffer(
|
|
172
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)),
|
|
173
|
+
reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)),
|
|
174
174
|
reader.readObject(
|
|
175
175
|
ClaimedLengthArrayFromBuffer(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
176
176
|
),
|
|
@@ -200,8 +200,8 @@ export class PrivateCircuitPublicInputs {
|
|
|
200
200
|
reader.readField(),
|
|
201
201
|
reader.readBoolean(),
|
|
202
202
|
reader.readU64(),
|
|
203
|
-
reader.readObject(ClaimedLengthArrayFromFields(
|
|
204
|
-
reader.readObject(ClaimedLengthArrayFromFields(
|
|
203
|
+
reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)),
|
|
204
|
+
reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)),
|
|
205
205
|
reader.readObject(
|
|
206
206
|
ClaimedLengthArrayFromFields(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
207
207
|
),
|
|
@@ -234,8 +234,8 @@ export class PrivateCircuitPublicInputs {
|
|
|
234
234
|
Fr.ZERO,
|
|
235
235
|
false,
|
|
236
236
|
0n,
|
|
237
|
-
ClaimedLengthArray.empty(
|
|
238
|
-
ClaimedLengthArray.empty(
|
|
237
|
+
ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL),
|
|
238
|
+
ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL),
|
|
239
239
|
ClaimedLengthArray.empty(KeyValidationRequestAndGenerator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL),
|
|
240
240
|
ClaimedLengthArray.empty(NoteHash, MAX_NOTE_HASHES_PER_CALL),
|
|
241
241
|
ClaimedLengthArray.empty(Nullifier, MAX_NULLIFIERS_PER_CALL),
|
package/src/messaging/in_hash.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
2
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
-
import { sha256Trunc } from '@aztec/foundation/crypto';
|
|
4
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
-
import {
|
|
4
|
+
import { computeBalancedShaRoot } from '@aztec/foundation/trees';
|
|
6
5
|
|
|
7
6
|
/** Computes the inHash for a block's ContentCommitment given its l1 to l2 messages. */
|
|
8
|
-
export
|
|
7
|
+
export function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Fr {
|
|
9
8
|
const l1ToL2Messages = padArrayEnd<Fr, number>(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
10
|
-
|
|
11
|
-
Promise.resolve(sha256Trunc(Buffer.concat([left, right])) as Buffer<ArrayBuffer>);
|
|
12
|
-
const parityHeight = Math.ceil(Math.log2(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
|
|
13
|
-
const parityCalculator = await MerkleTreeCalculator.create(parityHeight, Fr.ZERO.toBuffer(), hasher);
|
|
14
|
-
return new Fr(await parityCalculator.computeTreeRoot(l1ToL2Messages.map(msg => msg.toBuffer())));
|
|
9
|
+
return new Fr(computeBalancedShaRoot(l1ToL2Messages.map(msg => msg.toBuffer())));
|
|
15
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { SiblingPath, UnbalancedMerkleTreeCalculator,
|
|
2
|
+
import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec/foundation/trees';
|
|
3
3
|
|
|
4
4
|
export interface MessageRetrieval {
|
|
5
5
|
getL2ToL1Messages(l2BlockNumber: number): Promise<Fr[][] | undefined>;
|
|
@@ -58,7 +58,7 @@ export function computeL2ToL1MembershipWitnessFromMessagesForAllTxs(
|
|
|
58
58
|
return Fr.fromBuffer(txOutHash);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
const root =
|
|
61
|
+
const root = computeUnbalancedShaRoot(messages.map(msg => msg.toBuffer()));
|
|
62
62
|
return Fr.fromBuffer(root);
|
|
63
63
|
});
|
|
64
64
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { UnbalancedMerkleTreeCalculator,
|
|
2
|
+
import { UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec/foundation/trees';
|
|
3
3
|
|
|
4
4
|
export function computeTxOutHash(messages: Fr[]): Fr {
|
|
5
5
|
if (!messages.length) {
|
|
@@ -7,7 +7,7 @@ export function computeTxOutHash(messages: Fr[]): Fr {
|
|
|
7
7
|
}
|
|
8
8
|
// Tx out hash is the root of the unbalanced merkle tree of all the messages.
|
|
9
9
|
// Zero hashes (which should not happen) are not compressed.
|
|
10
|
-
return Fr.fromBuffer(
|
|
10
|
+
return Fr.fromBuffer(computeUnbalancedShaRoot(messages.map(msg => msg.toBuffer())));
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function computeBlockOutHash(messagesPerBlock: Fr[][]): Fr {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import { computeUnbalancedPoseidonRoot } from '@aztec/foundation/trees';
|
|
3
|
+
|
|
4
|
+
import type { BlockHeader } from '../tx/block_header.js';
|
|
5
|
+
|
|
6
|
+
export async function computeBlockHeadersHash(blockHeaders: BlockHeader[]): Promise<Fr> {
|
|
7
|
+
const blockHeaderHashes = await Promise.all(blockHeaders.map(header => header.hash()));
|
|
8
|
+
// Must match the implementation in merge_block_rollups.nr, with the **wonky** rollup structure
|
|
9
|
+
// (see validate_consecutive_block_rollups.nr > assert_rollups_filled_greedily.nr).
|
|
10
|
+
const blockHeadersHash = await computeUnbalancedPoseidonRoot(blockHeaderHashes.map(hash => hash.toBuffer()));
|
|
11
|
+
return Fr.fromBuffer(blockHeadersHash);
|
|
12
|
+
}
|
|
@@ -50,6 +50,12 @@ export class BlockRollupPublicInputs {
|
|
|
50
50
|
* Timestamp of the last block in this block range.
|
|
51
51
|
*/
|
|
52
52
|
public endTimestamp: UInt64,
|
|
53
|
+
/**
|
|
54
|
+
* Hash of the headers of all blocks in this block range. It will be combined with the `blockHeadersHash` from
|
|
55
|
+
* other blocks in the same checkpoint to form a wonky tree. The root of that tree becomes the final hash stored in
|
|
56
|
+
* the checkpoint header, enabling validation of the blocks included in a checkpoint given their headers.
|
|
57
|
+
*/
|
|
58
|
+
public blockHeadersHash: Fr,
|
|
53
59
|
/**
|
|
54
60
|
* SHA256 hash of l1 to l2 messages.
|
|
55
61
|
*/
|
|
@@ -84,6 +90,7 @@ export class BlockRollupPublicInputs {
|
|
|
84
90
|
Fr.fromBuffer(reader),
|
|
85
91
|
Fr.fromBuffer(reader),
|
|
86
92
|
Fr.fromBuffer(reader),
|
|
93
|
+
Fr.fromBuffer(reader),
|
|
87
94
|
);
|
|
88
95
|
}
|
|
89
96
|
|
|
@@ -98,6 +105,7 @@ export class BlockRollupPublicInputs {
|
|
|
98
105
|
this.endSpongeBlob,
|
|
99
106
|
bigintToUInt64BE(this.startTimestamp),
|
|
100
107
|
bigintToUInt64BE(this.endTimestamp),
|
|
108
|
+
this.blockHeadersHash,
|
|
101
109
|
this.inHash,
|
|
102
110
|
this.outHash,
|
|
103
111
|
this.accumulatedFees,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
1
|
import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH } from '@aztec/constants';
|
|
3
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
@@ -157,11 +156,6 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
157
156
|
* The constants of the checkpoint.
|
|
158
157
|
*/
|
|
159
158
|
public constants: CheckpointConstantData,
|
|
160
|
-
/**
|
|
161
|
-
* The start sponge blob of this block. No data has been absorbed into it yet, since it's the first block. But the
|
|
162
|
-
* number of expected fields must be set to the total number of fields in the entire checkpoint.
|
|
163
|
-
*/
|
|
164
|
-
public startSpongeBlob: SpongeBlob,
|
|
165
159
|
/**
|
|
166
160
|
* The timestamp of this block.
|
|
167
161
|
*/
|
|
@@ -186,7 +180,6 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
186
180
|
fields.previousArchive,
|
|
187
181
|
fields.previousState,
|
|
188
182
|
fields.constants,
|
|
189
|
-
fields.startSpongeBlob,
|
|
190
183
|
fields.timestamp,
|
|
191
184
|
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
192
185
|
fields.newArchiveSiblingPath,
|
|
@@ -199,7 +192,6 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
199
192
|
this.previousArchive,
|
|
200
193
|
this.previousState,
|
|
201
194
|
this.constants,
|
|
202
|
-
this.startSpongeBlob,
|
|
203
195
|
bigintToUInt64BE(this.timestamp),
|
|
204
196
|
this.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
205
197
|
this.newArchiveSiblingPath,
|
|
@@ -213,7 +205,6 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
213
205
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
214
206
|
StateReference.fromBuffer(reader),
|
|
215
207
|
CheckpointConstantData.fromBuffer(reader),
|
|
216
|
-
SpongeBlob.fromBuffer(reader),
|
|
217
208
|
reader.readUInt64(),
|
|
218
209
|
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
219
210
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
@@ -20,6 +20,8 @@ export class CheckpointHeader {
|
|
|
20
20
|
constructor(
|
|
21
21
|
/** Root of the archive tree before this block is added. */
|
|
22
22
|
public lastArchiveRoot: Fr,
|
|
23
|
+
/** Hash of the headers of all blocks in this checkpoint. */
|
|
24
|
+
public blockHeadersHash: Fr,
|
|
23
25
|
/** Content commitment of the L2 block. */
|
|
24
26
|
public contentCommitment: ContentCommitment,
|
|
25
27
|
/** Slot number of the L2 block */
|
|
@@ -40,6 +42,7 @@ export class CheckpointHeader {
|
|
|
40
42
|
return z
|
|
41
43
|
.object({
|
|
42
44
|
lastArchiveRoot: schemas.Fr,
|
|
45
|
+
blockHeadersHash: schemas.Fr,
|
|
43
46
|
contentCommitment: ContentCommitment.schema,
|
|
44
47
|
slotNumber: schemas.Fr,
|
|
45
48
|
timestamp: schemas.BigInt,
|
|
@@ -54,6 +57,7 @@ export class CheckpointHeader {
|
|
|
54
57
|
static getFields(fields: FieldsOf<CheckpointHeader>) {
|
|
55
58
|
return [
|
|
56
59
|
fields.lastArchiveRoot,
|
|
60
|
+
fields.blockHeadersHash,
|
|
57
61
|
fields.contentCommitment,
|
|
58
62
|
fields.slotNumber,
|
|
59
63
|
fields.timestamp,
|
|
@@ -72,6 +76,7 @@ export class CheckpointHeader {
|
|
|
72
76
|
const reader = BufferReader.asReader(buffer);
|
|
73
77
|
|
|
74
78
|
return new CheckpointHeader(
|
|
79
|
+
reader.readObject(Fr),
|
|
75
80
|
reader.readObject(Fr),
|
|
76
81
|
reader.readObject(ContentCommitment),
|
|
77
82
|
Fr.fromBuffer(reader),
|
|
@@ -86,6 +91,7 @@ export class CheckpointHeader {
|
|
|
86
91
|
equals(other: CheckpointHeader) {
|
|
87
92
|
return (
|
|
88
93
|
this.lastArchiveRoot.equals(other.lastArchiveRoot) &&
|
|
94
|
+
this.blockHeadersHash.equals(other.blockHeadersHash) &&
|
|
89
95
|
this.contentCommitment.equals(other.contentCommitment) &&
|
|
90
96
|
this.slotNumber.equals(other.slotNumber) &&
|
|
91
97
|
this.timestamp === other.timestamp &&
|
|
@@ -100,6 +106,7 @@ export class CheckpointHeader {
|
|
|
100
106
|
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
101
107
|
return serializeToBuffer([
|
|
102
108
|
this.lastArchiveRoot,
|
|
109
|
+
this.blockHeadersHash,
|
|
103
110
|
this.contentCommitment,
|
|
104
111
|
this.slotNumber,
|
|
105
112
|
bigintToUInt64BE(this.timestamp),
|
|
@@ -117,6 +124,7 @@ export class CheckpointHeader {
|
|
|
117
124
|
static empty(fields: Partial<FieldsOf<CheckpointHeader>> = {}) {
|
|
118
125
|
return CheckpointHeader.from({
|
|
119
126
|
lastArchiveRoot: Fr.ZERO,
|
|
127
|
+
blockHeadersHash: Fr.ZERO,
|
|
120
128
|
contentCommitment: ContentCommitment.empty(),
|
|
121
129
|
slotNumber: Fr.ZERO,
|
|
122
130
|
timestamp: 0n,
|
|
@@ -130,6 +138,7 @@ export class CheckpointHeader {
|
|
|
130
138
|
|
|
131
139
|
static random(): CheckpointHeader {
|
|
132
140
|
return new CheckpointHeader(
|
|
141
|
+
Fr.random(),
|
|
133
142
|
Fr.random(),
|
|
134
143
|
ContentCommitment.random(),
|
|
135
144
|
new Fr(BigInt(Math.floor(Math.random() * 1000) + 1)),
|
|
@@ -144,6 +153,7 @@ export class CheckpointHeader {
|
|
|
144
153
|
isEmpty(): boolean {
|
|
145
154
|
return (
|
|
146
155
|
this.lastArchiveRoot.isZero() &&
|
|
156
|
+
this.blockHeadersHash.isZero() &&
|
|
147
157
|
this.contentCommitment.isEmpty() &&
|
|
148
158
|
this.slotNumber.isZero() &&
|
|
149
159
|
this.timestamp === 0n &&
|
|
@@ -169,6 +179,7 @@ export class CheckpointHeader {
|
|
|
169
179
|
static fromViem(header: ViemHeader) {
|
|
170
180
|
return new CheckpointHeader(
|
|
171
181
|
Fr.fromString(header.lastArchiveRoot),
|
|
182
|
+
Fr.fromString(header.blockHeadersHash),
|
|
172
183
|
ContentCommitment.fromViem(header.contentCommitment),
|
|
173
184
|
new Fr(header.slotNumber),
|
|
174
185
|
header.timestamp,
|
|
@@ -182,6 +193,7 @@ export class CheckpointHeader {
|
|
|
182
193
|
toViem(): ViemHeader {
|
|
183
194
|
return {
|
|
184
195
|
lastArchiveRoot: this.lastArchiveRoot.toString(),
|
|
196
|
+
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
185
197
|
contentCommitment: this.contentCommitment.toViem(),
|
|
186
198
|
slotNumber: this.slotNumber.toBigInt(),
|
|
187
199
|
timestamp: this.timestamp,
|
|
@@ -198,6 +210,7 @@ export class CheckpointHeader {
|
|
|
198
210
|
toInspect() {
|
|
199
211
|
return {
|
|
200
212
|
lastArchive: this.lastArchiveRoot.toString(),
|
|
213
|
+
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
201
214
|
contentCommitment: this.contentCommitment.toInspect(),
|
|
202
215
|
slotNumber: this.slotNumber.toBigInt(),
|
|
203
216
|
timestamp: this.timestamp,
|
|
@@ -212,6 +225,7 @@ export class CheckpointHeader {
|
|
|
212
225
|
const gasfees = `da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas}`;
|
|
213
226
|
return `Header {
|
|
214
227
|
lastArchiveRoot: ${this.lastArchiveRoot.toString()},
|
|
228
|
+
blockHeadersHash: ${this.blockHeadersHash.toString()},
|
|
215
229
|
contentCommitment: ${inspect(this.contentCommitment)},
|
|
216
230
|
slotNumber: ${this.slotNumber.toBigInt()},
|
|
217
231
|
timestamp: ${this.timestamp},
|
package/src/rollup/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './avm_proof_data.js';
|
|
2
2
|
export * from './base_rollup_hints.js';
|
|
3
3
|
export * from './block_constant_data.js';
|
|
4
|
+
export * from './block_headers_hash.js';
|
|
4
5
|
export * from './block_merge_rollup_private_inputs.js';
|
|
5
6
|
export * from './block_rollup_public_inputs.js';
|
|
6
7
|
export * from './block_root_rollup_private_inputs.js';
|
package/src/tests/factories.ts
CHANGED
|
@@ -93,7 +93,7 @@ import { Gas, GasFees, GasSettings } from '../gas/index.js';
|
|
|
93
93
|
import { computeCalldataHash } from '../hash/hash.js';
|
|
94
94
|
import { KeyValidationRequest } from '../kernel/hints/key_validation_request.js';
|
|
95
95
|
import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
|
|
96
|
-
import { ReadRequest } from '../kernel/hints/read_request.js';
|
|
96
|
+
import { ReadRequest, ScopedReadRequest } from '../kernel/hints/read_request.js';
|
|
97
97
|
import {
|
|
98
98
|
ClaimedLengthArray,
|
|
99
99
|
PartialPrivateTailPublicInputsForPublic,
|
|
@@ -234,8 +234,8 @@ export function makeSelector(seed: number): FunctionSelector {
|
|
|
234
234
|
return new FunctionSelector(seed);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
function
|
|
238
|
-
return new ReadRequest(new Fr(BigInt(n)), n + 1);
|
|
237
|
+
function makeScopedReadRequest(n: number): ScopedReadRequest {
|
|
238
|
+
return new ScopedReadRequest(new ReadRequest(new Fr(BigInt(n)), n + 1), makeAztecAddress(n + 2));
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
@@ -642,8 +642,16 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn
|
|
|
642
642
|
argsHash: fr(seed + 0x100),
|
|
643
643
|
returnsHash: fr(seed + 0x200),
|
|
644
644
|
minRevertibleSideEffectCounter: fr(0),
|
|
645
|
-
noteHashReadRequests: makeClaimedLengthArray(
|
|
646
|
-
|
|
645
|
+
noteHashReadRequests: makeClaimedLengthArray(
|
|
646
|
+
MAX_NOTE_HASH_READ_REQUESTS_PER_CALL,
|
|
647
|
+
makeScopedReadRequest,
|
|
648
|
+
seed + 0x300,
|
|
649
|
+
),
|
|
650
|
+
nullifierReadRequests: makeClaimedLengthArray(
|
|
651
|
+
MAX_NULLIFIER_READ_REQUESTS_PER_CALL,
|
|
652
|
+
makeScopedReadRequest,
|
|
653
|
+
seed + 0x310,
|
|
654
|
+
),
|
|
647
655
|
keyValidationRequestsAndGenerators: makeClaimedLengthArray(
|
|
648
656
|
MAX_KEY_VALIDATION_REQUESTS_PER_CALL,
|
|
649
657
|
makeKeyValidationRequestAndGenerators,
|
|
@@ -806,8 +814,9 @@ export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
|
806
814
|
makeStateReference(seed + 0x500),
|
|
807
815
|
makeSpongeBlob(seed + 0x600),
|
|
808
816
|
makeSpongeBlob(seed + 0x700),
|
|
817
|
+
BigInt(seed + 0x800),
|
|
809
818
|
BigInt(seed + 0x810),
|
|
810
|
-
|
|
819
|
+
fr(seed + 0x820),
|
|
811
820
|
fr(seed + 0x830),
|
|
812
821
|
fr(seed + 0x840),
|
|
813
822
|
fr(seed + 0x850),
|
|
@@ -911,12 +920,14 @@ export function makeL2BlockHeader(
|
|
|
911
920
|
new Fr(seed + 0x800),
|
|
912
921
|
new Fr(seed + 0x900),
|
|
913
922
|
new Fr(seed + 0xa00),
|
|
923
|
+
new Fr(seed + 0xb00),
|
|
914
924
|
);
|
|
915
925
|
}
|
|
916
926
|
|
|
917
927
|
export function makeCheckpointHeader(seed = 0) {
|
|
918
928
|
return CheckpointHeader.from({
|
|
919
929
|
lastArchiveRoot: fr(seed + 0x100),
|
|
930
|
+
blockHeadersHash: fr(seed + 0x150),
|
|
920
931
|
contentCommitment: makeContentCommitment(seed + 0x200),
|
|
921
932
|
slotNumber: new Fr(seed + 0x300),
|
|
922
933
|
timestamp: BigInt(seed + 0x400),
|
package/src/tx/tx_effect.ts
CHANGED
|
@@ -265,10 +265,6 @@ export class TxEffect {
|
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
/**
|
|
269
|
-
* Returns a flat packed array of fields of all tx effects, to be appended to blobs.
|
|
270
|
-
* Must match the implementation in noir-protocol-circuits/crates/rollup-lib/src/tx_base/components/tx_blob_data.nr
|
|
271
|
-
*/
|
|
272
268
|
toTxBlobData(): TxBlobData {
|
|
273
269
|
return {
|
|
274
270
|
txStartMarker: this.getTxStartMarker(),
|