Remove unused float serialization #21981
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2105-NoSerFloat changing 6 files +15 −69-
MarcoFalke commented at 11:10 am on May 17, 2021: member
-
Remove unused float serialization fa57a8fed1
-
laanwj added the label Utils/log/libs on May 17, 2021
-
laanwj commented at 11:23 am on May 17, 2021: member
Good catch!
Code review ACK fa57a8fed196c5e89659265e1b39efb0e2bec9d0
-
practicalswift commented at 1:59 pm on May 17, 2021: contributor
Nice!
cr ACK fa57a8fed196c5e89659265e1b39efb0e2bec9d0
-
sipa commented at 3:29 pm on May 17, 2021: memberConcept ACK, certainly no need to keep this longer if it’s unused.
-
DrahtBot commented at 3:37 pm on May 17, 2021: 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:
- #21966 (Remove double serialization; use software encoder for fee estimation by sipa)
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.
-
in src/serialize.h:242 in fa57a8fed1
238@@ -252,7 +239,7 @@ template<typename Stream> inline void Unserialize(Stream& s, int32_t& a ) { a = 239 template<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); } 240 template<typename Stream> inline void Unserialize(Stream& s, int64_t& a ) { a = ser_readdata64(s); } 241 template<typename Stream> inline void Unserialize(Stream& s, uint64_t& a) { a = ser_readdata64(s); } 242-template<typename Stream> inline void Unserialize(Stream& s, float& a ) { a = ser_uint32_to_float(ser_readdata32(s)); } 243+template<typename Stream> inline void Unserialize(Stream& s, float& a ) { static_assert(ALWAYS_FALSE<Stream>, "Not implemented"); }
MarcoFalke commented at 3:37 pm on May 17, 2021:Looks like the current templates are set up such that this fails compilation even if removed completely. Though, I am worried that in the future it will silently fall back fromfloat
->double
, so I’ve added thestatic_assert(false)
to ensure this is never compiled.
laanwj commented at 6:04 pm on May 17, 2021:I kind of hope we can remove the double case as well some time soon. But I think this is fine for now.
sipa commented at 6:06 pm on May 17, 2021:I’m fine with doing this or not. Even if it’s accidentally invoked, at worst it’ll result in serialization as a double, which is just 4 bytes bigger, but no loss compared to (highly hypothetical) expected float serialization.
MarcoFalke commented at 5:30 am on May 18, 2021:Should be easy to remove it in a follow-up. E.g #21966 (comment)laanwj referenced this in commit 707ba8692b on May 26, 2021DrahtBot added the label Needs rebase on May 26, 2021DrahtBot commented at 9:55 am on May 26, 2021: member🐙 This pull request conflicts with the target branch and needs rebase.
Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a “draft”.
laanwj closed this on May 27, 2021
sidhujag referenced this in commit efa10235fa on May 27, 2021fanquake removed the label Needs rebase on May 31, 2021MarcoFalke deleted the branch on May 31, 2021DrahtBot locked this on Aug 18, 2022
github-metadata-mirror
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-12-28 09:12 UTC
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-12-28 09:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me