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

fix(app.go): disable vesting account creation to prevent contract address bricking #923

Merged
merged 13 commits into from
Aug 11, 2023

Conversation

lumtis
Copy link
Member

@lumtis lumtis commented Aug 8, 2023

Description

Solve the contract address bricking issue.

  • Add all vesting message types to disable messages for authz decorator
  • Create a new vesting decorator to directly block the messages

To test:

Start network

make zetanode
make start-smoketest

Attach to node and try create vesting accout:

docker exec -it zetacore0 /bin/sh

./zetacored tx vesting create-vesting-account zeta1vhuekf9h3ef3k744xt0hha84upr5gy77435gqy 1azeta 1788469479 --from hotkey --chain-id athens_101-1 --fees 10000000000000000azeta --yes

raw_log: 'MsgTypeURL /cosmos.vesting.v1beta1.MsgCreateVestingAccount not supported:
  unauthorized'


./zetacored tx vesting  create-permanent-locked-account zeta1vhuekf9h3ef3k744xt0hha84upr5gy77435gqy 1azeta --from hotkey --chain-id athens_101-1 --fees 10000000000000000azeta --yes

raw_log: 'MsgTypeURL /cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount not supported:
  unauthorized'


echo '{"start_time": 1625204910, "period": [{"coins": "1azeta", "length_seconds": 2592000 }, {"coins": "1azeta", "length_seconds": 2592000 }]}' > periodic.json

./zetacored tx vesting  create-periodic-vesting-account zeta1vhuekf9h3ef3k744xt0hha84upr5gy77435gqy periodic.json --from hotkey --chain-id athens_101-1 --fees 10000000000000000azeta --yes

raw_log: 'MsgTypeURL /cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount not supported:
  unauthorized'


./zetacored query account zeta1vhuekf9h3ef3k744xt0hha84upr5gy77435gqy

rpc error: code = NotFound desc = rpc error: code = NotFound desc = account zeta1vhuekf9h3ef3k744xt0hha84upr5gy77435gqy not found: key not found

Closes: #888

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

@lumtis lumtis self-assigned this Aug 8, 2023
@lumtis lumtis marked this pull request as ready for review August 9, 2023 14:28
@brewmaster012
Copy link
Collaborator

very cool.

@lumtis lumtis merged commit e82e86a into develop Aug 11, 2023
16 checks passed
@lumtis lumtis deleted the fix/disable-vesting branch August 11, 2023 06:55
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.

Prevent blocking contract address with vesting account creation
3 participants