Zebra/zebra-state/src
Marek b8712d9a1e
feat(state): Send treestate from non-finalized state to finalized state (#4721)
* Add history trees for each height in non-fin state

* Refactor formatting

* Pass the treestate to the finalized state

I created a new structure `FinalizedBlockWithTrees` that wraps the
treestate and the finalized block. I did that because the original
`FinalizedBlock` is `Eq`, but `HistoryTree` can't be `Eq`.

This makes Zebra faster because:

1. The finalized state doesn't retrieve the treestate from the disk if
the non-finalized state supplies it.

2.The finalized state doesn't recompute the treestate if the
non-finalized state supplies it.

* Check block commitment before updating hist tree

* Store Sprout commitment trees in non-fin state

* Send trees for the root block to fin-state

When committing a block and sending the treestate from the non-finalized
state to the finalized state, Zebra was sending trees that correspond to
the tip block instead of trees that correspond to the root block of the
best chain. This commit fixes that.

* Refactor doc comments

* Refactor block finalization

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-09-06 09:32:54 +00:00
..
service feat(state): Send treestate from non-finalized state to finalized state (#4721) 2022-09-06 09:32:54 +00:00
tests feat(state): Send treestate from non-finalized state to finalized state (#4721) 2022-09-06 09:32:54 +00:00
arbitrary.rs fix(doc): Fix various doc warnings, part 2 (#4561) 2022-06-14 01:22:16 +00:00
config.rs feat(state): delete old database directories (#4586) 2022-06-21 00:59:51 +00:00
constants.rs fix(consensus): Increase the number of blocks checked for legacy transactions (#4804) 2022-08-29 20:25:41 +00:00
error.rs 1. fix(perf): Run CPU-intensive state updates in parallel rayon threads (#4802) 2022-07-22 12:19:11 -04:00
lib.rs feat(state): delete old database directories (#4586) 2022-06-21 00:59:51 +00:00
request.rs feat(state): Send treestate from non-finalized state to finalized state (#4721) 2022-09-06 09:32:54 +00:00
response.rs fix(doc): Fix various doc warnings, part 2 (#4561) 2022-06-14 01:22:16 +00:00
service.rs feat(state): Send treestate from non-finalized state to finalized state (#4721) 2022-09-06 09:32:54 +00:00
tests.rs build(deps): bump insta from 1.15.0 to 1.17.1 (#4884) 2022-08-04 15:44:44 +00:00
util.rs feat(log): log the state tip height as part of sync progress logs (#3437) 2022-01-28 19:12:19 -03:00