Commit Graph

8640 Commits

Author SHA1 Message Date
parazyd
2e37330d0d chore: Update crate dependencies 2024-05-27 15:29:58 +02:00
dasman
d8fe390e6d bin/darkirc: configurable dag sync attempt and retries 2024-05-27 16:02:58 +03:00
parazyd
1960ca795c blockchain/block_store: Derive serialization instead of manual impl 2024-05-27 14:40:57 +02:00
parazyd
124a9466cf serial: Add support for num-bigint 2024-05-27 14:39:22 +02:00
draoi
15b7bc4bd8 settings: set inbound/ outbound default to 8, white_connect_percent to 70
Also propgagate this change as the default to various configs.
2024-05-27 11:19:16 +02:00
skoupidi
490084b26d blockchain: updated to sled-overlay 0.1.2 2024-05-27 12:15:26 +03:00
parazyd
d2e705b8cc darkirc: Add "no-autojoin" CAP 2024-05-26 16:56:23 +02:00
parazyd
f8543f4143 darkirc/meetbot: Rework code to work over a single connection 2024-05-26 14:00:14 +02:00
dasman
defc1af9cf bin/darkirc: bots send CAP END to complete regestiration 2024-05-26 04:40:01 +03:00
dasman
349ec7413e bin/tau: fix archive monthes and indexing stopped tasks 2024-05-26 04:39:19 +03:00
skoupidi
96a8068ec3 drk: refactor to support SMT
Additionaly, some cleanup was done, minor bugz fixed and updated DAO Propose call with the new setup and added its fee call.
2024-05-25 18:29:40 +03:00
draoi
3e0ddde295 darkirc: fix update line in android.Dockerfile 2024-05-24 17:21:09 +02:00
draoi
70fc34f90e outbound_session: make clippy 2024-05-24 16:22:12 +02:00
draoi
8d9510478e net: add ipv6 addrs to dark list if we do not support ipv6
If ipv6_available is set to false, filter_addrs will send ipv6 addresses
to the darklist.

This is necessary since otherwise they would be deleted by the refinery
and not propagated on the network, even if they are perfectly valid
hosts.

Once on the dark list, these addresses will not be connected to in
OutboundSession.

Note that because there may be a delay when we establish ipv6 connectivity
(since it requires Connector to fail with ENETUNREACH), there is a
possibility of the following happening:

* recv ipv6 addrs, add to greylist
* try to connect to ipv6 addr
* set ipv6_available == false
* recv ivp6 addrs, add to darklist
* we now have duplicate addrs on darklist and greylist.

This is not a problem because the refinery will eventually delete the
greylist entries and from then on the dark list will be the definitive
list for ipv6 addrs.
2024-05-24 16:22:12 +02:00
draoi
0b8ea0db34 net/test: disable gold and white connections 2024-05-24 16:22:12 +02:00
draoi
ca4b415c42 outbound_session: remove SlotPreference
Previously if we didn't meet the gold count or white counts set in
settings, we would select from other lists that do not match what we
specified in the config. This feels like a side effect and in fact we
should more strictly adher to the prefereces.

If our preferences aren't met, we simply do peer discovery.
2024-05-24 16:22:12 +02:00
skoupidi
68d6c77c13 drk: fixed money coin insert due to nullifier column removal 2024-05-24 12:00:10 +03:00
dasman
b93ea66864 darkirc: info log flushed bytes on termination 2024-05-24 04:51:24 +03:00
dasman
d1c2af5244 bin/deg: replace leftover bytes for cleaner event_details 2024-05-24 04:49:58 +03:00
dasman
9e8bdd8630 eventgraph: replayer instruction log simplified a bit 2024-05-24 04:48:52 +03:00
parazyd
9f838d6d40 net/connector: Mark IPv6 unavailability if the connector gets ENETUNREACH 2024-05-23 15:33:24 +02:00
parazyd
d747188055 net/transport: Propagate everything as io::Result 2024-05-23 15:29:46 +02:00
parazyd
c51c1d1a1e net/transport: Use io::Result in the net::transport module instead of crate::Result 2024-05-23 15:17:36 +02:00
draoi
3bf9c67e77 outbound_session: fix bug in Slot white_count calculations
settings.white_count was 90 by default (a percentage) but was being
treated as an absolute value in outbound session.

we fix this and simplify the types to avoid excessive conversions.
2024-05-23 12:40:17 +02:00
darkfi
60858f36d6 wallet: add font fallbacks 2024-05-23 12:09:01 +02:00
skoupidi
0bea8f5697 drk: removed nullifier column from money coin table 2024-05-23 12:46:12 +03:00
skoupidi
d12e49d6d6 drk: fixed fee not using the correct output pubkey 2024-05-23 12:33:31 +03:00
draoi
394ccc7b63 outbound_session: move host to greylist before suspending
This is necessary since it could be a gold or whitelist peer that hasn't
updated and so fails the version exchange. Marking a gold or whitelist
peer as Suspend wouldn't do anything since it would never make it to the
refinery.
2024-05-23 10:37:17 +02:00
skoupidi
fb5865fce4 drk: provide liquidity to dao with transfer and token mint 2024-05-22 20:49:22 +03:00
skoupidi
10ea889e31 drk: dao records sympliefied and dao mint call fee added
Removed dao_id and use the dao name as the identifier. Cleaned up all dao record structures. Fixed dao mint call and added its fee.
2024-05-22 16:43:17 +03:00
skoupidi
1cbddfdf93 drk: simplyfied some naming schemes 2024-05-22 16:43:17 +03:00
darkfi
d4810afe29 wallet: partially working emoji display 2024-05-22 15:24:54 +02:00
draoi
511c26c904 outbound_session: suspend a peer that fails the version exchange 2024-05-22 15:07:50 +02:00
darkfi
444a2b3e14 wallet: delete old unused code and cleanup 2024-05-22 14:23:59 +02:00
draoi
9806543de6 protocol_version: bugfix
The Error result of the version exchange was not being dealt with.
Instead we were only handling when the version exchange timed out.

There was also a bug in the handling of the failure in session/mod.rs
where the error case was similarly ignored. We now explicitly return
with an error in the case that the version exchange fails or times out.
2024-05-22 13:50:13 +02:00
draoi
27b03c2528 outbound_session: make clippy 2024-05-22 13:50:13 +02:00
darkfi
fa9dc5c3f9 wallet: working OTF fancy text rendering 2024-05-22 13:42:58 +02:00
skoupidi
b89c4196a4 drk: updated basic dao handling 2024-05-22 13:44:28 +03:00
draoi
5f9b862e9a refine_session: bugfix
Fix bug that was causing peers to pass the refinery even when the version exchange failed. We use futures::select instead of the system method timeout() for more fine grained control over the different return types.
2024-05-22 12:30:40 +02:00
draoi
0dea915843 p2p: better start(), stop() sequences
Before we would start the refine() session first because it contains a
SelfHandshake that ProtocolAddr/Seed were dependent on.

Since it's an internal process that deals with locks and HostState it
feels more logical to start() stop() it last in the sequence.
2024-05-22 11:50:05 +02:00
draoi
e6cdcc80e1 outbound_session: don't add to greylist if Connector stops
Also add a FIXME/ TODO note and various improved debug statements.
2024-05-22 11:30:53 +02:00
draoi
5828da13e3 net: rm SelfHandshake
Previously we would do a version exchange with our own external
address and perform a time stamp when the version exchange occured
successfully. This tuple of (external_addr, last_seen) would be shared
with other nodes in ProtocolAddr and ProtocolSeed.

This commit removes SelfHandshake. Instead, we simply set the last_seen
to now when we send our addrs in ProtocolAddr/Seed.

Rationale:

1. Doing a version exchange with ourselves requires creating two
   channels, an inbound and an outbound channel. This causes unintended
   message broadcasting to our own addrs in p2p.broadcast(), and race
   conditions when one of the two channels disconnects.

2. Being reachable by our own node does not guarantee our node is
   reachable by other nodes, so it's not a reliable method for
   determining whether an address is accessible.

3. As the external addrs ends up on the greylist of other peers, the
   work is essentially redundant, since they will also ping the address
   via their GreylistRefinery.

One notable impact of this change is that setting the timestamp to now
means that external addresses from other nodes will be placed on the top
of our greylist. Hostlists are sorted by last_seen, with the most
recently seen timestamp on the top of the list. However, this does not
impact the refinery ordering because refinery selects peers to refine
randomly.

The one area this could impact is outbound session, since we
search for an address to connect to by looping through the hostlists
(incl. greylist) starting from index 0 (i.e. the most recently seen
node). Therefore, this commit increases the probability of connecting to
a node that has recently sent its address to us (or marking that node as
"Suspend" if we cannot connect to it).
2024-05-21 17:05:53 +02:00
draoi
1915b38f8e net: rename anchor[..] to gold[..]
We have already mostly made this change so it's just for consistency.
2024-05-21 17:05:53 +02:00
darkfi
667035a159 book: extend wallet.md section with specifics on plugins wrt to scene graph 2024-05-21 13:05:03 +02:00
dasman
e093c5ed57 bin/deg: update README 2024-05-21 01:34:49 +03:00
foo
ed4385de0c fuzz: Add dictionaries, improve README 2024-05-20 11:16:57 -04:00
draoi
55e9cc21d0 session: manually stop the connector on slot.stop()
This change required adding a new abstraction called Slot that stores a
Connector, and refactoring ManualSession significantly such that it more
closely resembles the format of other sessions.

We also use FuturesUnordered to stop process concurrently wherever
relevant.
2024-05-20 16:45:30 +02:00
draoi
eca97916f6 connector: add a stop signal to abort the Connector
Connector can be prematurely stopped even if a connection is in
progress.
2024-05-20 16:22:57 +02:00
draoi
a092f0d0eb transport: non-blocking tcp connect
`socket2::connect_with_timeout()` is blocking, and so would wait up to
`outbound_connect_timeout` seconds before returning even when the
underlying connection has been stopped.

To make the connection non-blocking, we wrap it in an Async object and
wait for it to complete using the socket method `take_error()`. If
there's a timeout configured, we use futures::select to return whatever
completes first. Otherwise, we wait on the connection.

For more info, see: https://github.com/rust-lang/socket2/issues/466

Also helpful: https://stackoverflow.com/questions/73101446/non-blocking-tcp-socket-fails-to-connect-using-socket2
2024-05-20 16:22:57 +02:00
draoi
007500d8e7 net/test: check all hostlists, not just 1 random hostlist
also give the seed node enough time to run the refinery twice, to ensure
peers have at least 1 addr from the seed node (since the node that was
refined will filter out its own addr in the first addr propagation).
2024-05-20 16:22:57 +02:00