Fork aware max values in rpc (#6847)

N/A


  In https://github.com/sigp/lighthouse/pull/6329 we changed `max_blobs_per_block` from a preset to a config value.
We weren't using the right value based on fork in that PR. This is a follow up PR to use the fork dependent values.

In the proces, I also updated other places where we weren't using fork dependent values from the ChainSpec.

Note to reviewer: easier to go through by commit
This commit is contained in:
Pawan Dhananjay
2025-01-29 11:42:13 -08:00
committed by GitHub
parent e7ea69647a
commit 4a07c08c4f
16 changed files with 203 additions and 114 deletions

View File

@@ -1,6 +1,6 @@
use lighthouse_network::rpc::methods::BlobsByRootRequest;
use std::sync::Arc;
use types::{blob_sidecar::BlobIdentifier, BlobSidecar, ChainSpec, EthSpec, Hash256};
use types::{blob_sidecar::BlobIdentifier, BlobSidecar, EthSpec, ForkContext, Hash256};
use super::{ActiveRequestItems, LookupVerifyError};
@@ -11,7 +11,7 @@ pub struct BlobsByRootSingleBlockRequest {
}
impl BlobsByRootSingleBlockRequest {
pub fn into_request(self, spec: &ChainSpec) -> BlobsByRootRequest {
pub fn into_request(self, spec: &ForkContext) -> BlobsByRootRequest {
BlobsByRootRequest::new(
self.indices
.into_iter()

View File

@@ -1,7 +1,7 @@
use beacon_chain::get_block_root;
use lighthouse_network::rpc::BlocksByRootRequest;
use std::sync::Arc;
use types::{ChainSpec, EthSpec, Hash256, SignedBeaconBlock};
use types::{EthSpec, ForkContext, Hash256, SignedBeaconBlock};
use super::{ActiveRequestItems, LookupVerifyError};
@@ -9,8 +9,8 @@ use super::{ActiveRequestItems, LookupVerifyError};
pub struct BlocksByRootSingleRequest(pub Hash256);
impl BlocksByRootSingleRequest {
pub fn into_request(self, spec: &ChainSpec) -> BlocksByRootRequest {
BlocksByRootRequest::new(vec![self.0], spec)
pub fn into_request(self, fork_context: &ForkContext) -> BlocksByRootRequest {
BlocksByRootRequest::new(vec![self.0], fork_context)
}
}