-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: possible assert call if nHeight in CDeterministicMNList is higher then Tip #5590
fix: possible assert call if nHeight in CDeterministicMNList is higher then Tip #5590
Conversation
UPD: done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I vote for 04fc666.
Feels more right to me.
What if we adjust the calling locations to ensure they're not null there? |
It can be wrong chain (wrong fork) anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
I think concept NACK, but not positive; This function is called from these locations, the problematic call is the qt/masternodelist.cpp location;
I believe that this issue is only possible when the |
…igher than Tip Example of new log: ``` 2023-09-28T17:35:50Z GetProjectedMNPayeesAtChainTip WARNING pindex is nullptr due to height=914160 chain height=914159 ``` instead assert call: ``` ... dashpay#6 0x00007ffff7a33b86 in __assert_fail (assertion=0x55555783afd2 "pindex", file=0x5555577f2ed8 "llmq/utils.cpp", line=730, function=0x5555577f2448 "bool llmq::utils::IsMNRewardReallocationActive(const CBlockIndex*)") at ./assert/assert.c:101 dashpay#7 0x0000555555ab7daf in llmq::utils::IsMNRewardReallocationActive (pindex=<optimized out>) at llmq/utils.cpp:730 dashpay#8 0x00005555559458ad in CDeterministicMNList::GetProjectedMNPayees (this=this@entry=0x7fffffffc690, pindex=0x0, nCount=<optimized out>, nCount@entry=2147483647) at evo/deterministicmns.cpp:231 dashpay#9 0x000055555594614f in CDeterministicMNList::GetProjectedMNPayeesAtChainTip (this=this@entry=0x7fffffffc690, nCount=nCount@entry=2147483647) at evo/deterministicmns.cpp:216 dashpay#10 0x00005555558c9f51 in MasternodeList::updateDIP3List (this=this@entry=0x55555908cfd0) at qt/masternodelist.cpp:194 dashpay#11 0x00005555558ca9a0 in MasternodeList::updateDIP3ListScheduled (this=0x55555908cfd0) at qt/masternodelist.cpp:157 dashpay#12 0x000055555684a60f in void doActivate<false>(QObject*, int, void**) () dashpay#13 0x00005555568525b1 in QTimer::timerEvent(QTimerEvent*) () dashpay#14 0x0000555556844ce5 in QObject::event(QEvent*) () dashpay#15 0x0000555556ac3252 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () dashpay#16 0x000055555681e6b8 in QCoreApplication::sendEvent(QObject*, QEvent*) () dashpay#17 0x000055555686de2a in QTimerInfoList::activateTimers() () dashpay#18 0x000055555686be84 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#19 0x00005555569bf8a2 in QXcbUnixEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#20 0x000055555681caf6 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#21 0x0000555556825f8a in QCoreApplication::exec() () ... ```
…ount, should reserve memory accordingly
04fc666
to
e258c36
Compare
The problematic call is indeed qt/masternodelist.cpp location because latest commits fix all usages of |
fails to compile for me
d109650 helps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it looks good 👍 (reindexed and invalidated/reconsidered ~100 blocks from the tip).
ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK for squash merge
…igher than Tip - cummulative from dashpay#5590 Example of new log: ``` 2023-09-28T17:35:50Z GetProjectedMNPayeesAtChainTip WARNING pindex is nullptr due to height=914160 chain height=914159 ``` instead assert call: ``` ... dashpay#6 0x00007ffff7a33b86 in __assert_fail (assertion=0x55555783afd2 "pindex", file=0x5555577f2ed8 "llmq/utils.cpp", line=730, function=0x5555577f2448 "bool llmq::utils::IsMNRewardReallocationActive(const CBlockIndex*)") at ./assert/assert.c:101 dashpay#7 0x0000555555ab7daf in llmq::utils::IsMNRewardReallocationActive (pindex=<optimized out>) at llmq/utils.cpp:730 dashpay#8 0x00005555559458ad in CDeterministicMNList::GetProjectedMNPayees (this=this@entry=0x7fffffffc690, pindex=0x0, nCount=<optimized out>, nCount@entry=2147483647) at evo/deterministicmns.cpp:231 dashpay#9 0x000055555594614f in CDeterministicMNList::GetProjectedMNPayeesAtChainTip (this=this@entry=0x7fffffffc690, nCount=nCount@entry=2147483647) at evo/deterministicmns.cpp:216 dashpay#10 0x00005555558c9f51 in MasternodeList::updateDIP3List (this=this@entry=0x55555908cfd0) at qt/masternodelist.cpp:194 dashpay#11 0x00005555558ca9a0 in MasternodeList::updateDIP3ListScheduled (this=0x55555908cfd0) at qt/masternodelist.cpp:157 dashpay#12 0x000055555684a60f in void doActivate<false>(QObject*, int, void**) () dashpay#13 0x00005555568525b1 in QTimer::timerEvent(QTimerEvent*) () dashpay#14 0x0000555556844ce5 in QObject::event(QEvent*) () dashpay#15 0x0000555556ac3252 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () dashpay#16 0x000055555681e6b8 in QCoreApplication::sendEvent(QObject*, QEvent*) () dashpay#17 0x000055555686de2a in QTimerInfoList::activateTimers() () dashpay#18 0x000055555686be84 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#19 0x00005555569bf8a2 in QXcbUnixEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#20 0x000055555681caf6 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () dashpay#21 0x0000555556825f8a in QCoreApplication::exec() () ... ``` fix: use g_chainman.m_blockman.LookupBlockIndex for any known block (even wrong tip) fix: handle GetProjectedMNPayees's failures in `MasternodeList::updateDIP3List()` fix: resulting vector in GetProjectedMNPayees grows to the weighted count, should reserve memory accordingly fix: avoid useless loop in GetProjectedMNPayees after mn_rr activation fix: pass proper CBlockIndex from ClientModel fix statusItem
Issue being fixed or feature implemented
Example of new log:
instead assert call:
What was done?
ClientModel returns now a pair: MNList and CBlockIndex; so, we always know the which one has been used even if current chain is switched.
How Has This Been Tested?
Run on my localhost from
c034ff0c2606142ba3e8894bc74f693b87374e5c
- aborted with backtrace like above.With both of commit - no assert more.
Breaking Changes
N/A
Checklist: