Store cumulative work in the finalized state for each height #7109
Labels
A-state
Area: State / database changes
C-enhancement
Category: This is an improvement
S-needs-triage
Status: A bug report needs triage
Motivation
We need to store block work in the finalized state database to:
getnetworksolps
&getnetworkhashps
responses, andOtherwise, we have to load:
Specifications
See the upgrade design docs for more details.
Implementation Steps
Complex Code or Requirements
This will need an in-place format update. There's no need to wait for this update to complete, or do it in any particular order. The RPCs can fall back to loading block headers, and the chain forks can use the partial cumulative work.
If we store the cumulative work, we can calculate the block work for
height
using:cumulative_work(height) - cumulative_work(height - 1)
Testing
Compare the work
bits
and RPC outputs withzcashd
.Optional Cleanups
Chain
PartialCumulativeWork
withWork
inChain
PartialCumulativeWork
typeThe text was updated successfully, but these errors were encountered: