Cuprate, an upcoming experimental, modern & secure monero node. Written in Rust https://cuprate.org
Find a file
hinto-janai 8f22d8ab79
database: impl trait function bodies for heed & redb (#85)
* env: remove `T: Table` for `Env::create_tables()`

It creates _all_ tables, not a specific `T: Table`

* heed: half impl `Env::open()`, some TODOs

* heed: add `HeedTxR{o,w}<'env>`

* workspace/cargo: add `parking_lot`

* remove `parking_lot`

`MappedRwLockGuard` doesn't solve the `returning reference to
object owned by function` error when returning heed's lock guard
+ the tx so we'll be going with `std`

* env: add `{EnvInner,TxRoInput,TxRwInput}` and getter `fn()`s

* env: fix tx <-> table lifetimes, fix `Env::create_tables()`

* heed: impl `DatabaseRo`

* heed: impl `DatabaseRw`

* database: add `src/backend/${BACKEND}/tests.rs`

* heed: impl more of `Env::open()`

* redb: fix trait signatures, add `trait ValueGuard`

* accommodate `DatabaseRo` bounds for both `{heed,redb}`

* fold `get_range()` generic + bounds

* add `TxCreator`, add `heed` tests

* env: `TxCreator` -> `EnvInner` which doubles as DB/Table opener

* database: `DatabaseRw<'tx>` -> `DatabaseRw<'db, 'tx>`

* heed: `db_read_write()` test

* database: fix `get()` lifetimes, heed: add `db_read_write()` test

* database: remove `'env` lifetime from `DatabaseRo<'env, 'tx>`

not needed for immutable references

* redb: fix new `{Env, EnvInner, DatabaseR{o,w}}` bounds

* redb: impl `Database` traits

* redb: impl `TxR{o,w}` traits

* redb: impl `Env`

* redb: open/create tables in `Env::open`

* redb: enable tests, add tmp `Storable` printlns

* redb: fix alignment issue with `Cow` and `from_bytes_unaligned()`

* redb: only allocate bytes when alignment != 1

* heed: remove custom iterator from `range()`

* storable: conditionally allocat on misaligned bytes in `from_bytes`

* add database guard

* database: AccessGuard -> ValueGuard

* storable: add `ALIGN` and `from_bytes_unaligned()`

* redb: 1 serde type `StorableRedb`, fix impl

* cow serde, trait bounds, fix backend's where bounds

- Uses Cow for `redb`'s deserialization
- Conforms `heed` to use Cow (but not as the actual key/value)
- Conforms the `cuprate_database` trait API to use Cow
- Adds `ToOwned + Debug` (and permutation) trait bounds
- Solves 23098573148968945687345349657398 compiler errors due
  to aforementioned trait bounds, causing `where` to be everywhere

* fix docs, use fully qualified Tx functions for tests

* backend: check value guard contains value in test

* add `Storable::ALIGN` tests, doc TODOs

* add `trait ToOwnedDebug`

* traits: `ToOwned + Debug` -> `ToOwnedDebug`

* heed: remove `ToOwned` + `Debug` bounds

* redb: remove `ToOwned` + `Debug` bounds

* add `ValueGuard`, replace signatures, fix `redb`

* heed: fix for `ValueGuard`

* docs, tests

* redb: add `CowRange` for `T::Key` -> `Cow<'_, T::Key>` conversion

* separate `config.rs` -> `config/`

* ci: combine tests, run both `heed` and `redb` tests

* ci: fix workflow

* backend: add `resize()` test

* ci: remove windows-specific update

* ci: remove update + windows default set

* backend: add `unreachable` tests, fix docs

* trait docs

* ci: fix

* Update database/src/backend/heed/env.rs

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

* Update database/src/backend/heed/env.rs

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

* Update database/src/backend/heed/transaction.rs

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

* Update database/src/backend/heed/transaction.rs

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

* Update database/src/backend/heed/transaction.rs

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

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

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

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

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

* Update database/src/backend/heed/database.rs

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

* readme: fix `value_guard.rs`

* heed: remove unneeded clippy + fix formatting

* heed: create and use `create_table()` in `Env::open()`

* redb: create and use `create_table()` in `Env::open()`

* redb: remove unneeded clippy

* fix clippy, remove `<[u8], [u8]>` docs

---------

Co-authored-by: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com>
Co-authored-by: Boog900 <boog900@tutanota.com>
2024-03-13 22:05:24 +00:00
.github/workflows database: impl trait function bodies for heed & redb (#85) 2024-03-13 22:05:24 +00:00
consensus CI: fix deny (#83) 2024-02-29 20:29:11 +00:00
cryptonight Add typos + cargo doc CI (#32) 2024-02-15 16:03:04 +00:00
database database: impl trait function bodies for heed & redb (#85) 2024-03-13 22:05:24 +00:00
helper database: Resizes, Shutdown, Flushing (#68) 2024-02-25 19:46:36 +00:00
misc update gpg key (#86) 2024-03-03 23:19:26 +00:00
net levin: fragmented messages (#84) 2024-03-05 01:29:57 +00:00
old_database Add typos + cargo doc CI (#32) 2024-02-15 16:03:04 +00:00
p2p levin: fragmented messages (#84) 2024-03-05 01:29:57 +00:00
pruning CI: fix deny (#83) 2024-02-29 20:29:11 +00:00
test-utils levin: fragmented messages (#84) 2024-03-05 01:29:57 +00:00
.gitignore ci: include macos + windows (#52) 2024-02-12 13:39:15 +00:00
Cargo.lock levin: fragmented messages (#84) 2024-03-05 01:29:57 +00:00
Cargo.toml levin: fragmented messages (#84) 2024-03-05 01:29:57 +00:00
CONTRIBUTING.md Add typos + cargo doc CI (#32) 2024-02-15 16:03:04 +00:00
deny.toml CI: fix deny (#83) 2024-02-29 20:29:11 +00:00
LICENSE-AGPL License correction for github (#10) 2023-03-20 21:35:20 +01:00
LICENSE.md License correction for github (#10) 2023-03-20 21:35:20 +01:00
README.md add CI actions 2023-10-25 21:07:13 -04:00
SECURITY.md Inital Security Policy 2023-03-20 18:41:58 +01:00
typos.toml Add typos + cargo doc CI (#32) 2024-02-15 16:03:04 +00:00

Cuprate


An up and coming Rust Monero node.

Matrix CI

Cuprate will be an alternative Monero node written from the ground up in Rust. It will be able to independently validate Monero consensus rules providing a layer of security and redundancy for the Monero network.

Cuprate will help to protect the network from implementation bugs that could cause a variety of issues, plus because it's written in a memory safe language Cuprate will be less likely to suffer from memory safety issues compared to monerod.