-
Notifications
You must be signed in to change notification settings - Fork 63
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(lightning): Add Lightning as transport #85
Open
mariocynicys
wants to merge
14
commits into
talaia-labs:master
Choose a base branch
from
mariocynicys:lightning-msgs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Feb 6, 2023
-
feat(lightning): add tower messages
Add message (de)serilaization to teos-common This commit adds lightning messages and message (de)serialization using helper local modules (ser_utils, ser_macros) and LDK v0.0.108 instead of the attempted fork used before (https://github.com/meryacine/rust-lightning/tree/expose-tlv-macros) Most of the serialization macros and utils are copied from LDK's own serialization framework though. Also we might remove some of the locally implemented TLV stuff if they ever get exposed by LDK. But some of the macros have been edited and diverged from LDK's first implementation: for example, the `vec` arms for the macros were adjusted so that it works with `impl_writeable_msg` macro to send arrays as TLV (which is not the case for LDK ATM). Note that we could have had vectors(arrays) be inside `Option`s and put in a TLV, but this will waste extra two bytes for vector length annotation (we don't need the vector length annotated in the V(value) of the TLV since L(length) already embeds this information) We also now have another macro match arm `str_opt`, which indicates an optional string inside a TLV, this was created to avoid adding extra length field for strings just like `vec`.
Configuration menu - View commit details
-
Copy full SHA for 20d9ad4 - Browse repository at this point
Copy the full SHA 20d9ad4View commit details -
Configuration menu - View commit details
-
Copy full SHA for ceefb85 - Browse repository at this point
Copy the full SHA ceefb85View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f12f20 - Browse repository at this point
Copy the full SHA 9f12f20View commit details -
Configuration menu - View commit details
-
Copy full SHA for 23b87e4 - Browse repository at this point
Copy the full SHA 23b87e4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 195b325 - Browse repository at this point
Copy the full SHA 195b325View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab9699d - Browse repository at this point
Copy the full SHA ab9699dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 19ff970 - Browse repository at this point
Copy the full SHA 19ff970View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3969d02 - Browse repository at this point
Copy the full SHA 3969d02View commit details -
This commit adds the lightning server and its port configuration option. The peer manager in charge of the lightning server doesn't know about routing and lightning channels (yet?). It can only responde to the user custom messages defined in `teos_common::lightning::messages`. A \`block_in_place\` is used in \`handle_tower_message\` to synchronously block on grpc calls.
Configuration menu - View commit details
-
Copy full SHA for 88bbb12 - Browse repository at this point
Copy the full SHA 88bbb12View commit details -
Configuration menu - View commit details
-
Copy full SHA for de3c7df - Browse repository at this point
Copy the full SHA de3c7dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 697be71 - Browse repository at this point
Copy the full SHA 697be71View commit details -
tests: Add lightning tower handler tests
These tests are analogous to tests in `http::tests_methods` and they test the tower message handler logic only (not the tower message handler when inside a peer manager)
Configuration menu - View commit details
-
Copy full SHA for 1857e12 - Browse repository at this point
Copy the full SHA 1857e12View commit details -
tests: Add test utils for peer manager testing
These test utils include: - A test lightning client: this simulates a client's peer manager that is trying to connect to the tower and send/receive tower messages. For a real client, this should be part of a bigger application (say a lightning node) and the custom message handler adds the capabilities of speaking with the tower over Lightning. - Some utils to launch a Lightning server and connect one peer manager to another - A simple proof of concept test
Configuration menu - View commit details
-
Copy full SHA for a107335 - Browse repository at this point
Copy the full SHA a107335View commit details -
Fix: Run
lightning-net-tokio
on a different runtimeThis fixes a deadlock issue that appears with too many concurrent requtests. This solution was taken from devrandom's issue: lightningdevkit/rust-lightning #1367 Another solution that would probably work is that lightning net tokio wraps our sync calls with `tokio::task::spawn_blocking(|| sync_call()).await.unwarp()`, but not sure how would this affect performace of other users with no async code requirements. Note that peer_manager_tests now don't need to be anotated with `flavor = "multi_thread"`, that's because the runtime we block_on (inside lightning net tokio) is the artificial runtime created in `api::lightning::server` which is already "multi_thread"
Configuration menu - View commit details
-
Copy full SHA for 5206d34 - Browse repository at this point
Copy the full SHA 5206d34View commit details
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.