Skip to content

lightning-net Iteration 1 #1

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

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1f9c848
Create empty lightning-net module
MaxFangX Apr 22, 2022
a33e3fe
SyncSocketDescriptor skeleton implementation
MaxFangX Apr 25, 2022
cd869e8
Connection struct with read and write halves
MaxFangX Apr 26, 2022
8815608
Implement shutdown() for TcpReader and TcpWriter
MaxFangX Apr 26, 2022
d403f8e
Implement most of spawn_inbound_handler
MaxFangX Apr 27, 2022
71599ed
Add crossbeam and some associated channels
MaxFangX Apr 27, 2022
8d0eea7
Implement basic functionality of ConnectionWriter
MaxFangX Apr 28, 2022
bf3da4d
Pass a Arc<PeerManager> into ConnectionReader
MaxFangX Apr 28, 2022
bfb22d9
Get a SyncSocketDescriptor into the ConnectionWriter
MaxFangX Apr 28, 2022
3433140
Implement first half of pausing reads
MaxFangX Apr 28, 2022
63bf0a4
Renome write tx/rx to write_data tx/rx
MaxFangX Apr 28, 2022
ff567d5
Rename ConnectionReader/Writer to Reader/Writer
MaxFangX Apr 28, 2022
b6f0e27
Create the Reader/Writer cmd channels
MaxFangX Apr 28, 2022
4d4862b
Send ResumeRead command to the Reader
MaxFangX Apr 28, 2022
aa5b4b3
Remove write_cmd, rename reader_cmd -> resume_read
MaxFangX Apr 28, 2022
66d6f1e
Reader can handle ResumeRead events
MaxFangX Apr 28, 2022
2c793c6
Implement disconnecting from peer
MaxFangX Apr 28, 2022
37c729d
send_data() actually sends data now
MaxFangX Apr 28, 2022
85fd0e6
Allow send_data() to pause reads
MaxFangX Apr 29, 2022
6fe340e
Get a Arc<PeerManager> into Writer
MaxFangX Apr 29, 2022
1e333e0
Refactor write_data tx/rx into writer_cmd tx/rx
MaxFangX Apr 29, 2022
1769071
Give Reader/Writer a cmd tx for the other
MaxFangX Apr 29, 2022
18c7d50
Implement all disconnecting except TcpDisconnectooor
MaxFangX Apr 29, 2022
4fa2fd9
Remove the Arc<Mutex<Connection>>
MaxFangX Apr 29, 2022
95753b1
Refactor Connection into setup()
MaxFangX Apr 29, 2022
419a6d5
disconnect_socket() now calls into TcpDisconnectooor
MaxFangX Apr 29, 2022
de404d6
Get a SyncSocketDescriptor into Writer
MaxFangX Apr 29, 2022
ca9caae
Call write_buffer_space_avail and socket_disconnected v2
MaxFangX Apr 29, 2022
c0a1bb0
resume_read check should go before the early return
MaxFangX Apr 29, 2022
068e108
Handle read() ErrorKind variants
MaxFangX Apr 29, 2022
2f74d6c
Implement handle_connection and initiate_outbound
MaxFangX Apr 29, 2022
9ef6de3
Finish writing doc comments, clean up
MaxFangX May 3, 2022
0e412cc
Basic tests for lightning-net
MaxFangX May 4, 2022
515475b
Update GitHub CI and dependabot for lightning-net
MaxFangX May 4, 2022
6ba2487
Reduce the dependencies used
MaxFangX May 4, 2022
bb6cd26
Remove some comments about SGX
MaxFangX May 4, 2022
d4e7b6d
Hide ID_COUNTER in a function, return JoinHandles
MaxFangX May 5, 2022
4b97ae4
Reader/Writer now send commands via the descriptor
MaxFangX May 5, 2022
98fdb93
Extract do_recv(), do_try_recv(), do_read() fns v2
MaxFangX May 5, 2022
6462dbc
Split WriteData command into its own channel v4
MaxFangX May 5, 2022
fde35de
Remove `std::net` limitations from EDP doc comment
MaxFangX May 5, 2022
54cb2b6
Implement ReaderState enum v2
MaxFangX May 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ updates:
directory: "/lightning-invoice"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/lightning-net"
schedule:
interval: "daily"
- package-ecosystem: "cargo"
directory: "/lightning-net-tokio"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
platform: [ ubuntu-latest ]
toolchain: [ stable,
beta,
# 1.41.1 is MSRV for Rust-Lightning, lightning-invoice, and lightning-persister
# 1.41.1 is MSRV for Rust-Lightning, lightning-invoice, lightning-persister, and lightning-net
1.41.1,
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1.45.2,
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"lightning",
"lightning-block-sync",
"lightning-invoice",
"lightning-net",
"lightning-net-tokio",
"lightning-persister",
"lightning-background-processor",
Expand Down
22 changes: 22 additions & 0 deletions lightning-net/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "lightning-net"
version = "0.0.106"
authors = ["Max Fang <[email protected]>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/lightningdevkit/rust-lightning/"
description = """
Implementation of the rust-lightning network stack for a synchronous runtime.
For Rust-Lightning clients which wish to make direct connections to Lightning
P2P nodes, this is a simple alternative to implementing the required network
stack for those who do not want to use async Rust or Tokio.
"""
edition = "2018"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
bitcoin = { version = "0.27", default-features = false }
lightning = { version = "0.0.106", path = "../lightning" }
crossbeam-channel = "0.5.4"
Loading