Commit graph

317 commits

Author SHA1 Message Date
Boog900
cfe5bea453
fix tests
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
2024-06-13 23:07:35 +01:00
Boog900
3e87556411
add a timeout 2024-06-13 22:12:41 +01:00
Boog900
3a7a8563e6
Merge branch 'main' into block-downloader 2024-06-13 22:05:58 +01:00
Boog900
6d83cda90f
clean up test 2024-06-13 22:04:58 +01:00
acd5380256
Fix clippy & Cargo update (#161)
Some checks are pending
Audit / audit (push) Waiting to run
CI / fmt (push) Waiting to run
CI / typo (push) Waiting to run
CI / ci (macos-latest, stable, bash) (push) Waiting to run
CI / ci (ubuntu-latest, stable, bash) (push) Waiting to run
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Waiting to run
Deny / audit (push) Waiting to run
* fix clippy

* run cargo update

* fix cargo deny

* remove duplicate `#[test]`
2024-06-13 19:08:34 +01:00
Boog900
3d995c5af5
order imports correctly 2024-06-13 16:44:07 +01:00
hinto-janai
25b5b63349
ci: update actions/cache -> v4 (#158)
Some checks are pending
CI / fmt (push) Waiting to run
CI / typo (push) Waiting to run
CI / ci (macos-latest, stable, bash) (push) Waiting to run
CI / ci (ubuntu-latest, stable, bash) (push) Waiting to run
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Waiting to run
2024-06-13 16:37:26 +01:00
Boog900
efbe18b242
remove test unwrap 2024-06-13 15:54:13 +01:00
Boog900
18d4b77070
fix test 2024-06-13 14:36:11 +01:00
Boog900
dd9e63d408
add a test
Some checks are pending
Audit / audit (push) Waiting to run
Deny / audit (push) Waiting to run
2024-06-13 03:15:47 +01:00
hinto-janai
a3e34c3ba8
rpc: implement json-rpc crate (#148)
Some checks failed
Audit / audit (push) Has been cancelled
CI / fmt (push) Has been cancelled
CI / typo (push) Has been cancelled
CI / ci (macos-latest, stable, bash) (push) Has been cancelled
CI / ci (ubuntu-latest, stable, bash) (push) Has been cancelled
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Has been cancelled
Deny / audit (push) Has been cancelled
* rpc: add `json-rpc` from https://github.com/Cuprate/cuprate/pull/43

Maintains all the changes made in that branch

* workspace: add `rpc/json-rpc`

* json-rpc: fix cargo.toml

* add todo

* satisfy clippy

* `method/params` -> `body` switch, adjust input types

* add test helpers, test tagged enums and flatten structs

* fix id type `None` <-> `Some(Id::Null)` difference

* lib.rs: add docs

* impl `Version`

* impl `Id`

* impl `Request`

* impl `Response`

* impl `ErrorCode`

* impl `ErrorObject`

* fixes

* add monero jsonrpc tests

* response: add id test

* add display docs to `ErrorObject`

* remove `#[inline]`

* add id null test

* cleanup

* code: clarify Monero's error code usage in docs

* id: fix macro indentation

* readme: fix `Response` -> `Request`

* request: add `lowercase` test

* tests: formatting, more string tests

* readme: add `Serialization changes`

* code: ugly `match` -> `if`

* response: manual deserialization impl

- lowercase keys only
- enforce either `result/error` but not both

* remove unneeded clone bounds

* readme: add implementation comparison tests

* request/response: more tests

* readme: formatting, assert error messages are expected

* request: add unknown field test

* request/response: add unknown field and unicode test
2024-06-12 02:12:31 +01:00
Boog900
cefd8a7a3f
fix previous merge 2024-06-12 01:46:17 +01:00
Boog900
c5a493a186
remove spammy log
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
2024-06-12 01:38:37 +01:00
Boog900
712e9723b2
remove test_init 2024-06-12 01:25:14 +01:00
Boog900
8fb1406490
doc changes 2024-06-12 01:24:36 +01:00
Boog900
002df61ac0
fix panic 2024-06-12 00:23:56 +01:00
Boog900
4ef809e85f
tracing + bug fixes 2024-06-12 00:06:59 +01:00
Boog900
e81593beff
clean up API and add more docs 2024-06-11 02:41:05 +01:00
Boog900
7d33ab25b4
fix stopping the block downloader
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
2024-06-10 22:12:14 +01:00
Boog900
bd1b7ff6c5
fix .lock 2024-06-10 20:01:45 +01:00
f043e0b71a
Merge branch 'main' into block-downloader 2024-06-10 18:59:24 +00:00
Boog900
fe597a7fd3
fix clippy 2024-06-10 19:58:21 +01:00
Boog900
78e63e2cbf
keep peers that dont have the current need data 2024-06-10 19:17:09 +01:00
Boog900
6776264dc6
add some limits on messages 2024-06-10 02:21:49 +01:00
jomuel
663c852b13
Fast sync (WIP) (#155)
Some checks failed
Audit / audit (push) Has been cancelled
CI / fmt (push) Has been cancelled
CI / typo (push) Has been cancelled
CI / ci (macos-latest, stable, bash) (push) Has been cancelled
CI / ci (ubuntu-latest, stable, bash) (push) Has been cancelled
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Has been cancelled
Deny / audit (push) Has been cancelled
* Fast sync (work in progress)

* Cargo.lock

* Add missing hashes file

* clippy warnings

* Stub of database tool to create the fast sync hashes

* Command line arg for target height, error handling

* Cargo.lock

* fmt and unused imports

* fmt

* Add license information to consensus/fast-sync/Cargo.toml

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

* Order imports in consensus/fast-sync/src/create.rs

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

* beautify hex generation function & fmt

* Reorder imports consensus/fast-sync/src/fast_sync.rs
2024-06-09 14:24:44 +01:00
Boog900
08f1abb9df
add more docs 2024-06-09 02:38:00 +01:00
Boog900
d7c9032dd8
fix imports 2024-06-08 02:40:28 +01:00
hinto-janai
e0736d1807
books: add user-book template (#154)
Some checks failed
CI / fmt (push) Has been cancelled
CI / typo (push) Has been cancelled
CI / ci (macos-latest, stable, bash) (push) Has been cancelled
CI / ci (ubuntu-latest, stable, bash) (push) Has been cancelled
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Has been cancelled
* add user-book

* add `A-book-user` to labeler
2024-06-07 22:04:27 +01:00
0e5555d4d4
Consensus: block batch prepper (#151)
* add block batch prepper

* Apply suggestions from code review

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

* review comments

* review comments

* fix doc

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-06-07 21:23:48 +01:00
07f61bdb9c
Consensus: fix panic in batch verifier (#152)
Some checks failed
CI / fmt (push) Waiting to run
CI / typo (push) Waiting to run
CI / ci (macos-latest, stable, bash) (push) Waiting to run
CI / ci (ubuntu-latest, stable, bash) (push) Waiting to run
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Waiting to run
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
* fix panic in batch verifier

* docs

* review comments

* Update consensus/rules/src/batch_verifier.rs

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

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-06-07 13:34:53 +01:00
Boog900
d3e784d432
fix merge
Some checks failed
Audit / audit (push) Has been cancelled
Deny / audit (push) Has been cancelled
2024-06-06 02:12:15 +01:00
Boog900
9edcb760f7
Merge branch 'main' into block-downloader 2024-06-06 01:36:15 +01:00
hinto-janai
6df67bb9d3
rpc: add initial crates (#146)
Some checks failed
Audit / audit (push) Has been cancelled
CI / fmt (push) Has been cancelled
CI / typo (push) Has been cancelled
CI / ci (macos-latest, stable, bash) (push) Has been cancelled
CI / ci (ubuntu-latest, stable, bash) (push) Has been cancelled
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Has been cancelled
Deny / audit (push) Has been cancelled
* add `rpc/` crates

* rpc: fix `monero-rpc-server` -> `monero-rpc-types`

* rpc: add skeleton `rpc/json-rpc`

* remove `cuprate-rpc-server`, add `json-rpc`
2024-06-05 15:35:08 +01:00
0622237d19
Consensus: use cuprate-types types (#145)
Some checks failed
Audit / audit (push) Has been cancelled
CI / fmt (push) Has been cancelled
CI / typo (push) Has been cancelled
CI / ci (macos-latest, stable, bash) (push) Has been cancelled
CI / ci (ubuntu-latest, stable, bash) (push) Has been cancelled
CI / ci (windows-latest, stable-x86_64-pc-windows-gnu, msys2 {0}) (push) Has been cancelled
Deny / audit (push) Has been cancelled
* move consensus database to /types

* fix `storage` builds

* unify `VerifiedBlockInformation`

* fix docs

* change `Database` trait wording

* order imports

* service -> blockchain

* Apply suggestions from code review

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

* fix typo

* fix key_images_spent

* add back todo

* fix tests

* service -> blockchain 2

* update docs

* update docs 2

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-06-04 18:19:35 +01:00
b510739701
P2P: Network init (#130)
* p2p changes

* clippy

* a few more docs

* init cuprate-p2p

* remove some unrelated code and add some docs

* start documenting client_pool.rs

* add more docs

* typo

* fix docs

* use JoinSet in connection maintainer

* small changes

* add peer sync state svc

* add broadcast svc

* add more docs

* add some tests

* add a test

* fix merge

* add another test

* unify PeerDisconnectFut and add more docs

* start network init

* add an inbound connection server

* remove crate doc for now

* fix address book docs

* fix leak in client pool

* correct comment

* fix merge + add some docs

* fix doc

* dandelion_tower -> dandelion-tower

* fix async-buffer builds

* check if incoming peers are banned

* add interface methods

* update docs

* use a JoinSet for background network tasks

* Apply suggestions from code review

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

* Update p2p/monero-p2p/src/services.rs

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

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-06-04 18:19:25 +01:00
Boog900
fd8885174b
more checks on incoming data 2024-06-04 02:42:53 +01:00
Boog900
51e67163a8
Keep a longer of queue of blocks to get 2024-06-03 16:08:10 +01:00
Boog900
44c7ad4992
dynamic batch size changes 2024-06-01 02:02:45 +01:00
Boog900
334a62115b
Merge branch 'network-init' into block-downloader 2024-06-01 00:36:48 +01:00
889e15738b
Cleanup & Document consensus (#65)
* change monero-consensus to cuprate-consensus-rules

* document the context service

* remove the mutex on blockchain context

* comment the context caches

* add back tokio

* document block checks

* typo

* keep tha amount of outputs with a certain amount in the output cache

* typo

* nuke cross-block batch verification

* remove RPC scanner

* change how contextual data is got.

* fmt & clippy fixes

* typo

* cargo update

* restore Cargo.lock

* add a verify tx test.
+ fixes an issue with verifying signatures after BPs

* clippy

* remove bad test

* add mores tests and fix a couple bugs

* typos

* move tests and add some more

* typo

* remove scan_chain docs

* fix check for duplicate txs when duplicates are not sequential

* add a proptest for dup txs

* cache tx verification state

* doc updates + move `Vec` to `Arc<[]>`

* clippy

* misc changes

* Apply suggestions from code review

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
Co-authored-by: SyntheticBird <118022351+SyntheticBird45@users.noreply.github.com>

* fix fmt

* review changes

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
Co-authored-by: SyntheticBird <118022351+SyntheticBird45@users.noreply.github.com>
2024-05-31 01:52:12 +01:00
Boog900
cbcfbff878
use a JoinSet for background network tasks 2024-05-30 21:14:28 +01:00
Boog900
cce4ef96dd
update docs 2024-05-30 18:24:23 +01:00
Boog900
d84e8a48f8
add interface methods 2024-05-30 17:02:38 +01:00
Boog900
fd7225e673
check if incoming peers are banned 2024-05-30 02:03:48 +01:00
Boog900
a4ca123589
fix async-buffer builds 2024-05-30 01:27:27 +01:00
Boog900
a53279a8c6
Merge branch 'main' into network-init 2024-05-30 01:25:59 +01:00
Boog900
384818f57f
dandelion_tower -> dandelion-tower 2024-05-30 01:25:55 +01:00
hinto-janai
d21160868c
books: add skeleton and docs (#141)
* update `books/`

* update CONTRIBUTING.md

* .gitignore: ignore built books

* add dummy `books/architecture/`

* remove some changes from CONTRIBUTING.md

out of scope, will be in another PR

* add docs/books to LICENSE

* formatting
2024-05-30 01:19:46 +01:00
Boog900
1ae87734fe
dynamic batch sizes 2024-05-29 23:47:32 +01:00
hinto-janai
c50d9642be
storage: create Cargo.toml for {database, cuprate-txpool} (#140) 2024-05-29 20:00:29 +01:00