Skip to content
Snippets Groups Projects

hinto-janai - full-time work on Cuprate (3 months)

Merged hinto requested to merge (removed):hinto-2023-nov into master
hinto-2023-nov.md 0 → 100644
+ 87
0
---
layout: fr
title: hinto-janai full-time work on Cuprate (3 months)
author: hinto-janai
date: Nov 6, 2023
amount: 144
milestones:
- name: Month 1
funds: 33% (48)
done:
status: unfinished
- name: Month 2
funds: 33% (48)
done:
status: unfinished
- name: Month 3
funds: 33% (48)
done:
status: unfinished
payouts:
- date:
amount:
- date:
amount:
- date:
amount:
---
## What
Cuprate is an alternative Monero node implementation, currently solely worked on by [Boog900](https://repo.getmonero.org/monero-project/ccs-proposals/-/merge_requests/405).
I've been in contact with Boog and there are many sections within Cuprate that can be worked on in parallel, currently the most pressing section is the database. This work was left unfinished by SyntheticBird45 before they left the project. Boog is currently working on block downloading/verification/consensus with cobbled together database-like functions - this means an actual database layer can be worked on in parallel without any merge conflicts, and can be cleanly slotted in once complete.
This CCS is to support me working on full-time on Cuprate for the next 3 months.
The 3-month goal is for the completion of the base database "layer" layed out below with at least `LMDB` supported.
## Who
I'm [hinto-janai](https://github.com/hinto-janai).
Past CCS: https://ccs.getmonero.org/proposals/gupax.html.
## Design
The design document and active PR is here: https://github.com/Cuprate/cuprate/pull/35 and will be updated as things change.
The main goal iimplementation (for now) include:
- LMDB (via [`heed`](https://github.com/meilisearch/heed))
- [`sanakirja`](https://docs.rs/sanakirja) (a database [similar and orignally based off](https://pijul.org/posts/2021-02-06-rethinking-sanakirja) to LMDB)
Both of these will be forked and maintained by Cuprate as there are `monerod`-specific things that must be added (e.g output lookup using [sub-keys](https://github.com/monero-project/monero/blob/ac02af92867590ca80b2779a7bbeafa99ff94dcb/src/blockchain_db/lmdb/db_lmdb.cpp#L3447C1-L3449C80)).
The overall design is mostly from Boog900 - I am simply implementing it.
## Future
There's plenty more work to be done after the database. Boog plans on handling P2P code after his current CCS, which means I could possibly work on these things in the future (in parallel with Boog's work):
- RPC server (e.g. `get_info`)
- Transaction-pool related (e.g. Dandelion++)
- Application interface linking everything together (e.g. `./cuprated --option`)
Most likely, the RPC server would be the next thing I would be working on.
And there are things that are planned, but for the very distant future:
- ZMQ support
- Tor/i2p support: [Tor is quite feasible today](https://blog.torproject.org/announcing-arti), i2p less so
- RandomX: Currently, there exists multiple (quite rough) `C/C++ <-> Rust` bindings but as RandomX is in active use (and will most likely be for the foreseeable future) another implementation or more realistically, a maintained "Rust"-like shim on-top would be nice
- CryptoNight: Same as RandomX but less important as this is only used for legacy purposes
- P2P encryption (preferably compatible with the proposal for [`monerod`](https://github.com/monero-project/monero/issues/7078))
## Why
Cuprate has an advantage in that it has an 8+ year old codebase as reference - although we are starting with a blank canvas, we have a finished painting next to us, displaying all the very good, okay, and not-so-good parts.
As such, we can focus on things other than making it work, notably: documentation, maintenence, and correctness.
Other than documenting the [Monero protocol itself](https://monero-book.cuprate.org), we plan to write documentation for internal subsystems such that future Cuprate contributors/maintainers will be able to pick up easily where we left off. What this means for me and this CCS is that I'll be documenting how this database "layer" fits in with the rest of Cuprate, and answer all the "what does this do?", "how does this work?", "why was it done like this?" questions. If I were to continue working on Cuprate past this CCS, i.e. the RPC server, all RPC types would also be documented (and the internals as well) - the same goes for any future subsystems.
Other notable projects following this pattern: [Tor](https://youtu.be/hdFL0kXu440?t=700), [Bitcoin](https://github.com/rust-bitcoin/rust-bitcoin), [Ethereum](https://github.com/rust-ethereum), [Zcash](https://github.com/ZcashFoundation/zebra).
## Proposal
I propose to work for 44 hours/week for 3 months. The proposal's milestones are broken into 3, one for each month.
If the database layer is finished before the end of this proposal, the next tasks in `Future` will be worked on - or whatever is necessary at the time for the codebase.
- Hours: 528
- Rate: $45 USD/hour
- XMR: $164 (20-day EMA, Kraken, 2023/11/06)
- Total: 144 XMR
Loading