Commit Graph

236 Commits

Author SHA1 Message Date
parazyd
98ef7c834e chore: Update project dependencies. 2023-07-08 20:17:47 +02:00
parazyd
55ee919906 net: Perform full p2p code cleanup and improve certain pieces.
Notable changes:

* Rewritten transport protocols into Dialer and Listener (Nym is TODO)

  This simplifies using the transports a lot, as can be seen for example
  in src/rpc, and generally around the p2p library. It also defines features
  for each transport (all of which are enabled by default). We drop the
  socks client for Tor and Nym and use first-class support with the Arti Tor
  library, and nym-sphinx/nym-websockets (to be used with nym-client).

* Outbound session healing

  The outbound session will now poll and try to fill all the requested
  slots more efficiently, and if needed, will activate peer discovery to
  find more peers if we can't connect to any known ones. Also if we're
  unable to connect to any, we shall drop them from our set.

  Additionally, transport mixing is enabled by default, so when we're
  allowing transport mixing, and we use Tor, we will also be able to connect
  to other transports that Tor can connect to (e.g. tcp://).

* Unix socket transport dropped

  We haven't been using this, and it seems we're not going down this path,
  so the code has been obsoleted and removed.

* TLS session verification

  We fully verify server and client TLS certificates upon connection so
  we're able to perform TLS1.3 with forward secrecy.

* lilith pruning

  lilith now periodically prunes known peers from its sets if it's unable
  to connect to them.
2023-06-29 13:13:15 +02:00
parazyd
761f3d508d rpc: Remove websockets client. 2023-06-29 13:06:54 +02:00
aggstam
ec3bc88fb7 util/time: simplyfied Timestamp 2023-04-29 01:39:41 +03:00
parazyd
4efb0ecf8c lib: Apply linter suggestions. 2023-03-07 12:29:47 +01:00
x
5702976798 cleanup logging project wide 2023-01-02 14:47:55 +01:00
parazyd
71cd3064d6 Update license year. 2022-12-28 13:06:00 +01:00
parazyd
6b563e63aa net: Have Unix sockets work in the same way as the Tcp transport. 2022-12-12 17:15:26 +01:00
aggstam
b4d461ee1f rpc/client: read timeout logic updated to support subscription, fmt 2022-12-11 23:42:04 +02:00
aggstam
e99b8dc5a3 rpc/client: minor cleanup 2022-12-10 02:27:55 +02:00
aggstam
56cf6257f3 rpc/client: fixed response data reading 2022-12-09 22:36:39 +02:00
parazyd
1d7866f688 Update crate dependencies. 2022-11-29 13:54:05 +01:00
aggstam
3692735012 rpc/server: detach request handling 2022-11-25 18:05:35 +02:00
parazyd
c93040df33 rpc: Increase read timeout to 20 minutes 2022-11-25 15:49:34 +01:00
aggstam
49d275ddc8 rpc/client: subscribe to notifications impl added, script/research/rpc_cleint_notifications: example usage of rpc/client.subscribe() 2022-11-23 23:06:25 +02:00
aggstam
af8609f59a rpc: simplyfied notify handler 2022-11-23 17:25:01 +02:00
aggstam
5f32bd58b4 Revert "rpc: implemented notify handler"
This reverts commit 5325268d14.
2022-11-23 13:14:45 +02:00
aggstam
5325268d14 rpc: implemented notify handler
This enables notifying a connected stream about items as they arrive at provided subscriber. A dummy example was added to Lilith.
2022-11-23 01:24:20 +02:00
parazyd
8334ab6831 rpc: Increase incoming JSON-RPC buffer size to 8 meg. 2022-11-17 14:34:54 +01:00
parazyd
bfbba26ba1 rpc: Don't kill connections if the endpoint returns a JSON-RPC error. 2022-11-16 20:34:41 +01:00
parazyd
8ae84ad7f9 Add license header to source files. 2022-10-31 18:16:13 +01:00
lunar-mining
22151f6b7a book/dchat: use anchors where possible, copy paste code where not.
also run cargo fmt.
2022-10-20 12:02:04 +02:00
Luther Blissett
5e4b663b13 Apply new path to serial crate throughout codebase. 2022-10-15 20:06:28 +02:00
Luther Blissett
2b587bc14a Migrate lib to smol instead of explicit async deps.
Internally they're the same, smol exports them.
2022-10-14 18:43:26 +02:00
Luther Blissett
88abda32ce make fix and cargo fmt. 2022-10-06 14:21:56 +02:00
Luther Blissett
c10d4f140b Make "util" module not depend on "rpc" (and in turn "net"). 2022-09-24 16:02:19 +02:00
Luther Blissett
5f56936668 rpc/websockets: Port to rustls. 2022-09-24 16:02:19 +02:00
Luther Blissett
3b27bde7ac rpc/server: Enlarge recv buffer to 81920 bytes. 2022-09-23 15:46:45 +02:00
ghassmo
fe147fe8ae more explicit names for network errors 2022-06-20 12:26:46 +03:00
parazyd
4c9570583e Minor rustdoc corrections. 2022-05-22 21:12:59 +02:00
parazyd
61bee58239 rpc: Cleanup and separate namespaces into client and server. 2022-05-22 20:54:17 +02:00
parazyd
82ee1a9331 rpc: Clean up and document the server implementation. 2022-05-22 20:54:17 +02:00
ghassmo
0f8458373a rpc/rpcclient: minor changes 2022-05-21 05:54:14 +03:00
ghassmo
f20dd33cb8 net/transport: add timeout option for dial function 2022-05-20 00:47:37 +03:00
ghassmo
45382ecb74 rpc/rpcclient: catch the error when send to closed channel 2022-05-19 23:55:34 +03:00
ghassmo
e16204496b rpcclient: add close connection function 2022-05-13 11:47:49 +03:00
ghassmo
5cec2b98ff rpcclient: don't use Executor for spawn a task 2022-05-13 11:33:02 +03:00
ghassmo
94f37b764b rpcclient: handle error when lost connection with rpc server 2022-05-13 10:53:03 +03:00
ghassmo
28a837a733 rpc: use macro accept! for rpcserver 2022-05-13 07:37:36 +03:00
ghassmo
9f58f0aa21 rpc: remove boilerplate code in jsonrpc.rs and use macro & clean up 2022-05-13 07:21:08 +03:00
ghassmo
19f2c79ea7 rpc: create RpcClient for handling opened channels 2022-05-13 07:19:01 +03:00
ghassmo
1d6e92bf55 rpc: create function to open channels to feed rpc connection and keep the stream alive 2022-05-13 05:08:11 +03:00
ghassmo
54e7ee21bc net, rpc: cargo clippy clean up 2022-05-11 17:21:22 +02:00
ghassmo
47257c022e rpc: add support for unix socket 2022-05-11 17:21:22 +02:00
ghassmo
8287e0195f general clean up for network upgrade 2022-05-11 17:21:00 +02:00
ghassmo
ea9a993e9b net: add nym and unix to TransportName enum 2022-05-11 17:21:00 +02:00
ghassmo
f1c97207ba rpc: merge rpcserver2 to rpcserver & fix bins affected by the merging 2022-05-11 17:20:59 +02:00
ghassmo
ffee60228c rpc: WIP use new transport for rpcserver2 2022-05-11 17:20:59 +02:00
ghassmo
7fd0843200 rpc: use new network transport for jsonrpc 2022-05-11 17:20:59 +02:00
ghassmo
2a258cf509 rpc: extend buffer size 2022-05-08 18:26:26 +03:00