hinto-janai full-time work on Cuprate (3 months)
layout: fr
title: hinto-janai full-time work on Cuprate (3 months)
author: hinto-janai
date: May 5, 2024
amount: 264
milestones:
- name: RPC server design
funds: 20% (52.8)
done:
status: unfinished
- name: JSON RPC interface
funds: 40% (105.6)
done:
status: unfinished
- name: Binary/other RPC interface + other work
funds: 40% (105.6)
done:
status: unfinished
payouts:
- date:
amount:
- date:
amount:
- date:
amount:
What
Cuprate is an alternative Monero node implementation, currently worked on by me and Boog900.
The next large section that needs work is the RPC server. Another contributor, yamabiiko, is also interested in working on the RPC server, although they currently have limited time, so I'll be starting on it alone for now (with much help from Boog900).
Who
I'm hinto-janai.
Past CCS: !422 (merged).
RPC server
yamabiiko has started a discussion on the design for the RPC server here, and Boog900 has suggested some changes.
The first milestone's time will be spent on:
- Fleshing out the current proposal or potentially finding better alternatives
- Preparing an initial design document, similar to
database/
The current design for the database was spread out across several months, although, the design for the RPC server should take much less time.
After a design is set, the second/third milestone will start on the RPC interface library - the timeline for this is by the end of this CCS. This includes testing, documentation, etc. The current plan is to separate the interface from the inner RPC handler. After the interface is finished, the internal handler(s) will be finished in another CCS (potentially split between contributors).
By the end of this CCS, the initial design document will be polished to reflect the implementation, similar to here, and user documentation will also be finished (again, like database/
).
The resulting design document will be added to Cuprate's architecture book (see below).
Other work
There's also other work that I believe would be beneficial to start on earlier rather than later.
These will be started on during this CCS:
- Cuprate's architecture book
- Persistent transaction pool
-
monero-core
RPC PRs - Benchmarking suite
- Project lints
The persistent transaction pool will be finished within this CCS, the rest will grow alongside the project.
Cuprate's architecture book
This is a book similar to Cuprate's protocol book, although it will be for Cuprate's implementation. The RPC design will be documented in this book (along with every other component) as they are implemented. The current database document will be ported to the book as well.
Current rough draft: https://hinto-janai.github.io/cuprate-architecture
Expected included items are:
- Relational map of components (RPC, DB, block downloader, verifier, etc)
- Component designs
- Thread model (when/where/how many threads get spawned? for what purpose?)
- Resource model (files, sockets, memory usage)
- Instrumentation (logging, data collection methods)
- Known inefficiencies/tradeoffs, their reasoning
Persistent transaction pool
Considering RPC implementation will take a while, implementing a persistent transaction pool sooner rather than later would be preferred; another option Cuprate has is to create an in-memory only transaction pool, although this would only be a stop-gap and would take more work in the long run, thus this work will be done now.
monero-core
RPC PRs
As I'll be going through all of monerod
's RPC methods/objects and getmonero.org
documentation, I will open PRs to monero-core
or create an issue if I notice any discrepancies.
Benchmarking suite
Creating a benchmarking suite for Cuprate's components would allow for collecting and storing information on code execution time. This data can be used later on to detect performance regressions as well as measuring optimizations.
Creating a bespoke benchmarking tool would be a project of its own, so Cuprate is planning to use the Criterion project.
Project lints
Lints cause compiler warnings to become hard errors, blocking compilation. An example: serai-dex
.
Cuprate's CI already fails on warnings (among other pedantic things), although there are many additional lints we could add. Selecting the lints that make sense for Cuprate sets higher code standards for the project. Setting this up and fixing current code should not take too much effort, but it will be drawn out over time.
Funding
I am asking for a rate closer to market rates, please read here.
I am asking for $65 + 0.05 XMR per hour for 480 hours at $130/XMR. This gives 264 XMR.
Recent activity has shown that monerod
does not handle load well. Furthermore, there is little system-level documentation; changes needed to fix issues like this are more difficult than necessary. I do not believe this has to be repeated.
I believe this is a fair rate for creating well documented and maintainable infrastructure. I am also asking for less hours than before as I don't believe I can continue at my current pace long-term.
Merge request reports
Activity
I support this proposal. Having another person working on Cuprate been very helpful, Hinto has continued to be helpful even in the "down time" between CCSs.
Multiple issues have been found in monerod from the development of Cuprate, along with the recent issues monerod has had with the increased activity, shows the importance of the project.
Edit: after discussing with Boog900, I've added an
Architecture book
section toOther work
. This is a book similar to Cuprate's protocol book, although it will be for Cuprate's implementation. This was planned for another time but starting this book now such that the RPC design document (and future components) could be written there instead made more sense. The current database document will be ported to the book as well.Current rough draft: https://hinto-janai.github.io/cuprate-architecture
mentioned in commit 4e3f649c
Milestone 1
Day 18 (started 2024-05-19). The initial RPC design is ready, moving onto implementation.
RPC design discussion:
Other than RPC, I've also been working on setting-up Cuprate's books:
and the lints mentioned in the proposal:
- Proposal: https://github.com/Cuprate/cuprate/issues/131
- Initial PR: https://github.com/Cuprate/cuprate/pull/133
Also, various repository-related things:
- Automatic issue/PR labels: https://github.com/Cuprate/cuprate/pull/136
- Issue templates: https://github.com/Cuprate/cuprate/pull/137
-
{README,SECURITY}.md
update: https://github.com/Cuprate/cuprate/pull/143 -
CONTRIBUTING.md
update: https://github.com/Cuprate/cuprate/pull/150 - Library naming scheme: https://github.com/Cuprate/cuprate/pull/144
Merged PRs since last CCS (10):
Payout
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Key: https://github.com/Cuprate/cuprate/blob/main/misc/gpg_keys/hinto-janai.asc Requesting payout for milestone 1 on: https://repo.getmonero.org/monero-project/ccs-proposals/-/merge_requests/456 To the following address: 44hintoFpuo3ugKfcqJvh5BmrsTRpnTasJmetKC4VXCt6QDtbHVuixdTtsm6Ptp7Y8haXnJ6j8Gj2dra8CKy5ewz7Vi9CYW -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQxxRRar6Wo3xwdsqbUfOBfoXWkmQUCZmEQPwAKCRDUfOBfoXWk mUKoAQCHTqenlLX70/vlqy17PQpSXCyEeXMCpOWFN37tIQ8qSAD/S8faXCrATYIi 0cciC+NVrIIzbXyToOY4sf3K6kndMAA= =hbu8 -----END PGP SIGNATURE-----
Milestone 2 & 3
This CCS is complete, requesting payout for milestone 2 & 3 to the same address posted above.
RPC
The RPC interface is finished: https://github.com/Cuprate/cuprate/issues/183.
This CCS resulted in 3 libraries:
Architecture book and documentation
The architecture book is now live at: https://architecture.cuprate.org.
The RPC section is here: https://architecture.cuprate.org/rpc/intro.html.A website for library documentation was also launched at: https://doc.cuprate.org.
For example, the RPC type library documentation: https://doc.cuprate.org/cuprate_rpc_types.Other
mentioned in merge request !484 (merged)
mentioned in merge request !518 (merged)
mentioned in merge request !539 (closed)
mentioned in merge request !543 (merged)