-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: merge bitcoin#19521, #22047, #21796, #21767, #24133, #24921, #27988, partial #24117, #24138, #27405 (assumeutxo: part 5) #5501
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
Conversation
This pull request has conflicts, please rebase. |
This pull request has conflicts, please rebase. |
This pull request has conflicts, please rebase. |
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.
LGTM, 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.
Seems fine, one question
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.
3 changes:
-
this: knst@1c71b08
-
this refactoring (optional, can be done as an extra PR): knst@0bfefaf
-
and document
block_subsidy
in feature_coinstatsindex.py
A test failure occured because changes brought on by Remnants of earlier behaviour were still left over in |
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 (still waiting CI)
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 for merging via merge commit
Dash uses the height and difficulty of the previous block to calculate the subsidy for the current block... which in the case of the genesis block is block -1, which doesn't exist. Attempting in reading `pprev` which is will evaluate to a `nullptr`, so for any blocks <=0, we fetch the subsidy expected from block 0 from CChainParams.
It's highly unlikely the test will ever deal with chains with >4500 blocks, so only the subset of the subsidy logic that is needed to validate `gettxoutsetinfo` output has been included
…statsindex excludes: - 691d45f (portions)
…nd FastRandomContext::rand_uniform_delay
…asure durations includes: - fa1d804
abca5ef
to
cc9dcdd
Compare
#5524) ## Issue being fixed or feature implemented Unlike bitcoin we are using PREVIOUS block in `GetBlockSubsidy()`. That creates special case for genesis block, because it doesn't have previous block. In this special case instead of calling `GetBlockSubsidy` should be used pre-calculated value. To avoid confusion for new code and simplify implementation, there's introduced a new method `GetBlockSubsidyPrev` that has other interface: it takes pointer `CBlockIndex* prev` in agruments instead pair of height + nbits. These changes are follow-up for #5501 ## What was done? Implemented new method `GetBlockSubsidyPrev()` and used instead of `GetBlockSubsidy` when it is more convenient. ## How Has This Been Tested? Run unit/functional tests. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone --------- Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Additional information