Make max_blobs_per_block a config parameter (#6329)

* First pass

* Add restrictions to RuntimeVariableList api

* Use empty_uninitialized and fix warnings

* Fix some todos

* Merge branch 'unstable' into max-blobs-preset

* Fix take impl on RuntimeFixedList

* cleanup

* Fix test compilations

* Fix some more tests

* Fix test from unstable

* Merge branch 'unstable' into max-blobs-preset

* Merge remote-tracking branch 'origin/unstable' into max-blobs-preset

* Remove footgun function

* Minor simplifications

* Move from preset to config

* Fix typo

* Revert "Remove footgun function"

This reverts commit de01f923c7.

* Try fixing tests

* Thread through ChainSpec

* Fix release tests

* Move RuntimeFixedVector into module and rename

* Add test

* Remove empty RuntimeVarList awefullness

* Fix tests

* Simplify BlobSidecarListFromRoot

* Merge remote-tracking branch 'origin/unstable' into max-blobs-preset

* Bump quota to account for new target (6)

* Remove clone

* Fix issue from review

* Try to remove ugliness

* Merge branch 'unstable' into max-blobs-preset

* Fix max value

* Fix doctest

* Fix formatting

* Fix max check

* Delete hardcoded max_blobs_per_block in RPC limits

* Merge remote-tracking branch 'origin/unstable' into max-blobs-preset
This commit is contained in:
Pawan Dhananjay
2025-01-10 12:04:58 +05:30
committed by GitHub
parent ecdf2d891f
commit 05727290fb
61 changed files with 655 additions and 335 deletions

View File

@@ -119,6 +119,8 @@ impl TestRig {
.network_globals
.set_sync_state(SyncState::Synced);
let spec = chain.spec.clone();
let rng = XorShiftRng::from_seed([42; 16]);
TestRig {
beacon_processor_rx,
@@ -142,6 +144,7 @@ impl TestRig {
harness,
fork_name,
log,
spec,
}
}
@@ -213,7 +216,7 @@ impl TestRig {
) -> (SignedBeaconBlock<E>, Vec<BlobSidecar<E>>) {
let fork_name = self.fork_name;
let rng = &mut self.rng;
generate_rand_block_and_blobs::<E>(fork_name, num_blobs, rng)
generate_rand_block_and_blobs::<E>(fork_name, num_blobs, rng, &self.spec)
}
fn rand_block_and_data_columns(
@@ -1328,8 +1331,10 @@ impl TestRig {
#[test]
fn stable_rng() {
let spec = types::MainnetEthSpec::default_spec();
let mut rng = XorShiftRng::from_seed([42; 16]);
let (block, _) = generate_rand_block_and_blobs::<E>(ForkName::Base, NumBlobs::None, &mut rng);
let (block, _) =
generate_rand_block_and_blobs::<E>(ForkName::Base, NumBlobs::None, &mut rng, &spec);
assert_eq!(
block.canonical_root(),
Hash256::from_slice(
@@ -2187,8 +2192,8 @@ mod deneb_only {
block_verification_types::{AsBlock, RpcBlock},
data_availability_checker::AvailabilityCheckError,
};
use ssz_types::VariableList;
use std::collections::VecDeque;
use types::RuntimeVariableList;
struct DenebTester {
rig: TestRig,
@@ -2546,12 +2551,15 @@ mod deneb_only {
fn parent_block_unknown_parent(mut self) -> Self {
self.rig.log("parent_block_unknown_parent");
let block = self.unknown_parent_block.take().unwrap();
let max_len = self.rig.spec.max_blobs_per_block(block.epoch()) as usize;
// Now this block is the one we expect requests from
self.block = block.clone();
let block = RpcBlock::new(
Some(block.canonical_root()),
block,
self.unknown_parent_blobs.take().map(VariableList::from),
self.unknown_parent_blobs
.take()
.map(|vec| RuntimeVariableList::from_vec(vec, max_len)),
)
.unwrap();
self.rig.parent_block_processed(