Commit Graph

6769 Commits

Author SHA1 Message Date
parazyd
9be54085bb net/acceptor: More robust handling of listener.next() errors. 2023-08-30 12:39:14 +02:00
parazyd
eae2e53f42 Add a libsqlite3-sys exception when building on musl-libc. 2023-08-30 12:17:01 +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
parazyd
3a948fee72 lilith: Also purge host after handshake failure.
So far we've been only doing it when the host is unreachable,
but we can be aggressive now.
2023-08-30 11:13:59 +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
spital
2a67711868 fix/update_dependencies_202307_fedora_almalinux (#182)
Co-authored-by: parazyd <parazyd@users.noreply.github.com>
2023-08-30 05:52:01 +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
greptile
7e76cf360c docs: Add more details about fuzzing (#201)
Add more documentation to fuzz/README.md, especially when it comes to
interpreting out-of-memory issues.

Co-authored-by: y <y>
Co-authored-by: parazyd <parazyd@users.noreply.github.com>
2023-08-30 05:44:42 +00:00
y
374d19851f fuzz: Restructure corpora git structure
Use artifacts/ rather than corpus/ to track fuzz inputs. corpus appears
to be a temporary directory that will be modified when minimizing test
cases using commands like `cargo fuzz cmin` or `cargo fuzz tmin`. For
this reason it's not suitable for long-term storage and is likely to
make the git commit-staging process very messy.
2023-08-30 05:42:23 +00:00
greptile
ccc46c2d3e doc: add troubleshooting steps for development (#199)
* doc: add troubleshooting steps for development

* Minor consistency fixes

---------

Co-authored-by: y <y>
Co-authored-by: parazyd <parazyd@dyne.org>
2023-08-30 05:40:51 +00:00
parazyd
c36e34eb83 Makefile: Remove target directory on distclean 2023-08-30 07:36:35 +02:00
parazyd
31a5f28d66 sdk: Enable halo2_gadgets dev feature used for constants tests. 2023-08-29 22:03:43 +02:00
parazyd
b72660860c lib: Hopefully final feature powerset fix 2023-08-29 18:26:36 +02:00
parazyd
96d35d5022 research/pow: Block timestamp verification 2023-08-29 17:48:46 +02:00
parazyd
e8a25b9ec4 Kill Tim Cook 2023-08-29 14:34:20 +02:00
parazyd
a59b628db5 research/pow: Add missing license header. 2023-08-29 14:27:20 +02:00
parazyd
6a9f311c99 lib: Modify feature powerset
Attempted fix, use Github for global warming.
2023-08-29 14:27:05 +02:00
parazyd
27606a5a46 Update github actions 2023-08-29 13:46:30 +02:00
parazyd
27b8d01287 chore: Clippy lints 2023-08-29 13:40:57 +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
e2956a1451 Update system library dependency list. 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
parazyd
39e9d77e67 vanityaddr: Replace clap with arg and add standalone Makefile. 2023-08-29 10:19:10 +02:00
parazyd
0051baf300 zkas: Add standalone Makefile. 2023-08-29 08:59:42 +02:00
parazyd
0440864b3a fuzz: Use patched blake2_simd crate. 2023-08-29 08:58:49 +02:00
parazyd
a659081d52 research/pow: Ignore genesis block for diff calc. 2023-08-28 20:50:46 +02:00
parazyd
5aa411779c research/pow: Add difficulty adjustment algorithm with passing Monero tests. 2023-08-28 20:38:52 +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
6867eab442 research/pow: Actually push transactions into the block 2023-08-28 11:23:01 +02:00
parazyd
f441e4c512 research/pow: Print RandomX hash bytes on successful mining 2023-08-28 11:19:39 +02:00
parazyd
16a043537d research/pow: Multithreaded setup 2023-08-28 11:10:43 +02:00
parazyd
b80b4b755e net/acceptor: Handle accept(2) errors more robustly. 2023-08-28 10:34:43 +02:00