diff --git a/beacon_node/beacon_chain/src/chain_config.rs b/beacon_node/beacon_chain/src/chain_config.rs index 08f17c6c6b..d6be96afe9 100644 --- a/beacon_node/beacon_chain/src/chain_config.rs +++ b/beacon_node/beacon_chain/src/chain_config.rs @@ -114,6 +114,8 @@ pub struct ChainConfig { /// On Holesky there is a block which is added to this set by default but which can be removed /// by using `--invalid-block-roots ""`. pub invalid_block_roots: HashSet, + /// Disable the getBlobs optimisation to fetch blobs from the EL mempool. + pub disable_get_blobs: bool, } impl Default for ChainConfig { @@ -152,6 +154,7 @@ impl Default for ChainConfig { block_publishing_delay: None, data_column_publishing_delay: None, invalid_block_roots: HashSet::new(), + disable_get_blobs: false, } } } diff --git a/beacon_node/network/src/network_beacon_processor/mod.rs b/beacon_node/network/src/network_beacon_processor/mod.rs index cecb1c66f7..a78fea453e 100644 --- a/beacon_node/network/src/network_beacon_processor/mod.rs +++ b/beacon_node/network/src/network_beacon_processor/mod.rs @@ -751,6 +751,9 @@ impl NetworkBeaconProcessor { block_root: Hash256, publish_blobs: bool, ) { + if self.chain.config.disable_get_blobs { + return; + } let epoch = block.slot().epoch(T::EthSpec::slots_per_epoch()); let custody_columns = self.chain.sampling_columns_for_epoch(epoch); let self_cloned = self.clone(); diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index e58320010f..e57b8cf454 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -909,6 +909,14 @@ pub fn cli_app() -> Command { .action(ArgAction::Set) .display_order(0) ) + .arg( + Arg::new("disable-get-blobs") + .long("disable-get-blobs") + .help("Disables the getBlobs optimisation to fetch blobs from the EL mempool") + .action(ArgAction::SetTrue) + .help_heading(FLAG_HEADER) + .display_order(0) + ) .arg( Arg::new("builder-header-timeout") .long("builder-header-timeout") diff --git a/beacon_node/src/config.rs b/beacon_node/src/config.rs index 1cf56ae043..3ed53b1071 100644 --- a/beacon_node/src/config.rs +++ b/beacon_node/src/config.rs @@ -182,6 +182,10 @@ pub fn get_config( client_config.chain.enable_light_client_server = false; } + if cli_args.get_flag("disable-get-blobs") { + client_config.chain.disable_get_blobs = true; + } + if let Some(sync_tolerance_epochs) = clap_utils::parse_optional(cli_args, "sync-tolerance-epochs")? { diff --git a/book/src/help_bn.md b/book/src/help_bn.md index 475c2e43ad..6af7b93b14 100644 --- a/book/src/help_bn.md +++ b/book/src/help_bn.md @@ -453,6 +453,8 @@ Flags: IP address and port as seen by other peers on the network. This disables this feature, fixing the ENR's IP/PORT to those specified on boot. + --disable-get-blobs + Disables the getBlobs optimisation to fetch blobs from the EL mempool --disable-inbound-rate-limiter Disables the inbound rate limiter (requests received by this node). --disable-light-client-server diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index e064096aec..85db2a51c1 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -2532,6 +2532,25 @@ fn light_client_server_disabled() { }); } +#[test] +fn get_blobs_disabled() { + CommandLineTest::new() + .flag("disable-get-blobs", None) + .run_with_zero_port() + .with_config(|config| { + assert!(config.chain.disable_get_blobs); + }); +} + +#[test] +fn get_blobs_enabled() { + CommandLineTest::new() + .run_with_zero_port() + .with_config(|config| { + assert!(!config.chain.disable_get_blobs); + }); +} + #[test] fn light_client_http_server_disabled() { CommandLineTest::new()