Skip to content
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

Refactor shared mixnet client and tun provider #1731

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

neacsu
Copy link
Collaborator

@neacsu neacsu commented Dec 6, 2024

This change is Reviewable

Copy link
Contributor

@pronebird pronebird left a comment

Choose a reason for hiding this comment

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

Reviewed 37 of 45 files at r1.
Reviewable status: 37 of 45 files reviewed, 4 unresolved discussions (waiting on @doums, @neacsu, @octol, @rokas-ambrazevicius, and @zaneschepke)


nym-vpn-core/crates/nym-mixnet-client/src/lib.rs line 23 at r1 (raw file):

}

impl SharedMixnetClient {

Nit: oh I'd be happy to get rid of this type as it holds Arc<Mutex<>> and does a lot of unwrapping. Personally I'd for channel instead to keep it safe.


nym-vpn-core/crates/nym-mixnet-client/src/lib.rs line 26 at r1 (raw file):

    pub fn new(
        mixnet_client: MixnetClient,
        #[cfg(target_os = "android")] tun_provider: Arc<dyn AndroidTunProvider>,

I think it would be much simpler to pass Fn(RawFd) instead of AndroidTunProvider which should reduce cross-module dependencies.


nym-vpn-core/Cargo.toml line 14 at r1 (raw file):

    "crates/nym-ip-packet-client",
    "crates/nym-mixnet-client",
    "crates/nym-routing", "crates/nym-tunnel-provider",

nit: add newline between crates


nym-vpn-core/crates/nym-vpn-lib/src/tunnel_state_machine/tunnel/mod.rs line 48 at r1 (raw file):

impl ConnectedMixnet {
    /// Returns the websocket fd owned by mixnet client.

Please fix documentation

@neacsu neacsu force-pushed the feature/bypass_reconnect branch from 34997d0 to d92ac25 Compare December 9, 2024 13:36
@neacsu neacsu changed the title Call bypass on mixnet client reconnect Refactor shared mixnet client and tun provider Dec 9, 2024
Copy link
Collaborator Author

@neacsu neacsu left a comment

Choose a reason for hiding this comment

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

Reviewable status: 23 of 45 files reviewed, 3 unresolved discussions (waiting on @doums, @octol, @pronebird, @rokas-ambrazevicius, and @zaneschepke)


nym-vpn-core/crates/nym-mixnet-client/src/lib.rs line 26 at r1 (raw file):

Previously, pronebird (Andrej Mihajlov) wrote…

I think it would be much simpler to pass Fn(RawFd) instead of AndroidTunProvider which should reduce cross-module dependencies.

Did this in the separated PR, thanks for the idea.


nym-vpn-core/crates/nym-vpn-lib/src/tunnel_state_machine/tunnel/mod.rs line 48 at r1 (raw file):

Previously, pronebird (Andrej Mihajlov) wrote…

Please fix documentation

Done.

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.

2 participants