zebra/zebra-state/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
..
service change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769) 2024-08-16 19:54:44 +00:00
tests Addresses clippy lints (#8723) 2024-07-26 14:29:35 +00:00
arbitrary.rs change: Track the balance of the deferred chain value pool (#8729) 2024-08-05 20:30:47 +00:00
config.rs fix(state): Write database format version to disk atomically to avoid a rare panic (#8795) 2024-08-29 21:09:27 +00:00
constants.rs change(state): Support in-place disk format upgrades for major database version bumps (#8748) 2024-08-09 15:39:38 +00:00
error.rs
lib.rs
request.rs change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769) 2024-08-16 19:54:44 +00:00
response.rs change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769) 2024-08-16 19:54:44 +00:00
service.rs change(rpc): Add value pool balances to `getblockchaininfo` RPC method response (#8769) 2024-08-16 19:54:44 +00:00
tests.rs