Remove --disable-partial-columns in favour of bool argument to --enable... (#9478)

Similar to https://github.com/sigp/lighthouse/pull/9476, partial columns is a feature expected to become the default soon, so instead of introducing a CLI option that will be removed again soon, consolidate into `--enable-partial-columns` which now takes a boolean argument.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
This commit is contained in:
Daniel Knopik
2026-06-17 02:45:30 +02:00
committed by GitHub
parent 9de2e9e6e1
commit e8472b9d77
4 changed files with 29 additions and 42 deletions

View File

@@ -684,21 +684,13 @@ pub fn cli_app() -> Command {
.arg( .arg(
Arg::new("enable-partial-columns") Arg::new("enable-partial-columns")
.long("enable-partial-columns") .long("enable-partial-columns")
.value_name("BOOLEAN")
.help("Enable partial messages for data columns. This can reduce the amount of \ .help("Enable partial messages for data columns. This can reduce the amount of \
data sent over the network. Enabled by default on Hoodi and Sepolia; use \ data sent over the network. Enabled by default on Hoodi and Sepolia; set to \
--disable-partial-columns to opt out.") \"false\" to opt out.")
.action(ArgAction::SetTrue) .action(ArgAction::Set)
.help_heading(FLAG_HEADER) .num_args(0..=1)
.display_order(0) .default_missing_value("true")
)
.arg(
Arg::new("disable-partial-columns")
.long("disable-partial-columns")
.help("Disable partial messages for data columns. Use this on Hoodi or Sepolia \
to opt out of the default-enabled behavior.")
.action(ArgAction::SetTrue)
.conflicts_with("enable-partial-columns")
.help_heading(FLAG_HEADER)
.display_order(0) .display_order(0)
) )
/* /*

View File

@@ -112,10 +112,8 @@ pub fn get_config<E: EthSpec>(
.config_name .config_name
.as_ref() .as_ref()
.is_some_and(|name| matches!(name.as_str(), "hoodi" | "sepolia")); .is_some_and(|name| matches!(name.as_str(), "hoodi" | "sepolia"));
let user_disable_partial_columns = parse_flag(cli_args, "disable-partial-columns"); let enable_partial_columns = clap_utils::parse_optional(cli_args, "enable-partial-columns")?
let user_enable_partial_columns = parse_flag(cli_args, "enable-partial-columns"); .unwrap_or(default_partial_columns_enabled);
let enable_partial_columns = !user_disable_partial_columns
&& (user_enable_partial_columns || default_partial_columns_enabled);
if enable_partial_columns { if enable_partial_columns {
// Partial messages assume that each subnet maps to exactly one column. // Partial messages assume that each subnet maps to exactly one column.

View File

@@ -88,6 +88,10 @@ Options:
Enables the mplex multiplexer alongside yamux. Yamux is preferred when Enables the mplex multiplexer alongside yamux. Yamux is preferred when
both are available. Enabled by default; set to "false" to disable. both are available. Enabled by default; set to "false" to disable.
[default: true] [default: true]
--enable-partial-columns [<BOOLEAN>]
Enable partial messages for data columns. This can reduce the amount
of data sent over the network. Enabled by default on Hoodi and
Sepolia; set to "false" to opt out.
--enr-address <ADDRESS>... --enr-address <ADDRESS>...
The IP address/ DNS address to broadcast to other peers on how to The IP address/ DNS address to broadcast to other peers on how to
reach this node. If a DNS address is provided, the enr-address is set reach this node. If a DNS address is provided, the enr-address is set
@@ -475,9 +479,6 @@ Flags:
--disable-packet-filter --disable-packet-filter
Disables the discovery packet filter. Useful for testing in smaller Disables the discovery packet filter. Useful for testing in smaller
networks networks
--disable-partial-columns
Disable partial messages for data columns. Use this on Hoodi or
Sepolia to opt out of the default-enabled behavior.
--disable-proposer-reorgs --disable-proposer-reorgs
Do not attempt to reorg late blocks from other validators when Do not attempt to reorg late blocks from other validators when
proposing. proposing.
@@ -493,10 +494,6 @@ Flags:
Sets the local ENR IP address and port to match those set for Sets the local ENR IP address and port to match those set for
lighthouse. Specifically, the IP address will be the value of lighthouse. Specifically, the IP address will be the value of
--listen-address and the UDP port will be --discovery-port. --listen-address and the UDP port will be --discovery-port.
--enable-partial-columns
Enable partial messages for data columns. This can reduce the amount
of data sent over the network. Enabled by default on Hoodi and
Sepolia; use --disable-partial-columns to opt out.
--enable-private-discovery --enable-private-discovery
Lighthouse by default does not discover private IP addresses. Set this Lighthouse by default does not discover private IP addresses. Set this
flag to enable connection attempts to local addresses. flag to enable connection attempts to local addresses.

View File

@@ -2827,7 +2827,7 @@ fn enable_mplex_no_value() {
#[test] #[test]
fn partial_columns() { fn partial_columns() {
CommandLineTest::new() CommandLineTest::new()
.flag("enable-partial-columns", None) .flag("enable-partial-columns", Some("true"))
.run_with_zero_port() .run_with_zero_port()
.with_config(|config| { .with_config(|config| {
assert!(config.network.enable_partial_columns); assert!(config.network.enable_partial_columns);
@@ -2842,6 +2842,18 @@ fn partial_columns() {
}) })
} }
#[test]
fn partial_columns_no_value() {
// Passing the flag without a value should enable partial columns.
CommandLineTest::new()
.flag("enable-partial-columns", None)
.run_with_zero_port()
.with_config(|config| {
assert!(config.network.enable_partial_columns);
assert!(config.chain.enable_partial_columns);
});
}
#[test] #[test]
fn partial_columns_default_hoodi() { fn partial_columns_default_hoodi() {
CommandLineTest::new() CommandLineTest::new()
@@ -2865,10 +2877,10 @@ fn partial_columns_default_sepolia() {
} }
#[test] #[test]
fn partial_columns_disable_overrides_hoodi_default() { fn partial_columns_false_overrides_hoodi_default() {
CommandLineTest::new() CommandLineTest::new()
.flag("network", Some("hoodi")) .flag("network", Some("hoodi"))
.flag("disable-partial-columns", None) .flag("enable-partial-columns", Some("false"))
.run_with_zero_port() .run_with_zero_port()
.with_config(|config| { .with_config(|config| {
assert!(!config.network.enable_partial_columns); assert!(!config.network.enable_partial_columns);
@@ -2877,24 +2889,12 @@ fn partial_columns_disable_overrides_hoodi_default() {
} }
#[test] #[test]
fn partial_columns_disable_on_mainnet_no_op() { fn partial_columns_false_on_mainnet() {
CommandLineTest::new() CommandLineTest::new()
.flag("disable-partial-columns", None) .flag("enable-partial-columns", Some("false"))
.run_with_zero_port() .run_with_zero_port()
.with_config(|config| { .with_config(|config| {
assert!(!config.network.enable_partial_columns); assert!(!config.network.enable_partial_columns);
assert!(!config.chain.enable_partial_columns); assert!(!config.chain.enable_partial_columns);
}); });
} }
#[test]
fn partial_columns_enable_disable_conflict() {
let mut cmd = base_cmd();
cmd.arg("--enable-partial-columns")
.arg("--disable-partial-columns");
let output = cmd.output().expect("should run command");
assert!(
!output.status.success(),
"expected clap to reject --enable-partial-columns and --disable-partial-columns together",
);
}