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

Fixed deadlock when receiving new block during VerifyDB #379

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
snapshot-version=2.0.1.99-SNAPSHOT
release-version=2.0.1.00
candidate-version=2.0.1.00-candidate
snapshot-version=2.0.2.99-SNAPSHOT
release-version=2.0.2.00
candidate-version=2.0.2.00-candidate
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 01)
define(_CLIENT_VERSION_REVISION, 02)
define(_CLIENT_VERSION_BUILD, 99)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2024)
Expand Down
22 changes: 11 additions & 11 deletions src/update/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ VoteResult MinerRoundVoting::GetVote(const CBlockIndex *blockIndex, const Update
}
}
VoteResult vote(yesCount, update.RoundSize());
LogPrint(BCLog::UPDATES, "Updates: Update: %s, MinerRoundVoting::GetVote, Height: %7d, %s\n", blockIndex->nHeight,
update.Name().c_str(), vote.ToString().c_str());
LogPrint(BCLog::UPDATES, "Updates: Update: %s, MinerRoundVoting::GetVote, Height: %7d, %s\n", update.Name().c_str(),
blockIndex->nHeight, vote.ToString().c_str());
cache[{update.UpdateId(), blockIndex}] = vote;
return vote;
}
Expand Down Expand Up @@ -178,7 +178,7 @@ VoteResult NodeRoundVoting::GetVote(const CBlockIndex *blockIndex, const Update
continue;
}

// LogPrint(BCLog::UPDATES, "Updates: NodeRoundVoting, Height: %d, Tx: %d, Quorum Commitmentx - ValidMembers: %3d, Signers: %3d\n", curIndex->nHeight, i, qc.commitment.CountValidMembers(), qc.commitment.CountSigners());
// LogPrint(BCLog::UPDATES, "Updates: NodeRoundVoting, Height: %d, Tx: %d, Quorum Commitment - ValidMembers: %3d, Signers: %3d\n", curIndex->nHeight, i, qc.commitment.CountValidMembers(), qc.commitment.CountSigners());
if (qc.commitment.CountValidMembers()) {
int64_t samples = qc.commitment.CountValidMembers();
for (const auto it: qc.commitment.quorumUpdateVotes) {
Expand All @@ -196,8 +196,8 @@ VoteResult NodeRoundVoting::GetVote(const CBlockIndex *blockIndex, const Update
}
}
}
LogPrint(BCLog::UPDATES, "Updates: NodeRoundVoting::GetVote, Height: %7d, %s\n", blockIndex->nHeight,
vote.ToString().c_str());
LogPrint(BCLog::UPDATES, "Updates: Update: %s, NodeRoundVoting::GetVote, Height: %7d, %s\n", update.Name().c_str(),
blockIndex->nHeight, vote.ToString().c_str());
cache[{update.UpdateId(), blockIndex}] = vote;
return vote;
}
Expand All @@ -219,8 +219,8 @@ VoteResult MinerUpdateVoting::GetVote(const CBlockIndex *blockIndex, const Updat
// LogPrint(BCLog::UPDATES, "Updates: MinerUpdateVoting::GetVote - retrieved vote for height %d: %s\n", roundBlockIndex->nHeight, roundVote.ToString());
vote += roundVote;
}
LogPrint(BCLog::UPDATES, "Updates: MinerUpdateVoting::GetVote, Height: %7d, %s\n", blockIndex->nHeight,
vote.ToString().c_str());
LogPrint(BCLog::UPDATES, "Updates: Update: %s, MinerUpdateVoting::GetVote, Height: %7d, %s\n", update.Name().c_str(),
blockIndex->nHeight, vote.ToString().c_str());
return vote;
}

Expand All @@ -241,8 +241,8 @@ VoteResult NodeUpdateVoting::GetVote(const CBlockIndex *blockIndex, const Update
// LogPrint(BCLog::UPDATES, "Updates: NodeUpdateVoting::GetVote - retrieved vote for height %d: %s\n", roundBlockIndex->nHeight, roundVote.ToString());
vote += roundVote;
}
LogPrint(BCLog::UPDATES, "Updates: NodeUpdateVoting::GetVote, Height: %7d, %s\n", blockIndex->nHeight,
vote.ToString().c_str());
LogPrint(BCLog::UPDATES, "Updates: Update: %s, NodeUpdateVoting::GetVote, Height: %7d, %s\n", update.Name().c_str(),
blockIndex->nHeight, vote.ToString().c_str());
return vote;
}

Expand Down Expand Up @@ -300,7 +300,7 @@ StateInfo UpdateManager::State(enum EUpdate eUpdate, const CBlockIndex *blockInd
}
}

LOCK(updateMutex);
LOCK2(cs_main, updateMutex);

// Dump the final state cache:
// LogPrint(BCLog::UPDATES, "Updates: FinalState cache\n");
Expand Down Expand Up @@ -502,7 +502,7 @@ StateInfo UpdateManager::State(enum EUpdate eUpdate, const CBlockIndex *blockInd
}

uint32_t UpdateManager::ComputeBlockVersion(const CBlockIndex *blockIndex) {
LOCK(updateMutex);
LOCK2(cs_main, updateMutex);
uint32_t nVersion = VERSIONBITS_TOP_BITS;
for (auto const &update: updates) {
StateInfo si = State(update.first, blockIndex);
Expand Down
Loading