bitcoinfuzz icon indicating copy to clipboard operation
bitcoinfuzz copied to clipboard

Return block hash on `block_deserialization` success

Open moisesPompilio opened this issue 9 months ago • 1 comments

Instead of just returning std::optional<bool>, block_deserialization functions could return the block hash. This would allow us to compare hashes for successful deserialization and extend fuzzing to cover hash validation.

Proposed behavior:

  • Failed blocks return false or 0.
  • Cases that currently return null in std::optional<bool> return an empty string.
  • Successful deserialization returns the block hash

moisesPompilio avatar Mar 14 '25 00:03 moisesPompilio

I think this is a good idea and it's what we were doing on bitcoinfuzz v1 (see https://github.com/brunoerg/bitcoinfuzz/blob/main/btcd_lib/wrapper.go#L21)

brunoerg avatar Mar 14 '25 18:03 brunoerg

I've opened a PR to fix this: #222

bc1cindy avatar Jul 10 '25 21:07 bc1cindy