Skip to content

[IF-FINDING-005] Messages MsgDelegate and MsgCancelUnbondingDelegation should be disabled#63

Merged
AdriaCarrera merged 9 commits intomainfrom
fix/IF-FINDING-005
Mar 18, 2025
Merged

[IF-FINDING-005] Messages MsgDelegate and MsgCancelUnbondingDelegation should be disabled#63
AdriaCarrera merged 9 commits intomainfrom
fix/IF-FINDING-005

Conversation

@AdriaCarrera
Copy link
Contributor

[IF-FINDING-005] Messages MsgDelegate and MsgCancelUnbondingDelegation should be disabled

Description

Since BondDenom tokens can only be minted and burned during validator creation (these tokens are immediately staked and bonded) and removal by an authority and both undelegate and redelegate messages are disabled, there are no free tokens available for delegation, nor any possibility of canceling unbonding delegation. This means the messages MsgDelegate and MsgCancelUnbondingDelegation are unnecessary and can be removed, simplifying the codebase.

Problem scenarios

No problem scenarios, just code clarity.

Recommendation

Explicitly disable MsgDelegate and MsgCancelUnbondingDelegation messages. If delegations are completely disabled, there is no need for BeforeDelegationHook implementation.
In order for authz-ed MsgDelegate and MsgCancelUnbondingDelegation messages to be disabled - add the messages among AuthzDisabledMsgTypes (code ref) in HandlerOptions.

Applied changes

Added MsgDelegate and MsgCancelUnbondingDelegation in ante handler and authz disabled msgs

@AdriaCarrera AdriaCarrera merged commit 8f8b315 into main Mar 18, 2025
3 checks passed
@AdriaCarrera AdriaCarrera deleted the fix/IF-FINDING-005 branch March 18, 2025 12:34
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