-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Trin compilable on Windows #739
Conversation
6404b77
to
7f8e9c4
Compare
7f8e9c4
to
bb9fc39
Compare
_discv5: Arc<Discovery>, | ||
_history_handler: mpsc::UnboundedSender<HistoryJsonRpcRequest>, | ||
) -> anyhow::Result<ServerHandle> { | ||
panic!("Windows doesn't support Unix Domain Sockets IPC, use --web3-transport http") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems Windows support unix domain sockets since 2018: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ and there is a rust crate for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to use that crate. Currently Reth uses tokio UnixStream so we can't use that crate. For tokio to add windows UDS it has to be added to MIO first I made a PR for it tokio-rs/mio#1667 but there is no telling when it will be merged if at all. This is a tokio windows UDS by Microsoft https://github.com/Azure/tokio-uds-windows but it hasn't been updated really in 5 years so it is hard to know if it is even maintained.
If we want we could maintain our own Windows Tokio UDS library I can have that ready by this week, but then we would also need to see if Reth would want to use that.
So yes Windows supports UDS (without pair), but it really isn't supported by any Rust libraries what suit Tokio.
So I think this is the best solution for now and maybe we can talk if maintaining a windows tokio UDS library and working with reth in the future. So my idea was merge this now and see if that is a overhead we would want to support in the future. (Unless we get lucky and get support from the Tokio team, but they seem uninterested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, supporting windows at this stage is not a priority, so I don't think we should maintain our Windows Tokio UDS library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so either, which is why I don't think windows should support RPC via IPC
What was wrong?
fixes Trin so that it can compile to windows
How was it fixed?
add cfg and add a few panics to clearly define what is not supported by windows so it can compile