Skip to content
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

Open
wants to merge 10 commits into
base: unstable
Choose a base branch
from

Conversation

pawanjay176
Copy link
Member

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.

@pawanjay176 pawanjay176 marked this pull request as ready for review September 4, 2024 23:19
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;
Copy link
Member

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> {
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let num_blobs = rng.gen::<usize>() % 6;
let num_blobs = rng.gen::<usize>() % (6 + 1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants