Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thoughts on a new architecture for v0.1 #48

Open
buffrr opened this issue Nov 29, 2024 · 1 comment
Open

Thoughts on a new architecture for v0.1 #48

buffrr opened this issue Nov 29, 2024 · 1 comment
Milestone

Comments

@buffrr
Copy link
Member

buffrr commented Nov 29, 2024

We've been iterating rapidly, which has led us to rely on dependencies we can now remove. This change will enable faster compilation times, more hardened codebase, and lower resource usage.

My initial thoughts would be to create a tiny core process for the consensus client with extremely minimal dependencies that's separate from the wallet service.

  • Dropping dependencies: reqwest, jsonrpsee and tokio which have large dependency trees. We can replace these with a tiny RPC server and client. No large dependencies such as TLS stack ... etc (if such functionality is desired, they could throw it behind a proxy).

  • Lock-free: The core process should be almost entirely lock-free and single-threaded except for the block fetcher. This can be achieved with a single reader/writer core process. If higher throughput is desired (e.g. if you're running a public facing server), multiple reader core processes can be launched using SO_REUSEPORT, letting the Linux kernel balance load across them (inspired by knot resolver design). Removing locks and tokio should greatly simplify the codebase.

  • Spaced: The spaced process can handle launching both spaces_wallet and spaces_core as child processes.

@buffrr buffrr added this to the v0.1 milestone Nov 29, 2024
@buffrr
Copy link
Member Author

buffrr commented Dec 10, 2024

I think tokio is actually not bad with most of its features disabled and could make it easier to achieve a single threaded design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant