Skip to content

Commit 13ad1f0

Browse files
6 blobs
1 parent 45e1fad commit 13ad1f0

File tree

7 files changed

+215
-74
lines changed

7 files changed

+215
-74
lines changed

l1-contracts/src/core/libraries/ConstantsGen.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ library Constants {
1818
uint256 internal constant L1_TO_L2_MSG_SUBTREE_HEIGHT = 4;
1919
uint256 internal constant MAX_L2_TO_L1_MSGS_PER_TX = 8;
2020
uint256 internal constant INITIAL_L2_BLOCK_NUM = 1;
21-
uint256 internal constant BLOBS_PER_BLOCK = 3;
21+
uint256 internal constant BLOBS_PER_BLOCK = 6;
2222
uint256 internal constant AZTEC_MAX_EPOCH_DURATION = 48;
2323
uint256 internal constant GENESIS_ARCHIVE_ROOT =
2424
14_298_165_331_316_638_916_453_567_345_577_793_920_283_466_066_305_521_584_041_971_978_819_102_601_406;

l1-contracts/src/core/libraries/rollup/FeeLib.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ uint256 constant MAGIC_CONGESTION_VALUE_DIVISOR = 1e8;
4646
uint256 constant MAGIC_CONGESTION_VALUE_MULTIPLIER = 854_700_854;
4747

4848
uint256 constant BLOB_GAS_PER_BLOB = 2 ** 17;
49-
uint256 constant BLOBS_PER_BLOCK = 3;
49+
uint256 constant BLOBS_PER_BLOCK = 6; // Q: why doesn't this use ConstantsGen.sol::BLOBS_PER_BLOCK?
5050

5151
struct OracleInput {
5252
int256 feeAssetPriceModifier;

noir-projects/noir-protocol-circuits/crates/blob/src/blob_batching.nr

Lines changed: 68 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ mod tests {
164164
],
165165
)
166166
.point;
167-
let kzg_commitments_in =
168-
[kzg_commitment_in, BLSPoint::point_at_infinity(), BLSPoint::point_at_infinity()];
167+
let mut kzg_commitments_in = [BLSPoint::point_at_infinity(); BLOBS_PER_BLOCK];
168+
kzg_commitments_in[0] = kzg_commitment_in;
169169

170170
let final_challenges = FinalBlobBatchingChallenges {
171171
// = z_0
@@ -209,7 +209,7 @@ mod tests {
209209
assert_eq(final_acc.c, blob_commitment.to_compressed_fields());
210210
}
211211

212-
// All hardcoded values in this test are taken from yarn-project/foundation/src/blob/blob_batching.test.ts -> 'should construct and verify a batch of 3 full blobs'
212+
// All hardcoded values in this test are taken from blob_batching.test.ts -> 'should construct and verify a batch of BLOBS_PER_BLOCK full blobs'
213213
#[test]
214214
unconstrained fn test_full_blobs_batched() {
215215
// Fill three blobs completely with different values (to avoid a constant polynomial)
@@ -271,16 +271,61 @@ mod tests {
271271
],
272272
)
273273
.point,
274+
BatchingBlobCommitment::from_limbs(
275+
[
276+
0x2ca633e7524caede7cbdd48c77e87b,
277+
0x89e1dbfa31596d3e2825325d6a7b61,
278+
0x938b99971ea67afa7609024dc180ff,
279+
0x058289,
280+
],
281+
[
282+
0xb30ab66039f62e7a30e0e3c7954db8,
283+
0x67d7efea5253eede78e9df70b85292,
284+
0xe587ea21713d3b9bb963914866523a,
285+
0x0754b1,
286+
],
287+
)
288+
.point,
289+
BatchingBlobCommitment::from_limbs(
290+
[
291+
0xa1779f052e237e1f8d216890439059,
292+
0xbfcfc7bf7f952ee60a5cce2c40ef70,
293+
0x8d5a308f3b6e528ab5ecab0c0dcf73,
294+
0x19c23b,
295+
],
296+
[
297+
0xc7ef27bbee5c316988aa5a63a30c1b,
298+
0xd85499ab4ff0c1a42d118e140d87e9,
299+
0x952bd7c9d15626844798c1b507adac,
300+
0x1314bb,
301+
],
302+
)
303+
.point,
304+
BatchingBlobCommitment::from_limbs(
305+
[
306+
0x6b07c07e983f96a2bd93e86dfd7fb2,
307+
0x6fee66da3e45dabc2c2efd0884c1d0,
308+
0x858a10a8c61e4abaf639f16ff97fcc,
309+
0x08364e,
310+
],
311+
[
312+
0xdb4cc811dbdcc8419671018760cfc6,
313+
0x233cc9a637b358500e44b38811cae3,
314+
0x6660d63680f50c909493ab2937bb9a,
315+
0x087f18,
316+
],
317+
)
318+
.point,
274319
];
275320

276321
let final_challenges = FinalBlobBatchingChallenges {
277322
// - The final z value is injected and checked for correctness in root (see below final_acc)
278-
z: 0x02d6a54e591ada73e5eea35188a02ac87779f4293ea3e7d675fa50ae7ff332ce,
323+
z: 0x1ebbeb7ee3ec7b8ec5c92a8fbdb49e08e70361b72b3c24e6c616b430818ca929,
279324
// - The final gamma value is injected and checked for correctness in root (see below final_acc)
280325
gamma: F::from_limbs([
281-
0x281287a8d44071d216177e06a02327,
282-
0x16571aa3dcfef75c2447c705c6c68a,
283-
0x16f2,
326+
0x3449d892175348e980c1fcfe326de3,
327+
0xa9886ca9c91d2d562c32a663588d5e,
328+
0x0219,
284329
]),
285330
};
286331
// Init. the accumulator
@@ -302,34 +347,34 @@ mod tests {
302347
final_challenges.gamma.__pow(F::from(BLOBS_PER_BLOCK as Field)),
303348
);
304349

305-
// y is a BLS Fr field with value 0x0cd2fd9a46ba70fd7f212d08ec7283024b0b1ff9446b1f78a482fb7443e49b57
350+
// y is a BLS Fr field with value 0x4c31f422cd98d3439b4f6fc957fd2daea1fe6970eacda248498f6e1fd95b451f
306351
let expected_y = F::from_limbs([
307-
0x0b1ff9446b1f78a482fb7443e49b57,
308-
0xfd9a46ba70fd7f212d08ec7283024b,
309-
0x0cd2,
352+
0xfe6970eacda248498f6e1fd95b451f,
353+
0xf422cd98d3439b4f6fc957fd2daea1,
354+
0x4c31,
310355
]);
311356

312357
// C is a BLS point with value:
313-
// x: 0x0f2f5f62cc6c3ab4c1ac1abcb9da9677e12796a76064f68c0d4f659f25a046a6d42616100269935afcb1b98c85d5e93e,
314-
// y: 0x0af1e4abfa449daf65201c2b24507b1058d8ea9bf82ff948a1d01912615c4a8e507160da282e6c41bab917c868923254,
358+
// x: 0x013c359b779fcee152d70f14336175f6b655d9638485d0174d7f8856dd892aa976e494070abe9e42c5ec5507cd46891b,
359+
// y: 0x0aaee553933f7b6683d03c241616524f45471b916f491d1adfce83f32c080ebd4e19f28c14e8f7c87451d436621d2500,
315360
let expected_c = BatchingBlobCommitment::from_limbs(
316361
[
317-
0x2616100269935afcb1b98c85d5e93e,
318-
0x96a76064f68c0d4f659f25a046a6d4,
319-
0x62cc6c3ab4c1ac1abcb9da9677e127,
320-
0x0f2f5f,
362+
0xe494070abe9e42c5ec5507cd46891b,
363+
0xd9638485d0174d7f8856dd892aa976,
364+
0x9b779fcee152d70f14336175f6b655,
365+
0x013c35,
321366
],
322367
[
323-
0x7160da282e6c41bab917c868923254,
324-
0xea9bf82ff948a1d01912615c4a8e50,
325-
0xabfa449daf65201c2b24507b1058d8,
326-
0x0af1e4,
368+
0x19f28c14e8f7c87451d436621d2500,
369+
0x1b916f491d1adfce83f32c080ebd4e,
370+
0x53933f7b6683d03c241616524f4547,
371+
0x0aaee5,
327372
],
328373
);
329374

330-
// blob_commitments_hash is a BN Fr field with value 0x00d2f7bffbc5a9008207a188e348e753087f54557a686efd7f74c90cac52a9a1
375+
// blob_commitments_hash is a BN Fr field
331376
let expected_blob_commitments_hash =
332-
0xd2f7bffbc5a9008207a188e348e753087f54557a686efd7f74c90cac52a9a1;
377+
0x0075c54179e6b1cc44571e6266a24a8bd1b8c145867cb145d9f3bff490951f22;
333378

334379
assert_eq(final_acc.y, expected_y);
335380
assert_eq(final_acc.c, expected_c.to_compressed_fields());

noir-projects/noir-protocol-circuits/crates/rollup-lib/src/block_root/block_root_rollup_inputs.nr

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub(crate) mod tests {
207207
assert_eq(output.blob_public_inputs.end_blob_accumulator.gamma_acc, expected_gamma_acc);
208208
}
209209

210-
// All hardcoded values in this test are taken from yarn-project/foundation/src/blob/blob_batching.test.ts -> 'should construct and verify a batch of 3 full blobs'
210+
// All hardcoded values in this test are taken from yarn-project/foundation/src/blob/blob_batching.test.ts -> 'should construct and verify a batch of BLOBS_PER_BLOCK full blobs'
211211
// These values are also used in blob_batching.nr -> test_full_blobs_batched(), but the below ensures inputs are propagated properly throughout block_root
212212
#[test]
213213
fn correct_blobs_with_non_empty_fields() {
@@ -269,6 +269,51 @@ pub(crate) mod tests {
269269
],
270270
)
271271
.point,
272+
BatchingBlobCommitment::from_limbs(
273+
[
274+
0x2ca633e7524caede7cbdd48c77e87b,
275+
0x89e1dbfa31596d3e2825325d6a7b61,
276+
0x938b99971ea67afa7609024dc180ff,
277+
0x058289,
278+
],
279+
[
280+
0xb30ab66039f62e7a30e0e3c7954db8,
281+
0x67d7efea5253eede78e9df70b85292,
282+
0xe587ea21713d3b9bb963914866523a,
283+
0x0754b1,
284+
],
285+
)
286+
.point,
287+
BatchingBlobCommitment::from_limbs(
288+
[
289+
0xa1779f052e237e1f8d216890439059,
290+
0xbfcfc7bf7f952ee60a5cce2c40ef70,
291+
0x8d5a308f3b6e528ab5ecab0c0dcf73,
292+
0x19c23b,
293+
],
294+
[
295+
0xc7ef27bbee5c316988aa5a63a30c1b,
296+
0xd85499ab4ff0c1a42d118e140d87e9,
297+
0x952bd7c9d15626844798c1b507adac,
298+
0x1314bb,
299+
],
300+
)
301+
.point,
302+
BatchingBlobCommitment::from_limbs(
303+
[
304+
0x6b07c07e983f96a2bd93e86dfd7fb2,
305+
0x6fee66da3e45dabc2c2efd0884c1d0,
306+
0x858a10a8c61e4abaf639f16ff97fcc,
307+
0x08364e,
308+
],
309+
[
310+
0xdb4cc811dbdcc8419671018760cfc6,
311+
0x233cc9a637b358500e44b38811cae3,
312+
0x6660d63680f50c909493ab2937bb9a,
313+
0x087f18,
314+
],
315+
)
316+
.point,
272317
];
273318

274319
let mut builder = TestBuilder::new_with_blobs_fields(blob, []);
@@ -281,38 +326,38 @@ pub(crate) mod tests {
281326
builder.inputs.blob_commitments = kzg_commitments_in;
282327
// - The final z value is injected and checked for correctness in root (see below final_acc)
283328
builder.inputs.final_blob_challenges.z =
284-
0x02d6a54e591ada73e5eea35188a02ac87779f4293ea3e7d675fa50ae7ff332ce;
329+
0x1ebbeb7ee3ec7b8ec5c92a8fbdb49e08e70361b72b3c24e6c616b430818ca929;
285330
// - The final gamma value is injected and checked for correctness in root (see below final_acc)
286331
builder.inputs.final_blob_challenges.gamma = F::from_limbs([
287-
0x281287a8d44071d216177e06a02327,
288-
0x16571aa3dcfef75c2447c705c6c68a,
289-
0x16f2,
332+
0x3449d892175348e980c1fcfe326de3,
333+
0xa9886ca9c91d2d562c32a663588d5e,
334+
0x0219,
290335
]);
291336

292337
let output = builder.execute();
293338
let final_acc = output.blob_public_inputs.end_blob_accumulator;
294339

295340
assert_eq(final_acc.z_acc, builder.inputs.final_blob_challenges.z);
296341

297-
// y is a BLS Fr field with value 0x0cd2fd9a46ba70fd7f212d08ec7283024b0b1ff9446b1f78a482fb7443e49b57
342+
// y is a BLS Fr field with value 0x4c31f422cd98d3439b4f6fc957fd2daea1fe6970eacda248498f6e1fd95b451f
298343
let expected_y_limbs =
299-
[0x0b1ff9446b1f78a482fb7443e49b57, 0xfd9a46ba70fd7f212d08ec7283024b, 0x0cd2];
344+
[0xfe6970eacda248498f6e1fd95b451f, 0xf422cd98d3439b4f6fc957fd2daea1, 0x4c31];
300345

301346
// C is a BLS point with value:
302-
// x: 0x0f2f5f62cc6c3ab4c1ac1abcb9da9677e12796a76064f68c0d4f659f25a046a6d42616100269935afcb1b98c85d5e93e,
303-
// y: 0x0af1e4abfa449daf65201c2b24507b1058d8ea9bf82ff948a1d01912615c4a8e507160da282e6c41bab917c868923254,
347+
// x: 0x013c359b779fcee152d70f14336175f6b655d9638485d0174d7f8856dd892aa976e494070abe9e42c5ec5507cd46891b,
348+
// y: 0x0aaee553933f7b6683d03c241616524f45471b916f491d1adfce83f32c080ebd4e19f28c14e8f7c87451d436621d2500,
304349
let expected_c = BatchingBlobCommitment::from_limbs(
305350
[
306-
0x2616100269935afcb1b98c85d5e93e,
307-
0x96a76064f68c0d4f659f25a046a6d4,
308-
0x62cc6c3ab4c1ac1abcb9da9677e127,
309-
0x0f2f5f,
351+
0xe494070abe9e42c5ec5507cd46891b,
352+
0xd9638485d0174d7f8856dd892aa976,
353+
0x9b779fcee152d70f14336175f6b655,
354+
0x013c35,
310355
],
311356
[
312-
0x7160da282e6c41bab917c868923254,
313-
0xea9bf82ff948a1d01912615c4a8e50,
314-
0xabfa449daf65201c2b24507b1058d8,
315-
0x0af1e4,
357+
0x19f28c14e8f7c87451d436621d2500,
358+
0x1b916f491d1adfce83f32c080ebd4e,
359+
0x53933f7b6683d03c241616524f4547,
360+
0x0aaee5,
316361
],
317362
)
318363
.point;
@@ -324,7 +369,7 @@ pub(crate) mod tests {
324369

325370
// blob_commitments_hash is a BN Fr field with value 0x00d2f7bffbc5a9008207a188e348e753087f54557a686efd7f74c90cac52a9a1
326371
let expected_blob_commitments_hash =
327-
0xd2f7bffbc5a9008207a188e348e753087f54557a686efd7f74c90cac52a9a1;
372+
0x0075c54179e6b1cc44571e6266a24a8bd1b8c145867cb145d9f3bff490951f22;
328373

329374
assert_eq(final_acc.y_acc.get_limbs(), expected_y_limbs);
330375
assert_eq(final_acc.c_acc, expected_c);

noir-projects/noir-protocol-circuits/crates/types/src/constants.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub comptime global PRIVATE_KERNEL_RESET_INDEX: u32 = 20;
133133
pub global FUNCTION_SELECTOR_NUM_BYTES: Field = 4;
134134
pub global INITIAL_L2_BLOCK_NUM: Field = 1;
135135
pub global FIELDS_PER_BLOB: u32 = 4096;
136-
pub global BLOBS_PER_BLOCK: u32 = 3;
136+
pub global BLOBS_PER_BLOCK: u32 = 6;
137137
pub global AZTEC_MAX_EPOCH_DURATION: u32 = 48;
138138
pub global MAX_INCLUDE_BY_TIMESTAMP_DURATION: u64 = 86400; // 1 day
139139
// The genesis values are taken from world_state.test.cpp > WorldStateTest.GetInitialTreeInfoForAllTrees

0 commit comments

Comments
 (0)