From ac324d62cd41aa45bf96165e576452e0ad28d0f2 Mon Sep 17 00:00:00 2001 From: Ayush Baluni <73417844+aayushbaluni@users.noreply.github.com> Date: Wed, 18 Mar 2026 20:04:43 +0530 Subject: [PATCH] fix: extract file path from IPC URL in Transport::new_ipc --- chain/ethereum/src/transport.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/chain/ethereum/src/transport.rs b/chain/ethereum/src/transport.rs index 0929dda9d1c..ea5d63bc83b 100644 --- a/chain/ethereum/src/transport.rs +++ b/chain/ethereum/src/transport.rs @@ -42,9 +42,17 @@ pub enum Transport { impl Transport { /// Creates an IPC transport. + /// + /// Accepts both a raw file path (`/tmp/geth.ipc`) and an `ipc://` URL + /// (`ipc:///tmp/geth.ipc`). When a URL is provided the file path is + /// extracted so that the underlying IPC connector receives a plain path. #[cfg(unix)] pub async fn new_ipc(ipc: &str) -> Self { - let transport = IpcConnect::new(ipc.to_string()); + let path = Url::parse(ipc) + .ok() + .map(|u| u.path().to_string()) + .unwrap_or_else(|| ipc.to_string()); + let transport = IpcConnect::new(path); Transport::IPC(transport) }