mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
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:
@@ -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(
|
||||
|
||||
@@ -12,7 +12,7 @@ use slot_clock::ManualSlotClock;
|
||||
use std::sync::Arc;
|
||||
use store::MemoryStore;
|
||||
use tokio::sync::mpsc;
|
||||
use types::{test_utils::XorShiftRng, ForkName, MinimalEthSpec as E};
|
||||
use types::{test_utils::XorShiftRng, ChainSpec, ForkName, MinimalEthSpec as E};
|
||||
|
||||
mod lookups;
|
||||
mod range;
|
||||
@@ -64,4 +64,5 @@ struct TestRig {
|
||||
rng: XorShiftRng,
|
||||
fork_name: ForkName,
|
||||
log: Logger,
|
||||
spec: Arc<ChainSpec>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user