From 977b54e330182fa709ade90d7efe43b4fd459f5c Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 1 Aug 2024 18:27:49 +0800 Subject: [PATCH] Problem: disable of create vesting account messages are not complete --- CHANGELOG.md | 1 + app/ante/authz_test.go | 20 ++++++++++++++++++++ app/app.go | 2 ++ 3 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f58ff534b..a91cc8a7ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#443](https://github.com/crypto-org-chain/ethermint/pull/443) Keep behavior of random opcode as before. * (app) [#451](https://github.com/crypto-org-chain/ethermint/pull/451) Disable block gas meter, it's not compatible with parallel tx execution. It's safe to do as long as we checks total gas-wanted against block gas limit in process proposal, which we do in default handler. * (ante) [#493](https://github.com/crypto-org-chain/ethermint/pull/493) Align gasWanted for process proposal mode, [#500](https://github.com/crypto-org-chain/ethermint/pull/500) Check for overflow before adding gasLimit to gasWanted. +- (ante) [#506](https://github.com/evmos/ethermint/pull/506) Disable MsgCreatePermanentLockedAccount and MsgCreatePeriodicVestingAccount messages. ### Bug Fixes diff --git a/app/ante/authz_test.go b/app/ante/authz_test.go index d6e52a022d..1d8ef92eac 100644 --- a/app/ante/authz_test.go +++ b/app/ante/authz_test.go @@ -255,6 +255,26 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() { }, expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), }, + { + name: "a MsgGrant with MsgCreatePermanentLockedAccount typeURL on the authorization field is blocked", + msgs: []sdk.Msg{ + newGenericMsgGrant( + testAddresses, + sdk.MsgTypeURL(&sdkvesting.MsgCreatePermanentLockedAccount{}), + ), + }, + expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), + }, + { + name: "a MsgGrant with MsgCreatePeriodicVestingAccount typeURL on the authorization field is blocked", + msgs: []sdk.Msg{ + newGenericMsgGrant( + testAddresses, + sdk.MsgTypeURL(&sdkvesting.MsgCreatePeriodicVestingAccount{}), + ), + }, + expectedCode: sdkerrors.ErrUnauthorized.ABCICode(), + }, { name: "a MsgGrant with MsgEthereumTx typeURL on the authorization field included on EIP712 tx is blocked", msgs: []sdk.Msg{ diff --git a/app/app.go b/app/app.go index aacc1cb2d8..940b0f95b7 100644 --- a/app/app.go +++ b/app/app.go @@ -823,6 +823,8 @@ func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted u DisabledAuthzMsgs: []string{ sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), sdk.MsgTypeURL(&vestingtypes.MsgCreateVestingAccount{}), + sdk.MsgTypeURL(&vestingtypes.MsgCreatePermanentLockedAccount{}), + sdk.MsgTypeURL(&vestingtypes.MsgCreatePeriodicVestingAccount{}), }, PendingTxListener: app.onPendingTx, })