Commit Graph

7952 Commits

Author SHA1 Message Date
draoi
e631e8ce68 doc: minor tweak to channel.rs doc 2024-01-29 15:31:37 +01:00
draoi
a21def4f53 refinery: fix redundant channel.stop() call 2024-01-29 15:31:37 +01:00
draoi
589a847205 settings: change inbound_connections default to 10
Setting this to 0 disables inbound sessions by default, even if we have
configured a inbound address.

If we have a inbound address configured, it should be assumed we want to accept inbound sessions.
2024-01-29 15:31:37 +01:00
draoi
7959d9741c channel: safely shutdown the channel when an error is triggered 2024-01-29 15:31:37 +01:00
draoi
78964589ca inbound_session: activate subscriber before accepting inbound connections
InboundSession::start() must happen in this order:

* create the Acceptor
* activate acceptor subscriber
* finally we are ready to start accepting inbound connections.

Previously the flow was like this:

* create the acceptor
* starting accepting inbound connections
* activate the subscriber

This means that inbound connections would potentially be dropped in between
creating the acceptor and activating the subscriber. This is only
obvious in low latency conditions, like refinery::ping_node().
2024-01-29 15:31:37 +01:00
draoi
cf431cbd69 dchatd: downgrade version to match master 2024-01-29 15:31:37 +01:00
zero
43621729fe spec: money xfer params 2024-01-29 11:11:37 +01:00
draoi
deb784d68d channel: use convenience function 2024-01-27 17:46:48 +01:00
draoi
ffee76843a dchatd: bugfix
shutdown p2p network only after other tasks have been shutdown
2024-01-27 17:42:53 +01:00
draoi
1deb70efc5 doc: fix typo in services.md 2024-01-27 17:42:24 +01:00
draoi
5aa187913f refinery: bugfix
start the channel BEFORE calling .await on the handshake task. otherwise
the channel does not exist yet and the handshake will timeout.
2024-01-27 14:05:43 +01:00
draoi
cbfef54aab chore: remove artifact from protocol_version 2024-01-27 14:05:03 +01:00
skoupidi
a7120c6fca lilith: remove missleading todo
We can't configure multiple networks with same name in .toml files so they are already differentiated. Additionally, each one will use their configured version attribute as app network version.
2024-01-27 01:05:13 +02:00
skoupidi
9a2fad2c0f drk: replaced rest hardcoded balance base10 decimals with the const 2024-01-26 16:28:13 +02:00
draoi
cecf284cef net: create system::run_until_completion() to ensure ping_node() does not create zombie process
This commit refactors the ping_node method to use a system function
called run_until_completion(), which ensures a task will safely complete even
if it's parent task has been cancelled.

This happens in ping_node() in the case the handshake is ongoing but the
p2p network has been destroyed.

We also introduce a timeout for ping_node() to prevent
perform_handshake_protocols from running forever and blocking
channel.stop() from being safely invoked.
2024-01-26 11:10:44 +01:00
draoi
715f6c7a86 channel: fix incorrect API usage 2024-01-26 11:10:44 +01:00
draoi
d60bb8bf33 manual_session: bugfix
Push the tasks onto the vector of stoppable tasks before starting them
to avoid a possible race condition.
2024-01-26 11:10:44 +01:00
skoupidi
cd762c95e0 doc/Makefile: use RUST_TARGET in docs folder path 2024-01-25 23:08:03 +02:00
dasman
0567c219bd bin/darkirc: [commitbot] replace pusher name with committer's 2024-01-25 23:37:43 +03:00
skoupidi
9d9dd1590c net/hosts/store: chore clippy 2024-01-25 20:29:59 +02:00
skoupidi
0e400fb299 drk/Cargo.toml: missing darkfi feature added 2024-01-25 20:28:36 +02:00
draoi
a42fd04bee store: update test to use new flattened fetch_address logic 2024-01-25 18:30:00 +01:00
skoupidi
c3f84d3abb src/wallet: yeet 2024-01-25 19:06:37 +02:00
skoupidi
8c8db819f2 drk: script kiddies be gone 2024-01-25 18:55:47 +02:00
skoupidi
3062597fca drk is back in the menu boys 2024-01-25 18:52:03 +02:00
skoupidi
2f6bb5748f drk2: Dao functionality added 2024-01-25 18:44:38 +02:00
skoupidi
c04667a845 net/session/outbound_session::fetch_address(): simplyfied returns 2024-01-25 14:51:13 +02:00
draoi
3447394eda net: make fetch address logic less nested + fix bug
Previously when we called whitelist_fetch_[...](), it would call
greylist_fetch_[...]() inside that method if insufficient whitelist
entries were found.

This was confusing and non-intuitive.

This commit removes this nesting. Now we call
whitelist_fetch_[...] followed by greylist_fetch_[...] in ProtocolAddr
and OutboundSession explicitly.

This commit also fixes a bug in the refinery.
2024-01-25 13:30:24 +01:00
draoi
74f91dd3bc dchat: fix mistakes on default config 2024-01-25 13:22:11 +01:00
aggstam
6e7dc81704 chore: clippy 2024-01-24 17:57:46 +02:00
parazyd
b498847676 contract/money: Add missing error to the error enum 2024-01-24 16:26:14 +01:00
zero
d06cffd0f1 spec: add description of the group hash algo 2024-01-24 14:13:58 +01:00
zero
98fd142aa4 spec: elgamal enc, cleanup use of subscripts 2024-01-24 13:51:50 +01:00
parazyd
228aea9926 contract/fee: Enforce that fee_paid > 0 2024-01-24 13:11:56 +01:00
lunar-mining
354ef3270e store: reverse the order of hostlists
entries with the most recently seen timestamps should be at the top of
the list.
2024-01-24 12:47:36 +01:00
parazyd
1daffcb911 ci: Remove codeberg mirror push 2024-01-24 12:22:34 +01:00
parazyd
5f73784731 README: Update MSRV 2024-01-24 12:18:30 +01:00
zero
b320fd881b spec: ElGamalEncryptedNote 2024-01-24 12:12:55 +01:00
zero
a00034146e spec: 𝔽ᵥ to 𝔽_q 2024-01-24 12:10:13 +01:00
zero
d87be16dd3 spec: update DAO section with recent ElGamalEncryptedNote fixes. 2024-01-24 12:10:11 +01:00
lunar-mining
949f9f0f6f net: remove advertise bool from settings
instead use the presence of an external addresses to decide whether or
not our address should be broadcasted.
2024-01-24 11:20:15 +01:00
lunar-mining
831d17cd48 chore: more informational debug statement 2024-01-24 11:08:54 +01:00
lunar-mining
b1511b991a chore: correct debug statements and code comments 2024-01-24 10:18:28 +01:00
lunar-mining
fe95e34db5 chore: remove artifact from debug statement 2024-01-24 10:11:52 +01:00
lunar-mining
7f3d43f538 protocol_address/seed: don't return if ping_node is false
this would mean that if the first external addr in our list is invalid
it will exit the function. instead, continue to check each addr, and if
they are all invalid just broadcast an empty vector inside the AddrsMessage.
2024-01-24 09:56:03 +01:00
lunar-mining
453a712b9e refinery: only refine nodes that match our transports
this commit means each node's whitelist will only consist of nodes that match their own transports.
2024-01-24 08:00:41 +01:00
parazyd
badd907efc hosts: Wrap module rustdoc 2024-01-23 18:01:04 +01:00
parazyd
2fc0ceeccf net/hosts/refinery: Attempt to fetch exclusive greylist lock before pinging 2024-01-23 17:55:20 +01:00
parazyd
cf2a5fcc44 darkirc: Add "hostlist" to config 2024-01-23 17:26:59 +01:00
parazyd
39f7a8828a net/settings: Do not write a default hostlist to the filesystem. 2024-01-23 17:25:06 +01:00