-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 incorrect start height for block request #5875
Fix incorrect start height for block request #5875
Conversation
We added 1 as with the lite monitor mode we persist the most recent block, thus we request with the start height for the next block. But that cause a problem at a DAO full mode which has lite monitor mode set as then the block parsing would not be triggered. We refactor it so that we take the chainHeight from the dao state directly and add 1 at the requests. We add a check if we are at chain tip, and if so we skip requests and call the onParseBlockChainComplete directly.
I tried to re-produce this issue on Regtest, but without success. All my nodes on Regtest are full nodes without monitoring and I didn't recognized the failed behavior before or when following the steps provide above. Is this only reproducible on Mainnet? |
Me too, I could not reproduce the problem in regtest mode. |
Have you tried to restart the app a few times? If still not reproduceable, create a block and then restart 1 or 2 times... |
I think the issue is when the blocks request is faster then the blockhash requests from other nodes. So might be a bit of race conditions...
This is false in case the startBlockHeight is one block higher than the chainHeight. |
Following those steps above I can re-produce the problem 👍 and verify that this PR fixes the problem. |
You mean a DAO lite mode with DAO hash monitoring mode set to lite mode as well? Can you reproduce it or provide more info? |
…leted yet. - At genesis we use the genesis height for request (not height+1) - If wallet is not synced yet we do not call onParseBlockChainComplete (as it was before)
I just tried to re-produce my issue with the current state of the PR and everything is looking fine now. |
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 - Tested on Mainnet
We added 1 as with the lite monitor mode we persist the most recent block,
thus we request with the start height for the next block.
But that cause a problem at a DAO full mode which has lite monitor mode set
as then the block parsing would not be triggered.
We refactor it so that we take the chainHeight from the dao state
directly and add 1 at the requests.
We add a check if we are at chain tip, and if so we skip requests
and call the onParseBlockChainComplete directly.
How to test it?
Use a DAO full node and set lite mode for monitoring in setting.
Create a new block. Restart. Now there is no BSQ and no monitoring data as block parsing did not get triggered.
With the PR this does not happen.