Commit graph

283 commits

Author SHA1 Message Date
Boog900
cb7d8b7b5e
fix cumulative diff calculations + sort timestamps before getting median
we were not accounting for the genesis blocks difficulty of 1.
2023-10-24 23:35:24 +01:00
Boog900
2033a2d16c
add rules for blocks
TODO: the tests need re-ordering they are just all chucked in at the moment.
2023-10-24 23:02:19 +01:00
Boog900
b727062e97
finish rules for v1 txs - clean up is needed 2023-10-24 20:18:46 +01:00
Boog900
9b7f778f60
fix getting the median timestamp
we were excluding the genesis block
2023-10-24 15:34:41 +01:00
Boog900
edccf83481
add saving cache to disk. 2023-10-24 02:25:11 +01:00
Boog900
6bfc4da4e4
cache more blockchain data to reduce number of RPC calls 2023-10-23 22:24:02 +01:00
Boog900
eeefe49d63
add block/ tx verifier svc 2023-10-23 19:14:40 +01:00
Boog900
50f9458528
move hardforks, weights and pow cache to single context with unified API 2023-10-22 17:27:37 +01:00
Boog900
387278b821
add more consensus rules. 2023-10-20 01:04:26 +01:00
Boog900
ac87f9998e
add error handling to cryptonight.
Also remove the variant enum for separate functions.
2023-10-18 12:52:43 +01:00
Boog900
21f1448343
add more config options for the verifier 2023-10-15 20:35:33 +01:00
Boog900
55b7699a82
add tests to cryptonight crate 2023-10-15 18:56:25 +01:00
Boog900
bfbafa4ed5
change epee-encoding to monero-epee-bin-serde 2023-10-09 21:10:16 +01:00
Boog900
20f6af7951
use get_blocks_by_height.bin in RPC 2023-10-05 17:54:19 +01:00
Boog900
88b646c5a3
add back monero-epee-bin-serde
I am now a maintainer of monero-rs, so I can keep this maintained and not using serde was annoying.
2023-10-05 14:24:42 +01:00
Boog900
f60bb1a678
init scan chain code 2023-10-04 14:50:13 +01:00
Boog900
d5595b7eaf
add logic to build all caches synchronously 2023-10-03 22:10:31 +01:00
Boog900
eb3c727b4d
add effective median weight calculations
+ more rpc speedup for the rest of the consensus lib
2023-10-02 21:07:11 +01:00
Boog900
d7798328b6
consensus: add block weight calculations + rcp speedup
Instead of asking for one block at a time, we ask for batches of blocks, which significantly speeds up getting blocks.
2023-09-28 12:21:06 +01:00
Boog900
545189f523
random-x: add dataset/ cache 2023-09-17 19:01:56 +01:00
Boog900
f9c2794af2
Add aes generators/ hash to random-x 2023-09-16 18:46:44 +01:00
Boog900
57630ed9fb
init random-x module
super scaler program generation/ execution is complete.
2023-09-14 00:23:10 +01:00
Boog900
0000ee96b3
Clean up some of the rpc code 2023-09-07 21:38:56 +01:00
Boog900
b243ff0021
Remove CryptoNight V3
there is no v3 monero goes straight from v2 -> v4 I can only guess this is because of the way monero calculates what variant to use:

5900ed3706/src/cryptonote_core/cryptonote_tx_utils.cpp (L702)
2023-09-07 21:24:33 +01:00
Boog900
b4711c7118
add references to monero protocol docs
+ skip genesis block in DifficultyCalculator
2023-09-06 19:50:49 +01:00
Boog900
ab3c496bbd
add difficulty calculations 2023-09-06 15:54:49 +01:00
Boog900
367ea1a837
add method to init the hard fork struct at a certain height. 2023-09-05 19:49:01 +01:00
Boog900
a56d8ea87f
fetch block headers in parallel and support multiple rpc endpoints
this significantly speeds up initiating the hardfork struct
2023-09-05 19:13:46 +01:00
Boog900
42548f733d
add cryptonight bindings 2023-09-05 11:56:07 +01:00
Boog900
2f08978e67
init consensus rules crate 2023-09-03 23:50:38 +01:00
Boog900
59e7e0b4e8
Remove donation address 2023-08-11 12:48:36 +01:00
Boog900
b483415c87
Add design document 2023-08-01 02:04:57 +01:00
Boog900
58a076f3aa
re-write README
This removes a lot of the content from the README.

I have also removed the MIT license file so people don't get confused.

This README is meant to be expanded in the future when more work has been done on Cuprate
2023-07-26 14:09:38 +01:00
Boog900
477d9e42f3
change monero-wire to use epee-encoding (#25)
* change monero-wire to use epee-encoding

* Add back unified `Message` enum

* Run clippy & fmt

* add back default val for top_version
2023-07-17 18:43:34 +01:00
Boog900
e6e8bdaf6c
Re-work levin to remove a lot of the complexities (#24) 2023-07-13 22:10:52 +01:00
Boog900
f9a735b51f
Add Cuprate's logo(s) + move pgp keys to misc (#23)
* Add Cuprate's logo(s) + move pgp keys to etc

* re-name folder

* use Logo on README instead of wordmark

* reduce size

* Update readme.md

* little correction on size

---------

Co-authored-by: Someone Else <118022351+SyntheticBird45@users.noreply.github.com>
2023-05-04 22:56:59 +01:00
Boog900
5f20342736
initial Abscissa bin (#18)
* abscissa init

* remove package in cargo.toml

* cargo fmt + remove more stuff fro toml

* bump rust edition
2023-04-26 19:22:06 +01:00
Boog900
a187d9a357
initial p2p code (#8)
* init

* save

* use macro to create the levin body enum

* add protocol docs and cargo fmt

* add response validation

* add client functionality to connection + fmt

* Add new cuprate-common crate
this crate will hold stuff needed across cuprate crates

+ init handshaker

* add stagenet & testnet hardforks + tests

+ cargo fmt

* split peer and protocol into separate crates
+ add sync state watcher

* finish initial sync states and add some tests

* save

* add initial address book

* cargo fmt

* save

* add pruning module to cuprate-common

* more address book updates
- added an address book client
- add some more address book requests
- add "NetZone"

* lots of changes

* cargo fmt

* combine p2p into one crate
they were all linked anyway

* cargo fmt

* turn the handshaker into a statemachine

* cargo fmt

* reduce the amt of copies when decoding

+ remove reliance on monero-rs

* update time_from_timestamp func

* cargo fmt
+ change qr code link
+ remove clippy.toml
2023-04-24 22:37:40 +01:00
Someone Else
be43216b3f
initial database code (#6)
* commit to start the draft pull request.

added a space

* Please don't look to close.It might hurt your eyes

* impl associated types

* errors, docs & divided ro/rw tx

Added some more errors to DB_FAILURES, rewrited crates docs, and specified
WriteTransaction subtype which implement write mode method.

* more changes see description

changed blockchain_db folder by database. Implemented (just for test) get_block_hash, open, from to Interface.
Also rewrited a declarative macro for tables. Will have to add Dummy Tables later.

* small changes

* Organized modules & implemented get_block_hash

* write prototype & error

Added prototype functions for clear(), put() & delete() in mdbx implementation. They still don't
consider table flags. Also added a temporary DB_FAILURES::EncodingError for monero-rs consensus_encode
errors. Still have to rethink about it to resend a reference to the data that can't be encoded.

* Multiple changes

- hse.rs
Added hse.rs that will contain db implementations for HSE. Since the codebase can't welcome unsafe
code, the wrapper will be written outside of the project.
- lib.rs
Added a specific FailedToCommit error. (will investigate if really necessary).
Added DupTable trait, which is a Table with DUPSORT/DUPFIXED support and its declarative macro.
Added two other tables, blockheaders that give block's header with specified hash & blockbody that give block's body with specified hash
Added Cursor methods, that are likely to be deprecated if I found a way to implemen Iterator on top of it.
Added WriteCursor trait & methods, which is basically put & del.
Added mandatory type for Cursors in Transaction & WriteTransactions
Refactored get_block_hash interface method.
- mdbx.rs
Added partial implementation of Cursor & WriteCursor trait for libmdbx::Cursor. Only the first() & get() methods are implemented
Added implementation of get & commit for Transaction

* put mdbx as features with its dependency

* save

* refactored some method with macros

* more mdbx errors, docs correction, moved to error.rs

* finish nodup mdbx impl, errors.rs, macros, tables

Finished the initial implementation of Cursor, WriteCursor, Transaction and WriteTransaction in mdbx.rs. Corrected some macros in mdbx.rs to simplify the implementations. There is certainly rooms to more flexible macros. Also added 3 other tables. I started to divide errors into category to more easily handle them at higher-level. Due to the large number of errors i just moved them into another file. There is know DB_SERIAL enum for errors relating of decoding/encoding error & DB_FULL enum for every errors relating a component being overeaching its capacity.

* bye bye match statement in mdbx.rs

* defined all blockchain tables (not txpool)

* dupsort/fixed support, dupcursor, basic block interface

* tables, types, encoding and documentations

Redefined all the database types from @Boog900's monero-rs db branch and added the needed
implementations. The database now use bincode2 for encoding and decoding. We observe that bincode was
5 times faster at serializing than monero::consensus_encode. Since we still use monero-rs types but can't implement
foreign trait to them, the encoding module contain a compatibility layer, the time we switch from monero-rs to properly
implement it. All the tables are now defined. (can be subject to change if there is good reason for). added documentations
to modules and types.

* replaced macros and added hfversion table

* save

* multiple changes

* modified database schema. deprecated output global index and splited up pre-rct from rct output.

* Fixed DupCursor function to return subkey (thx to rust turbofish inference).

* Added some output functions

* Added two new DB_FAILURES, one to handle a prohibited None case and one for undefined case where a dev msg is needed.

* fixed TxOutputIdx, previously used global index, now is a tuple of amount/amount_index.

* i hate lifetimes

* read-only method now use read-only tx

* initial output fn

* some tx functions. Yes I'll refactor them

* moved interface in a module

* redefined errors, more tx fn, None->error

* corrected a table + started blk fns

* save

* fixed TxOutputIdx + pop_block

* IIRC I finished initial interface fns

* fixed table name const + db build/check/open fn

* switched important tables to dummy keys + rm blockhfversion

* minor docs correction

* fixed mentioned issues

* make a test bin, just for fun

* fixed issues + cargo fmt

* removed monerod part

* fixed a comment
2023-04-20 18:20:32 +01:00
Someone Else
fc9b077d94
Merge Readme update (#14)
* added donation qr code

donation qr code

* Update readme.md

* Update readme.md

* fix typo

* Just some small changes

* another change (last one)

---------

Co-authored-by: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com>
2023-03-31 20:27:45 +00:00
Boog900
9861e07c9a
Update boog900.asc (#13)
forgot my encryption sub key
2023-03-30 21:58:56 +01:00
Someone Else
6dc3cd9a38
Added Revolt server on readme.md 2023-03-26 17:12:54 +00:00
Someone Else
61aa3e7121
setup basic Rust Github Actions 2023-03-20 22:51:25 +01:00
Someone Else
1d4abc841c
License correction for github (#10)
* Rename AGPL-3.0 to LICENSE-AGPL

* Create LICENSE-MIT (#9)

* Rename LICENSE to LICENSE.md

* remove rust version

* bump rust-version
2023-03-20 21:35:20 +01:00
Someone Else
84975c4541
Inital Security Policy 2023-03-20 18:41:58 +01:00
Someone Else
5ba92e7643
update readme
remove boog900's credit
2023-03-18 23:09:48 +00:00
Someone Else
8a5e7f543e
Add files via upload 2023-03-10 19:06:36 +00:00
Boog900
6227544ae6
Add Boog900's PGP key 2023-03-10 15:58:56 +00:00
Someone Else
207a32d099
fix 2023-03-10 13:52:27 +00:00
Someone Else
cd08bbdde7
Update status 2023-03-10 13:51:24 +00:00