-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make max_blobs_per_block a config parameter #6329
base: unstable
Are you sure you want to change the base?
Conversation
8b665b5
to
52bb581
Compare
let (block, blobs_vec) = | ||
generate_rand_block_and_blobs::<E>(ForkName::Deneb, NumBlobs::Random, &mut rng); | ||
let mut blobs: FixedVector<_, <E as EthSpec>::MaxBlobsPerBlock> = FixedVector::default(); | ||
let max_len = spec.max_blobs_per_block(block.epoch()) as usize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The epoch here will be random right?
@@ -214,6 +262,85 @@ where | |||
} | |||
} | |||
|
|||
/// Emulates a SSZ `Vector`. | |||
#[derive(Clone, Debug)] | |||
pub struct RuntimeFixedList<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh we should probably move this to a separate file
@@ -676,7 +676,8 @@ impl<E: EthSpec> ExecutionBlockGenerator<E> { | |||
ForkName::Deneb | ForkName::Electra => { | |||
// get random number between 0 and Max Blobs | |||
let mut rng = self.rng.lock(); | |||
let num_blobs = rng.gen::<usize>() % (E::max_blobs_per_block() + 1); | |||
// TODO(pawan): thread the chainspec value here somehow | |||
let num_blobs = rng.gen::<usize>() % 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let num_blobs = rng.gen::<usize>() % 6; | |
let num_blobs = rng.gen::<usize>() % (6 + 1); |
Issue Addressed
N/A
Proposed Changes
Change
max_blobs_per_block
from a preset value to a config value. This affects a lot of the codebase where we have to use runtime variants of ssz List and Vector.