Skip to content

Commit

Permalink
Problem: disable of create vesting account messages are not complete
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Aug 1, 2024
1 parent 3509552 commit 977b54e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 20 additions & 0 deletions app/ante/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 2 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 977b54e

Please sign in to comment.