# **Proposal: parasnaps.io six months maintenance** **Beneficary: DDbQ9YnjeLS6DvZgvTgFvttnqJZrD12gVq4889yh9opXVS6** **Date: 31.8.2022** **Requested Amount: 382.19 KSM/18'450.95 USD (EMA7 48.277$)** **Link: https://parasnaps.io** **E-mail address:** staking@amforc.com **Twitter:** [@tugytur](https://twitter.com/TugyTur) **Element handle:** @tugytur:matrix.org **Short description:** To be able to recover inside an epoch on Kusama and prevent an offline event or potential slashing, we built a snapshot solution that allows bootstrapping a Kusama/Polkadot validator in less than five minutes to continue producing blocks. --- # 1. Context of the proposal Parasnaps was built out of the necessity to have a high-throughput snapshot solution to be able to take fast actions. Community members that we talked to showed great interest in a solution that would allow to restore a validator in a couple of minutes. ### Team credentials We are experienced in running validators since NPoS was enabled. Early last year, we founded our own company which provides dedicated and public staking solutions focusing on the Dotsama ecosystem. The company is self-funded, independent, domiciled and based in [Switzerland](https://sz.chregister.ch/cr-portal/auszug/auszug.xhtml?uid=CHE-277.593.688). ### Community tips Parasnaps.io was reported by community members for a [tip](https://www.dotreasury.com/ksm/tips/11806490_0xcbd0dd314675d31d537f456ca3e06104e4e2c23b6bb5dbe453f948f7d29c39a8) from the Kusama council. It was accepted and approved by the council. ### Central topic Parasnaps was launched in February 2022, this proposal aims to cover the costs and work generated by Parasnaps in its first six months of being publicly available. # 2. Problem statement For every session, validators must send an “I’m online” heartbeat if no blocks were produced to indicate that they are live during an epoch. It is possible that the heartbeat is not sent until 60-70% of the epoch is over. Slashing would occur if more than 10% of the network is unresponsive. With an epoch period of one hour on Kusama, this means that there could be the scenario with less than 20 minutes to react to a potential issue and prevent a slashing event. Other potential issues are bugs in either rocksdb or paritydb – because of this, both DB versions must be available at all times. # 3. Proposal Objective/solution/s to point 2 The solution we built uploads daily synced snapshots for Polkadot and Kusama for both DB versions. Those snapshots are synced across five different geographical locations to prevent local outages and increase the download speed. ### DB sync/testing Snapshots are always synced from scratch if the snapshot machines are updated to a new release or if there are any changes to the DB. Before making a snapshot available to the public, we run a validator with rocksdb and paritydb for at least 24h to check for any potential issues. This led us to the discovery of multiple issues: - [paritydb brekas on upgrade](https://github.com/paritytech/polkadot/issues/5168) - [StateDb does not have PRUNING_MODE](https://github.com/paritytech/polkadot/issues/5554) ### Download There are three ways to download the snapshots as mentioned on the website with examples: - Interactive (Bash script) - Manual - Ansible (examples on how to integrate into the automation) All three options rely on a Rust binary that executes 16 concurrent downloads and keeps the results in a sorted binary tree to allow piping into stdout to directly be extracted. ### Demo For demonstration purposes, we took the biggest DB size from the available ones, which is rocksdb for Kusama with a size of 154 GB as per August 4, 2022. ![](https://i.imgur.com/j4V9mfQ.png) ![](https://i.imgur.com/aVu3bpu.png) The screenshot above shows the directory size before and after the download, as well as the time that it took to download the 154GB, which was 4 minutes and 50 seconds. ### Who does this solution help? - Validator operators that need to failover in a fast manner. - Validator operators that want tested snapshots. ### Usage From merging the monthly usage reports for the s3 buckets (see below), a total of 25’368 GB was downloaded in the first six months. Assuming an average of 105 GB for a download, this results in ca. 241 downloads in total so far, which averages to around 1.3 downloads per day. ![](https://i.imgur.com/I9FAwXK.jpg) ### Operational expenses Parasnaps is hosted on AWS. We marked all related services with a corresponding tag to be able to create a report for the proposal. In addition to the infrastructure cost, we included an hourly rate of $85 for labor. For the operation and maintenance we estimate four hours a month, which would equal to 24 hours for the last six months. This includes operation of the related services and machines, taking care of it and ensuring it runs without issues. For testing of new snapshots and troubleshooting issues, we estimate a lower bound of nine hours a month, which would equal 54 hours for the last six months. # 4. Payment conditions: Specified payments below are a reimbursement for Parasnaps for the period from February to July 2022. ### Amount XXX KSM/17’572.35 USD (to be converted using 7d EMA on the day of the submission) ### Breakdown | Item | Cost | Notes | | -------- | -------- | -------- | | Parasnaps Domain | $71 | ![](https://i.imgur.com/k2t97Uo.png) | | Infrastructure | $9615.77 | ![](https://i.imgur.com/R6iaiwH.png)| | 24h maintenance | $2040 | Estimated labor from February-July for maintenance (see [here](#Operational-expenses)) | | 54h labor | $4590 | Estimated labor from February-July for troubleshooting and testing (see [here](#Operational-expenses)) | | Total excl. VAT | $16'316 | | | VAT 7.7% | $1256.35 | Swiss VAT (verify [here](https://www.estv.admin.ch/estv/en/home/value-added-tax/vat-rates-switzerland.html)) | | Total incl. VAT | $17'572.35 | | | Exchange Rate KSM/USD 7d EMA | $48.277 | | | Slippage + conversion fee 5% | $878.6 | | | Proposal KSM | 382.19 KSM | | ### How does this amount cover the work of the proposal? The calculations above summarize the operational costs to offer this solution publicly for the community over the last six months. The goal of our proposal is to be able to sustainably offer Parasnaps for free to everyone. With the proposal, we can cover the costs incurred over the last six months. # 5. Future Proposals: Parasnaps maintenance proposals will alternate between Kusama and Polkadot maintenance bounty, due to providing snapshots for both chains. This first proposal will be submitted to the Kusama treasury, since the development of this solution was neither funded by the treasury nor a grant program. We built parasnaps out of necessity and made it publicly available from the start without external funding. Therefore, we are not yet eligible for the maintenance bounty.