From b09eb9244053a51f0ad43893cb203c807dadee31 Mon Sep 17 00:00:00 2001 From: redshiftzero Date: Thu, 21 Sep 2023 15:15:53 -0400 Subject: [PATCH] governance: do not allow UndelegateClaim inside DaoSpend --- crates/core/app/src/action_handler/actions/submit.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/core/app/src/action_handler/actions/submit.rs b/crates/core/app/src/action_handler/actions/submit.rs index ffec362be4..c0347c9ca3 100644 --- a/crates/core/app/src/action_handler/actions/submit.rs +++ b/crates/core/app/src/action_handler/actions/submit.rs @@ -84,21 +84,24 @@ impl ActionHandler for ProposalSubmit { for action in &parsed_transaction_plan.actions { match action { - Spend(_) | Output(_) | Swap(_) | SwapClaim(_) | DelegatorVote(_) => { + Spend(_) | Output(_) | Swap(_) | SwapClaim(_) | DelegatorVote(_) | UndelegateClaim(_) => { // These actions all require proving, so they are banned from DAO spend // proposals to prevent DoS attacks. anyhow::bail!( "invalid action in DAO spend proposal (would require proving)" ) } + Delegate(_) | Undelegate(_) => { + // Delegation and undelegation is disallowed due to Undelegateclaim requiring proving. + anyhow::bail!( + "invalid action in DAO spend proposal (can't claim outputs of undelegation)" + ) + } ProposalSubmit(_) | ProposalWithdraw(_) | ProposalDepositClaim(_) => { // These actions manipulate proposals, so they are banned from DAO spend // actions because they could cause recursion. anyhow::bail!("invalid action in DAO spend proposal (not allowed to manipulate proposals from within proposals)") } - Delegate(_) - | Undelegate(_) - | UndelegateClaim(_) | ValidatorDefinition(_) | IbcAction(_) | ValidatorVote(_)