Commit graph

77 commits

Author SHA1 Message Date
hinto.janai
8ac347d3cf
clippy 2025-03-26 21:07:09 -04:00
hinto.janai
daa6f630d9
rct output fix 2025-03-26 20:21:14 -04:00
hinto.janai
373c890a77
output fix 2025-03-26 20:08:22 -04:00
hinto.janai
986c5c4b25
fix 2025-03-25 20:42:07 -04:00
hinto.janai
d18a9dade3
fix 2025-03-25 19:56:20 -04:00
hinto.janai
366c4a3ea4
Merge branch 'main' into other 2025-03-25 19:44:12 -04:00
b97bbab593
Cuprated: Fix reorgs ()
* fix reorgs

* fix off by 1 and add a test

* commit file

* docs

* remove unneeded fn

* fix tests
2025-03-21 17:52:10 +00:00
1549a88618
cuprated: Add fast sync ()
* add specific method for context

* add new statemachine for tx verification

* fix consensus crates build

* working builds

* fix CI

* add docs

* fix CI

* fix docs

* fix clippy

* cleanup

* add docs to `blockchain_context`

* fix doc tests

* add output cache

* new monero-serai

* todo

* todo

* Revert "new monero-serai"

This reverts commit fe3f6acc676fe59e794d5f92f07f76445db35199.

* use indexmap to request outputs

* clean up

* fix typos

* fix CI

* fix cargo hack

* fix reorgs

* check if a block is already present before adding it to the alt block cache

* fmt

* update to new monero oxide API

* fmt & fix cache

* update config values

* fix tests

* add fast sync

* fix start_height check

* disable kill switch for now

* add fast sync config options

* add docs

* wait for all blocks to download before starting the syncer again.

* fix permit

* typo

* fix import order

* fmt

* add docs + order imports

* fix clippy

* review fixes

* rename top -> stop
2025-03-08 01:54:34 +00:00
5c2b56c78e
Update to experimental monero oxide api ()
* add specific method for context

* add new statemachine for tx verification

* fix consensus crates build

* working builds

* fix CI

* add docs

* fix CI

* fix docs

* fix clippy

* cleanup

* add docs to `blockchain_context`

* fix doc tests

* add output cache

* new monero-serai

* todo

* todo

* Revert "new monero-serai"

This reverts commit fe3f6acc676fe59e794d5f92f07f76445db35199.

* use indexmap to request outputs

* clean up

* fix typos

* fix CI

* fix cargo hack

* fix reorgs

* check if a block is already present before adding it to the alt block cache

* fmt

* update to new monero oxide API

* fmt & fix cache

* update config values

* fix tests

* fix no-std builds
2025-03-06 19:03:25 +00:00
6a9356b552
consensus: Batch get outputs ()
* add specific method for context

* add new statemachine for tx verification

* fix consensus crates build

* working builds

* fix CI

* add docs

* fix CI

* fix docs

* fix clippy

* cleanup

* add docs to `blockchain_context`

* fix doc tests

* add output cache

* new monero-serai

* todo

* todo

* Revert "new monero-serai"

This reverts commit fe3f6acc676fe59e794d5f92f07f76445db35199.

* use indexmap to request outputs

* clean up

* fix typos

* fix CI

* fix cargo hack

* update doc comment

* fix non-rct miner tx error

* Apply suggestions from code review

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

* Update storage/database/src/backend/redb/env.rs

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

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2025-03-06 16:17:09 +00:00
1c04634396
P2P: fix deadlock ()
* fix deadlock

* fix ci

* clean up + docs

* fmt

* remove extra tick

* fix typos
2025-03-04 21:36:27 +00:00
hinto.janai
ecc21d22b0
Merge branch 'main' into other 2025-01-29 15:27:30 -05:00
hinto-janai
7e8e62135c
database: SyncMode changes ()
apply
2025-01-29 14:41:30 +00:00
d8d1e34266
Consensus: Improve API ()
* add specific method for context

* add new statemachine for tx verification

* fix consensus crates build

* working builds

* fix CI

* add docs

* fix CI

* fix docs

* fix clippy

* cleanup

* add docs to `blockchain_context`

* fix doc tests

* review fixes

* fix cargo doc
2025-01-28 22:25:20 +00:00
hinto.janai
405db208c7
Merge branch 'main' into other 2025-01-17 15:28:17 -05:00
503ef11514
cuprated: Init ()
* add cuprated skeleton

* fmt and add deny exception

* add main chain batch handler

* add blockchain init

* very rough block manager

* misc changes

* move more config values

* add new tables & types

* add function to fully add an alt block

* resolve current todo!s

* add new requests

* WIP: starting re-orgs

* add last service request

* commit Cargo.lock

* add test

* more docs + cleanup + alt blocks request

* clippy + fmt

* document types

* move tx_fee to helper

* more doc updates

* fmt

* fix imports

* remove config files

* fix merge errors

* fix generated coins

* handle more p2p requests + alt blocks

* clean up handler code

* add function for incoming blocks

* add docs to handler functions

* broadcast new blocks + add commands

* add fluffy block handler

* fix new block handling

* small cleanup

* increase outbound peer count

* fix merge

* clean up the blockchain manger

* add more docs + cleanup imports

* fix typo

* fix doc

* remove unrelated changes

* add `get_objects` handler

* add `get_chain` handler

* add `fluffy_missing_txs` handler

* add `new_fluffy_block` handler

* improve interface globals

* manger -> manager

* enums instead of bools

* move chain service to separate file

* more review fixes

* sort imports + docs

* init config

* init dandelion integration

* add dandelion start function

* finish incoming tx handler

* Add tx blob hash table

* Add missing txpool requests

* handle duplicate stem txs

* check txpool on incoming block

* add request to remove tx in new blocks from the pool

* tell the txpool about incoming blocks

* fix merge

* typos

* remove blockchain height from txpool

* fix merge

* fix merge

* handle incoming txs in p2p request handler

* split sections

* finish initial config.

* fix clap

* misc changes

* fix doc

* fix test & clippy

* fix test 2

* try fix windows

* testing

* testing 2

* fix windows test

* fix windows: the remix.

* Allow `IncomingTxHandler` to be given later

* add p2p clearnet init

* fix build

* misc changes

* review comments

* fix imports

* rename & fix default config file

* fix cargo hack

* enable serde on `cuprate-helper`

* changes from matrix chats

* fix ci

* fix doc

* fix doc test

* doc updates

* more doc updates

* sort imports

* add startup code

* d -> h

* add file logging

* fix stem peer service

* todo

* remove `get_range`

* change usages of `get_range`

* clippy

* cargo update

* fix test + update comment

* manually set numb threads for each pool

* fix address book saves

* add more data to status

* fix config

* cleanup main + logging

* add more info to output when changing log level

* cleanup commands

* fix small issue in block downloader  more misc clean up

* cross block bp(+) batch verification

* add message when syncing is done

* Revert "cross block bp(+) batch verification"

This reverts commit 764c4663a0.

* fix fmt & clippy

* move `io_loop` to commands

* review fixes

* fix clippy

* review fixes
2025-01-17 20:24:24 +00:00
hinto.janai
2c32e0238e
fixes 2025-01-17 15:22:01 -05:00
hinto.janai
416efcb788
fix key image types 2025-01-17 14:58:54 -05:00
hinto.janai
0b3ff4e14c
review fixes 2025-01-16 20:14:30 -05:00
hinto.janai
13f5ed9dd0
Merge branch 'main' into other 2025-01-16 11:44:58 -05:00
hinto-janai
c817c3b889
workspace: Rust 1.84 ()
* apply

* ci: use stable rust for rustfmt
2025-01-16 15:43:42 +00:00
hinto.janai
04ade527ff
Merge branch 'main' into other 2024-12-25 16:50:03 -05:00
hinto.janai
85ebc679b2
review fixes 2024-12-20 20:53:10 -05:00
hinto.janai
dff77e8bed
fix get_txid for /get_outs
miner transaction was not accounted for
2024-12-19 18:11:00 -05:00
80369b82d2
Storage: remove get_range ()
* remove `get_range`

* change usages of `get_range`

* clippy

* cargo update

* fix test + update comment
2024-12-19 21:58:54 +00:00
hinto.janai
ed8de29504
txpool: all_hashes 2024-12-18 21:03:40 -05:00
hinto.janai
aca28552ab
get_output_distribution 2024-12-18 18:09:01 -05:00
hinto.janai
f7f9063890
clippy 2024-12-16 20:49:20 -05:00
hinto.janai
8cd319cc45
/get_o_indexes.bin 2024-12-16 20:30:52 -05:00
hinto.janai
541302ea07
get_blocks_by_height, shared::get_outs 2024-12-16 20:21:00 -05:00
hinto.janai
0b3ee2d1d1
finish other draft 2024-12-16 17:56:27 -05:00
hinto.janai
805f475083
/get_transaction_pool_stats 2024-12-13 20:21:11 -05:00
hinto.janai
c5abf9bb98
/get_transaction_pool 2024-12-13 20:14:16 -05:00
hinto.janai
d4b30333bb
most of /send_raw_transaction 2024-12-13 16:43:39 -05:00
hinto.janai
a359eed8be
/is_key_image_spent 2024-12-11 20:52:40 -05:00
hinto.janai
c3bc9b26ec
/get_transactions 2024-12-11 19:16:34 -05:00
hinto.janai
568a276b7f
rpc-types -> types pt. 2 2024-12-05 20:45:27 -05:00
hinto.janai
2104bb0e17
cuprate_types::rpc, from module for cuprate_rpc_types 2024-12-05 16:05:22 -05:00
7b8756fa80
cuprated: P2P protocol request handler ()
* add cuprated skeleton

* fmt and add deny exception

* add main chain batch handler

* add blockchain init

* very rough block manager

* misc changes

* move more config values

* add new tables & types

* add function to fully add an alt block

* resolve current todo!s

* add new requests

* WIP: starting re-orgs

* add last service request

* commit Cargo.lock

* add test

* more docs + cleanup + alt blocks request

* clippy + fmt

* document types

* move tx_fee to helper

* more doc updates

* fmt

* fix imports

* remove config files

* fix merge errors

* fix generated coins

* handle more p2p requests + alt blocks

* clean up handler code

* add function for incoming blocks

* add docs to handler functions

* broadcast new blocks + add commands

* add fluffy block handler

* fix new block handling

* small cleanup

* increase outbound peer count

* fix merge

* clean up the blockchain manger

* add more docs + cleanup imports

* fix typo

* fix doc

* remove unrelated changes

* add `get_objects` handler

* add `get_chain` handler

* add `fluffy_missing_txs` handler

* add `new_fluffy_block` handler

* improve interface globals

* manger -> manager

* enums instead of bools

* move chain service to separate file

* more review fixes

* sort imports + docs

* init dandelion integration

* add dandelion start function

* finish incoming tx handler

* Add tx blob hash table

* Add missing txpool requests

* handle duplicate stem txs

* check txpool on incoming block

* add request to remove tx in new blocks from the pool

* tell the txpool about incoming blocks

* fix merge

* typos

* remove blockchain height from txpool

* fix merge

* fix merge

* handle incoming txs in p2p request handler

* Allow `IncomingTxHandler` to be given later

* add p2p clearnet init

* fix build

* misc changes

* doc updates

* more doc updates

* sort imports

* review changes

* Result -> DbResult

* use `NonZero`

* review fixes

* remove `rust-2024-compatibility` lint
2024-12-03 20:21:05 +00:00
ecd077b402
cuprated: config & args ()
* init config

* split sections

* finish initial config.

* fix clap

* misc changes

* fix doc

* fix test & clippy

* fix test 2

* try fix windows

* testing

* testing 2

* fix windows test

* fix windows: the remix.

* review comments

* fix imports

* rename & fix default config file

* fix cargo hack

* enable serde on `cuprate-helper`

* changes from matrix chats

* fix ci

* fix doc

* fix doc test

* move Cuprated.toml

* remove default.rs

* `size` -> `bytes`

* `addressbook_path` -> `address_book_path`

* fix config output

* fix ci

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

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

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-12-03 15:17:21 +00:00
hinto-janai
38541dbfda
workspace: add/fix 1.83 lints ()
* 1.83 `cargo clippy --fix`

* fix type complexity, add `DbResult`

* clippy fix

* redb fix

* Update consensus/context/src/difficulty.rs

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

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2024-11-28 19:53:59 +00:00
hinto-janai
f3c1a5c2aa
Fix ()
fixes
2024-11-21 22:32:48 +00:00
hinto-janai
372cab24d7
cuprated: internal signatures required for RPC pt. 2 ()
* apply diffs

* clippy

* fix tests

* rpc: fix tests

* remove `BlockchainManagerRequest::Overview`

* cuprated/p2p: fix `ConnectionInfo`

* move `CalculatePow`

* remove `AddAuxPow`

* move `Spans` and `NextNeededPruningSeed`

* factor types into `cuprate-types`

* scope cargo features

* fix/doc type serde

* Update binaries/cuprated/src/rpc/request/address_book.rs

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

* Update binaries/cuprated/src/rpc/request/blockchain_context.rs

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

* Update binaries/cuprated/src/rpc/request/blockchain_manager.rs

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

* fmt

* txpool: collapse `TxEntry`

* `ConnectionId`

* fix import

* fix bin

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2024-11-01 22:25:55 +00:00
44981f2b24
CI: add cargo hack ()
* add workflow

* fix errors

* fix workflow

* install dependencies

* fix more errors

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

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

* fix hack + enable it for cuprate-database

* move hack to main CI

* fix docs

* fix ci formatting

* fix txpool tests

* fix CONTRIBUTING.md formatting

* service -> tower::Service

* review fixes

* review fixes

* fix CI

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-11-01 20:22:14 +00:00
b57ee2f4cf
cuprated: txpool ()
* init dandelion integration

* add dandelion start function

* finish incoming tx handler

* Add tx blob hash table

* Add missing txpool requests

* handle duplicate stem txs

* check txpool on incoming block

* add request to remove tx in new blocks from the pool

* tell the txpool about incoming blocks

* fix merge

* typos

* remove blockchain height from txpool

* add function to start the pool

* add cross network address

* pre-review changes

* fix CI

* review fixes

* review fixes

* abort on DB error

* fix clippy
2024-10-29 15:30:51 +00:00
SyntheticBird
63216aecae
workspace: Defines cuprate members as workspace dependencies ()
Defines cuprate members as workspace dependencies

- Defines cuprate members as workspace dependencies
- Changed all `path` import into `workspace = true`

Co-authored-by: Boog900 <boog900@tutanota.com>
2024-10-24 23:12:30 +01:00
SyntheticBird
b8e2d00af4
storage: Add common amounts commitment lookup table ()
Add common ammounts commitment lookup table

- Implements `compute_zero_commitment` function in `cuprate-helper::crypto` module.
- Added test that compare the function output with the correct calculation.
- Use of a constant-time algorithm for the lookup table.
- Added according documentation
2024-10-24 22:10:33 +01:00
hinto-janai
9923d8d69d
cuprated: internal signatures required for RPC ()
* add request methods

* add p2p messages

* add txpool msgs

* add blockchain_context msgs

* add blockchain msgs

* fmt

* blockchain_manager msgs

* blockchain manager msg types

* add DB fn signatures

* add statics module

* p2p msg changes, docs

* txpool docs/types

* blockchain docs/types

* `AlternateChains`, docs

* fixes

* remove blockchain write handle, fix docs

* remove `BlockchainReadRequest::Difficulty`

* remove `BlockchainReadRequest::MinerData`

* fix p2p ban types

* `CurrentRxVm` -> `CurrentRxVms`

* storage: remove `Clone` off write handle

* Update p2p/p2p-core/src/ban.rs

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

* fix merge

---------

Co-authored-by: Boog900 <boog900@tutanota.com>
2024-10-08 22:57:09 +01:00
hinto-janai
a003e0588d
Add constants/ crate ()
* add `constants/`

* ci: add `A-constants` labeler

* add modules, move `cuprate_helper::constants`

* add `genesis.rs`

* `rpc.rs` docs

* remove todos

* `CRYPTONOTE_MAX_BLOCK_HEIGHT`

* add genesis data for all networks

* features

* fix feature cfgs

* test fixes

* add to architecture book

* fix comment

* remove `genesis` add other constants

* fixes

* revert

* fix
2024-10-02 18:51:58 +01:00
hinto-janai
88605b081f
books/architecture: port database design document ()
* add chapters

* add files, intro

* db abstraction

* backends

* abstraction

* syncing

* serde

* issues

* common/types

* common/ops

* common/service

* service diagram

* service/resize

* service/thread-model

* service/shutdown

* storage/blockchain

* update md files

* cleanup

* fixes

* update for https://github.com/Cuprate/cuprate/pull/290

* review fix
2024-09-24 17:23:22 +01:00