Skip to content

Display the correct tspend next TVI block the first time #1995

@ukane-philemon

Description

@ukane-philemon

@itswisdomagain on matrix: It seems the last tspend has stayed in mempool longer than it should have. Maybe the dcrdata code needs some correction?
I've seen the dcrdata page show Voting complete – Mineable at Next TVI: 857664 with 3 different TVI blocks now.
I saw mineable at 857088 2 days ago, then 857376 yesterday and now 857664.
When the proposed inclusion block gets mined and it's not included, the display shows the next TVI block as the proposed inclusion block.

To implement this according to DCP0007, we'd need to fetch block data from the db and calculate the treasury spend amount for the current policy window which is TVI * TVIM * TEW (288 * 12 * 2 = 6912) blocks per window

Fetching information for 6912 blocks to calculate the treasury expenditure and determine if the current live tspend would get mined at the next TVI is not scalable for dcrdata.

I propose we save the required data(total expenditure) to the db for each policy window/expenditure policy window for easy retrieval.

OR

We leave the existing code as it is, the NextTVI will keep changing until we pass the expenditure policy window check(i.e. if the next tspend exceeds the allowable spend for the current expenditure policy window).

cc: @chappjc, @itswisdomagain

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions