Incomplete Zero-Height Genesis Preparation in Allora Network
Summary
The current implementation of prepForZeroHeightGenesis in the Allora network lacks several key operations present in the reference implementation, potentially leading to inconsistent or incomplete state resets when exporting genesis at zero height.
Vulnerability Detail
The prepForZeroHeightGenesis function in the Allora network's AlloraApp is missing several crucial steps compared to a more comprehensive implementation. The current implementation omits:
Withdrawal of validator commissions and delegator rewards
Clearing of validator slash events and historical rewards
Reinitialization of validators and delegations
Resetting of validator signing info start heights
Handling of fee distribution state
Impact
These omissions could result in:
Inconsistent initial state when exporting genesis at zero height
Potential loss of accrued rewards and commissions
Carry-over of historical data that should be reset
Inconsistent validator and delegation states in the new genesis
The absence of these operations may lead to unexpected behavior or state inconsistencies when the network is restarted from a zero-height genesis export.
defsec
Medium
Incomplete Zero-Height Genesis Preparation in Allora Network
Summary
The current implementation of prepForZeroHeightGenesis in the Allora network lacks several key operations present in the reference implementation, potentially leading to inconsistent or incomplete state resets when exporting genesis at zero height.
Vulnerability Detail
The
prepForZeroHeightGenesis
function in the Allora network'sAlloraApp
is missing several crucial steps compared to a more comprehensive implementation. The current implementation omits:Impact
These omissions could result in:
The absence of these operations may lead to unexpected behavior or state inconsistencies when the network is restarted from a zero-height genesis export.
Example Juno Export : https://github.com/CosmosContracts/juno/blob/main/app/export.go#L19
Code Snippet
export.go#L55
Tool used
Manual Review
Recommendation
Update the prepForZeroHeightGenesis function to include: