Commit Graph

199 Commits

Author SHA1 Message Date
Jane Lusby a122a547be reorganize modules for consistency 2020-11-18 15:09:43 -05:00
Henry de Valence e0b2af7123 state: add sled tree precommit metrics on tracked objects 2020-11-17 14:56:27 -08:00
Henry de Valence a3ab589d89 consensus,state: document cancellation contracts for services
This change explicitly documents cancellation contracts for our Tower services,
and tries to correct a bug in the implementation of the CheckpointVerifier,
which duplicates information from the state service but did not ensure that it
would be kept in sync.
2020-11-17 14:56:27 -08:00
teor 2f53ff44f7 Move chain order assertions to commit_finalized_direct
And remove a duplicate assert in the contextual verification function.
2020-11-17 13:16:31 +10:00
teor d7d15984eb Move all contextual validation code into its own function
This change has two benefits:
* reduces conflicts with the sled refactor and any replacement
* allows the function to be called independently for testing
2020-11-17 11:46:57 +10:00
teor cfe779db69 Add an info-level span to check_contextual_validity 2020-11-17 10:07:37 +10:00
teor d80a0c7402 Stop panicking during contextual validation
`check_contextual_validity` mistakenly used the new block's hash to try
to get the parent block from the state. This caused a panic, because the
new block isn't in the state yet.

Use `StateService::chain` to get the parent block, because we'll be
using `chain` for difficulty adjustment contextual verification anyway.
2020-11-17 10:07:37 +10:00
teor 54cb9277ef Allow some new clippy nightly lints 2020-11-17 10:07:37 +10:00
Jane Lusby a6bd77e98a
Add check to ensure heights in state service are sequential (#1290)
* Add check to ensure heights in state service are sequential

Co-authored-by: teor <teor@riseup.net>
2020-11-17 09:53:33 +10:00
Jane Lusby 4c2b44be93
Add tests for QueuedBlocks (#1268)
* Add unit test for QueuedBlocks
* Add test for pruned blocks
2020-11-17 09:31:22 +10:00
teor 2253ab3c00 Improve state request docs
Document best and any chain requests
Explain that the block locator is sparse
2020-11-17 07:52:53 +10:00
Jane Lusby 57637560b9
Add internal iterator API for accessing relevant chain blocks (#1271)
* Add internal iterator API for accessing relevant chain blocks
* get blocks from all chains in non_finalized state
* Impl FusedIterator for service::Iter
* impl ExactSizedIterator for service::Iter
* let size_hint find heights in side chains

Co-authored-by: teor <teor@riseup.net>
2020-11-16 12:22:53 +10:00
dependabot[bot] 18eb4d1c31 build(deps): bump primitive-types from 0.7.2 to 0.7.3
Bumps [primitive-types](https://github.com/paritytech/parity-common) from 0.7.2 to 0.7.3.
- [Release notes](https://github.com/paritytech/parity-common/releases)
- [Commits](https://github.com/paritytech/parity-common/compare/primitive-types-v0.7.2...primitive-types-v0.7.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-13 15:59:04 -05:00
dependabot[bot] 8c5f6d0177 build(deps): bump once_cell from 1.5.1 to 1.5.2
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.5.1...v1.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-13 14:48:11 -05:00
Jane Lusby 7403897fda
Add transcript tests as described in the state service tracking issue (#1281)
* Add transcript test for requests while state is empty

* Add happy path test for each query once the state is populated

* let populate logic handle out of order blocks
2020-11-13 10:19:47 -08:00
Jane Lusby 8ba9d0114b
Add consensus critical check for sequential heights (#1291)
* Add consensus critical check for sequential heights
* document the check module
* Add unit tests for consensus checks
2020-11-13 14:26:16 +10:00
Jane Lusby 7c0275ac0b
reorganize stop check (#1288)
* reorganize stop check
* remove unused enum
* move out and make it unique
Co-authored-by: teor <teor@riseup.net>
2020-11-13 11:37:52 +10:00
teor 4e07719a7d
Add a maximum queued height metric to the finalized state (#1262)
* Add a maximum queued height metric to the finalized state
And rename all the finalized state metrics to contain "finalized".

* Use i32 and -1 instead of Option<Height>
Co-authored-by: Jane Lusby <jlusby42@gmail.com>
2020-11-13 09:49:55 +10:00
Jane Lusby 32934bd574 remove redundant conversions 2020-11-12 09:14:52 -05:00
Jane Lusby a5861e5ad9 use arbitrary for creating work 2020-11-12 09:14:52 -05:00
Jane Lusby b287ea58c2 Add proptest for work roundtrip 2020-11-12 09:14:52 -05:00
Jane Lusby a798074088 split conversion into a fn 2020-11-12 09:14:52 -05:00
Jane Lusby ae843d856f Add comment explaining work to expanded conversion 2020-11-12 09:14:52 -05:00
Jane Lusby 1bc833dbcc Move work conversion helpers to test code 2020-11-12 09:14:52 -05:00
Jane Lusby beede1c03d tweek chain test to use set_work 2020-11-12 09:14:52 -05:00
Jane Lusby c41a7303fa Add helpers for setting work on fake chains 2020-11-12 09:14:52 -05:00
Jane Lusby dc9081b738 clarify test name 2020-11-12 09:14:52 -05:00
Jane Lusby a398e96f79 Update zebra-state/src/service/memory_state/non_finalized_state.rs
Co-authored-by: teor <teor@riseup.net>
2020-11-12 09:14:52 -05:00
Jane Lusby c54b07eb32 Update zebra-state/src/service/memory_state/non_finalized_state.rs
Co-authored-by: teor <teor@riseup.net>
2020-11-12 09:14:52 -05:00
Jane Lusby 8279c65218 Update zebra-state/src/service/memory_state/non_finalized_state.rs
Co-authored-by: teor <teor@riseup.net>
2020-11-12 09:14:52 -05:00
Jane Lusby dcc19f6b25 fully cover commit_block 2020-11-12 09:14:52 -05:00
Jane Lusby 74af22e5ca Add unit tests for 2020-11-12 09:14:52 -05:00
dependabot[bot] a7ad73feac build(deps): bump sled from 0.34.4 to 0.34.5
Bumps [sled](https://github.com/spacejam/sled) from 0.34.4 to 0.34.5.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.34.4...v0.34.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-10 11:01:06 -05:00
teor 41788c3f27
Add metrics for the non-finalized state and queue (#1263) 2020-11-10 11:11:58 +10:00
Alfredo Garcia 128643d81e
Call `zebra_test::init` where needed. (#1227)
* Add missing `zebra_test::init()` to zebra-chain
* Add missing `zebra_test::init()` to zebra-consensus
* Add missing `zebra_test::init()` to zebra-network
* Add missing `zebra_test::init()` to zebra-state
* Add missing `zebra_test::init()` to zebra-test
* Add missing `zebra_test::init()` to zebrad
2020-11-10 10:29:25 +10:00
Jane Lusby 34f50d7ebb
Fix inconsistencies related to best chain order in RFC and state impl (#1267)
Prior to this PR we realized that the RFC had been drafted with the assumption that chains would be ordered from best to worst in `NonFinalizedState`. This assumption was incorrect, since `BTreeSet` only ever orders values in ascending order. This discrepancy was noticed and fixed in the code, but there were still some inconsistencies that needed to be cleaned up.

This PR updates all the incorrect or confusing comments about chain ordering in the RFC and code.
2020-11-09 15:53:16 -08:00
Jane Lusby 818fede30f
Reorganize memory_state to avoid giant test module (#1258)
Prior to this PR `memory_state` defined and implemented functionality for three different types, `Chain`, `NonFinalizedState`, and `QueuedBlocks`. Each of these components will need a fair number of unit tests, and I realized that as its currently organized it would be difficult to organize the tests or at a glance figure out which tests are testing which components.

This PR changes the organization of `memory_state` such that each component it exports is defined in its own module. In follow up PRs each module will get its own test module, which will focus exclusively on unit tests for the item defined there-in.

- [Tracking Issue](https://github.com/ZcashFoundation/zebra/issues/1250)
2020-11-09 10:05:18 -08:00
Jane Lusby c9bf7f4cf6 Add tests for new sled impls needed for debug format 2020-11-09 09:12:26 -05:00
Jane Lusby c1de002f58 add key debug to assert error message 2020-11-09 09:12:26 -05:00
Jane Lusby ee7ec31aa2 Add a more relevant error message to insert panics 2020-11-09 09:12:26 -05:00
Deirdre Connolly 782f4606d0 Revert "Add message if assertion that sled map keys don't collide fails"
This reverts commit d784a23eab.
2020-11-09 09:12:26 -05:00
Deirdre Connolly 1a9490dc4f Revert "Bytes are Display-able"
This reverts commit c48e24e89b.
2020-11-09 09:12:26 -05:00
Deirdre Connolly 27d0fa8d83 Bytes are Display-able 2020-11-09 09:12:26 -05:00
Deirdre Connolly bfbdd7112b Add message if assertion that sled map keys don't collide fails
Co-authored-by: teor <teor@riseup.net>
2020-11-09 09:12:26 -05:00
Jane Lusby 76385e8620 assert that sled maps are collision free 2020-11-09 09:12:26 -05:00
Jane Lusby e8a3a28869
swap best_chain_len and related constants to u32 for consistency (#1257) 2020-11-06 14:00:10 +10:00
Jane Lusby 06e74d15ae
Add proptests for sled conversions (#1253)
* Add proptests for sled conversions
* document primary helper functions
2020-11-05 14:47:56 +10:00
dependabot[bot] e87340594a build(deps): bump thiserror from 1.0.21 to 1.0.22
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.21 to 1.0.22.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.21...1.0.22)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-04 19:28:42 -05:00
Jane Lusby 714def990e
make state service use both finalized and non-finalized state (#1239)
* make service use both finalized and non-finalized state

* Document new functions

* add documentation to sled fns

* cleanup tip fn now that errors are gone

* rename height unwrap fn
2020-11-01 10:49:34 -08:00
Jane Lusby 1b7c57371d
Fix format used to store transactions in sled (#1238)
## Motivation

While working on the block locator fix PR together with Henry we noticed that we'd accidentally serialized entire transactions in `tx_by_hash`, instead of serializing just the height of the block and the index of the transaction within the block, as described by the original RFC.

## Solution

We've fixed it by adding a `TransactionLocation` new type, which handles the sled format traits. We've removed the sled format impls for `Transaction` to prevent inserting the wrong data in the future. Finally we've bumped the database format to reflect the change in the format on the disk and its incompatibility with previous versions.
2020-10-30 15:24:39 -07:00
Henry de Valence e2c5b71323 state: document memory_cache_bytes, reduce default
Closes #1026

Because of the way that sled uses this parameter, the actual in-memory
size may be much larger.  Dialing this down should help avoid high
memory usage.
2020-10-29 14:31:50 -04:00
Henry de Valence 68b9a70a60 state: skip transactions in a genesis block 2020-10-29 09:58:56 -07:00
Henry de Valence 1573e0e4ae state: remove spent UTXOs in commit_finalized_direct 2020-10-29 09:58:56 -07:00
Jane Lusby c8a97f94b2 state: clean up SledState query impls 2020-10-29 09:58:56 -07:00
Jane Lusby dace92aca1 state: add SLED_FORMAT_VERSION prefix to db path
Also removes a redundant test.
2020-10-29 09:58:56 -07:00
Jane Lusby 2095b4f0d3 state: insert into nullifier trees 2020-10-29 09:58:56 -07:00
Jane Lusby 6758fdbd1c state: create SledSerialize, SledDeserialize traits 2020-10-29 09:58:56 -07:00
teor 0d47b80e68
Fix a comment typo 2020-10-27 19:31:45 +10:00
teor ea510b7d41
Run a block sync in CI with 2 large checkpoints (#1193)
* Run large checkpoint sync tests in CI
* Improve test child output match error context
* Add a debug_stop_at_height config
* Use stop at height in acceptance tests

And add some restart acceptance tests, to make sure the stop at
height feature works correctly.
2020-10-27 19:25:29 +10:00
dependabot[bot] 83c844abb5 build(deps): bump futures from 0.3.6 to 0.3.7
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.6...0.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-27 02:28:48 -04:00
Jane Lusby 971765ab30
Handle duplicate blocks in zebra-state (#1198)
## Motivation

The zebra-state service needs to be able to handle duplicate blocks.

## Solution

This implements changes already outlined by [The State
RFC](https://zebra.zfnd.org/dev/rfcs/0005-state-updates.html). We check for
successfully committed blocks first, since interacting with the queued blocks
struct at this point just complicates the implimentation. If the block has not
already been committed we then check if the block has already been queued, if
not we handle the block normally (normally here being the bit we already had
implemented).

## Documentation Changes

- [x] Update the state RFC to match the ways this fix departs from the design
	- the main thing is that I switched the order of checking for duplicates
- [x] ~~Add newly added functions to the state rfc~~ Decided not to do this because they're minor getters that don't influence the rest of the design and aren't exposed as part of the API
- [x] Document newly added functions inline

## Testing

## Related Issues

- fixes https://github.com/ZcashFoundation/zebra/issues/1182
- tracking issue https://github.com/ZcashFoundation/zebra/issues/1049

Co-authored-by: teor <teor@riseup.net>
2020-10-26 13:54:19 -07:00
Henry de Valence 6f8f8a56d4 state: perform sled reads synchronously
We already use an actor model for the state service, so we get an
ordered sequence of state queries by message-passing.  Instead of
performing reads in the futures we return, this commit performs them
synchronously.  This means that all sled access is done from the same
task, which

(1) might reduce contention
(2) allows us to avoid using sled transactions when writing to the
state.

Co-authored-by: Jane Lusby <jane@zfnd.org>


Co-authored-by: Jane Lusby <jane@zfnd.org>
Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-10-26 12:05:35 -07:00
Henry de Valence 65e0c22fbe state: don't pre-buffer the service
There's no reason to return a pre-Buffer'd service (there's no need for
internal access to the state service, as in zebra-network), but wrapping
it internally removes control of the buffer size from the caller.
2020-10-26 12:05:35 -07:00
teor 672b39a847 Use MAX_BLOCK_REORG_HEIGHT in zebra-checkpoints
MAX_BLOCK_REORG_HEIGHT is 1 less than the constant it replaces. The new
calculation is correct: the 100th block is finalized.
2020-10-26 20:59:40 +10:00
Jane Lusby e05103323e
Implement Async Script Verification RFC (#961)
This commit begins the process of integrating `zcash_script` with the rest of the system for verifying scripts while syncing the block chain. It does so by adding the necessary support for looking up UTXOs from the state service and implements the first parts of the `script::Verifier` for looking up the necessary UTXOs in the state and then generating the necessary call to `zcash_script` to verify the script itself.

Co-authored-by: teor <teor@riseup.net>
2020-10-14 14:06:32 -07:00
Alfredo Garcia c0a14ecc8c
move genesis parameters to zebra-chain (#1151) 2020-10-12 14:08:23 -07:00
teor e2d67fc9e7
Add metrics for the sled state (#1062) 2020-10-10 11:49:44 +10:00
Jane Lusby eaf5473efc
Add verification and state tracing events and spans (#1131) 2020-10-09 19:05:09 +10:00
Jane Lusby b3634fa3e7
Make the state service use broadcast channels (#1137)
And refactor error handling
2020-10-09 18:37:24 +10:00
Jane Lusby 855f9b5bcb
Implement MVP of NonFinalizedState and integrate it with the state service (#1101)
* implement most of the chain functions
* implement fork
* fix outpoint handling in Chain struct
* update expect for work
* split utxo into two sets
* update the Chain definition
* remove allow attribute in zebra-state/lib.rs
* merge ChainSet type into MemoryState
* Add error messages to asserts
* export proptest impls for use in downstream crates
* add testjob for disabled feature in zebra-chain
* try to fix github actions syntax
* add module doc comment
* update RFC for utxos
* add missing header
* working proptest for Chain
* propagate back results over channel
* Start updating RFC to match changes
* implement queued block pruning
* and now it syncs wooo!
* remove empty modules
* setup config for proptests
* re-enable missing_docs lint
* update RFC to match changes in impl
* add documentation
* use more explicit variable names
2020-10-08 13:07:32 +10:00
dependabot[bot] 1b7bf61f96 build(deps): bump thiserror from 1.0.20 to 1.0.21
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.20 to 1.0.21.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.20...1.0.21)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-07 18:25:33 -04:00
dependabot[bot] 08f363e1cb build(deps): bump futures from 0.3.5 to 0.3.6
Bumps [futures](https://github.com/rust-lang/futures-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.5...0.3.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-06 16:54:08 -04:00
Jane Lusby 86ed13060f
Add tests for `Chain` implementation (#1093)
* Begin work on RFC5 implementation

* I think this is necessary

* holy shit supertrait implemented via subtrait

* implement most of the chain functions

* change to slightly better name

* implement fork

* fix outpoint handling in Chain struct

* update expect for work

* resolve review comment

* split utxo into two sets

* update the Chain definition

* just a little more

* update comment

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* apply changes from code review

* remove allow attribute in zebra-state/lib.rs

* Update zebra-state/src/memory_state.rs

Co-authored-by: teor <teor@riseup.net>

* merge ChainSet type into MemoryState

* rename state impl types

* Add error messages to asserts

* checkpoint so I can split off arbitrary changes into a PR

* export proptest impls for use in downstream crates

* add testjob for disabled feature in zebra-chain

* run rustfmt

* try to fix github actions syntax

* differentiate name

* prove that github action tests zebra-chain build without features

* revert change from last commit now that test is running

* remove accidentally introduced newline

* checkpoint

* add module doc comment

* update RFC for utxos

* add missing header

* working proptest for Chain

* apply change from chain impl PR

* setup config for proptests

* Update zebra-chain/src/block/arbitrary.rs

Co-authored-by: teor <teor@riseup.net>

* run rustfmt

Co-authored-by: teor <teor@riseup.net>
2020-10-02 15:51:51 -07:00
Jane Lusby 352721bd88
Implement RFC5: State updates `Chain` type (#1069)
* Begin work on RFC5 implementation

* I think this is necessary

* holy shit supertrait implemented via subtrait

* implement most of the chain functions

* change to slightly better name

* implement fork

* fix outpoint handling in Chain struct

* update expect for work

* resolve review comment

* split utxo into two sets

* update the Chain definition

* just a little more

* update comment

* Apply suggestions from code review

Co-authored-by: teor <teor@riseup.net>

* apply changes from code review

* remove allow attribute in zebra-state/lib.rs

* Update zebra-state/src/memory_state.rs

Co-authored-by: teor <teor@riseup.net>

* merge ChainSet type into MemoryState

* rename state impl types

* Add error messages to asserts

* add module doc comment

* update RFC for utxos

* add missing header

Co-authored-by: teor <teor@riseup.net>
2020-09-24 15:46:04 -07:00
Jane Lusby 0b4e974c9e
export proptest impls for use in downstream crates (#1092)
* export proptest impls for use in downstream crates

* add testjob for disabled feature in zebra-chain

* run rustfmt

* try to fix github actions syntax

* differentiate name

* prove that github action tests zebra-chain build without features

* revert change from last commit now that test is running

* remove accidentally introduced newline

* Update .github/workflows/ci.yml

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>

Co-authored-by: Deirdre Connolly <deirdre@zfnd.org>
2020-09-23 18:52:52 -07:00
Henry de Valence 6dd7318d3b deps: use Tower 0.4 from git instead of 0.3.1.
This addresses at least three pain points:

- we were affected by bugs that were already fixed in git, but not in
  the released crate;
- we can use service combinators to transform requests and responses;
- we can use the hedge middleware.

The version in git is still marked as 0.3.1 but these changes will be
part of tower 0.4: https://github.com/tower-rs/tower/issues/431
2020-09-21 14:16:56 -07:00
Henry de Valence 9e2ff23d54 consensus, state: increase Buffer sizes
Using a Buffer with size 1 is a footgun because it allows only one
sender to call poll_ready at a time.  This is usually undesirable
because it means that a task or service that calls poll_ready but only
makes a service call later (potentially much later) will block all other
callers.
2020-09-21 09:26:39 -07:00
teor c349f75ffe Split a sentence in a state comment 2020-09-16 12:25:31 -04:00
Henry de Valence bbd8a069bb state: fix bug in SledState::commit_finalized
The previous code filled in block height 0 for a missing coinbase height
in `SledState::commit_finalized`, since the genesis block is the only
block without a coinbase height (because of a mistake when it was
created).

However, @teor2345 noticed that this is incorrect, because we already
parse the genesis block specially and fill in its coinbase height
correctly.  So instead, we can .expect it to be present, because we can
assume that all finalized blocks are valid.
2020-09-11 13:37:49 -07:00
Henry de Valence de2400031c state: merge SledState::{queue, process_queue}.
We never want to call one without the other, so just do them together.
2020-09-11 13:37:49 -07:00
Henry de Valence 526f771ceb state: update SledState docs. 2020-09-11 13:37:49 -07:00
Henry de Valence 8fb0e11674 fix: clippy-redundant closures, fmt 2020-09-11 13:37:49 -07:00
Henry de Valence 006596b9a9 state: remove unused variables 2020-09-11 13:37:49 -07:00
Henry de Valence f4db12efcb state: implement Request::Block with sled 2020-09-11 13:37:49 -07:00
Henry de Valence 5d8decd224 state: process CommitFinalizedBlock out of order 2020-09-11 13:37:49 -07:00
Henry de Valence b27ace87eb state: partial implementation of new sled layout 2020-09-11 13:37:49 -07:00
Henry de Valence f1f0b331ac state: make Response::Tip return (height, hash) 2020-09-11 13:37:49 -07:00
Henry de Valence 070013439e state: fill in RFC5-style Request, Response enums
The test transcripts need to be rewritten, so they are removed for now.
2020-09-11 13:37:49 -07:00
Henry de Valence 98d5351206 state: add rustdoc links 2020-09-11 13:37:49 -07:00
Henry de Valence 2ac8b5b9d4 state: create a new wrapper service
The new `StateService` type wraps a `SledState` and a `MemoryState`.
This will allow the sled-related code and the in-memory code to be kept
separate, with the top-level `StateService` making method calls to one
or the other, as appropriate.

This commit removes the existing Service impl for the SledService.  This
saves time in refactoring, and the code needs to be rewritten
anyways so there's no loss to deleting it now.
2020-09-11 13:37:49 -07:00
Henry de Valence 303b02d10a state: split into modules and reorganize
Closes #975.
2020-09-11 13:37:49 -07:00
dependabot[bot] 69032e1007 build(deps): bump sled from 0.34.3 to 0.34.4
Bumps [sled](https://github.com/spacejam/sled) from 0.34.3 to 0.34.4.
- [Release notes](https://github.com/spacejam/sled/releases)
- [Changelog](https://github.com/spacejam/sled/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spacejam/sled/compare/v0.34.3...v0.34.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-11 13:08:16 -04:00
teor 9cf7de6253 Temporarily ignore failing state tests
This commit should be reverted when the state can handle out-of-order
blocks.
2020-09-09 15:37:59 -07:00
teor 1cd9f48d19 Add tests for in-order state AddBlock requests
Also fix a bug in the tests, where Mainnet and Testnet were swapped.
2020-09-09 15:37:59 -07:00
teor 8463b705c8 Panic when state blocks are inserted out of order
This panic ensures our state is not corrupted. Corrupt states can lead
to future panics when querying the chain.
2020-09-09 15:37:59 -07:00
teor 1285561c3f Perform serialised block writes to the state
As per the state design RFC 0005.
2020-09-09 15:37:59 -07:00
Alfredo Garcia 454e75e7c0
Rename old references to BlockHeaderHash and BlockHeight (#1002)
* rename some references

* Apply suggestions from code review

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
Co-authored-by: teor <teor@riseup.net>

Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
Co-authored-by: teor <teor@riseup.net>
2020-09-04 15:40:48 -07:00
teor d3b6a73f7b Improve zebra-state logging and metrics 2020-09-02 12:09:50 -04:00
Jane Lusby ffdec0cb23
Remove in-memory state service (#974)
* Remove in-memory state service

* make the config compatible with toml again

* checkpoint commit to see how much I still have to revert

* back to the starting point...

* remove unused dependency

* reorganize error handling a bit

* need to make a new color-eyre release now

* reorder again because I have problems

* remove unnecessary helpers

* revert changes to config loading

* add back missing space

* Switch to released color-eyre version

* add back missing newline again...

* improve error message on unix when terminated by signal

* add context to last few asserts in acceptance tests

* instrument some of the helpers

* remove accidental extra space

* try to make this compile on windows

* reorg platform specific code

* hide on_disk module and fix broken link
2020-09-01 12:39:04 -07:00
Ramana Venkata ad0001f7f7
zebra-state: Add support for temporary sled databases (#939)
* Test config with persistent sled database
* Test ephemeral config
* Add misconfigured ephemeral test
2020-08-31 18:32:55 +10:00