441 Commits

Author SHA1 Message Date
Artur
af2a0e5206 Merge branch 'Cuprate:main' into main 2025-08-21 16:12:23 -03:00
Boog900
807bfafb35 cuprated: add txpool manager (#483)
* add txpool manager

* add version check for tx-pool

* add docs

* fix merge

* fix test

* fix merge

* fix cargo hack

* clean up imports

* fix typo

* add small buffer to rebroadcasts

* review fixes

* small clean up

* fmt

* fix merge

* review fixes
2025-08-15 15:41:23 +01:00
hinto-janai
32b3572450 lints: enable wildcard_enum_match_arm (#367)
* apply

* fixes

* clippy

* fmt

* fix

* review fix
2025-08-15 15:38:58 +01:00
Boog900
27a97ab106 Update deps (#527)
* fix clippy

* update deps

* fix ci
2025-08-12 22:43:47 +01:00
Boog900
db20a19d02 p2p: fix d++ state log (#523)
fix d++ state log
2025-08-12 22:43:33 +01:00
Boog900
93772f17ab p2p: Expose support flags (#521)
* expose connected peer's support flags

* expose basic node data

* derive clone

* fix IPv4 Endianness

* fix import order

* add node address to incoming peer list

* fix tests
2025-08-12 22:43:21 +01:00
Boog900
51d4e5f13c fix clippy (#525) 2025-08-12 22:43:07 +01:00
Omar
00e4a498b3 P2P: Add hourly warning logging for no incoming P2P connections (#520)
* Add hourly logging for no incoming P2P connections

* Address clippy findings

* Avoid creating Duration inside monitoring loop

---------

Co-authored-by: Omar Murad <me@omar-murad.com>
2025-08-07 14:28:33 +01:00
SyntheticBird
9c2c942d2f Add Tor support to Cuprate (Arti, Tor Daemon, Dandelion router) (#509)
In `workspace`:
- New dependencies: `arti_client`, `Cuprate/tokio-socks.git`, `tor-cell`, `tor-config-path`, `tor-hsservice`, `tor-persist`, `tor-proto`, `tor-rtcompat` (yes nothing was exported).
- In `deny.toml`, whitelisted `Unlicense` license for `arti_client`.

In `cuprate-p2p-transport`:
- Implemented `Transport<ClearNet>` and `Transport<Tor>` for `Arti`. New `ArtiClientConfig`, `ArtiServerConfig` configuration. New `OnionListener` for accepting inbound connections from arti's generated onion service.
- Implemented `Transport<Tor>` for `Daemon`. New `DaemonClientConfig`, `DaemonServerConfig` configuration. New `DaemonInboundStream` listening for incoming TCP  connections from the tor daemon.
- `DisabledListener` as a polyfill for transports with inbound disabled, such as `Transport<ClearNet> for Arti` and in the future `Transport<ClearNet> for Socks5`.

In `cuprate-p2p-core`:
- Removed `Default` and `Debug` bound from `Transport::ClientConfig` and `Transport::ServerConfig`.
- Removed `Clone` bound from `Transport::ServerConfig`.

In `cuprate-p2p`:
- Changed some function visibility to `pub(super)` instead of `pub`.

In `cuprate-wire`:
- Added `borsh` dependency and `BorshSerialize` and `BorshDeserialize` derived implementation to `OnionAddr` for `BorshNetworkZone` requirement in address book.

In `cuprated`:
- New `tor` module containing the initialization of Arti, config helpers and context structure `TorContext` to pass down to p2p initialization function and other helpers.
- New `config/tor` module containing the `[tor]` configuration table. It define tor daemon related variables, as well as arti settings.
- Added `enable_inbound` field to `ClearNetConfig` to disable incoming listener by default.
- Added `proxy` field to `ClearNetConfig` for enabling clearnet over arti and in the future proxy urls.
- Added `TorNetConfig` for setting `Tor` network zone parameters such as listening ports, enabling arti inbound server, or setting an anonymous inbound onion address from an external daemon.
- Modified `initialize_zones_p2p` to now start Tor network zone and use the correct transport depending on user configuration.
- In `txpool/*`, generalized `DiffuseService`, `OutboundPeerStream` and `ConcreteDandelionRouter` for `Z: NetworkZone`. Created a new `MainDandelionRouter` service that will route local txs to a Tor router instead of clearnet if available. Adapted initialization to the changes.

---------

Co-authored-by: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com>
2025-08-04 15:31:25 +01:00
hinto-janai
97e539559a rpc: submit_block + /send_raw_transaction (#515)
* enable `submit_block` and `/send_raw_transaction`

* endpoint

* map

* not_relayed

* book

* log

* Update binaries/cuprated/src/rpc/service/tx_handler.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

* review

* fix

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2025-07-17 00:34:33 +01:00
hinto-janai
d43e0957a2 Update repo to cuprated 0.0.5 (#501)
* apply

* ks

* update

* 515
2025-07-16 21:35:29 +01:00
hinto-janai
15c106f4a5 fast-sync: update height to 3456000 (#502)
* apply

* update
2025-07-16 21:30:26 +01:00
hinto-janai
b6a0302c81 ci: install openssl, fix clippy (#513)
* add openssl

* typos -w

* macro

* lint

* patch

* fix
2025-07-03 14:03:14 +01:00
hinto-janai
b6bd4ffb1f ci: extend build environments (#480)
* apply

* update

* fix

* revert

* latest

* hash

* use `GITHUB_SHA`

* update

* cargo update -p randomx-rs

* alpine

* bash

* curl

* comment alpine
2025-06-28 15:02:40 +01:00
hinto-janai
e67b9f5f68 storage: fix get_txid for pre-RCT outputs (#504)
* apply

* apply

* apply

* apply

* revert

* apply

* reduce diffs

* apply

* apply

* fix
2025-06-07 19:23:47 +01:00
SyntheticBird
d4caf95838 cuprated: Removing panicking assert in address_book_config (#506)
Remove addressb_book_config assert. Be careful.
2025-06-06 16:04:38 +01:00
SyntheticBird
392653c659 Define Tor Zone, add onion addressing and more (#481)
* Define Tor Zone, add onion addressing, extend AddressBook, adapt `handle_timed_sync_request`, changes in cuprated + some cleanup

In `cuprated`:

- Added `Z: NetworkZone` as a generic requirement for `address_book_config`. Now takes the optional node address in argument.
- Added `tor_net_seed_nodes` fn for obtaining tor seed nodes.
- Added `CrossNetworkInternalPeerId::Tor(_)` variant and `From<InternalPeerId<OnionAddr>>`

In `cuprate-wire`:

- Added `src/network_address/onion_addr.rs` implementing `OnionAddr` type used by `Tor` network zone.
- Implemented parsing, formatting, conversion and validation of `OnionAddr`.
- Implemented 2 validation tests and 2 parsing tests for `OnionAddr`.
- Documented and cleaned up `src/network_address/epee_builder.rs`.
- Changed `u8` `type` field of `TaggedNetworkAddress` to `AddressType` enum equivalent to monerod's `address_type`.
- Added additional `host` and `port` fields to `AllFieldedNetworkAddress` collection type.
- Added `NetworkAddress:Tor` variant and added conversion to related functions.

In `cuprate-address-book`:

- Added `our_own_addr: Z::Addr` field to AddressBookConfig. This adds a `Z: NetworkZone` requirement to `AddressBookConfig`.
- Adapted code to the new generic requirement.
- Implemented handling of new `AddressBookRequest::OwnAddress` for querying the node self specified address for the zone.

In `cuprate-p2p`:

- If `Z::BROADCAST_OUR_OWN_ADDR` = `true`, `handle_timed_sync_request` will insert the node's address to the peerlist being sent.

In `cuprate-p2p-core`:

- Removed `#[async_trait::async_trait]` attribute to `impl NetworkZone for *`.
- Added `AddressBookRequest::OwnAddress` and `AddressBookResponse::OwnAddress(Option<Z::Addr>)`.
- Defined new `Tor` `NetworkZone`

* fmt

* fix typo and fmt

* final edits?

* fix test

* forgor
2025-06-05 20:54:19 +01:00
Artur
6df4b7e102 Merge branch 'Cuprate:main' into main 2025-06-05 14:49:49 -03:00
hinto-janai
640ac1bc1c Update repo to cuprated 0.0.4 (#462)
* apply

* update

* update

* fs

* typos -w

* update
2025-06-04 17:29:32 +01:00
hinto-janai
4c2c749a4c cuprated: CupratedRpcHandler, enable certain endpoints (#450)
* add rpc server

* add init fn

* add layers

* docs

* comments

* move

* warn

* split config

* split

* fix toml

* impl p2p port

* fix tests

* docs

* doc

* remove (de)compression

* init rpc servers with handlers

* add `rpc.md`

* typo

* sort

* revert cargo.lock diff

* 🟣

* not_available()

* `advertise`

* Update binaries/cuprated/src/config/rpc.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

* update tracing

* `tracing::field::display`

* fix

* typo

* docs

* clippy

* remove comment_out

* add test for `cuprate_helper::net::ip_is_local`

* fix args

* `/get_outs`, `/get_height`

* enable methods

* apply

* block fn

* fix

* clippy

* book

* add warning

* update

* typos

* Update binaries/cuprated/src/rpc/handlers/helper.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

* fmt

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2025-06-04 17:28:40 +01:00
hinto-janai
cb41f2057e fast-sync: update height to 3425792 (#490)
* apply

* !!

* typos -w
2025-06-04 02:55:26 +01:00
Boog900
e3f60cc77e cuprated: Fix config flatten (#495)
* Fix config flatten

* add back docs on fields

* add bach addressbook config
2025-05-31 00:47:41 +01:00
hinto-janai
f882eb24f6 ci: Rust naming scheme for releases (#484)
apply
2025-05-30 19:38:54 +01:00
hinto-janai
004983d09e cuprated: integrate RpcServer (#423)
* add rpc server

* add init fn

* add layers

* docs

* comments

* move

* warn

* split config

* split

* fix toml

* impl p2p port

* fix tests

* docs

* doc

* remove (de)compression

* `advertise`

* Update binaries/cuprated/src/config/rpc.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

* update tracing

* `tracing::field::display`

* fix

* typo

* docs

* clippy

* remove comment_out

* add test for `cuprate_helper::net::ip_is_local`

* add `FIXME`

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2025-05-30 19:38:11 +01:00
hinto-janai
2a3de0b9ac randomx-rs: ab4a0ea -> 567bdca (#493)
* update

* update

* cargo update -p randomx-rs
2025-05-30 19:37:33 +01:00
Boog900
1b28c3b728 Add Fuzzing + fix found issues (#464)
* add fuzz tests

* fix CI

* fix found vuln

* fix deny

* add more targets

* fmt + clippy

* Add exclude for fuzz

* add defaults rather than exclude

* add fuzz to CI

* remove clippy run

* add readme

* review fixes

* Update Cargo.toml

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

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2025-05-28 20:29:06 +01:00
hinto-janai
118f02d52e workspace: Rust 1.85..=1.87 (#482)
* apply

* remove false positive

* manual_midpoint

* fmt

* fix macro

* reason

* lukka/get-cmake@v4.0.2

* lukka/get-cmake@v4.0.1

* revert cmake
2025-05-27 23:55:14 +01:00
hinto-janai
1c22d40bb5 randomx-rs: e09955c -> ab4a0ea (#487)
apply
2025-05-27 21:22:09 +01:00
Artur
11722e053b Bypass uninmplemented stuff 2025-05-22 13:52:12 -03:00
hinto-janai
ce7a04f2d9 Update bug template (#460)
edit bug.md
2025-05-13 01:59:51 +01:00
SyntheticBird
a23ca6f730 P2P: Abstract TCP methods under the Transport Trait. (#446)
Abstract TCP methods under the Transport Trait.

In workspace:
- Added a new `cuprate-p2p-transport` crate that will later welcome
complex or crate dependent transport implementations. (Arti for example.)

In `cuprate-p2p-core`:
- Implemented a new Transport trait that abstract methods to listen
for or connect to other peers over a NetworkZone Z.
- Reduced `NetworkZone` trait accordingly.
- Added a new `BROADCAST_OWN_ADDR` to `NetworkZone` for anonymized
networks.
- Implemented `Tcp` transport for `ClearNet`.
- Implemented `Dummy` transport for placeholder/testing purposes
- Adapted definition of P2P components to the new `Transport` trait.
- Changed original `InBoundStream` implementation to support two
different but optional listeners (IPv4/IPv6)

In `p2p-core/tests`:
- Implemented `FragTcp` for fragmented message testing

In `cuprated`:
- Added `p2p.enable_inbound_v6` and `listen_on_v6` config field.
- Added `From<&ClearNetConfig>` for `TransportConfig<ClearNet, Tcp>`.
- Abstracted original `start_clearnet_p2p` to `start_zone_p2p` with a
given `NetworkZone` and `Transport`.
- Zone/NetworkInterface<Z> P2P initialization has been moved to `cuprated::p2p` in
`initialize_zones_p2p` fn.
- Defined `NetworkInterfaces` collection (useless at the moment).
2025-05-10 14:22:19 +01:00
hinto-janai
63246843fe changelog: add #457 + #458 (#459)
* 457

* 458

* wording
2025-05-07 23:32:36 +01:00
oussama
4417c65d44 display formatter implementation (#457)
* display formatter implementation

* show file system configuration

* updating display format to have pretty debug
2025-05-07 23:31:55 +01:00
Boog900
2acced631a fix epee bin OOM (#458)
* fix epee bin OOM

* fix epee bin OOM

* fmt imports

* ci

* add docs
2025-05-07 22:02:49 +01:00
hinto-janai
11d0272a5c Update repo to cuprated 0.0.3 (#437)
* 0.0.3

* update sanity timestamp

* case

* changes

* intro

* prs

* include 456
2025-05-07 02:10:09 +01:00
Boog900
d7e6eb785b cuprated: fix alt block log (#456)
fix alt block log
2025-05-06 19:11:49 +01:00
Boog900
4f020deece cuprated: Bad reorg recover (#449)
* add more logging

* add recovery from bad reorgs

* fmt

* fix typos false positive

* fix typo
2025-05-03 16:57:34 +01:00
hinto-janai
a85d99bdc6 ci: fix deny (#452)
cargo update -p crossbeam-channel
2025-05-03 14:56:54 +01:00
hinto-janai
b862b3da83 fast-sync: .bin -> .json (#448)
* serialize to json

* hex

* build script + static

* doc
2025-05-02 18:55:12 +01:00
hinto-janai
fac61ccb1e Add cuprated.service (#444)
* add `binaries/cuprated/cuprated.service`

* ci

* docs
2025-04-30 16:20:51 +01:00
Boog900
474ff9ed6f cuprated: relay rules (#424)
* add relay rules

* add comments

* fmt

* sort imports

* review fixes
2025-04-11 23:02:06 +01:00
Boog900
eceb74f183 cuprated: fix switching to main chain after a reorg (#438)
* fix switching to main chain after a reorg

* fmt

* sort imports
2025-04-10 21:59:14 +01:00
Boog900
91099846d6 fix clippy warnings (#439)
fix clippy
2025-04-10 21:58:56 +01:00
Brandon Trussell
24265ac43c Use blank peer list if saved peer list cannot be read. (#426)
* Use blank peer list if saved peer list cannot be read.

* Format corrections

* The delete operation is not needed.
2025-04-10 14:25:46 +01:00
hinto-janai
95aca1d4a5 ci: fix release.yml (#434)
gen config
2025-04-09 16:01:19 +01:00
hinto-janai
b169557ff2 ci: fix deny (#430)
`cargo update -p tokio`
2025-04-09 15:07:37 +01:00
hinto-janai
56d3459782 cuprated: v0.0.2 version + changelog (#413)
* update

* !!

* update

* version
2025-04-09 15:05:45 +01:00
hinto-janai
159016f10e cuprated: update killswitch timestamp for v0.0.2 (#403)
* update

* Update binaries/cuprated/src/killswitch.rs

Co-authored-by: Boog900 <boog900@tutanota.com>

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2025-04-09 15:03:56 +01:00
hinto-janai
51b56b0a8b cuprated/database: fix error mappings + msg (#419)
* add

* dbi

* err

* log and panic
2025-04-09 01:18:01 +01:00
hinto-janai
550d8598e4 books: user-book for cuprated 0.0.2 (#402)
* title

* fixes

* add `--version` table

* add types

* config docs

* add macro docs

* fix

* case

* Update binaries/cuprated/src/config.rs

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2025-04-09 01:12:05 +01:00