Upgrade Zecwallet's Lite client Infra

Overview

Zecwallet's infrastructure is funded by a previous Foundation grant (https://grants.zfnd.org/proposals/2066095144-zecwallet-maintainance-and-cloud-computing-costs). Since this was approved, Zecwallet has launched mobile apps and improved the light clients considerably. This has increased usage of Zecwallet, which is creating some strain on Zecwallet's cloud infra for light clients.

This proposal is to upgrade Zecwallet's cloud infrastructure into a multi-region, highly available setup with load balancing and failovers across data centers, to ensure that Zecwallet users have an uninterrupted way to access thier Zcash at all times.

The light client needs several pieces of software infrastructure running in the cloud:

  • A zcashd daemon that runs with some special flags (txindex=1 insightexplorer=1) which takes up considerably more memory and disk space than a regular node.
  • Lightwalletd, a server side component that caches compact blocks to serve to light clients. Zecwallet's implementation caches the entire blockchain of compact blocks in memory for performance reasons.
  • A GRPC reverse proxy that handles the SSL certs (issued by Let's Encrypt) and handles some basic failover managment across primary-secondary Lightwalletd.

Right now, the infra is run in a primary-secondary setup in a single region of AWS, to optimize for cost. This approach is suseptible to random infra failures in the cloud (Recent incedent: https://github.com/adityapk00/zecwallet-lite/issues/65)

Approach

The new approach will run multiple, redundant instances of zcashd, which will be fronted by multiple, redundant instances of Lightwalletd. Additionally, they will be run across multiple AWS regions, with load balancing and failovers across multiple datacenters, to remove any single point failures. Specifically:

  • Run zcashd - Lightwalletd in multiple AWS regions
  • Allow each Lightwalletd to failover to backup zcashd instances, even across datacenters.
  • Run GRPC reverse proxy in each region that can handle primary-secondary Lightwalletd, and additionally failover to an alternate datacenter.
  • Run Lightwalletd on multiple IP addresses, which will remove any single point of failures if a single AWS region has issues.
  • Purchase new SSL certs that will allow DNS level load balancing, which will resolve lightwalletd.zecwallet.co to multiple IP addresses across data centers.
    • Setup independent monitoring infrastructure that can track uptime and failures across all instances
  • Improve devop processes to allow easy deployment and management of the infrastructure, removing manual steps to maintain the light client infrastructure.

Deliverable

Zecwallet will purchase the additional infra across AWS regions and the necessary SSL certs, make improvements to the infrastructure and deploy it. This should reduce downtime for Zecwallet users, allowing uninterrupted access for Zecwallet users to their ZEC wallets.

Tipping

Tips Received
???  
ZEC

Campaign

Started
a month ago
Funding
$5,000 
Funded through  
1
Upgrade Zecwallet Cloud Infra

Upgrade Zecwallet Cloud Infra

Reward: $5,000
The team was awarded $5,000 in ZEC as an initial payout on Sep 25th, 2020, 1:21 am.
Multi region setup and failovers