Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add msg filter antehandler for gov min deposit ratio #159

Merged
merged 3 commits into from
Jun 19, 2023

Conversation

crypin
Copy link
Member

@crypin crypin commented Jun 16, 2023

Description

Add MsgFilterDecorator on antehandler

  • filtering double nested authz exec msg
  • filtering insufficient deposit amount for gov submit proposal (It should be over 50% of params.DepositRatio)
  • filtering deprecated msgs ( e.g. claim )

TODO on next PR

  • add other deprecated msg types
  • prevent authz nested midblock, batch msgs
  • prevent multi msgs midblock, batch msgs with normal msg

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Appropriate labels applied
  • Targeted PR against correct branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@crypin crypin force-pushed the 159-gov-min-deposit-ratio-ante branch from 6c7221c to b9b4ebd Compare June 16, 2023 06:50
@crypin crypin self-assigned this Jun 16, 2023
@crypin crypin marked this pull request as ready for review June 16, 2023 07:08
app/ante_handler.go Outdated Show resolved Hide resolved
app/anteplus/msg_ante.go Outdated Show resolved Hide resolved
@crypin
Copy link
Member Author

crypin commented Jun 19, 2023

Here is a integration test script and result on a localnet

crescentd testnet --v 1 output-dir ./ --keyring-backend test
cd mytestnet/node0

crescentd tx gov submit-proposal \
  --deposit 1stake,1testtoken \
  --title "test" \
  --description "test" \
  --type text \
  --from node0 \
  --chain-id chain-9KSoCs \
  --keyring-backend test \
  --home ./crescentd \
  -b block

# raw_log: 'insufficient initial deposit amount - required: 5000000stake: insufficient


crescentd tx claim claim 1 swap \
  --from node0 \
  --chain-id chain-9KSoCs \
  --keyring-backend test \
  --home ./crescentd \
  -b block

# raw_log: /crescent.claim.v1beta1.MsgClaim is deprecated msg type

Copy link
Contributor

@kingcre kingcre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kingcre kingcre merged commit 40d4eaf into main Jun 19, 2023
@kingcre kingcre deleted the 159-gov-min-deposit-ratio-ante branch August 1, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants