feat(fibre): Add TLS support - #996
Merged
Merged
Conversation
citizen-stig
marked this pull request as ready for review
September 1, 2026 07:43
citizen-stig
requested review from
mcrakhman and
renaynay
and removed request for
a team and
renaynay
September 1, 2026 07:43
mcrakhman
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
According to celestia-app fibre/cmd README:
https://github.com/celestiaorg/celestia-app/blob/ea02b6f61c02f296703710cbf0a7ce631ebce174/fibre/cmd/README.md?plain=1#L142
Existing fibre client tries to connect as plaintext.
This PR addresses it
Solution
FibreIoConnectorFibre separates socket creation from the protocol stack through
FibreIoConnector. A connector opens an unauthenticated host:port byte stream implementing Tokio AsyncRead and AsyncWrite; Fibre then applies its authenticated TLS transport and runs HTTP/2 gRPC over it.A non-browser WASM runtime can support Fibre from a downstream crate by implementing
FibreIoConnectorwith its platform socket API, adapting the socket’s readable and writable streams into a boxed FibreIo, and injecting it throughFibreClient::from_endpoint_with_io_connector. JavaScript-backed handles may require a single-thread wrapper to satisfy the connector’s Send bounds.This keeps runtime-specific SDK dependencies out of Lumina while reusing Fibre’s TLS verification and protocol implementation.
Final architecture:
FibreIoConnectoropens a raw bidirectional connection to a validator. It does not handle TLS or gRPC.NativeTcpConnector, which opens a normal TCP socket automatically.BrowserWebSocketConnector. It creates a raw TCP tunnel through a WebSocket relay.FibreIoConnectorin their own crate using their platform socket API.IoConnectorRequired.In short:
Misc
Another reference from celestia-app celestiaorg/celestia-app#7306