Skip to content

fix: extract file path from IPC URI before passing to transport#6443

Open
aayushbaluni wants to merge 1 commit intographprotocol:masterfrom
aayushbaluni:fix/6204-ipc-url-path-extraction
Open

fix: extract file path from IPC URI before passing to transport#6443
aayushbaluni wants to merge 1 commit intographprotocol:masterfrom
aayushbaluni:fix/6204-ipc-url-path-extraction

Conversation

@aayushbaluni
Copy link

Summary

Fixes #6204

When configuring an IPC provider in config.toml with URLs like ipc:///path/to/socket.ipc or file:///path/to/socket.ipc, the URL was passed directly to Transport::new_ipc() which expects a file path. This caused connection failures and panics.

Root cause

The config parser validates URLs using proper URI format, but the web3 crate's IPC transport expects just a file path. The URL string (e.g. ipc:///socket.ipc) was passed through without extracting the path component.

Fix

Extract the path component from the URI when parseable via Url::parse(), otherwise use the raw string for bare paths. This allows both ipc:///path, file:///path, and bare /path formats to work correctly.

Testing

  • IPC URLs in config.toml now correctly extract the file path before connecting
  • Bare paths fall back to the original string when URL parsing fails

Made with Cursor

When configuring IPC provider in config.toml with URLs like ipc:///path/to/socket.ipc
or file:///path/to/socket.ipc, the URL was passed directly to Transport::new_ipc()
which expects a file path. This caused connection failures.

Extract the path component from the URI when parseable, otherwise use the
raw string for bare paths.

Fixes graphprotocol#6204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] IPC URL Parsing Fails with URL Scheme in config.toml

1 participant