Commit Graph

8209 Commits

Author SHA1 Message Date
zero
667e1505ec smt.py: modify impl to match the impl we have in rust 2024-03-10 17:14:09 +01:00
zero
abc318b096 smt.py: add missing check for position 2024-03-10 11:25:15 +01:00
zero
1f95e4f53c sparse merkle tree example 2024-03-10 11:23:55 +01:00
draoi
35a72c81a9 net: fix bug that was causing duplicate hostlist entries
When we receive info about a host from two nodes simulatenously it was
causing duplicate entries to enter the hostlist.

We fix this by introducing a new state, HostState::Insert, and checking
that hosts don't exist with this HostState before we accept them.
2024-03-10 10:20:18 +01:00
draoi
094c7f957a lilith: upgrade to new hosts API 2024-03-10 10:20:18 +01:00
draoi
a5687f973b store: reject peers that already exist on the white or gold list.
also delete redundant code comments.
2024-03-10 10:20:18 +01:00
zero
376784af2e zkas/zk: add sparse_tree_is_member() opcode 2024-03-09 13:10:14 +01:00
skoupidi
39223c6a98 darkfid: fixed fork sync issues 2024-03-08 15:38:33 +02:00
skoupidi
9d1123bec7 net/message_subscriber::MessageSubscription: new fn clean() added to purge existing items from the receiver channel 2024-03-08 15:38:33 +02:00
skoupidi
c6637029fe darkfid: remove second miners p2p
The usage of a second p2p network for miners was a premature optimization for faster block propagation between block producers, but in reality we don't know if its required yet, therefore we eliminate the extra complexity it introduces
2024-03-08 15:38:33 +02:00
skoupidi
99d149dd9b darkfid/tests: forks sync test added 2024-03-08 15:38:33 +02:00
skoupidi
e8d5b312aa validator: clippy chore | darkfid/task/miner: minor logs added 2024-03-08 15:38:33 +02:00
parazyd
69ec231a14 zk/gadget/cond_select: Implement gadget unit test 2024-03-08 13:44:54 +01:00
draoi
fe18477578 chore: remove lingering merge artifact + cargo fmt 2024-03-07 17:05:46 +01:00
draoi
4883b2f213 Revert "chore: cargo fmt"
This reverts commit e46cb5d55a.
2024-03-07 17:02:03 +01:00
draoi
e46cb5d55a chore: cargo fmt 2024-03-07 17:01:39 +01:00
draoi
d19f962830 net: replace downgrade, upgrade and blacklist methods with one method: move_hosts()
also rename HostState::Downgrading to HostState::Moving and add TryFrom to HostColor for more helpful debugging
2024-03-07 16:54:50 +01:00
parazyd
60aa076763 zk/vm_heap: Remove unused Literal enum 2024-03-07 14:49:06 +01:00
parazyd
e3634955ab zk/vm: Witness Scalar values at the time of witnessing rather than time of use. 2024-03-07 14:47:13 +01:00
parazyd
8e3edcb3cb zk/gadget/small_range_check: Assert that range > 0 in range_check() 2024-03-07 14:37:57 +01:00
parazyd
258849f79e zk/gadget/zero_cond: Simplify ZeroCondChip PLONK gate
Additionally remove the unused `_z` column from the chip config.
2024-03-07 14:29:04 +01:00
parazyd
8778d57b42 chore: Update crate dependencies 2024-03-07 14:17:17 +01:00
parazyd
30ebc50b3a chore: clippy lints 2024-03-07 12:40:44 +01:00
parazyd
1297ff7b07 src/time: Implement and use {over,under}flow-safe API 2024-03-07 12:35:21 +01:00
parazyd
4762c51f35 research/tfhe: Dark market implementation using FHE 2024-03-07 11:19:30 +01:00
draoi
a5c756bb1c store: cleanup
organize methods better, fix debug statements and comments, remove
hostlist_fetch_safe method.
2024-03-07 08:59:37 +01:00
draoi
48a5dc1b2b net: simplify and reduce Hosts API by introducing HostContainer
HostContainer is an Array of 4 hostlists which are identified by
HostColor as Grey, White, Gold or Black.

Using this Container allows us to quickly replicate the same utilities
on all host functions while minimizing code reuse.
2024-03-06 13:59:25 +01:00
zero
96a2e0b65f book/wallet: add lessons learnt from mozilla XUL failures 2024-03-05 17:37:26 +01:00
zero
547ffe2144 add book page on writing ZK proofs with zkas, includes info on debugging 2024-03-05 16:25:19 +01:00
draoi
2c15d0ad38 manual_session: delete 2nd death loop
this would loop forever in the case that the manual connection has been
successfully established.

we don't need `continue`, we can safely execute the function since
HostState is protecting from any invalid state changes (such
as changing a host state from Connected to Pending)

also move the HostState reset remove() after the sleep.
2024-03-05 15:52:46 +01:00
skoupidi
e8885e629f darkfid/tests: fixed block sync test logic 2024-03-05 15:48:44 +02:00
skoupidi
a3a747df39 contract/money/pow_reward: removed obselete ECVRF 2024-03-05 13:13:02 +02:00
skoupidi
17f928db22 lilith: fmt 2024-03-05 13:10:43 +02:00
skoupidi
c9e2cc0a42 .github/workflows: nightly is back on the menu boyz 2024-03-05 13:09:55 +02:00
parazyd
195c477caa chore: Clippy lints 2024-03-05 08:47:43 +01:00
parazyd
0de97d0db3 chore: Update crate dependencies 2024-03-05 08:47:43 +01:00
parazyd
551b96d4f9 sdk/crypto/blind: Don't use generics for fn random() 2024-03-05 08:47:43 +01:00
skoupidi
7010aae22e validator: changed ranking logic 2024-03-04 21:05:53 +02:00
draoi
36ecfb18e2 manual_session: fix death loop
We must stop tracking a peer if connecting to it has failed, i.e.
Pending peers must either transition to Connected or None, otherwise
they will be stuck in the Pending state forever.
2024-03-04 14:35:31 +01:00
draoi
fd728f4324 darkfid: update to new channels() API 2024-03-04 13:24:08 +01:00
draoi
9d685f408b lilith: migrate whitelist refinery to new HostState logic 2024-03-04 13:12:20 +01:00
draoi
5559e46ba9 chore: standardize debug statements on net/hosts/store.rs 2024-03-04 08:57:18 +01:00
draoi
1f9a01b94f net: combine remove_(..) etc methods into a single remove() method. 2024-03-04 08:57:18 +01:00
zero
c443ec962a consensus: small edits 2024-03-03 13:41:24 +01:00
zero
fcb1ca1242 book/consensus: add formalisms for block rank calcs 2024-03-03 13:30:51 +01:00
draoi
db92a9e3dc net: introduce HostState state machine to safely manage host activity
This commit removes excessive use of RwLocks in the net code, replacing
them with a state machine that:

* Protects against race conditions where multiple threads are trying to
  modify the same resource (i.e. the hostlists) by retricting state
  transitions to a fixed set of safe steps.

* Minimizes risk of deadlocks by aggregating is_migrating(), is_pending(),
  is_connected() etc checks to a single locked HashMap, `HostRegistry`.

This commit also simplifies the `p2p.rs` interface by migrating
connected channel utilities into `hosts/store.rs`.
2024-03-03 12:59:38 +01:00
draoi
7ec08e76b4 p2p: add is_pending() method
fixes a misuse of the API in greylist refinery that was adding a host to
the set of pending connections during the refinery process.
2024-03-03 12:59:38 +01:00
dasman
0043665c46 bin/tau: add deg task & respective rpc calls 2024-03-02 04:56:19 +03:00
dasman
50e57cba54 bin/darkirc: add forgotten deg_task.stop() 2024-03-02 04:33:39 +03:00
dasman
784438823d bin/deg: add guard to only show infos on live nodes 2024-03-02 04:24:09 +03:00