Zebra/zebra-state/src/service
teor 8390e4e0cd
refactor(state): Simplify difficulty and median-time-past state and mempool requests (#6031)
* Clarify function docs, rename variables, and fix log typos

* Add a ReadState best chain clone method, but don't use it yet

* Use the new calculate_median_time_past() function in existing code

* Skip a state request if the lock time is a height

* Remove dummy arguments and extra blocks from median-time-past calculation

* Update tests to remove requests that are no longer sent

* Simplify getting the best chain

Co-authored-by: Arya <aryasolhi@gmail.com>

* Clarify some function docs

Co-authored-by: Arya <aryasolhi@gmail.com>

* assigns `next_median_time_past` value from if statement

---------

Co-authored-by: Arya <aryasolhi@gmail.com>
2023-01-31 20:42:11 +00:00
..
chain_tip Only fetch block headers from the database to answer headers requests (#4792) 2022-07-22 09:15:22 +10:00
check refactor(state): Simplify difficulty and median-time-past state and mempool requests (#6031) 2023-01-31 20:42:11 +00:00
finalized_state fix(diagnostics): Hex-encode debug format of commitments, nonces, and nullifiers (#5960) 2023-01-17 13:57:22 +00:00
non_finalized_state fix(clippy): Put Rust format variables inline (#5783) 2022-12-08 01:05:57 +00:00
queued_blocks 3. change(state): Move the finalized queue to the StateService (#5152) 2022-09-16 13:53:40 +00:00
read refactor(state): Simplify difficulty and median-time-past state and mempool requests (#6031) 2023-01-31 20:42:11 +00:00
arbitrary.rs fix(test): Reduce verbose test logs (#5825) 2022-12-08 23:56:01 +00:00
block_iter.rs change(state): Write non-finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5257) 2022-10-11 19:25:45 +00:00
chain_tip.rs fix(clippy): Fix nightly clippy redundant code lints (#5916) 2023-01-05 15:46:04 +00:00
check.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
finalized_state.rs fix(clippy): Put Rust format variables inline (#5783) 2022-12-08 01:05:57 +00:00
non_finalized_state.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00
pending_utxos.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
queued_blocks.rs change(state): Add block channel metrics, in preparation for block fork metrics (#5327) 2022-10-20 20:02:58 +00:00
read.rs fix(consensus): Verify the lock times of mempool transactions (#6027) 2023-01-27 21:46:51 +00:00
tests.rs change(state): Write non-finalized blocks to the state in a separate thread, to avoid network and RPC hangs (#5257) 2022-10-11 19:25:45 +00:00
watch_receiver.rs change(rpc): Return from long polling immediately when the chain tip changes (#5862) 2022-12-15 15:33:00 +00:00
write.rs change(rpc): Add proposal capability to getblocktemplate (#5870) 2023-01-11 23:39:51 +00:00