Skip to content

Commit

Permalink
Merge bitcoin#20054: Remove confusing and useless "unexpected version…
Browse files Browse the repository at this point in the history
…" warning

0000a0c Remove confusing and almost useless "unexpected version" warning (MarcoFalke)

Pull request description:

  It is useless because it isn't displayed for most users:

  * It isn't displayed in normal operation (because the validation debug category is disabled by default)
  * It isn't displayed for users that sync up their nodes intermittently, e.g. once a day or once a week (because it is disabled for IBD)
  * It is only displayed in the debug log (as opposed to the versionbits warning, which is displayed more prominently)

  It is confusing because it doesn't have a use case:

  Despite the above, if a user *did* see the warning, it would most likely be a false positive (like it has been in the past). Even if it wasn't, there is nothing they can do about it. The only thing they could do is to check for updates and hope that a fixed version is available. But why would the user be so scrupulously precise in enabling the warning and reading the log, but then fail to regularly check update channels for updated software?

ACKs for top commit:
  practicalswift:
    ACK 0000a0c
  decryp2kanon:
    ACK 0000a0c
  LarryRuane:
    ACK 0000a0c

Tree-SHA512: 16e069c84be6ab6034baeefdc515d0e5cdf560b2005d2faec5f989d45494bd16cfcb4ffca6a17211d9556ae44f9737a60a476c08b5c2bb5e1bd29724ecd6d5c1
  • Loading branch information
laanwj authored and vijaydasmp committed Aug 25, 2023
1 parent cf6907f commit 6e0c6ab
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2711,7 +2711,6 @@ void CChainState::UpdateTip(const CBlockIndex* pindexNew)
assert(std::addressof(::ChainstateActive()) == std::addressof(*this));
if (!this->IsInitialBlockDownload())
{
int nUpgraded = 0;
const CBlockIndex* pindex = pindexNew;
for (int bit = 0; bit < VERSIONBITS_NUM_BITS; bit++) {
WarningBitsConditionChecker checker(bit);
Expand All @@ -2725,16 +2724,6 @@ void CChainState::UpdateTip(const CBlockIndex* pindexNew)
}
}
}
// Check the version of the last 100 blocks to see if we need to upgrade:
for (int i = 0; i < 100 && pindex != nullptr; i++)
{
int32_t nExpectedVersion = ComputeBlockVersion(pindex->pprev, m_params.GetConsensus());
if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && (pindex->nVersion & ~nExpectedVersion) != 0)
++nUpgraded;
pindex = pindex->pprev;
}
if (nUpgraded > 0)
AppendWarning(warningMessages, strprintf(_("%d of last 100 blocks have unexpected version").translated, nUpgraded));
}
assert(std::addressof(::ChainstateActive()) == std::addressof(*this));
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo) evodb_cache=%.1fMiB%s\n", __func__,
Expand Down

0 comments on commit 6e0c6ab

Please sign in to comment.