-
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
Always mark conflicting blocks with BLOCK_CONFLICT_CHAINLOCK flag #3924
Conversation
Co-authored-by: thephez <thephez@users.noreply.github.com>
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.
Can you introduce a regression test for this?
…licting after chainlock
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.
Looks good, just one potential change see below
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
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.
utACK
…shpay#3924) * More accurate handling of the BLOCK_CONFLICT_CHAINLOCK flag * Update test/functional/feature_llmq_chainlocks.py Co-authored-by: thephez <thephez@users.noreply.github.com> * tests: make sure that previous tip on the reorged node is marked conflicting after chainlock * Apply suggestions from code review Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: thephez <thephez@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
There is an inconsistency in the way we handle conflicting blocks atm - we add blocks to the block index as conflicting in
AcceptBlockHeader
but we mark re-orged blocks as invalid inEnforceBestChainLock
. Because of the latter, it works most of the time despite the fact that some logic for conflicting blocks is actually missing. This PR should fix it by always sticking to theBLOCK_CONFLICT_CHAINLOCK
flag for conflicting blocks and implementing all the required logic around it.EDIT: the flag was introduced in #2923 btw