Commit graph

26 commits

Author SHA1 Message Date
hinto-janai
aeb070ae8d
Replace OnceLock + fn with LazyLock (#256)
* `consensus/`

* `helper/`

* `test-utils/`

* `storage/`

* fix docs + tests + lints

* decomposed_amount: remove `LazyLock`

* clippy
2024-08-20 22:53:32 +01:00
Boog900
be2f3f2672
Consensus: move more types to types (#250)
* move `HardFork` to `types`

* fmt

* fix tests & doc

* fmt

* fix clippy

* move transaction verification data

* misc fixes

* doc fixes

* update README.md

* review fixes
2024-08-09 00:56:13 +01:00
Boog900
8227c28604
update monero-serai (#201)
* update monero-serai

* update monero-serai + change height to `usize`

* fix merge

* fix merge

* fix doc

* fix clippy take 2

* misc changes

* move RPC imports to dev deps

* handle miner txs when calculating fee

* Update consensus/rules/src/blocks.rs

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

* Update consensus/rules/src/transactions.rs

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

* Update storage/blockchain/src/ops/tx.rs

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

* Update test-utils/src/data/free.rs

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

* fixes

* fix clippy

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-08-07 00:48:53 +01:00
Boog900
b44c6b045b
Consensus: add alt-chain handling (#214)
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
Doc / build (push) Has been cancelled
Doc / deploy (push) Has been cancelled
* add `pop_blocks` to the difficulty cache

* add a rolling median struct

* use RollingMedian in weight cache

* add pop_blocks to weight cache

* add alt context cache

* add getting alt RX vms

* rework alt cache

* add alt block verify function

* keep alt caches around

* add alt checked alt blocks to the cache

* check the alt blocks timestamp

* add docs + cleanup code

* add popping blocks from the context cache

* finish popping blocks + fix tests

* fix doc

* add a test popping blocks from HF cache

* add a request to clear alt caches

* add back lint

* Apply suggestions from code review

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

* review fixes

* small changes

* change panic doc

---------

Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
2024-07-29 01:13:08 +01:00
hinto-janai
4b93dbec4c
workspace: enforce crate/directory naming scheme (#164)
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
* rename all directories and crates

* fix all `use`

* fix doc link

* `dandelion/` -> `dandelion-tower/`

* fix epee-encoding test

* fix `json-rpc`

* fix pruning

* crate import fixes

* fix leftover merge conflicts

* fix `epee-encoding`
2024-06-24 02:30:47 +01:00
Boog900
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
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
Boog900
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
28aa0b5552
CI: fix deny (#83) 2024-02-29 20:29:11 +00:00
Boog900
b7df133175
consensus: fix batch handling when we don't have a full list of outputs. (#54)
* consensus: fix batch handling when we don't have a full list of outputs.

* change `scan_chain` to new API

* clippy

* add a test for calculating multiple difficulties

* fmt

* rx_seed -> rx_vms

* consensus-rules: ring members younger than current block.

* only create rx vms when required.

* fix rx initiation when syncing

* add single block verification (no batch)

* update serai
2024-02-13 00:51:11 +00:00
hinto-janai
0d8f71b4c7
Fix link errors in cargo doc (#55)
fix `cargo doc` - links not using `<>`
2024-02-10 00:08:39 +00:00
Boog900
81eec5cbbb
consensus: add more difficulty tests 2024-01-22 18:17:34 +00:00
Boog900
ed598e374e
remove empty cuprate bin and common 2024-01-22 01:56:34 +00:00
Boog900
b20b6fdee1
remove primitive-types for crypto-bigint
we already have crypto-bigint in our tree
2024-01-21 15:18:25 +00:00
Boog900
b9334b6a90
clean up dependencies 2024-01-21 14:46:03 +00:00
Boog900
7cf7ea1693
Make RX VM an option for calculate_pow_hash
This means we don't have to init the dataset
if it's not needed
2024-01-09 22:39:29 +00:00
Boog900
730bc8fb42
link transaction rules to monero-book 2024-01-08 01:26:44 +00:00
Boog900
13957a5e7f
link rules to monero-book.
need to do transactions.
2024-01-07 01:15:33 +00:00
Boog900
40e64cc9c3
integrate RandomX, plus some other misc changes. 2024-01-05 22:36:57 +00:00
Boog900
5d6fb3f6b9
integrate ringCT rules into the RPC scanner. 2023-12-27 23:50:18 +00:00
Boog900
f037532610
add ringCT rules 2023-12-24 21:07:28 +00:00
Boog900
e264a40feb
remove InstaFuture for Ready
Also renames some functions so it's clear as to what they do https://github.com/Cuprate/cuprate/pull/45#issuecomment-1859054439
2023-12-17 14:50:08 +00:00
Boog900
376a41deb2
fmt + clippy + fix tests 2023-12-17 14:27:07 +00:00
Boog900
b0588fad2b
change cuprate-consensus to use monero-consensus 2023-12-17 14:27:06 +00:00
Boog900
b01314ff70
Move contextual data to monero-consensus 2023-12-17 14:27:04 +00:00
Boog900
3eea0b73bd
Split consensus rules into separate crate. 2023-12-17 14:26:54 +00:00