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

Epic: Zebra as a lightwalletd backend #3134

Closed
33 tasks done
oxarbitrage opened this issue Dec 2, 2021 · 6 comments
Closed
33 tasks done

Epic: Zebra as a lightwalletd backend #3134

oxarbitrage opened this issue Dec 2, 2021 · 6 comments
Labels
Epic Zenhub Label. Denotes a theme of work under which related issues will be grouped lightwalletd any work associated with lightwalletd

Comments

@oxarbitrage
Copy link
Contributor

oxarbitrage commented Dec 2, 2021

We want to enable Zebra to act as a lightwalletd backend. In order to do this we will need to expose the minimal subset of JSON-RPC methods required by a lightwalletd server.

This epic will be used to keep track of the items we need to implement to achieve that goal.

Getting started

zcashd's JSON-RPC interface is mainly JSON-RPC-v1. We plan to use the jsonrpc_core Rust crate, because it's compatible with both v1 and v2.

RPC listener port

We need to:

zcashd's RPC port has a lot of features, but they are out of scope for Zebra.

Fixed Value RPC method

Other Light Wallet RPC methods

The following zcashd JSON-RPC calls are used by lightwalletd. There is a list of RPC methods in the lightwalletd README.

We also need to create acceptance tests for each RPC method.

State RPC Methods

Block Chain RPC methods

Transparent output address index RPC methods

These tickets use the database changes in #3150, but if they aren't finished, we can just return an empty list:

State & Mempool Transaction RPC methods

Mempool-Only RPC methods

Internal Zebra Changes

The current database design is:

The draft database design was merged in:

Make transaction database more efficient

To get good lightwalletd performance, we need to make some changes to our database:

This is needed to:

  • provide address RPC results, and
  • provide good wallet performance

Add transparent output address database index

We also need to add extra indexes for transparent output addresses:

Add chain tip estimate calculations to zebra-state

Infrastructure / Testing

Optional Changes

We don't know if these changes are required yet.

Further Performance Improvements

Handling user-generated transactions

Out of Scope

These changes are not required, because the fields are not used by lightwalletd:

@oxarbitrage oxarbitrage added the Epic Zenhub Label. Denotes a theme of work under which related issues will be grouped label Dec 2, 2021
@teor2345 teor2345 changed the title Tracking: Zebra RPC methods to be a lightwalletd backend Tracking: Zebra JSON-RPC methods to be a lightwalletd backend Dec 2, 2021
@teor2345
Copy link
Contributor

teor2345 commented Dec 2, 2021

We plan to use tonic as our RPC framework.

tonic supports gRPC by default, but zcashd uses JSON-RPC.

I updated the ticket to add tonic-rpc, which supports JSON-RPC.

The other advantage of tonic-rpc is that we can write our RPCs in Rust, rather than using protobuf definitions.

@mpguerra mpguerra changed the title Tracking: Zebra JSON-RPC methods to be a lightwalletd backend Tracking: Zebra as a lightwalletd backend Dec 3, 2021
@teor2345
Copy link
Contributor

teor2345 commented Dec 7, 2021

I removed tonic and tonic-rpc as the preferred option, because they provide gRPC encoded as JSON, not JSON-RPC.

Other async JSON-RPC alternatives are:

But they are harder to use, because they declare RPC methods as closures.

@teor2345
Copy link
Contributor

@ftm1000 this is the big pile of tasks that are related to lightwalletd.

The essential tasks are listed in the ticket, so we should create a new epic with just those tasks.

We also left some security issues until the lightwalletd work. But we should create a separate epic for them, so it's easier to see the essential tasks.

@mpguerra
Copy link
Contributor

mpguerra commented Jan 26, 2022

We're trying to reduce the number of Epics we have so we can just clean up this one and move the non-essential tasks to a github tracking issue instead.

For the security issues I'm not sure that these should be an Epic unless we are planning to schedule them in the roadmap as a high level goal to complete over a number of sprints after the lightwalletd work. For anything that doesn't have a discrete start and end date we should probably just use github tracking issues instead, i.e a task list of issues as in #3125.

@teor2345
Copy link
Contributor

For the security issues I'm not sure that these should be an Epic unless we are planning to schedule them in the roadmap as a high level goal to complete over a number of sprints after the lightwalletd work. For anything that doesn't have a discrete start and end date we should probably just use github tracking issues instead, i.e a task list of issues as in #3125.

That sounds good.

We should decide which security issues represent a large risk for lightwalletd servers, and schedule them in an epic after lightwalletd is feature-complete. (I expect there might be 1-5 of these.)

And if any of the fixes will change the API or performance, we might want to put them in the lightwalletd epic itself. (I expect there might be 0-2 of these.)

@mpguerra mpguerra mentioned this issue Jan 27, 2022
40 tasks
@mpguerra mpguerra changed the title Tracking: Zebra as a lightwalletd backend Epic: Zebra as a lightwalletd backend Jan 27, 2022
@ftm1000 ftm1000 added the lightwalletd any work associated with lightwalletd label Mar 16, 2022
@mpguerra mpguerra added this to Zebra Sep 22, 2022
@mpguerra mpguerra moved this to 🆕 New in Zebra Sep 22, 2022
@mpguerra
Copy link
Contributor

Closing this one!!! Great job everyone! 👏 🎉

Repository owner moved this from 🆕 New to ✅ Done in Zebra Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic Zenhub Label. Denotes a theme of work under which related issues will be grouped lightwalletd any work associated with lightwalletd
Projects
Archived in project
Development

No branches or pull requests

4 participants