Problem
The get_data_from_inherent_data function in the cnight-observation pallet uses .expect() on the SCALE decode result. If inherent data is malformed — due to serialization bugs, version mismatches, or data corruption — every validator panics simultaneously, permanently halting the chain with no automatic recovery.
The function is called from three consensus-critical entry points: create_inherent, check_inherent, and is_inherent_required.
Expected behavior
Decode failures should be handled gracefully via typed errors, not panics. The sibling federated-authority-observation pallet already follows this pattern.
Fix
PR #1234 replaces .expect() with Result<Option<T>, InherentError> using a new DecodeFailed variant, and propagates the error appropriately in each caller.
JIRA: https://shielded.atlassian.net/browse/PM-21799
Problem
The
get_data_from_inherent_datafunction in thecnight-observationpallet uses.expect()on the SCALE decode result. If inherent data is malformed — due to serialization bugs, version mismatches, or data corruption — every validator panics simultaneously, permanently halting the chain with no automatic recovery.The function is called from three consensus-critical entry points:
create_inherent,check_inherent, andis_inherent_required.Expected behavior
Decode failures should be handled gracefully via typed errors, not panics. The sibling
federated-authority-observationpallet already follows this pattern.Fix
PR #1234 replaces
.expect()withResult<Option<T>, InherentError>using a newDecodeFailedvariant, and propagates the error appropriately in each caller.JIRA: https://shielded.atlassian.net/browse/PM-21799