This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bedeho / Joystream | |
I keep asking about how modules should deal with possible panic resulting from broken invariants, sorry to go on about it, but here is another one: | |
I am reading the democracy module, and from what I am seeing, when the staked amount assocaited with a preimage is released, an operation is initiated which may fail, from a static point of view, namely repatraite_reserved. Now obviously, if this reservation logic has been correctly managed, this is not possible during runtime. However, in the codepath, the error case is explicitly ignored by doing let _ = repatraite .... This is sort of a silent way of handling broken invaraints. | |
a) am I understanding this correctly | |
b) is it correct that this approach to dealing with broken invaraints is prevalent in the Substrate/Polkadot code base, even more so than the approach of trying to report errors for broken invariants | |
shawntabrizi |