Commit Graph

3329 Commits

Author SHA1 Message Date
aggstam
be4da84140 chore: clippy 2023-08-31 16:18:44 +03:00
Dastan-glitch
be037de544 event_graph: add some debug log 2023-08-31 15:24:01 +03:00
x
bcc159ea55 channel: minor fix to debug! statement 2023-08-31 14:14:36 +02:00
x
daca803280 sys: improve docstring for CondVar 2023-08-31 13:15:04 +02:00
x
902ec7bbf1 system: add unit tests for CondVar and StoppableTask like a good boi 2023-08-31 13:03:13 +02:00
parazyd
ab7a6af93a rpc/client: Refactor to use StoppableTask 2023-08-31 12:29:35 +02:00
y
92a7a80ddc cleanup: put test002 after test001 2023-08-31 09:54:26 +00:00
parazyd
fb1350daec rpc/server: Implement stop_connections() in RequestHandler. 2023-08-31 11:43:50 +02:00
parazyd
5b1510e112 rpc/server: Extend RequestHandler trait with methods for avoiding Mutex lock scope issues. 2023-08-31 11:08:18 +02:00
x
b0ca5dc7dd net/channel: improve Debug, and use {:?} in all trace/debug messages instead of self.address() 2023-08-31 10:23:24 +02:00
parazyd
882ef29351 rpc/server/test: Stop all active connections when the server is stopped. 2023-08-31 10:18:07 +02:00
parazyd
d030a19be4 rpc: Add missing license headers. 2023-08-31 09:53:04 +02:00
x
2c94dfdfa9 StoppableTask: use CondVar instead of channels, add logs and make impl more robust 2023-08-31 09:44:13 +02:00
Dastan-glitch
7ed79b1365 event_graph: [bug fix] rewrite get_offspring() method 2023-08-31 04:51:55 +03:00
parazyd
14fc49a7d6 rpc/server: Implement connection tracking through a StoppableTaskPtr set. 2023-08-31 01:19:22 +02:00
parazyd
59486b5392 system/stoppable_task: Implement Hash for StoppableTask and add an id field. 2023-08-31 01:18:45 +02:00
x
662c9936c6 undo accidental commit to cli.rs 2023-08-30 13:59:49 +02:00
x
0ecd4125a6 net: add inbound events to dnet 2023-08-30 13:47:22 +02:00
x
113978a6d4 darkirc: add p2p.get_info() 2023-08-30 13:27:06 +02:00
parazyd
9be54085bb net/acceptor: More robust handling of listener.next() errors. 2023-08-30 12:39:14 +02:00
parazyd
26090d9509 net/transport: Merge transport.rs and mod.rs 2023-08-30 11:53:20 +02:00
x
8a434ba6a6 net: add transport/mod.rs 2023-08-30 11:44:10 +02:00
x
4c3405697f Revert "net: Rename transport.rs to transport/mod.rs"
This reverts commit 9e61f76fd5.
2023-08-30 11:43:52 +02:00
parazyd
9e61f76fd5 net: Rename transport.rs to transport/mod.rs 2023-08-30 11:42:41 +02:00
x
08e5abb90b net: do some minor cleanup. move transport.rs into transport/ and make p2p.session_* non async functions 2023-08-30 11:35:56 +02:00
x
e481bd8bae add Error::SeedFailed 2023-08-30 10:33:01 +02:00
x
4cf9878604 net: fix the Option.unwrap() bug. Adding debug info, we see:
16:14:42 [DEBUG] (2) net::channel::stop(): END => address=tcp+tls://lilith1.dark.fi:5262 remote=485041065
    16:14:42 [DEBUG] (2) net::p2p::seed(): P2P::seed() [END]
    16:14:42 [DEBUG] (2) net::channel::main_receive_loop(): dnet sending recv msg, remote 485041065
    thread '<unnamed>' panicked at src/net/channel.rs:314:32:
    called `Option::unwrap()` on a `None` value

So the bug is caused after running p2p.seed(), where after
channel.stop() is called, main_receive_loop() keeps running. Examining
the code further we see ch.stop().await is called and the session is
destroyed but this doesn't give enough time for the channel to finish.

One solution is to modify `net/session/seedsync_session.rs` to this:

    let stop_sub = ch.subscribe_stop().await;
    ch.stop().await;
    stop_sub.recv().await;
    stop_sub.unsubscribe().await;

However a better solution is to make channel.stop() itself await until
the channel is fully closed (using the above code inside Channel::stop())

But the better solution is to ensure that StoppableTask.stop() itself
will not finish until the task it's responsible for has finished and
is no longer running. We do that by adding a stop barrier (see diff).
2023-08-30 10:19:52 +02:00
parazyd
31478a5305 zkas: Enable regression_001 test 2023-08-30 07:59:38 +02:00
parazyd
db28d4ef8a serial: Compile fix. 2023-08-30 07:59:19 +02:00
spital
2536a46aaa Dockerfile.almalinux and fix builds, latest working b36861fa1d_2023-06-13 (#183)
* Dockerfile.almalinux and fix builds, latest working b36861fa1d_2023-06-13

* Docker build can skip tests, add runtime deps

* update Fedora and Almalinux dockerfiles, worked for 95d0f47_2023-08-11 with "--build-arg DONT_EXEC_TESTS=1 --build-arg RUST_VER=nightly"

---------

Co-authored-by: parazyd <parazyd@dyne.org>
2023-08-30 05:57:33 +00:00
greptile
67b8de8451 zkas: fix index-out-of-bounds panic (#203)
Add check for indexing into byte array

Add regression unit test using input discovered via fuzzing

Co-authored-by: y <y>
Co-authored-by: parazyd <parazyd@users.noreply.github.com>
2023-08-30 05:51:01 +00:00
greptile
9d5ca4b904 zkas: fix out-of-memory panic (#202)
* zkas: fix out-of-memory panic

Fix panic due to unchecked Vec::with_capacity inputs. Also change
VecDeque to use the same validation pattern even though it was not
directly affected

Add panic regression unit test based on fuzzer input that caused the crash

* Add the vec alloc try to async serial as well

---------

Co-authored-by: y <y>
Co-authored-by: parazyd <parazyd@dyne.org>
2023-08-30 05:48:28 +00:00
parazyd
31a5f28d66 sdk: Enable halo2_gadgets dev feature used for constants tests. 2023-08-29 22:03:43 +02:00
parazyd
6a9f311c99 lib: Modify feature powerset
Attempted fix, use Github for global warming.
2023-08-29 14:27:05 +02:00
parazyd
cbe9c64065 chore: Update crate dependencies 2023-08-29 13:08:35 +02:00
parazyd
ffe8643812 bin: Feature cleanup 2023-08-29 13:08:35 +02:00
parazyd
8f46f7b777 lib: Clean up library features. 2023-08-29 13:08:35 +02:00
parazyd
35462e00b2 blockchain: Trivial cleanup, add FIXME for certain functions/deps. 2023-08-29 13:08:35 +02:00
parazyd
41bf60570a Implement standalone Makefiles for most of the bins and rework main Makefile. 2023-08-29 10:53:23 +02:00
x
18f7a27f66 net/acceptor: remove Mutex<Option<SessionWeakPtr>> in Acceptor, instead simply use SessionWeakPtr 2023-08-28 16:35:03 +02:00
aggstam
8e2b9e1838 chore: fmt 2023-08-28 17:24:19 +03:00
aggstam
dcdaa68115 net/acceptor: handle raw_os_error without unwrap() 2023-08-28 17:24:19 +03:00
x
adedcdbaaa Revert "net/acceptor: replace Mutex<Option<Weak<Session>>> with LazyWeak<Session>"
This reverts commit 34fc8fbd8f.
2023-08-28 14:15:09 +02:00
x
34fc8fbd8f net/acceptor: replace Mutex<Option<Weak<Session>>> with LazyWeak<Session> 2023-08-28 13:49:31 +02:00
parazyd
c9a9931300 serial: Correct code comment for blake2b serialization 2023-08-28 13:20:15 +02:00
parazyd
856b026f6b serial: Support variable-length BLAKE2b encoding. 2023-08-28 13:19:04 +02:00
parazyd
b80b4b755e net/acceptor: Handle accept(2) errors more robustly. 2023-08-28 10:34:43 +02:00
parazyd
624ea9a0c4 net/transport/tcp: Simplify tls accept 2023-08-28 10:11:05 +02:00
parazyd
dd49c947a1 serial/types: Add blake2b_simd support. 2023-08-28 09:27:43 +02:00
Dastan-glitch
71ec99e422 src/error: add forgotten event_graph error 2023-08-27 06:22:03 +03:00