Open bradlarsen opened 4 years ago
Thank you for raising this. I believe panic!
ing is the intended behavior here. In each case, the conditions that lead to the panic!
are indicative of irrecoverable chain state corruption, and the best thing to do would be to abort and (TBD) prompt the user to run a recovery tool.
There are several implementations of the
From<T>
trait forMARFValue
that can fail. Implementations of this trait must not fail. In these cases, theTryFrom<T>
trait should be used instead.https://doc.rust-lang.org/std/convert/trait.From.html https://doc.rust-lang.org/std/convert/trait.TryFrom.html
Locations of
From<T>
implementations that can fail:https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/index/mod.rs#L121-L133
https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/index/mod.rs#L35-L147
https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/index/mod.rs#L149-L163
https://github.com/trailofbits/x-audit-blockstack-core/blob/e2d3d5bae539d242851620e28129af6c4a9de642/src/chainstate/stacks/index/mod.rs#L165-L179