Commit Graph

3309 Commits

Author SHA1 Message Date
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
Dastan-glitch
3840fda64b event_graph: better error handling 2023-08-27 06:07:04 +03:00
x
5874702bce p2p channels() doesn't need to be async 2023-08-26 11:27:40 +02:00
parazyd
33631ab318 net/transport/tcp: Restore usage of socket2 to create TCP sockets. 2023-08-25 20:40:24 +02:00
parazyd
44b8cd022a system/lazy_weak: Fix rustdoc 2023-08-25 19:36:31 +02:00
parazyd
2b7dd67309 chore: Clippy lints and compile fixes. 2023-08-25 19:28:08 +02:00
parazyd
41631701ac consensus: Compile fix. 2023-08-25 19:23:07 +02:00
parazyd
974ab22b96 net/seedsync_session: Use AtomicUsize for counting failed seed queries and return error. 2023-08-25 19:22:30 +02:00
parazyd
d7303b9784 net/seed: Count failed seeds and log error if all queries failed. 2023-08-25 19:10:57 +02:00
x
250c8ba2d0 bugfix: there's a type Arc<Weak<Foo>> when it should be Weak<Foo> 2023-08-25 19:07:53 +02:00
x
347f6da54e net/outbound: put p2p.remove_pending() in the correct place. 2023-08-25 18:45:49 +02:00
x
32c7cf0d63 net: fix the ever elusive bug that started our quest 2023-08-25 18:38:51 +02:00
x
2802225ddb remove nonsense code 2023-08-25 18:10:42 +02:00
x
cbee8ccace s/_addr/addr_/ 2023-08-25 17:14:07 +02:00
x
1e752bfb7e net: add peer discovery connection strategy 2023-08-25 17:05:21 +02:00
parazyd
9ed979454c chore: Add license headers to new .rs files. 2023-08-25 16:56:12 +02:00
x
324024b83e system/net: introduce LazyWeak which simplifies parent-child hierarchies 2023-08-25 15:17:58 +02:00
x
dce54b61c3 net/outbound_session: add PeerDiscovery process to OutboundSession. Slots and PeerDiscovery communicate through CondVar 2023-08-25 14:50:38 +02:00
x
61b35c2b79 system: add CondVar 2023-08-25 10:47:10 +02:00
parazyd
092b3bd0dd net/outbound_session: Randomize hosts list in fetch_address_with_lock. 2023-08-25 09:46:25 +02:00
Dastan-glitch
a2cc4a146f src/serial: add necessery imports for tests 2023-08-25 05:01:11 +03:00