Summary
The consensus CLI allows a complete IPC transport configuration to be combined with --execution-ws-endpoint, even though the WebSocket endpoint is an RPC-only option.
The mixed configuration passes StartCmd::validate(). Later, StartConfig::engine_config() prioritizes IPC and constructs EngineConfig::Ipc, causing the explicitly supplied WebSocket endpoint to be silently ignored.
The CLI should reject this IPC/RPC conflict during startup validation instead of accepting a configuration it cannot fully honor.
Affected files
crates/malachite-cli/src/cmd/start.rs
crates/malachite-app/src/config.rs
The validation gap is in StartCmd::validate() in crates/malachite-cli/src/cmd/start.rs. StartConfig::engine_config() in crates/malachite-app/src/config.rs demonstrates the resulting behavior.
Observed behavior
StartCmd::validate() determines whether IPC options are present with:
let has_ipc_options = self.eth_socket.is_some() || self.execution_socket.is_some();
It determines whether RPC options are present with:
let has_rpc_options = self.eth_rpc_endpoint.is_some()
|| self.execution_endpoint.is_some()
|| self.execution_jwt.is_some();
execution_ws_endpoint is missing from has_rpc_options.
However, the same method explicitly classifies it as part of the RPC transport immediately afterward:
let uses_rpc_transport = self.eth_rpc_endpoint.is_some()
|| self.execution_endpoint.is_some()
|| self.execution_ws_endpoint.is_some()
|| self.execution_jwt.is_some();
This mixed configuration is therefore accepted:
--eth-socket /tmp/reth.ipc
--execution-socket /tmp/reth-auth.ipc
--execution-ws-endpoint ws://localhost:8546
StartConfig::engine_config() checks for a complete IPC configuration first. It consequently selects EngineConfig::Ipc, and execution_ws_endpoint is not included in that configuration.
Expected behavior
Any IPC transport option should conflict with any RPC transport option.
Because --execution-ws-endpoint is documented and handled as RPC-only, it should be included in has_rpc_options. Combining it with IPC options should fail with the existing IPC/RPC conflict error.
The conflict message's RPC option list should also include --execution-ws-endpoint.
Reproduction
The following focused regression test was run against current main:
#[test]
fn validate_err_when_mixing_ipc_and_execution_ws_endpoint() {
let mut cmd = new_start_cmd();
cmd.eth_socket = Some("/tmp/reth.ipc".to_string());
cmd.execution_socket = Some("/tmp/reth-auth.ipc".to_string());
cmd.execution_ws_endpoint = Some(dummy_url());
assert!(
cmd.validate().is_err(),
"--execution-ws-endpoint is an RPC option and must conflict with IPC"
);
}
Command:
cargo +1.94.0 test \
-p arc-node-consensus-cli \
validate_err_when_mixing_ipc_and_execution_ws_endpoint \
-- --nocapture
Result on the pre-fix implementation:
test cmd::start::tests::validate_err_when_mixing_ipc_and_execution_ws_endpoint ... FAILED
The test was executed against commit:
97f8da0dc4faa703fe2d68ca007e40dab2c8a9ef
Root cause
The IPC/RPC conflict detection and RPC transport detection use different option sets.
execution_ws_endpoint is included in uses_rpc_transport but omitted from has_rpc_options. This allows it to be recognized as an RPC transport option without triggering the IPC/RPC conflict check.
Why this matters
Silently accepting and ignoring an explicit CLI argument can mislead operators. An operator may believe the configured WebSocket endpoint is being used for execution-layer events while the node has actually selected IPC and discarded the WebSocket setting.
Failing during validation would expose the configuration mistake immediately and ensure explicitly supplied options are not silently ignored.
Suggested fix
Include execution_ws_endpoint in has_rpc_options:
let has_rpc_options = self.eth_rpc_endpoint.is_some()
|| self.execution_endpoint.is_some()
|| self.execution_ws_endpoint.is_some()
|| self.execution_jwt.is_some();
Also include --execution-ws-endpoint in the existing conflict error's RPC option list.
No transport-selection behavior should need to change.
Potential regression tests
Verify that:
- IPC configuration without RPC options remains valid;
- RPC configuration with
--execution-ws-endpoint remains valid;
- IPC combined with
--execution-ws-endpoint is rejected;
- the returned error identifies the IPC/RPC conflict and lists
--execution-ws-endpoint.
Duplicate check
Open and closed issues and pull requests were searched using:
execution-ws-endpoint
execution_ws_endpoint
execution websocket with eth-socket
Conflicting options detected
IPC and RPC
No prior direct duplicate was found. Issue #294 and PR #295 concern separated-host deprecation wording and do not address mixed IPC/WebSocket validation or the silently ignored endpoint.
Summary
The consensus CLI allows a complete IPC transport configuration to be combined with
--execution-ws-endpoint, even though the WebSocket endpoint is an RPC-only option.The mixed configuration passes
StartCmd::validate(). Later,StartConfig::engine_config()prioritizes IPC and constructsEngineConfig::Ipc, causing the explicitly supplied WebSocket endpoint to be silently ignored.The CLI should reject this IPC/RPC conflict during startup validation instead of accepting a configuration it cannot fully honor.
Affected files
crates/malachite-cli/src/cmd/start.rscrates/malachite-app/src/config.rsThe validation gap is in
StartCmd::validate()incrates/malachite-cli/src/cmd/start.rs.StartConfig::engine_config()incrates/malachite-app/src/config.rsdemonstrates the resulting behavior.Observed behavior
StartCmd::validate()determines whether IPC options are present with:It determines whether RPC options are present with:
execution_ws_endpointis missing fromhas_rpc_options.However, the same method explicitly classifies it as part of the RPC transport immediately afterward:
This mixed configuration is therefore accepted:
StartConfig::engine_config()checks for a complete IPC configuration first. It consequently selectsEngineConfig::Ipc, andexecution_ws_endpointis not included in that configuration.Expected behavior
Any IPC transport option should conflict with any RPC transport option.
Because
--execution-ws-endpointis documented and handled as RPC-only, it should be included inhas_rpc_options. Combining it with IPC options should fail with the existing IPC/RPC conflict error.The conflict message's RPC option list should also include
--execution-ws-endpoint.Reproduction
The following focused regression test was run against current
main:Command:
cargo +1.94.0 test \ -p arc-node-consensus-cli \ validate_err_when_mixing_ipc_and_execution_ws_endpoint \ -- --nocaptureResult on the pre-fix implementation:
The test was executed against commit:
Root cause
The IPC/RPC conflict detection and RPC transport detection use different option sets.
execution_ws_endpointis included inuses_rpc_transportbut omitted fromhas_rpc_options. This allows it to be recognized as an RPC transport option without triggering the IPC/RPC conflict check.Why this matters
Silently accepting and ignoring an explicit CLI argument can mislead operators. An operator may believe the configured WebSocket endpoint is being used for execution-layer events while the node has actually selected IPC and discarded the WebSocket setting.
Failing during validation would expose the configuration mistake immediately and ensure explicitly supplied options are not silently ignored.
Suggested fix
Include
execution_ws_endpointinhas_rpc_options:Also include
--execution-ws-endpointin the existing conflict error's RPC option list.No transport-selection behavior should need to change.
Potential regression tests
Verify that:
--execution-ws-endpointremains valid;--execution-ws-endpointis rejected;--execution-ws-endpoint.Duplicate check
Open and closed issues and pull requests were searched using:
execution-ws-endpointexecution_ws_endpointexecution websocketwitheth-socketConflicting options detectedIPC and RPCNo prior direct duplicate was found. Issue #294 and PR #295 concern separated-host deprecation wording and do not address mixed IPC/WebSocket validation or the silently ignored endpoint.