Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Update budget manager best height even if mnSync is incomplete #1843

Merged

Conversation

random-zebra
Copy link

Update the cached chain height in budget manager as soon as possible (no need to complete the mn sync first).

@random-zebra random-zebra added this to the 5.0.0 milestone Sep 9, 2020
@random-zebra random-zebra self-assigned this Sep 9, 2020
Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, ACK 7d3a61b .

@furszy furszy merged commit f4d5d34 into PIVX-Project:master Sep 9, 2020
@random-zebra random-zebra modified the milestones: 5.0.0, 4.3.0 Sep 10, 2020
random-zebra added a commit that referenced this pull request Oct 19, 2020
…for proposals / finalized budgets

4a49010 [BUG] Check budget payment history against active chain (random-zebra)
67c4343 [BUG] Fix finalized budget threshold if there's less than 10 active mns (random-zebra)
b65e862 [Bug] Fix masternode threshold 10% != 2 * 5% (random-zebra)
1d19725 [Cleanup] Remove redundant check in CBudgetProposal::CheckStartEnd (random-zebra)
351c088 [Trivial] fix linter issue with string in multiple lines (random-zebra)
741fa3a [BUG] Fix FillBlockPayee when there's no budget with enough votes (random-zebra)
c149407 [BUG] Immediate expiration of finalized budgets (random-zebra)
8866284 [RPC][BUG] Fix 'mnfinalbudget show' returning a single budget (random-zebra)
ddac6ce [Trivial] Serialize strProposals to disk (random-zebra)
25f749a [Refactor] Check confirmations once - remove nBlockFeeTx / nTime (random-zebra)
6b4c503 [Trivial] Log current/feetx height in CheckCollateralConfs (random-zebra)
6ad29bf [Refactor] Don't add immature/unconfirmed proposals - remove vecImmature (random-zebra)
090d708 [Trivial] Rename IsBudgetCollateralValid and don't export it (random-zebra)
ad1e9a2 [Refactoring] Cache block height of proposals collateral (random-zebra)
d4bedbd [Refactor] Perform CFinalizedBudget static checks in AddFinalizedBudget (random-zebra)
5c1208f [Refactor] Decouple CFinalizedBudget::UpdateValid checks (random-zebra)
0f399e6 [Cleanup] Move extra "Budget + name + (proposals)" out of strInvalid (random-zebra)
676139c [Refactor] Perform CBudgetProposal static checks in AddProposal (random-zebra)
a3d4651 [Refactor] Decouple static checks from IsBudgetCollateralValid (random-zebra)
73cdd20 [Cleanup] Remove extra "Proposal + name" from strInvalid (random-zebra)
be2ecf1 [Budget] Additional checks for proposal recipient address (random-zebra)
12d411f [Refactor] Decouple CBudgetProposal::UpdateValid checks (random-zebra)

Pull request description:

  Based on top of:
  - [x] #1843
  - [x] #1844

  Current PR starts with `[Refactor] Decouple CBudgetProposal::UpdateValid checks` (6c6a97e).

  This focuses on extracting context-independent checks and doing them only once in `AddProposal`/`AddFinalizedBudget`.
  As for the confirmation/expiration check (which is the only thing left for `UpdateValid`) , it is done without locking `cs_main` (while holding `cs_budgets`/`cs_proposals`) by caching the height of the block with the collateral transaction and relying on it (todo: it needs to be addressed the case of it being reorganized from the chain).

  This new field, called `nBlockFeeTx` is added directly to the serialization of CBudgetProposal and CFinalizedBudget, so the old budget.dat will be invalidated and recreated new at startup.

ACKs for top commit:
  furszy:
    Code review ACK 4a49010. Going to try it in regtest now.
  furszy:
    Tested, great ACK 4a49010 .
  Fuzzbawls:
    ACK 4a49010

Tree-SHA512: 3248259a76470da1270731b6b3ba1371db05d280cbe70624f9083f76a130f98f0752615205bfda63fb4aa9ae80ff61c343d77ab70db61c7e72bbc3e5eae7e024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants