Zebra/zebra-state/src
teor 343c5e68d4
change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134)
* Add a new block commit task and channels, that don't do anything yet

* Add last_block_hash_sent to the state service, to avoid database accesses

* Update last_block_hash_sent regardless of commit errors

* Rename a field to StateService.max_queued_finalized_height

* Commit finalized blocks to the state in a separate task

* Check for panics in the block write task

* Wait for the block commit task in tests, and check for errors

* Always run a proptest that sleeps once

* Add extra debugging to state shutdowns

* Work around a RocksDB shutdown bug

* Close the finalized block channel when we're finished with it

* Only reset state queue once per error

* Update some TODOs

* Add a module doc comment

* Drop channels and check for closed channels in the block commit task

* Close state channels and tasks on drop

* Remove some duplicate fields across StateService and ReadStateService

* Try tweaking the shutdown steps

* Update and clarify some comments

* Clarify another comment

* Don't try to cancel RocksDB background work on drop

* Fix up some comments

* Remove some duplicate code

* Remove redundant workarounds for shutdown issues

* Remode a redundant channel close in the block commit task

* Remove a mistaken `!force` shutdown condition

* Remove duplicate force-shutdown code and explain it better

* Improve RPC error logging

* Wait for chain tip updates in the RPC tests

* Wait 2 seconds for chain tip updates before skipping them

* Remove an unnecessary block_in_place()

* Fix some test error messages that were changed by earlier fixes

* Expand some comments, fix typos

Co-authored-by: Marek <mail@marek.onl>

* Actually drop children of failed blocks

* Explain why we drop descendants of failed blocks

* Clarify a comment

* Wait for chain tip updates in a failing test on macOS

* Clean duplicate finalized blocks when the non-finalized state activates

* Send an error when receiving a duplicate finalized block

* Update checkpoint block behaviour, document its consensus rule

* Wait for chain tip changes in inbound_block_height_lookahead_limit test

* Wait for the genesis block to commit in the fake peer set mempool tests

* Disable unreliable mempool verification check in the send transaction test

* Appease rustfmt

* Use clear_finalized_block_queue() everywhere that blocks are dropped

* Document how Finalized and NonFinalized clones are different

* Use the same check as commit_finalized() for finalized block heights

Co-authored-by: Marek <mail@marek.onl>

Co-authored-by: Marek <mail@marek.onl>
2022-09-28 16:09:56 +00:00
..
service change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134) 2022-09-28 16:09:56 +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 change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134) 2022-09-28 16:09:56 +00:00
config.rs feat(state): delete old database directories (#4586) 2022-06-21 00:59:51 +00:00
constants.rs fix(testnet): look back up to 10,000 blocks on testnet for a legacy chain (#5133) 2022-09-20 11:31:24 +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 change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134) 2022-09-28 16:09:56 +00:00
request.rs change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134) 2022-09-28 16:09:56 +00:00
response.rs 2. change(state): Run AwaitUtxo read requests without shared mutable chain state (#5107) 2022-09-16 04:13:26 +00:00
service.rs change(state): Write finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5134) 2022-09-28 16:09:56 +00:00
tests.rs 1. change(state): Run most StateService read requests without shared mutable chain state (#5132) 2022-09-14 00:35:37 +00:00