Skip to content

[IF-FINDING-001] Invariant checks through crisis module may go unnoticed#61

Merged
AdriaCarrera merged 6 commits intomainfrom
fix/IF-FINDING-001
Mar 18, 2025
Merged

[IF-FINDING-001] Invariant checks through crisis module may go unnoticed#61
AdriaCarrera merged 6 commits intomainfrom
fix/IF-FINDING-001

Conversation

@AdriaCarrera
Copy link
Contributor

[IF-FINDING-001] Invariant checks through crisis module may go unnoticed

Description

The x/crisis module is not advisable to use (see security advisory) because it does not actually halt the chain when an invariant check fails. While the module allows submitting a MsgVerifyInvariant transaction to confirm an invariant violation, this transaction does not cause nodes to panic. Instead, the SDK’s panic-recovery mechanism treats it as an invalid transaction and allows the chain to continue processing blocks.
Additionally, only nodes running with --inv-check-period X will panic upon detecting an invariant violation in EndBlock, but this is rarely used in production due to the high resource cost of running invariant checks every X blocks and in the case of this project the check period is set to zero meaning that it will not get triggered automatically. As a result, invariant violations may go unnoticed, making the module ineffective in practice.

Problem scenarios

Invariant violations may go unnoticed.

Recommendation

Consider alternative approaches for checking invariants, such as monitoring with alerts. Additionally, carefully evaluate the desired behavior for each invariant violation. Some violations may warrant stopping the chain, while others may only require raising an alert.

Applied changes

Removed all invariants, we will add monitoring system that will trigger alerts in the case some check is not done

@AdriaCarrera AdriaCarrera merged commit 0e99d07 into main Mar 18, 2025
3 checks passed
@AdriaCarrera AdriaCarrera deleted the fix/IF-FINDING-001 branch March 18, 2025 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants