Commit graph

10 commits

Author SHA1 Message Date
93372fa4b5
P2P Address book & Handshake changes (#89)
* use tokio's delay queue for bans

* document handles

* remove peers from address book when retrieving

* ping inbound peers during handshakes

* support receiving pings during handshakes

* add peer to anchor before reducing whit list

* clippy

* comment handshakes

* typos

* sort `use`

* use `rand::prelude::*`

* review comments

* update macro
2024-03-20 20:58:12 +00:00
159c8a3b48
levin: fragmented messages (#84)
* levin: fix fragmented messages & use bitflags

* levin: add a method to fragment a message

* levin: add tests for fragmented messages and fix issues

* fix docs

* tests: don't include bytes length

* levin: add support for sending fragmented
/ dummy messages

* fmt

* add fragmented handshake tests.

* fix handshake detection when fragmented
and alt (non-monero) protocol info

* add tracing logs

* remove `already_built`, this was an old way I was thinking of sending raw buckets

* clippy

* clippy 2

* Update net/levin/src/message.rs

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>

* review comments

* add timeout to tests

* Update net/levin/src/header.rs

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-03-05 01:29:57 +00:00
e560ecc2ee
Add a test for an inbound handshake from monerod (#75)
* monerod: set a random DB and remove dir when done

* add a test for an inbound monerod handshake

* don't fail if can't remove dir on windows

* Update test-utils/src/monerod.rs

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>

* use `temp_dir`

* use `tempfile`

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-02-25 21:21:25 +00:00
475c8c5ac0
imporove Monerod spawn stability (#66)
* output monerod logs when a thread panics

* always spawn a monerod don't attempt to re-use

* set zmq port and `non-interactive`

* check monerod has started before test

* remove test panic

* review changes
2024-02-16 22:47:50 +00:00
hinto-janai
630faed263
ci: include macos + windows (#52)
* ci: install boost, include macos + windows

* cryptonight: fix `MSVC`

* cryptonight: use `flag_if_supported()`

* fix cryptonight builds

* update randomX

* fix rx builds

* add memwipe

* include memwipe.c in build

* spawn monerod in msys2 for windows

* fix last commit

* install dependencies before spawning monerod

* remove --detach

* try another way of spawning monerod

* add /I

* download and spawn monerod as a part of tests

* add download.rs

* extend time for monerod spawn

* move sleep and show monerod output

* fix clippy

* change stdin to pipped

* #[cfg(unix)] on bytes::Buf

* fix macos capitalisation

* remove tar.bz2 on macos expected dir

* remove zip on windows expected dir

* fix todo

* add docs

* fix a couple typos

---------

Co-authored-by: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com>
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-02-12 13:39:15 +00:00
Boog900
83b59c557c
net: use epee_encoding instead of monero-epee-bin-serde
This gives us more control than what serde provides. This
PR also moves to use `Bytes` where possible to allow
zero-copy parsing of network messages.
2024-01-30 16:09:54 +00:00
Boog900
ed598e374e
remove empty cuprate bin and common 2024-01-22 01:56:34 +00:00
Boog900
a0b9280801
fix message requesting in Connection 2024-01-13 13:22:34 +00:00
Boog900
478a8c1545
return the Client after a handshake 2024-01-13 00:07:35 +00:00
Boog900
2c4cc1fb93
move address book to separate crate.
Also changes the address book to use the network zone trait
2023-12-08 15:03:01 +00:00