Skip to content

Conversation

@AbnerZheng
Copy link
Contributor

Close #2786.

@AbnerZheng
Copy link
Contributor Author

@mattsse PTAL when you available and let me know if I'm heading in the right direction. Thanks!

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, one suggestion re structure

Comment on lines 87 to 91
pub struct Receiver {
inner: FramedRead<tokio::net::unix::OwnedReadHalf, StreamCodec>,
#[cfg(unix)]
inner: FramedRead<OwnedReadHalf, StreamCodec>,
#[cfg(windows)]
inner: FramedRead<Arc<NamedPipeClient>, StreamCodec>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great,

what I would like to do instead is:
convert client into a module with
unix.rs
win.rs

and duplicate the types then client/mod.rs reexports based on windows or UNIX

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mattsse mattsse added C-enhancement New feature or request A-rpc Related to the RPC implementation labels Mar 19, 2024
@AbnerZheng AbnerZheng marked this pull request as ready for review March 19, 2024 15:52
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for taking this on 👑

@AbnerZheng
Copy link
Contributor Author

AbnerZheng commented Mar 19, 2024

@mattsse @onbjerg
There raise some issues when I tried to use cross to build and test.

> cross test --target x86_64-pc-windows-gnu -p reth-ipc 
error[E0432]: unresolved import `winapi::shared::winerror`
 --> /Users/abnerzheng/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parity-tokio-ipc-0.9.0/src/win.rs:1:21
  |
1 | use winapi::shared::winerror::{ERROR_PIPE_BUSY, ERROR_SUCCESS};
  |                     ^^^^^^^^ could not find `winerror` in `shared`

Looks like parity-tokio-ipc can't be compiled in windows anymore and out of maintainence. See paritytech/parity-tokio-ipc#39 and paritytech/parity-tokio-ipc#36

The server side implementation relay on parity-tokio-ipc.

@onbjerg
Copy link
Collaborator

onbjerg commented Mar 19, 2024

I think we only use this for the Endpoint type, we should be able to just roll our own, IIRC we had similar issues in Foundry and ditched this crate? cc @mattsse

@mattsse
Copy link
Collaborator

mattsse commented Mar 19, 2024

yeah this is indeed unmaintained and we should actually switch

Is the cross build issue a problem?
I think we can live with this for now?

@AbnerZheng
Copy link
Contributor Author

AbnerZheng commented Mar 19, 2024

Is the cross build issue a problem?

I think if we try to build ipc crate in windows machine, then it will issue the error.

I think we can live with this for now?

Yes, but then we have to guard the 'server' mod with #[cfg(unix)] as well, because it won't compile in windows system.

@mattsse
Copy link
Collaborator

mattsse commented Mar 19, 2024

I think we should transition to:

https://github.com/kotauskas/interprocess

@AbnerZheng
Copy link
Contributor Author

I think we should transition to:

https://github.com/kotauskas/interprocess

No problem, I will continue the transition in tomorrow.

@AbnerZheng AbnerZheng closed this Mar 25, 2024
@AbnerZheng AbnerZheng deleted the issue-6526 branch March 25, 2024 18:33
@AbnerZheng AbnerZheng restored the issue-6526 branch March 26, 2024 02:20
@AbnerZheng AbnerZheng reopened this Mar 26, 2024
@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Apr 17, 2024
@onbjerg onbjerg removed the S-stale This issue/PR is stale and will close with no further activity label Apr 18, 2024
@onbjerg
Copy link
Collaborator

onbjerg commented Apr 18, 2024

Hey @AbnerZheng! Are you blocked on anything here? Let me know 😊

@AbnerZheng
Copy link
Contributor Author

Let me know 😊

Would take it another try this weekend and will ping you if there are any problem.

@onbjerg onbjerg added the S-blocked This cannot more forward until something else changes label Apr 25, 2024
@AbnerZheng
Copy link
Contributor Author

@onbjerg I have switched to use interprocess v1.2.1, which would unblock this PR.

deny.toml Outdated
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
allow = [
"CC0-1.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onbjerg @mattsse I have to allowed this license because interprocess use a library which is under it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add it under exceptions like the other CC0-1.0 deps we have?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

on_ready.send(Ok(())).ok();

let mut incoming = Monitored::new(incoming, &stop_handle);
let mut connections = FuturesUnordered::new();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jsonrpsee has switch to use FuturesUnordered in PR paritytech/jsonrpsee#1062, which address some issues when upgrading tokio. The PR also removed the need of Incoming, Monitored, which unblock this PR.

@AbnerZheng AbnerZheng requested review from mattsse and onbjerg April 26, 2024 10:15
@onbjerg onbjerg removed the S-blocked This cannot more forward until something else changes label Apr 26, 2024
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prelim look this looks fine to me, ptal @mattsse

please move the license exception into where we have our other CC0 deps

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, ty

but futuresunordered has to go

Comment on lines +227 to +231
// FuturesUnordered won't poll anything until this line but because the
// tasks are spawned (so that they can progress independently)
// then this just makes sure that all tasks are completed before
// returning from this function.
while connections.next().await.is_some() {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unreachable and results in unbounded mem

please check jsonrpsee server loop on main

https://github.com/paritytech/jsonrpsee/blob/master/server/src/server.rs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but would like merge it first, and fire a new PR later today.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay sg, could you please open an issue for this then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#7916
would fire a PR today.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm,
needs followup re fut unordered

@mattsse mattsse added this pull request to the merge queue Apr 26, 2024
Merged via the queue into paradigmxyz:main with commit b6b2cf8 Apr 26, 2024
@AbnerZheng AbnerZheng deleted the issue-6526 branch April 26, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rpc Related to the RPC implementation C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add windows Ipc Client implementation

3 participants