Empact
commented at 0:53 am on January 16, 2020:
member
This bases the script/standard hash types, TxDestination-related and CScriptID on a base template which does not silently convert the underlying uintN type.
Inspired by and built on #17924. Commits are small and focused to ease review.
Note some of these changes may be relative to existing bugs of the same sort as #17924. See particularly “Convert CPubKey to WitnessV0KeyHash directly” and “Remove an apparently unnecessary conversion”.
DrahtBot
commented at 2:54 am on January 16, 2020:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#19326 (Simplify hash.h interface using Spans by sipa)
#19183 ([WIP DONOTMERGE] Replace boost with C++17 by MarcoFalke)
#19114 (scripted-diff: TxoutType C++11 scoped enum class by MarcoFalke)
#16841 (Replace GetScriptForWitness with GetScriptForDestination by meshcollider)
#15294 ([moveonly] wallet: Extract RipeMd160 by Empact)
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.
DrahtBot added the label
GUI
on Jan 16, 2020
DrahtBot added the label
RPC/REST/ZMQ
on Jan 16, 2020
DrahtBot added the label
Tests
on Jan 16, 2020
DrahtBot added the label
Wallet
on Jan 16, 2020
instagibbs
commented at 5:34 pm on January 16, 2020:
member
concept ACK, will review deeper if base is merged
Empact force-pushed
on Jan 16, 2020
fanquake removed the label
GUI
on Jan 17, 2020
fanquake removed the label
Tests
on Jan 17, 2020
Sjors
commented at 8:57 am on January 17, 2020:
member
laanwj
commented at 2:08 pm on February 5, 2020:
member
Concept ACK, I like the idea of using explicit and separate types here to prevent non-sensible conversions, if you can use language features to avoid bugs that’s very good.
Empact requested review from Sjors
on Feb 6, 2020
Empact requested review from ryanofsky
on Feb 6, 2020
Empact requested review from achow101
on Feb 6, 2020
Empact requested review from instagibbs
on Feb 6, 2020
practicalswift
commented at 6:46 am on February 11, 2020:
contributor
Concept ACK: explicit conversion is better (and safer!) than implicit conversion
DrahtBot added the label
Needs rebase
on Feb 25, 2020
Empact force-pushed
on Feb 28, 2020
DrahtBot removed the label
Needs rebase
on Feb 28, 2020
Empact
commented at 2:04 am on February 28, 2020:
member
Rebased, dropped one commit, as #17577 removed the relevant verifymessage conversion.
DrahtBot added the label
Needs rebase
on Mar 9, 2020
Empact force-pushed
on Mar 10, 2020
Empact
commented at 11:56 am on March 10, 2020:
member
I’m not sure what’s up with Appveyor, and I’m happy to squash.
MarcoFalke
commented at 11:47 am on June 19, 2020:
member
I think it makes sense to squash fixup commits that fix a compile-failure. Otherwise it is not possible to compile earlier commits.
Prefer explicit uint160 conversion0a5ea32ce6
Prefer explicit CScriptID construction3fcc468123
Convert CPubKey to WitnessV0KeyHash directly
The round-tripping through PKHash has no effect, and is
potentially misleading as such.
a9e451f144
Use explicit conversion from PKHash -> CKeyID
These types are equivalent, in data etc, so they need only their
data cast across.
Note a function is used rather than a casting
operator as CKeyID is defined at a lower level than script/standard
2c54217f91
Use explicit conversion from WitnessV0KeyHash -> CKeyID
These types are equivalent, in data etc, so they need only their
data cast across.
f32c1e07fd
Explicitly support conversion between equivalent hash types
CScript -> CScriptID -> ScriptHash is unnecessary because
ScriptHash and CScriptID do the same thing.
fa9ef2cdbe
Disallow automatic conversion between hash types
A templated BaseHash does not allow for automatic conversion, thus
conversions much be explicitly allowed / whitelisted, which will
reduce the risk of unintended conversions.
4d7369125a
Empact force-pushed
on Jun 19, 2020
Empact
commented at 8:04 pm on June 19, 2020:
member
Squashed the fix and rebased.
achow101
commented at 10:24 pm on June 19, 2020:
member
ACK4d7369125a82214ea42b808a32b71b315a5c3c72
Only change since last is to handle a newly introduced conversion. That’s also a good example of the benefits that this PR brings.
meshcollider
commented at 8:03 am on June 21, 2020:
contributor
re-utACK4d7369125a82214ea42b808a32b71b315a5c3c72
meshcollider merged this
on Jun 21, 2020
meshcollider closed this
on Jun 21, 2020
Empact deleted the branch
on Jun 21, 2020
Fabcien referenced this in commit
79bd38319d
on Feb 3, 2021
MarcoFalke removed the label
Waiting for author
on Apr 4, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2024-11-17 06:12 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me