Petite Chocolate Falcon
Medium
Incomplete State Reset in Zero-Height Genesis Export Leading to Potential Inconsistencies and Fund Loss
The prepForZeroHeightGenesis function is missing several critical steps that are necessary for a comprehensive state reset when exporting genesis at zero height. The current function lacks the following essential operations:
-
Proper Reinitialization of Validators and Delegations
-
Handling of Fee Distribution State Properly
The absence of the remaining necessary operations can lead to several issues:
Inconsistent Initial State in Zero-Height Genesis Exports: Validator and delegation states may not be properly reset, resulting in an incorrect starting state.
Carry-Over of Historical Data That Should Be Reset: Delegator rewards and historical rewards may persist incorrectly.
Inconsistent Validator and Delegation States: Delegation resets are incomplete, leading to possible misalignments in validator bonding/unbonding states.
Without addressing these issues, the network restart from a zero-height genesis export could result in unexpected behavior, potential security risks, and a degraded user experience.
- Properly Reinitialize Validators and Delegations
Ensure that validator bonding/unbonding heights are properly reset.
Implement delegation period resets to avoid inconsistencies in validator and delegator states.
- Comprehensive Handling of Fee Distribution State
Transfer unwithdrawn validator rewards to the community pool only after verification.
Ensure that any unaccounted validator commission is properly redistributed.