Commit Graph

8410 Commits

Author SHA1 Message Date
draoi
ec688f485a p2p: start refine_sesssion() before outbound_session()
we should perform self handshake as a priority since we will be sending
our addr in protocol addr
2024-04-07 14:35:06 +02:00
draoi
8a413d1c3d refine_session: reorder start(), shutdown sequence
We should start the self-handshake before the refinery, since it is
higher priority on start(). Also we should first stop the refinery
before saving the hostlist on stop().
2024-04-07 14:35:06 +02:00
draoi
b631a10629 channel: only print disconnect errors when we're on SESSION_NET
SESSION_REFINE disconnections will pass silently since they are expected
behavior.
2024-04-07 14:35:06 +02:00
dasman
214458322a add deg2 (dag_browser) code 2024-04-07 04:40:18 +03:00
draoi
f9f3fa2bf1 session: cleanup SessionBitFlags
Add an additional byte to SessionBitFlags to accommodate SESSION_REFINE
and reduce the risk of logic errors.

Additionally:

* `!SESSION_SEED & !SESSION_REFINE` is now referred to as `SESSION_DEFAULT`
* `!SESSION_REFINE` is refered to as `SESSION_NET`.
* `SESSION_ALL` has been deleted since it was conceptually out-dated
* Binaries have been updated.
2024-04-06 15:14:49 +02:00
draoi
2b18e5307b session: cleanup SessionBitFlags
Add an additional byte to SessionBitFlags to accommodate SESSION_REFINE
and reduce the risk of logic errors.

Additionally:

* `!SESSION_SEED & !SESSION_REFINE` is now referred to as `SESSION_DEFAULT`
* `!SESSION_REFINE` is refered to as `SESSION_NET`.
* `SESSION_ALL` has been deleted since it was conceptually out-dated
* Binaries have been updated.
2024-04-06 11:40:07 +02:00
skoupidi
9d64403407 zk/debug: properly structure feature imports 2024-04-05 15:40:47 +03:00
zero
1a1a26e396 Revert "sdk: move find_subslice() and NextTupleN from zkas into SDK util.rs"
This reverts commit dcf419b0ca.
2024-04-05 12:39:42 +02:00
zero
9ecfb0dd58 doc/consensus: update types info in tables. 2024-04-05 12:19:49 +02:00
zero
416b236715 Makefile: add comment about installing cargo-hack above check target. 2024-04-05 11:54:29 +02:00
zero
91bc56bee6 darkirc: add commented log and verbose settings + description to default toml config 2024-04-05 11:45:49 +02:00
skoupidi
930a511309 blockchain: major hashes cleanup 2024-04-04 22:00:51 +03:00
draoi
6b29e8c659 net: make blacklist settings more configurable + other fixes
1. Settings blacklist is now a Vec<(Url, Vec<u16>)> and if ports are left empty,
   we block all the ports of the given host.

2. We read from the settings blacklist on RefineSession::start(), and
   also move other save() and load() host functions into refine session
   since it's more logical than doing in GreylistRefinery.

3. Last but not least, we fix a really BAD BUG which would send blacklist peers to the Gold list instead of Black list when blacklisting peers in move_host() !!!
2024-04-04 13:45:39 +02:00
draoi
8dad8dfc8f lilith: add missing safety check 2024-04-04 13:45:39 +02:00
draoi
498a88e3b9 p2p: reorder shutdown sequence to reduce lag on CTRL-C 2024-04-04 13:45:39 +02:00
zero
dd341c156a smt: add docstrings for runtime/SDK fns 2024-04-03 19:07:40 +02:00
zero
56d5281f6c runtime: remove unused put_object_bytes() 2024-04-03 18:59:06 +02:00
zero
b42cb611c5 runtime: review and update ACL perms for fns 2024-04-03 18:57:40 +02:00
zero
cb4ef9b1fe money: fix FIXME, add (tx_hash, call_idx) now the calls exist 2024-04-03 18:20:24 +02:00
zero
e0932c5c50 deployooor: fix instruction deserialization 2024-04-03 13:53:20 +02:00
zero
ac979a2e38 doc/wallet: expand scenegraph section 2024-04-03 13:33:52 +02:00
zero
3a6707cb81 runtime/merkle: remove faulty asserts, we used to exit early with success if coins was empty but then that meant the merkle root -> blockheight wouldn't be updated. recently this was changed so the old asserts are no longer valid. 2024-04-03 13:13:15 +02:00
parazyd
2ef2f6560b sdk/crypto/smt: Move tree recalculation into separate internal function 2024-04-03 11:45:32 +02:00
zero
0d3b3cf77c deployooor: fix broken WASM fns 2024-04-03 11:21:35 +02:00
parazyd
d68619d84d runtime/import/smt: Correct log message 2024-04-03 11:17:19 +02:00
parazyd
f425397115 sdk/crypto/smt: Implement leaf removal support 2024-04-03 11:16:26 +02:00
zero
dcf419b0ca sdk: move find_subslice() and NextTupleN from zkas into SDK util.rs 2024-04-03 11:14:30 +02:00
zero
1cdbd03673 sdk/util.rs: add Itertools trait with .try_collect() method 2024-04-03 11:08:04 +02:00
zero
d3404939aa sdk/crypto/util.rs: replace ugly CtOption mess with cleaner version using .into() and match 2024-04-03 10:55:36 +02:00
zero
b9cc42cdf4 SDK: move all WASM runtime fns into wasm/ submod 2024-04-03 10:44:51 +02:00
draoi
83549ccbf0 doc: add missing documentation to refine session and hosts 2024-04-03 09:27:46 +02:00
draoi
7ff45ea2a5 refinery: acquire exclusive lock on greylist before refining
Modifications to the greylist (appending or deleting from) are dangerous while the refinery is ongoing, since it can lead to panics in the case the refinery fails (because we delete from the greylist by index when that happens).

We mitigate this issue by acquiring an exclusive lock on the greylist before proceeding with the refinery, and dropping the lock once the refinery process has finished and greylist modifications are no longer dangerous.
2024-04-03 09:00:00 +02:00
zero
564089646d sdk: add hex decoding fns 2024-04-03 08:34:48 +02:00
zero
c781936b12 replace usage of blake3::Hash for tx hashes with TransactionHash type. Change all occurances of let txs: Vec<blake3::Hash> = block.txs.iter().map(|x| blake3::hash(&serialize(x))).collect(); to let txs: Vec<TransactionHash> = block.txs.iter().map(|tx| tx.hash()).collect(); 2024-04-03 07:36:59 +02:00
parazyd
5f922f836f sdk/crypto/smt: Code style fixes 2024-04-02 18:42:33 +02:00
draoi
c47630366c refinery: acquire exclusive lock on greylist before refining
Modifications to the greylist (appending or deleting from) are dangerous while the refinery is ongoing, since it can lead to panics in the case the refinery fails (because we delete from the greylist by index when that happens).

We mitigate this issue by acquiring an exclusive lock on the greylist before proceeding with the refinery, and dropping the lock once the refinery process has finished and greylist modifications are no longer dangerous.
2024-04-02 13:51:44 +02:00
draoi
24ec6fffd7 doc: add cautionary comments about unregister() 2024-04-02 13:51:44 +02:00
zero
ed01a1a76a test-harness: update vks/pks hashes, put back to info and fix docstring in sdk 2024-04-02 11:52:01 +02:00
zero
88c39e5861 dao::propose(): fix get_tx_location(), by making the test-harness write the txs and their locs to the DB inside wallet.add_transactions() 2024-04-02 11:52:01 +02:00
draoi
318c7bef49 inbound: remove duplicate call to unregister()
it gets called in session::remove_sub_on_stop() so this is redundant + dangerous
2024-04-02 10:49:04 +02:00
zero
afa66e2bb0 MerkleNode: display as hex string instead of base58 2024-04-02 10:47:43 +02:00
zero
b6e8c00243 replace all data strings output as [123, 78, ...] with big endian hex strings. 2024-04-02 10:40:56 +02:00
draoi
84dcc54433 net: add blacklist field to settings and avoid for duration of program. 2024-04-02 10:37:22 +02:00
zero
b24cde844c dao: add usage of get_tx_location() 2024-04-02 10:03:12 +02:00
zero
9188a62bb3 smt: simplify ZK gadget. Use root = sparse_merkle_root(pos, path, leaf) instead of the more complicated is_member = sparse_tree_is_member(root, path, pos, leaf) 2024-04-02 09:39:38 +02:00
draoi
4d0c36a508 hosts: reject peers from other hosts that already exist on our greylist
Previously we would update the last seen field, however it is better to
let the refinery do that and keep the insertion process strictly
seperate.
2024-04-02 09:30:47 +02:00
AgustinBadi
bb47e7ef0b Improve anynomous assets page - Add minor explanation 2024-04-02 08:41:16 +02:00
AgustinBadi
89bc896bd2 Improve anynomous assets page - Clarify terms of the explanation 2024-04-02 08:41:16 +02:00
skoupidi
e8cb2d1f51 script/research/blockchain-explorer: updated to latest darkfi structures 2024-04-01 22:34:54 +03:00
skoupidi
85c80e1bd3 blockchain: store txs locations using the new tree 2024-04-01 21:48:14 +03:00