Zebra/zebra-state/src
Jane Lusby 4c9bb87df2
zebra-state: replace sled with rocksdb (#1325)
## Motivation

Prior to this PR we've been using `sled` as our database for storing persistent chain data on the disk between boots. We picked sled over rocksdb to minimize our c++ dependencies despite it being a less mature codebase. The theory was if it worked well enough we'd prefer to have a pure rust codebase, but if we ever ran into problems we knew we could easily swap it out with rocksdb.

Well, we ran into problems. Sled's memory usage was particularly high, and it seemed to be leaking memory. On top of all that, the performance for writes was pretty poor, causing us to become bottle-necked on sled instead of the network.

## Solution

This PR replaces `sled` with `rocksdb`. We've seen a 10x improvement in memory usage out of the box, no more leaking, and much better write performance. With this change writing chain data to disk is no longer a limiting factor in how quickly we can sync the chain.

The code in this pull request has:
  - [x] Documentation Comments
  - [x] Unit Tests and Property Tests

## Review

@hdevalence
2020-11-18 18:05:06 -08:00
..
service zebra-state: replace sled with rocksdb (#1325) 2020-11-18 18:05:06 -08:00
config.rs zebra-state: replace sled with rocksdb (#1325) 2020-11-18 18:05:06 -08:00
constants.rs zebra-state: replace sled with rocksdb (#1325) 2020-11-18 18:05:06 -08:00
error.rs Add consensus critical check for sequential heights (#1291) 2020-11-13 14:26:16 +10:00
lib.rs reorganize modules for consistency 2020-11-18 15:09:43 -05:00
request.rs consensus,state: document cancellation contracts for services 2020-11-17 14:56:27 -08:00
response.rs Implement Async Script Verification RFC (#961) 2020-10-14 14:06:32 -07:00
service.rs remove references to sled from service.rs 2020-11-18 15:09:43 -05:00
tests.rs remove redundant conversions 2020-11-12 09:14:52 -05:00
util.rs swap best_chain_len and related constants to u32 for consistency (#1257) 2020-11-06 14:00:10 +10:00