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_REQUEST_BLOCKS runtime-configurable #4811

Closed
michaelsproul opened this issue Oct 6, 2023 · 2 comments
Closed

Make MAX_REQUEST_BLOCKS runtime-configurable #4811

michaelsproul opened this issue Oct 6, 2023 · 2 comments

Comments

@michaelsproul
Copy link
Member

Description

In Deneb, the MAX_REQUEST_BLOCKS became configurable. We are currently using type-level numbers and constants for this on both stable and Deneb:

/// Maximum number of blocks in a single request.
pub type MaxRequestBlocks = U1024;
pub const MAX_REQUEST_BLOCKS: u64 = 1024;

pub type MaxRequestBlocksDeneb = U128;
pub const MAX_REQUEST_BLOCKS_DENEB: u64 = 128;

Ideally we would like to be able to configure this on a per-network basis, which would mean getting rid of the compile-time constants. This might be quite hard to do.

Steps to resolve

Easier option

  • Add max_request_blocks and max_request_blocks_deneb to the chain spec and ensure that the runtime-configured values match the compile-time ones (fail with an invalid config error if not).

Harder option

  • Refactor blocks by root requests to not use compile-time constants.
  • Remove all uses of constants related to MAX_REQUEST_BLOCKS. E.g. this one.
@michaelsproul
Copy link
Member Author

Previous versions of Teku were being pernickety about Lighthouse not including this value on the /eth/v1/config/spec endpoint, but IMO that's their problem (and they've fixed it now).

Keeping this issue and closing #4711.

@michaelsproul
Copy link
Member Author

Accidental duplicate of #4562

@michaelsproul michaelsproul closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant