-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Remove CCoinsViewCache::GetValueIn(...) #18859
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
|
Please don't remove the tests and benchmarks. Just because some imaginary input causes an integer overflow in a helper function doesn't mean all tests using it should be removed. You can inline the function where it is used of move it to the test library in |
Leaving this one as up for grabs. |
|
@MarcoFalke What is the point of keeping a function around that is not used outside of tests? |
|
The function calls AccessCoin, which is used to benchmark coin access in the coins_caching benchmark. See also the docstring If the call to AccessCoin is removed, the you might as well remove the whole benchmark |
|
@MarcoFalke Just so that I understand: would you be fine with anyone using |
|
Oh, wait the benchmark does the coins access via |
|
ACK b56607a |
|
Code review ACK b56607a. The removed |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
hebasto
left a comment
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 b56607a, I have not tested the code, but I have reviewed it and it looks OK, I agree it can be merged.
|
ACK b56607a |
|
@practicalswift Sorry again that I misread the diff. Looks good to merge now, and thanks for removing the code. |
Summary:
> Fixes #18858.
>
> It seems like `GetValueIn` was added in PR748 ("Pay-to-script-hash (OP_EVAL replacement)", merged in 2012) and the last use in validation code was removed in [[bitcoin/bitcoin#8498 | PR8498]] ("Near-Bugfix: Optimization: Minimize the number of times it is checked that no money...", merged in 2017).
This is a backport of Core [[bitcoin/bitcoin#18859 | PR18859]]
Test Plan: nja all check-all`
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9071
Remove
CCoinsViewCache::GetValueIn(...).Fixes #18858.
It seems like
GetValueInwas added in #748 ("Pay-to-script-hash (OP_EVAL replacement)", merged in 2012) and the last use in validation code was removed in #8498 ("Near-Bugfix: Optimization: Minimize the number of times it is checked that no money...", merged in 2017).CCoinsViewCache::GetValueIn(…)performs money summation like this:Note that no check is done to make sure that the resulting
nResultis such that it stays within the money bounds (MoneyRange(nResult)), or that the summation does not trigger a signed integer overflow.Proof of concept output:
Proof of concept code: