Always mark conflicting blocks with BLOCK_CONFLICT_CHAINLOCK flag#3924
Merged
Conversation
This was referenced Jan 11, 2021
UdjinM6
marked this pull request as ready for review
January 11, 2021 11:42
thephez
reviewed
Jan 11, 2021
Co-authored-by: thephez <thephez@users.noreply.github.com>
PastaPastaPasta
requested changes
Jan 14, 2021
PastaPastaPasta
left a comment
Member
There was a problem hiding this comment.
Can you introduce a regression test for this?
…licting after chainlock
xdustinface
requested changes
Jan 15, 2021
xdustinface
left a comment
There was a problem hiding this comment.
Looks good, just one potential change see below
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
gades
pushed a commit
to cosanta/cosanta-core
that referenced
this pull request
Mar 13, 2022
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is an inconsistency in the way we handle conflicting blocks atm - we add blocks to the block index as conflicting in
AcceptBlockHeaderbut 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_CHAINLOCKflag for conflicting blocks and implementing all the required logic around it.EDIT: the flag was introduced in #2923 btw