launch-code
launch-code copied to clipboard
Couple suggestion for production version (hashes and validating hashes from other code)
I have a couple suggestions for a production version of this lint that I should write down somewhere (if here is not OK, sorry):
- Support requiring a block to have a certain hash, rather than a digital signature. The idea is to mark the code as "do not edit" at least without deliberate thought.
- Support requiring other blocks to have a certain hash. So if you change some code, other code that depends on it could be made to fail.
An example of this: one of my library had a recent bug https://github.com/apoelstra/rust-bitcoin/pull/7 which was caused by me changing a type CommandString([u8;12]) to CommandString(String), while still using an unsafe block to copy 12 bytes out of the object (which for a String, might not all be allocated!). Since the unsafe block was intimately tied to the type of CommandString, it'd be great if I could've marked that unsafe block as failing ifever CommandString changed its type.
cc @gmaxwell