zebra/zebra-chain/src
Arya 0ef9987e9e
fix(state): Write database format version to disk atomically to avoid a rare panic (#8795)
* Splits `atomic_write_to_tmp_file` out of `zebra_network::Config::update_peer_cache`

* Uses the new `atomic_write_to_tmp_file` fn in `update_peer_cache()`

* Replaces repetitive code for getting the default peer and state cache directories with `default_cache_dir()`

* Converts `atomic_write_to_tmp_file` to a blocking function and adds `spawn_atomic_write_to_tmp_file` for use in async environments.

* Uses `atomic_write_to_tmp_file` to write database versions to disk

* Removes `spawn_atomic_write_to_tmp_file()` and inlines its body at its callsite to avoid adding tokio as a dependency of zebra-chain.

* Apply suggestions from code review

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

---------

Co-authored-by: Marek <mail@marek.onl>
2024-08-29 21:09:27 +00:00
..
amount
block add(chain): Add an NU6 network upgrade variant (#8693) 2024-07-18 17:49:24 +00:00
chain_sync_status
chain_tip
diagnostic
fmt
history_tree
orchard
parallel
parameters change(consensus/network): Updates `CURRENT_NETWORK_PROTOCOL_VERSION` and adds an NU6 activation height on Testnet (#8804) 2024-08-27 23:24:33 +00:00
primitives build(deps): make librustzcash crates workspace dependencies (#8792) 2024-08-24 00:55:57 +00:00
sapling
serialization Addresses clippy lints (#8723) 2024-07-26 14:29:35 +00:00
sprout
tests
transaction add(chain): Add an NU6 network upgrade variant (#8693) 2024-07-18 17:49:24 +00:00
transparent
value_balance change: Track the balance of the deferred chain value pool (#8729) 2024-08-05 20:30:47 +00:00
work
amount.rs change: Refactor error handling for block subsidies (#8735) 2024-08-07 15:34:57 +00:00
block.rs change: Track the balance of the deferred chain value pool (#8729) 2024-08-05 20:30:47 +00:00
chain_sync_status.rs
chain_tip.rs change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769) 2024-08-16 19:54:44 +00:00
common.rs fix(state): Write database format version to disk atomically to avoid a rare panic (#8795) 2024-08-29 21:09:27 +00:00
diagnostic.rs
error.rs
fmt.rs
history_tree.rs add(chain): Add an NU6 network upgrade variant (#8693) 2024-07-18 17:49:24 +00:00
lib.rs fix(state): Write database format version to disk atomically to avoid a rare panic (#8795) 2024-08-29 21:09:27 +00:00
orchard.rs
parallel.rs
parameters.rs change(network-params): Configurable Testnet funding streams (#8718) 2024-07-29 16:15:09 +00:00
primitives.rs
sapling.rs
serialization.rs
shutdown.rs
sprout.rs
subtree.rs
tests.rs
transaction.rs change: Track the balance of the deferred chain value pool (#8729) 2024-08-05 20:30:47 +00:00
transparent.rs
value_balance.rs change: Refactor error handling for block subsidies (#8735) 2024-08-07 15:34:57 +00:00
work.rs