Commit Graph

8811 Commits

Author SHA1 Message Date
dasman
89afa62a4f darkirc: add a debug msg when if dag not synced and skipping 2024-06-26 14:50:55 +03:00
dasman
653670fc3f darkirc: revert start IRC after DAG sync and queue user messages until synced successfully 2024-06-26 14:41:16 +03:00
draoi
958361c953 net: simplfy fetch_last() method and fix lilith's usage 2024-06-26 10:24:06 +02:00
draoi
6a0d4cfe7d net: simplify update_last_seen() method
Also fix its usage by Lilith
2024-06-26 10:01:42 +02:00
draoi
e2ba275cb9 session/mod: use !p2p.connected() instead of channels().is_empty() 2024-06-26 09:21:23 +02:00
draoi
0958e69b62 hosts: modify last_seen instead of entire entry on store_or_update() 2024-06-26 09:13:30 +02:00
draoi
55af782eb3 refine_session: use !p2p.connected() instead of channels.is_empty() 2024-06-26 09:01:33 +02:00
draoi
dbf5c6bc8f hosts: use sync Mutex for HostRegistry
We don't need to use an AsyncMutex here since we're not holding across .await points or for long periods of time.

Using a sync Mutex here also fixes some really weird fairness behaviors we observed in the smol::lock::Mutex where writers in the priority queue were occasionally getting ignored. This was apparently not a deadlock since subsequent and prior readers and writers were able to access the data with no problems.
2024-06-26 08:52:46 +02:00
draoi
958f02a3eb hosts: use sync Mutex for HostRegistry
We don't need to use an AsyncMutex here since we're not holding across .await points or for long periods of time.

Using a sync Mutex here also fixes some really weird fairness behaviors we observed in the smol::lock::Mutex where writers in the priority queue were occasionally getting ignored. This was apparently not a deadlock since subsequent and prior readers and writers were able to access the data with no problems.
2024-06-25 22:16:20 +02:00
skoupidi
235ba3f644 darkfid: purge current forks on network dc 2024-06-25 16:00:38 +03:00
skoupidi
df95f854a7 darkfid/task: use network disconnect subscription 2024-06-25 14:27:02 +03:00
draoi
787d9ac395 net: make disconnect_publisher notify with an Error instead of a bool 2024-06-25 09:12:12 +02:00
draoi
2badfbb141 net: create a disconnect_publisher that notifies when we have no connectons
We check whether there are any remaining channels when we remove a
channel in remove_sub_on_stop(). If the channel list is empty,
we call notify() on disconnect_pubisher and set its inner value to true.

Note that this only signals when we do not have any connections, and
does not update to false when new connections are formed.
2024-06-25 08:44:32 +02:00
dasman
01d57d5877 darkirc: start IRC server task after the DAG has been synced 2024-06-25 03:20:38 +03:00
dasman
c4ea68e474 event_graph: in dag_insert() continue instead of break when iterating over/cleaning unreferenced_tips 2024-06-25 03:18:54 +03:00
skoupidi
c43c293a09 darkfid/task/consensus.rs: properly handle the proposals subscription 2024-06-24 20:59:05 +03:00
skoupidi
dfc3918ec7 darkfid/task/consensus.rs: gracefully handle network disconnects for replicator 2024-06-24 20:47:57 +03:00
draoi
5d7632d79f hosts: use async mutex instead of async rwlock on HostRegistry
Mutex makes more sense here since there are orders of magnitude more call to write() than there are to read() (we counted) (trust me bro)
2024-06-24 18:00:37 +02:00
darkfi
6ac471f999 wallet: switch from harfbuzz_rs to harfbuzz_sys 2024-06-24 17:11:06 +02:00
darkfi
8937d3fa15 wallet: add commented harfbuzz-sys code that doesn't work on android due to needing a recent version of cargo, while APK tools use an older one 2024-06-24 14:40:32 +02:00
draoi
4abc12207a chore: cleanup hosts imports 2024-06-24 13:45:50 +02:00
draoi
43bad915a5 refinery: delete un-necessary and excessively long lock on greylist
Previously we were locking the greylist to prevent the index from changing
while performing a handshake. This isn't necessary. It is acceptable
for the greylist index to change while the handshake is ongoing.

The thing we don't want to happen is that the addr we are operating on
is somehow removed from the list- this should never happen since it has
been marked as "Refine" in the HostRegistry. Therefore, calling unwrap()
on get_index_at_addr() should pass 100% of the time (and if it doesn't,
that indicates a logic failure elsewhere in the code).
2024-06-24 13:34:34 +02:00
draoi
531e4b2f92 net: use sync Mutex for last_connection
RwLock is overkill in this case since there is only ever one reader and
one writer.

For more info why a sync Mutex is appropiate in this case, see commit 65a8e9a44fa3c835158550e7eb5b5e1946e3028f
2024-06-24 13:34:34 +02:00
draoi
76934ac216 net: use sync Mutex for ipv6_available
Locks should be sync for simple data operations and async if:

1. the lock must be held across an .await point
2. the new data being stored in the lock is calculated from data already inside the lock

Since ipv6_available is a fast and simple data operation it is more appropiate to use
a sync Mutex here.
2024-06-24 13:34:34 +02:00
skoupidi
e8465235d0 doc/spec/contract: vesting contract draft design spec added 2024-06-24 14:31:38 +03:00
darkfi
5b8b609797 wallet: cleanup FFI mess for font stuff 2024-06-24 10:28:19 +02:00
darkfi
85db1d7382 wallet: correctly handle alpha transparency in ansi_texture() on android 2024-06-23 14:58:10 +02:00
darkfi
1c54568fd1 wallet: fix text anti-aliasing calc, conversion from PixelMode::Gray was wrong 2024-06-23 14:18:55 +02:00
darkfi
cbff8febe1 wallet: for labels, create a texture atlas so quads can be batched as a single draw call 2024-06-23 13:41:22 +02:00
darkfi
061f50c2a0 wallet: add android terminal texture display 2024-06-22 19:23:18 +02:00
draoi
aee1e571d4 error: fix wrong print on HostStateBlocked 2024-06-22 19:01:24 +02:00
darkfi
eb2241ed13 wallet: add text rendering and a label widget 2024-06-22 18:51:26 +02:00
draoi
348ed19a7d net/tests: ensure ports are unique 2024-06-21 19:43:02 +02:00
draoi
541166162e acceptor: return error instead of calling unwrap() on subscribe_stop
unwrap() can panic in the rare case that a node disconnects while we are
in the middle of accepting a connection from it.

In the case that this happens we should instead just exit with an error.
2024-06-21 12:01:55 +02:00
dasman
2d68d9d054 tau: ignore any colon that isn't part of known attributes 2024-06-21 05:21:36 +03:00
dasman
273a046b8a tau: print and error and exxit if attributes are invalid, instead of assert 2024-06-20 17:34:09 +03:00
darkfi
2e66e9d6c6 wallet: working z_index in renderer 2024-06-20 15:44:44 +02:00
skoupidi
0c5bf14eee darkfid/drk: fmt 2024-06-20 16:03:32 +03:00
skoupidi
3cb2054928 drk: use per network configuration 2024-06-20 16:03:03 +03:00
skoupidi
01caf27291 darkfid: fixed txs_batch_size arg parsing 2024-06-20 16:03:03 +03:00
skoupidi
186e3302d3 darkfid: moved all relative args under blockchain config args 2024-06-20 16:03:03 +03:00
darkfi
563f04f963 wallet: +bugfix on_modify tasks were being dropped 2024-06-20 15:00:06 +02:00
darkfi
794a32f8b6 wallet: enable zmq backend network access 2024-06-20 13:48:39 +02:00
skoupidi
109b902b01 darkfid: optional mining reward spend hook and user data added 2024-06-20 14:18:27 +03:00
skoupidi
3f31e393e1 contract/money/client/pow_reward: minor cleanup 2024-06-20 14:18:27 +03:00
skoupidi
6e59afaee3 contract/money/client/genesis_mint: allow optional different recipient 2024-06-20 14:18:27 +03:00
darkfi
33a67b239b wallet: Mesh::on_modify rect property calls redraw 2024-06-20 12:27:36 +02:00
darkfi
7bc9e3c10c wallet: janny clean up warnings and comment unused mods 2024-06-20 11:52:39 +02:00
darkfi
751037d44f wallet: migrate widgets to src/ui/ 2024-06-20 11:27:45 +02:00
darkfi
9565b6a390 wallet: split event streams into separate publishers to avoid waking sleeping tasks uncessarily 2024-06-20 11:10:53 +02:00