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

Tx5Transport Module #75

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Tx5Transport Module #75

wants to merge 16 commits into from

Conversation

neonphog
Copy link
Collaborator

@neonphog neonphog commented Jan 20, 2025

I've ignored the peer_connect_disconnect test due to the following issue: holochain/tx5#119. I think that issue may be a low-ish priority, since we don't yet have any logic that depends on the disconnect events/callbacks.

@neonphog neonphog changed the title wip tx5 integration Tx5Transport Module Jan 22, 2025
@neonphog neonphog marked this pull request as ready for review January 22, 2025 18:13
@neonphog neonphog requested a review from a team January 22, 2025 18:13
@neonphog neonphog linked an issue Jan 22, 2025 that may be closed by this pull request
Copy link
Member

@ThetaSinner ThetaSinner left a comment

Choose a reason for hiding this comment

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

A handful of minor things. This is looking good and the testing looks ace :)

@@ -99,6 +99,10 @@ fn make_mock_transport(
}

#[tokio::test(flavor = "multi_thread")]
#[cfg_attr(
Copy link
Member

Choose a reason for hiding this comment

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

Yeah this is the one thing that's bugging me about K2 at the moment is these flaky tests on Windows. From what I can tell, they are just flaky tests and the code they're testing is fine but I think a good pass over these to make them be more careful with waits would be good @jost-s

They do very occasionally fail elsewhere too. I saw one failure today in maybe 40 test runs. Not bad, but would be good to minimise that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can set all the timeouts to 100 ms. There are no waits that an assertion depends on.

crates/transport_tx5/Cargo.toml Show resolved Hide resolved
crates/transport_tx5/src/lib.rs Outdated Show resolved Hide resolved
crates/transport_tx5/src/lib.rs Show resolved Hide resolved
impl Default for Tx5TransportConfig {
fn default() -> Self {
Self {
server_url: "<wss://your.sbd.url>".into(),
Copy link
Member

Choose a reason for hiding this comment

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

Any other way to express this as a required configuration without providing a dummy default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My hope was to be able to generate a default conductor config with these defaults in there. I feel like we're going to want an example like this in there when we do that. But I'm open to other suggestions.

Copy link
Member

Choose a reason for hiding this comment

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

That's fair, we can enforce this higher up. I'm wondering whether Kitsune2 could reject a configuration that doesn't provide a value for this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For sure there are a couple ways we could do this.

  • since the transport library is created in the "create" function of the top-level kitsune module, if we emit errors in them, holochain will get them when it tries to run the builder function, so we can error right on startup
  • alternately we could add some kind of "validate_config" option to the factory api, so modules could opt-in to that

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, the config callback we have is just dealing with setting defaults right? So it would have to be the creates on the factories that would need to check this. That would work and yes Holochain gets the feedback.

I do quite like the idea of a validate option so that we have a clear place to look for config checking rather than hunting through the create code when instances are created. Oh and that also means we should have some easy to call code when we get to updating config. Yeah I think I like that option more

Copy link
Member

Choose a reason for hiding this comment

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

Probably not a job for this PR then

crates/transport_tx5/src/lib.rs Show resolved Hide resolved
crates/transport_tx5/src/test.rs Outdated Show resolved Hide resolved
crates/transport_tx5/src/test.rs Show resolved Hide resolved
}
}

const S1: SpaceId = SpaceId(id::Id(bytes::Bytes::from_static(b"space1")));
Copy link
Member

Choose a reason for hiding this comment

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

There is now a test space in the test_utils module that could be used here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done: a521810

crates/transport_tx5/src/test.rs Show resolved Hide resolved
ThetaSinner
ThetaSinner previously approved these changes Jan 22, 2025
Copy link
Member

@ThetaSinner ThetaSinner left a comment

Choose a reason for hiding this comment

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

💥 :)

homepage = "https://github.com/holochain/kitsune2"
documentation = "https://docs.rs/kitsune2_transport_tx5"
authors = ["Holochain Core Dev Team <[email protected]>"]
keywords = ["holochain", "holo", "p2p", "dht", "networking"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need the "holo" keyword in here?

@@ -99,6 +99,10 @@ fn make_mock_transport(
}

#[tokio::test(flavor = "multi_thread")]
#[cfg_attr(
Copy link
Contributor

Choose a reason for hiding this comment

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

I can set all the timeouts to 100 ms. There are no waits that an assertion depends on.

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.

[k2] transport module tx5 integration
3 participants