Commit Graph

8262 Commits

Author SHA1 Message Date
dasman
acb3aeb3b9 bin/tau: update cargo's package description 2024-03-21 03:33:45 +03:00
dasman
f7d0b7a5ac bin/tau: print info on cli when access denied 2024-03-20 23:32:19 +03:00
dasman
d47eac66a4 bin/tau: setting access types as read-write and read-only(default) 2024-03-20 23:30:55 +03:00
skoupidi
5623914db7 Removed swapd 2024-03-20 20:12:50 +02:00
draoi
5f55e877ae net: enable hostlist migration + bugfixes
Fixes several bugs:

1. Gold list upgrades were getting blocked since it required the
   following state change that was not permitted: Connected() -> Move
   We have fixed this by enabling this state change and making Move
   take an Option<ChannelPtr> so that we can immediately reset Gold
   upgrades to Connected(ChannelPtr) once the upgrade has successfully
   completed.

2. Previously we were not downgrading peers when they disconnect, this
   has now been fixed.

3. Previously move_host() was not properly atomic. While HostState
   protects single host from being misused (like being Refined and Moved
   at the same time), HostState does not protect the hostlists
   themselves from being written to, creating race conditions when hosts
   are being removed from hostlists, like so:

        thread1: assert!(get_index(host_a) == 0)
        thread2: assert!(get_index(host_b) == 1)
        thread1: remove(0)
        thread2: remove(1) -> panic!

    We resolve this by moving write locks higher up in the code so that
    the entire sequence of looking up an index and removing it is
    atomic.

4. Manual session had a bug in which we proceeded to establish a
   Connector with an address even if try_register() failed. This has
   been fixed. We now only try to connect to address that are valid,
   otherwise we wait outbound_connect_timeout and retry
   manual_attempt_limit tries.
2024-03-20 12:10:02 +01:00
parazyd
1e5e56c9ea darkirc/nickserv: Feed RLN identity through REGISTER 2024-03-20 11:31:58 +01:00
parazyd
a9a6cb4ef9 darkirc: NickServ account registration
This currently just creates a sled tree for the account and generates a keypair.
2024-03-20 09:24:54 +01:00
parazyd
50f7220341 chore: Clippy lints 2024-03-20 09:21:40 +01:00
skoupidi
696bc213a0 validator: fixed stupid mistake 2024-03-19 18:02:05 +02:00
skoupidi
41c9bd28ba validator: updated sled-overlay version and use new diffs logic for finalization 2024-03-19 16:47:33 +02:00
skoupidi
aae713227f contract/test-harness/vks: updated hashes 2024-03-19 16:46:35 +02:00
zero
010ea6037d runtime/merkle: db_roots store key=blockhash, value=blockheight (before value=[]) 2024-03-19 10:48:22 +01:00
zero
cde5f7cea2 runtime/merkle: simplify the function. we do not need to store the intermediate roots for the tree since each update is atomic. Also the serialization length == 32 should be an assert rather than a conditional check. 2024-03-19 10:34:45 +01:00
zero
fd1d154b15 runtime/smt: return early with SUCCESS (but give a warning) if the nullifiers list for changing the tree is empty. 2024-03-19 10:26:01 +01:00
zero
309157e0ba runtime/merkle: return early with SUCCESS (but give a warning) if the coins list for changing the tree is empty. We also don't do any gas calc since nothing on disk was modified. 2024-03-19 10:15:24 +01:00
parazyd
ec5984685b chore: Add missing license headers 2024-03-19 09:23:11 +01:00
zero
6bee5bf416 subscriber: add docstrings, and simplify a method. 2024-03-19 08:11:23 +01:00
zero
fb4a521f70 zk/smt: fix broken unit test 2024-03-18 16:56:59 +01:00
zero
66b44abc78 runtime: lock sled overlay for the entire duration of merkle::merkle_add() [safety rzns] 2024-03-18 15:58:03 +01:00
zero
c5166445d7 smt: get it working with the WASM, and add it to money contract for nullifiers. Summary of changes:
* EMPTY_NODES_FP in sdk/crypto/smt/empty.rs since computing 256 hashes uses up all the gas
* Create SmtWasmFp backend for SMT in sdk/crypto/smt/wasmdb.rs
* add sparse_merkle_insert_batch() into runtime/import/smt.rs
* Update money contract nullifiers to use the SMT
2024-03-18 15:50:30 +01:00
zero
df1f9e744b Merge branch 'smt2' 2024-03-18 11:52:53 +01:00
zero
11e39f07cf mv smt2 smt 2024-03-18 11:51:59 +01:00
zero
ba60fc05f3 switch zkVM to new SMT gadget 2024-03-18 11:48:36 +01:00
zero
e97ade3c9d SMT2 ZK gadget 2024-03-18 11:27:44 +01:00
draoi
5d9c465b3e doc: update DEP-0001 2024-03-17 17:40:35 +01:00
draoi
b7c11c2bed net: implement DEP-0001
implement the upgrade specified at: https://darkrenaissance.github.io/darkfi/dep/0001.html

The `(services, version)` field is only partially implemented- we simply
send an empty vector in the Version message. Later this can be used to
enable features in protocols.
2024-03-17 17:34:09 +01:00
draoi
b9edcc6077 channel: expand ChannelInfo to include resolve_addr and connect_addr
This paves the way for DEP 0001: https://darkrenaissance.github.io/darkfi/dep/0001.html

We retain the same method for returning the channel's address, channel.address() but modify it so that it adapts depending on whether this channel is inbound or outbound. The usage remains the same and the return value is equivalent.
2024-03-17 14:39:32 +01:00
draoi
137eef25b7 doc: fmt and add dev NOTEs 2024-03-17 08:46:09 +01:00
draoi
b1cfbda94b hosts: remove useless Result<> on subscribe_store 2024-03-16 12:19:01 +01:00
draoi
d160e96161 net: gather unused channel_subscriber's into a single channel_subscriber in Hosts
Also remove redundant calls to notify() and provide a method to
subscribe to the subscriber.
2024-03-16 10:39:35 +01:00
draoi
9bcb691c65 contrib: add dchatd localnet for minimal net testing 2024-03-16 10:01:17 +01:00
draoi
0f5fcba2c2 net: add last_connection timer to more empirically track connection status
Before we were simply relying on channels() returning an empty
vector to determine our connection status, however this does not
work for e.g. Lilith that frequently has no active connections in
channels(), but may have received a connection more recently than the
time_with_no_connections refinery timeout.
2024-03-16 10:01:17 +01:00
zero
030d532222 smt2: replace generic_const_exprs unstable rust feature with temp workaround that can easily be changed once the feature exists in rust proper 2024-03-16 09:52:23 +01:00
parazyd
1c163c546b darkirc: Preliminary services implementation 2024-03-15 13:49:36 +01:00
zero
907f2f6e7f zk/native_range_check: add code comments 2024-03-15 12:05:11 +01:00
zero
fbbd9c5b2e WIP refactor of SMT 2024-03-15 12:04:19 +01:00
skoupidi
98ec24720c chore: fmt 2024-03-15 12:48:14 +02:00
skoupidi
b2d2c7a4e8 chore: fmt 2024-03-15 12:10:25 +02:00
parazyd
e607236337 Makefile: Remove PROOFS_BIN on make clean
Closes: #249
2024-03-15 09:54:42 +01:00
hishope
bd456cb839 chore: fix some typos
Signed-off-by: hishope <csqiye@126.com>
2024-03-15 09:53:37 +01:00
holisticode
6b1f75b0e8 fix link to dev section 2024-03-15 09:53:22 +01:00
cheeese
0aad2dfb06 zkas/parser: add check for function to be a symbol 2024-03-15 08:51:47 +00:00
draoi
00582c94a7 chore: remove deceptive comment in lilith whitelist refinery 2024-03-15 08:24:16 +01:00
draoi
ff6b2a3962 net: don't write test files to harddisk 2024-03-15 07:37:50 +01:00
draoi
a123826d22 net: cleanup and add documentation 2024-03-14 10:58:51 +01:00
dasman
4b28b79e5d doc: update tau doc 2024-03-13 02:59:59 +03:00
zero
db67d3bdf0 fix broken smt tests 2024-03-12 16:06:19 +01:00
zero
f92b55d16e smt: add terminology doc 2024-03-12 16:06:19 +01:00
draoi
24212a6f77 net: enable offline reconnect
This commit introduces the following changes that enable offline reconnect:

1. When we have no connections for longer than the period set in
   settings.time_with_no_connections, disable the refinery. This stops
   the refinery from deleting hosts from the hostlist when we are not
   connected.

2. Introduce a new HostState called Suspend, which replaces
   "quarantine". When we fail to connect to a host in OutboundSession we
   downgrade the peer to greylist and mark its state as "Suspend". This
   prevents us from making connections with this peer before the peer
   passes through the refinery.
   Essentially, setting the state to "Suspend" means the refinery is
   tasked with filtering this peer and ensuring whether it should stay
   on the hostlist or be deleted.

3. When we pause the refinery, we also free up all peers marked as
   "Suspend", so that we can immediately reconnect to such peers when
   we regain connectivity.

At present, time_with_no_connections is set to 30s by default, while the
refinery interval is 15s. This means that we could delete a maximum of 2
healthy hosts before the refinery is disabled. We need to consider this
carefully and test different outcomes.
2024-03-12 15:22:58 +01:00
zero
638c441a43 smt: replace FromUniformBytes<64>/[0u8; 64] with PrimeField/PrimeField::Repr 2024-03-12 11:19:30 +01:00