-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
feat: Ephemeral peer channels #5346
Conversation
7f531cb
to
8c2d9b3
Compare
ccd6b37
to
136db10
Compare
a0429e6
to
ddb0eeb
Compare
flake.nix
Outdated
@@ -525,15 +525,25 @@ | |||
}; | |||
}; | |||
|
|||
devShells.default = pkgs.mkShell { | |||
devShells.default = let |
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.
Unrelated changes
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.
same as #5548.
Should vanish when we merge the PR and the merge main.
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.
Let's merge it, but it seems we need to move all the tests from Rust to Python. Current Rust tests only work because of hardcoded relay, and we don't actually want any hardcoded relay, only the one which comes from metadata. iroh.testrun.org is not supported to be running forever.
Also there is still no way to disable it. |
🎉 |
} | ||
|
||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
async fn test_can_reconnect() { |
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.
This test is timing out in #5619 in Rust CI / Rust tests (ubuntu-latest, 1.77.0)
TLDR: Webxdc API to send ephemeral messages with iroh.
Desktop PR: #3741
Documentation PR: #78
Webxdc Hello PR: #59
Webxdc types PR: #6
Android PR: ?
IOS PR: ?
Gossip Tests: https://github.com/Septias/gossip_tests
Mutliplayer Pong: https://github.com/Septias/multiplayer-pong
Supersedes: #5041
TODO
WebXDC Realtime API
See Webxdc specs for more info.
Iroh
DeltaChat wants to use the ephemeral-channel provider Iroh, which attempts to establish direct p2p connections between peers (QUIC), using PlumTree as a gossiping protocol for efficient peer sampling. Iroh falls back to relay nodes when a direct connection can not be established. Even a relayed connection is faster than sending single WebXDC messages via mail.
Implementation
Ephemeral channels should be established lazily, to avoid bootstrapping p2p connectivity when it's not required. By asking application developers to explicitly subscribe to ephemeral messages, we know when this should happen.
In any case, we need a way to agree upon a gossip topic ID among all (future) participants, this topic ID should never be guessable or readable to any outsider.
GossipTopic
message header with a random 32-byte TopicId, securely generated on the initial webxdc sender’s device. This message header is encrypted and sent in the same message as the webxdc application.Testing
The application can be tested using the
sk/ephemeral_peer_channels
branch on the desktop and core. To setup local core on desktop, see here.You then need two accounts that know each other and a testing xdc. One option is gossip test which can be downloaded from this repository. Another option is the multiplayer pong game located here.