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

Bail out in few more places when blockchain is not synced yet #2888

Merged
merged 2 commits into from
Apr 30, 2019

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Apr 26, 2019

No description provided.

@UdjinM6 UdjinM6 added this to the 14.0 milestone Apr 26, 2019
gladcow
gladcow previously approved these changes Apr 30, 2019
Copy link

@gladcow gladcow left a comment

Choose a reason for hiding this comment

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

utACK

@@ -161,7 +162,7 @@ CQuorumManager::CQuorumManager(CEvoDB& _evoDb, CBLSWorker& _blsWorker, CDKGSessi

void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
{
if (fInitialDownload) {
if (!masternodeSync.IsBlockchainSynced()) {

Choose a reason for hiding this comment

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

Does this actually make a difference?

Copy link
Author

Choose a reason for hiding this comment

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

fInitialDownload switches to false ~144 blocks deep https://github.com/dashpay/dash/blob/master/src/validation.h#L129 which is ~6 llmq50 quorums. I assume it could be pretty wasteful to scan/ensure connections for these quorums (which are going to be dropped soon after sync is done) but I haven't tested this tbh.

Choose a reason for hiding this comment

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

Ah yeah, noticed this wasteful building-up of connections as well 👍

@@ -407,6 +413,10 @@ bool CChainLocksHandler::IsTxSafeForMining(const uint256& txid)
// This should also not be called from validation signals, as this might result in recursive calls
void CChainLocksHandler::EnforceBestChainLock()
{
if (!masternodeSync.IsBlockchainSynced()) {

Choose a reason for hiding this comment

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

This might actually result in never reaching the correct chain and thus never leaving the !masternodeSync.IsBlockchainSynced() state. Very unlikely, but still possible.

Copy link
Author

Choose a reason for hiding this comment

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

Hmm.. agree, will drop this one.

Copy link

@codablock codablock left a comment

Choose a reason for hiding this comment

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

utACK

@UdjinM6 UdjinM6 merged commit fbd244d into dashpay:develop Apr 30, 2019
@UdjinM6 UdjinM6 deleted the waitforsync2 branch November 26, 2020 13:29
panleone pushed a commit to panleone/PIVX that referenced this pull request Nov 14, 2024
…y#2888)

* Bail out in few more places when blockchain is not synced yet

* Apply review suggestion
Fuzzbawls added a commit to PIVX-Project/PIVX that referenced this pull request Nov 15, 2024
c7e2beb scripted-diff: Refactor llmq type consensus param names (dashpay#3093) (UdjinM6)
af7bb99 Re-verify invalid IS sigs when the active quorum set rotated (dashpay#3052) (Alexander Block)
be20a71 Remove recovered sigs from the LLMQ db when corresponding IS locks get confirmed (dashpay#3048) (Alexander Block)
802a933 Don't wake up select if it was already woken up (dashpay#2863) (Alexander Block)
436300d  Disable optimistic send in PushMessage by default (dashpay#2859) (Alexander Block)
44ad484 Optimize LLMQs sending of sig shares (dashpay#2704) (Alexander Block)
e01ad46 Fix db leaks in LLMQ db (dashpay#2914) (Alexander Block)
d2a2d15 Print inputs on which we voted and quorums used for signing (dashpay#2907) (Alexander Block)
dce46ad Bail out in few more places when blockchain is not synced yet (dashpay#2888) (UdjinM6)
965a4a7 Use lazy BLS signatures more often and don't always verify self-recovered sigs (dashpay#2860) (Alexander Block)
f4a5a04 cherry pick dashpay#2889 (UdjinM6)

Pull request description:

  each commit backports a different PR

ACKs for top commit: c7e2beb
  Duddino:
    utACK c7e2beb
  Liquid369:
    utACK c7e2beb

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

Successfully merging this pull request may close these issues.

3 participants