Bug report
Description
When configuring an IPC provider in config.toml, the URL parser rejects valid URI formats like ipc:///path/to/socket.ipc, file:///path/to/socket.ipc or /path/to/socket.ipc forcing users to use CLI arguments instead.
Steps to Reproduce
- Create a
config.toml with IPC provider:
....
[chains.N]
shard = "primary"
provider = [
{ label = "archive-N", details = { type = "web3", transport="ipc", url = "ipc:///socket.ipc", features = ["archive","traces"] }},
]
....
-
Run graph-node with config file:
graph-node --config config.toml ...
-
Observe errors:
INFO Creating transport, capabilities: archive, traces,
thread 'tokio-runtime-worker' panicked at /graph-node/chain/ethereum/src/transport.rs:32:14:
Failed to connect to Ethereum IPC: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })
urlnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
: file:///socket.ipc, provider: archive-N
INFO Creating transport, capabilities:
thread 'tokio-runtime-worker' panicked at /graph-node/chain/ethereum/src/transport.rs:32:14:
Failed to connect to Ethereum IPC: Io(Os { code: 2, kind: NotFound, message: "No such file or directory" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
archive, traces, url: ipc:///socket.ipc, provider: archive-N
INFO Reading configuration file `/config.toml`
configuration error: the url `/socket.ipc` for provider archive-N is not a legal URL: relative URL without a base
Expected Behavior
IPC URLs in config.toml should be parsed correctly and the path extracted before being passed to web3::ipc::Ipc::new().
Root Cause
In node/src/chain.rs (line 297): Ipc => Transport::new_ipc(&web3.url).await
The URL is passed directly without extracting the file path. The config parser validates URLs using Url::parse() which requires proper URI format, but the web3 crate's IPC transport expects just a file path.
Mismatch between:
- Config validation: expects valid URI (e.g.,
file:///path)
- IPC transport: expects file path (e.g.,
/path)
Suggested Fix
Strip the URI scheme before passing to Transport::new_ipc():
Ipc => {
// Extract file path from URI
let ipc_path = if let Ok(url) = Url::parse(&web3.url) {
url.path().to_string()
} else {
web3.url.clone()
};
Transport::new_ipc(&ipc_path).await
}
Or accept bare file paths in config validation for IPC transport.
Environment
- Graph Node Version: v0.41.0
- OS: Linux (Docker)
Additional Context
- CLI argument
ETHEREUM_IPC accepts IPC, but is useless, because it cannot be run with config.toml and therefore I am not able to validate if it works.
error: the argument '--config <CONFIG>' cannot be used with '--ethereum-ipc <NETWORK_NAME:[CAPABILITIES]:FILE>'
Same issues
#2356
Relevant log output
IPFS hash
No response
Subgraph name or link to explorer
No response
Some information to help us out
OS information
Linux
Bug report
Description
When configuring an IPC provider in
config.toml, the URL parser rejects valid URI formats likeipc:///path/to/socket.ipc,file:///path/to/socket.ipcor/path/to/socket.ipcforcing users to use CLI arguments instead.Steps to Reproduce
config.tomlwith IPC provider:Run graph-node with config file:
graph-node --config config.toml ...Observe errors:
Expected Behavior
IPC URLs in
config.tomlshould be parsed correctly and the path extracted before being passed toweb3::ipc::Ipc::new().Root Cause
In
node/src/chain.rs (line 297):Ipc => Transport::new_ipc(&web3.url).awaitThe URL is passed directly without extracting the file path. The config parser validates URLs using
Url::parse()which requires proper URI format, but the web3 crate's IPC transport expects just a file path.Mismatch between:
file:///path)/path)Suggested Fix
Strip the URI scheme before passing to
Transport::new_ipc():Or accept bare file paths in config validation for IPC transport.
Environment
Additional Context
ETHEREUM_IPCaccepts IPC, but is useless, because it cannot be run withconfig.tomland therefore I am not able to validate if it works.Same issues
#2356
Relevant log output
IPFS hash
No response
Subgraph name or link to explorer
No response
Some information to help us out
OS information
Linux