No description provided.
fuzz: Remove unused `DeserializeFromFuzzingInput` params overload #35679
pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:260707-fuzz-unused changing 1 files +0 −11-
hebasto commented at 3:56 PM on July 7, 2026: member
-
fuzz: Remove unused `DeserializeFromFuzzingInput` params overload 8c0c5a0e23
- DrahtBot added the label Fuzzing on Jul 7, 2026
-
DrahtBot commented at 3:56 PM on July 7, 2026: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35679.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline and AI policy for information on the review process.
Type Reviewers ACK pablomartin4btc, l0rinc, brunoerg If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
-
pablomartin4btc commented at 6:10 PM on July 7, 2026: member
ACK 8c0c5a0e23314d5918447e43a80c12f7f0720392
It was originally added in https://github.com/bitcoin/bitcoin/commit/fac81affb527132945773a5315bd27fec61ec52f but I couldn't find it ever being called.
- l0rinc approved
-
l0rinc commented at 6:11 PM on July 7, 2026: contributor
ACK 8c0c5a0e23314d5918447e43a80c12f7f0720392
It seems only the two-param
DeserializeFromFuzzingInputoverload is ever used. -
maflcko commented at 6:28 PM on July 7, 2026: member
Hmm, looks like this is unused since I added it in commit fac81affb52?
In any case, removing makes sense, because ser-params should just be embedded into the object itself, not passed as a separate param.
This works here, because only
Serializeis called and that doesn't need to construct a new object. If you want, you can removeSerializewith separate ser-param param completely:diff --git a/src/test/fuzz/deserialize.cpp b/src/test/fuzz/deserialize.cpp index 8e8ab53e38..152b0156d6 100644 --- a/src/test/fuzz/deserialize.cpp +++ b/src/test/fuzz/deserialize.cpp @@ -59,10 +59,2 @@ struct invalid_fuzzing_input_exception : public std::exception { -template <typename T, typename P> -DataStream Serialize(const T& obj, const P& params) -{ - DataStream ds{}; - ds << params(obj); - return ds; -} - template <typename T, typename P> @@ -129,3 +121,3 @@ void AssertEqualAfterSerializeDeserialize(const T& obj, const P& params) { - assert(Deserialize<T>(Serialize(obj, params), params) == obj); + assert(Deserialize<T>(Serialize(params(obj)), params) == obj); } - brunoerg approved
-
brunoerg commented at 1:26 PM on July 8, 2026: contributor
code review ACK 8c0c5a0e23314d5918447e43a80c12f7f0720392