Skip to content

bug: not able to execute a smart contract transaction  #438

@spoo-bar

Description

@spoo-bar

Discussed in https://github.com/orgs/archway-network/discussions/6

The feeburn feature was introduced in v3.0.0 #422
This involves the transaction fees sent with the wasmTypes.MsgExecuteContract will be burnt instead of being sent to stakers. More details here ADR-007-fee-burning

While the authtypes.FeeCollectorName was given burn permissions in app.go, so it would have the necessary permissions when the chain is started fresh from v3.0.0 onwards, the upgrade handler for this release missed providing this permission to the account.

This caused the following error on every contract exec as the burn was not possible.

Error: Broadcasting transaction failed with code 111222 (codespace: undefined). Log: recovered: module account fee_collector does not have permissions to burn tokens: unauthorized [cosmos/cosmos-sdk@v0.45.16/x/bank/keeper/keeper.go:438]
stack:
goroutine 42089775 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:24 +0x65
github.com/cosmos/cosmos-sdk/baseapp.newDefaultRecoveryMiddleware.func1({0x23fee80, 0xc0b258b000})
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/recovery.go:71 +0x27
github.com/cosmos/cosmos-sdk/baseapp.newRecoveryMiddleware.func1({0x23fee80?, 0xc0b258b000?})
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/recovery.go:39 +0x30
github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x23fee80, 0xc0b258b000}, 0xc0b10b3440?)
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/recovery.go:28 +0x37
github.com/cosmos/cosmos-sdk/baseapp.processRecovery({0x23fee80, 0xc0b258b000}, 0x2e9ca10?)
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/recovery.go:33 +0x5e
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx.func1()
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/baseapp.go:632 +0x110
panic({0x23fee80, 0xc0b258b000})
	runtime/panic.go:884 +0x213
github.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle.func1()
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/setup.go:57 +0x1fa
panic({0x23fee80, 0xc0b258b000})
	runtime/panic.go:884 +0x213
github.com/cosmos/cosmos-sdk/x/bank/keeper.BaseKeeper.BurnCoins({{{{0x2e9d040, 0xc001034390}, {0x2e77f10, 0xc002ff2fc0}, {0x2e9f1c0, 0xc0001ac5a0}}, {0x2e9d040, 0xc001034390}, {0x2e9f1c0, 0xc0001ac5a0}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/bank/keeper/keeper.go:438 +0x71a
github.com/archway-network/archway/x/rewards/ante.DeductFeeDecorator.deductFees({{0x0, 0x0}, {0x2e8ee48, 0xc0001f5a70}, {0x7fadfe312330, 0xc00016e2c0}, {0x2e75580, 0xc000e13bc0}, {0x2e91c00, 0xc000a9e1a0}}, ...)
	github.com/archway-network/archway/x/rewards/ante/fee_deduction.go:147 +0x559
github.com/archway-network/archway/x/rewards/ante.DeductFeeDecorator.AnteHandle({{0x0, 0x0}, {0x2e8ee48, 0xc0001f5a70}, {0x7fadfe312330, 0xc00016e2c0}, {0x2e75580, 0xc000e13bc0}, {0x2e91c00, 0xc000a9e1a0}}, ...)
	github.com/archway-network/archway/x/rewards/ante/fee_deduction.go:85 +0x765
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/archway-network/archway/x/tracking/ante.TxGasTrackingDecorator.AnteHandle({{_, _}}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, ...}, ...}, ...)
	github.com/archway-network/archway/x/tracking/ante/tracking.go:23 +0x170
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/archway-network/archway/x/rewards/ante.MinFeeDecorator.AnteHandle({{_, _}, {_, _}}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, ...}, ...}, ...)
	github.com/archway-network/archway/x/rewards/ante/min_cons_fee.go:56 +0x48b
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.ConsumeTxSizeGasDecorator.AnteHandle({{_, _}}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/basic.go:142 +0x646
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.ValidateMemoDecorator.AnteHandle({{_, _}}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/basic.go:66 +0x2ee
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.TxTimeoutHeightDecorator.AnteHandle({}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/basic.go:205 +0x28e
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.ValidateBasicDecorator.AnteHandle({}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/basic.go:34 +0x1ce
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.MempoolFeeDecorator.AnteHandle({}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/fee.go:54 +0x286
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.RejectExtensionOptionsDecorator.AnteHandle({}, {{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/ext.go:35 +0x12e
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dda8, 0xc09c46f170}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/CosmWasm/wasmd/x/wasm/keeper.CountTXDecorator.AnteHandle({{_, _}}, {{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, ...}, ...}, ...)
	github.com/CosmWasm/wasmd@v0.33.0/x/wasm/keeper/ante.go:48 +0x578
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/CosmWasm/wasmd/x/wasm/keeper.LimitSimulationGasDecorator.AnteHandle({_}, {{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/CosmWasm/wasmd@v0.33.0/x/wasm/keeper/ante.go:87 +0x684
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle({}, {{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/x/auth/ante/setup.go:62 +0x66f
github.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1({{0x2e8dd38, 0xc000130020}, {0x2e9ca10, 0xc0b2c047c0}, {{0xb, 0x0}, {0xc09981a5c0, 0xd}, 0x197daa, {0x2d1b6071, ...}, ...}, ...}, ...)
	github.com/cosmos/cosmos-sdk@v0.45.16/types/handler.go:40 +0x158
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx(0xc000b6bc00, 0x0, {0xc0b1352340, 0x186, 0x186})
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/baseapp.go:684 +0x786
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).CheckTx(0xc000b6bc00, {{0xc0b1352340?, 0xc0db5707b8?, 0x6b490e?}, 0xdb5708a8?})
	github.com/cosmos/cosmos-sdk@v0.45.16/baseapp/abci.go:244 +0x135
github.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync(0xc0073e5140, {{0xc0b1352340?, 0xd39920?, 0xc00f1d74e0?}, 0xdb570a18?})
	github.com/tendermint/tendermint@v0.34.27/abci/client/local_client.go:104 +0x118
github.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync(0xc00f1d74e0?, {{0xc0b1352340?, 0xc03c4abbb8?, 0x0?}, 0xdb570ac8?})
	github.com/tendermint/tendermint@v0.34.27/proxy/app_conn.go:126 +0x26
github.com/tendermint/tendermint/mempool/v0.(*CListMempool).CheckTx(0xc007adb080, {0xc0b1352340, 0x186, 0x186}, 0x0?, {0x20?, {0x0?, 0x50003?}})
	github.com/tendermint/tendermint@v0.34.27/mempool/v0/clist_mempool.go:254 +0x30d
github.com/tendermint/tendermint/rpc/core.BroadcastTxSync(0xc0b258a4a0, {0xc0b1352340, 0x186, 0x186})
	github.com/tendermint/tendermint@v0.34.27/rpc/core/mempool.go:36 +0xf6
reflect.Value.call({0x23143a0?, 0x2c4a7b8?, 0x478f96?}, {0x25b89c8, 0x4}, {0xc055d9d770, 0x2, 0x2?})
	reflect/value.go:586 +0xb0b
reflect.Value.Call({0x23143a0?, 0x2c4a7b8?, 0x211?}, {0xc055d9d770?, 0x25b0c40?, 0xc0b09a6cc0?})
	reflect/value.go:370 +0xbc
github.com/tendermint/tendermint/rpc/jsonrpc/server.makeJSONRPCHandler.func1({0x2e8c2e0, 0xc0b2bcbc80}, 0xc0ae0c0d00)
	github.com/tendermint/tendermint@v0.34.27/rpc/jsonrpc/server/http_json_handler.go:108 +0xf08
github.com/tendermint/tendermint/rpc/jsonrpc/server.handleInvalidJSONRPCPaths.func1({0x2e8c2e0?, 0xc0b2bcbc80?}, 0x7fadf5ae95d8?)
	github.com/tendermint/tendermint@v0.34.27/rpc/jsonrpc/server/http_json_handler.go:140 +0x5d
net/http.HandlerFunc.ServeHTTP(0xc000100000?, {0x2e8c2e0?, 0xc0b2bcbc80?}, 0xc0db5718b0?)
	net/http/server.go:2122 +0x2f
net/http.(*ServeMux).ServeHTTP(0x160?, {0x2e8c2e0, 0xc0b2bcbc80}, 0xc0ae0c0d00)
	net/http/server.go:2500 +0x149
github.com/tendermint/tendermint/rpc/jsonrpc/server.maxBytesHandler.ServeHTTP({{0x2e74360?, 0xc00fa825c0?}, 0x435747?}, {0x2e8c2e0?, 0xc0b2bcbc80}, 0xc0ae0c0d00)
	github.com/tendermint/tendermint@v0.34.27/rpc/jsonrpc/server/http_server.go:256 +0x124
github.com/tendermint/tendermint/rpc/jsonrpc/server.RecoverAndLogHandler.func1({0x2e8c940?, 0xc05d122700}, 0xc0ae0c0d00)
	github.com/tendermint/tendermint@v0.34.27/rpc/jsonrpc/server/http_server.go:229 +0x37f
net/http.HandlerFunc.ServeHTTP(0x0?, {0x2e8c940?, 0xc05d122700?}, 0x98de54?)
	net/http/server.go:2122 +0x2f
net/http.serverHandler.ServeHTTP({0x2e792e8?}, {0x2e8c940, 0xc05d122700}, 0xc0ae0c0d00)
	net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc0b0ec1050, {0x2e8dda8, 0xc00f850c60})
	net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
	net/http/server.go:3089 +0x5ed
: panic

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions