diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index e9f5d27328..c32bf4476d 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -645,7 +645,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re ctx := app.getContextForTx(mode, txBytes) ms := ctx.MultiStore() - gInfo.MinGasPrices = ctx.MinGasPrices().String() + gInfo.MinGasPrice = app.minGasPrices.String() // only run the tx if there is block gas remaining if mode == runTxModeDeliver && ctx.BlockGasMeter().IsOutOfGas() { @@ -658,12 +658,12 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re err, result = processRecovery(r, recoveryMW), nil } - gInfo = sdk.GasInfo{GasWanted: gasWanted, GasUsed: ctx.GasMeter().GasConsumed(), MinGasPrices: app.minGasPrices.String()} + gInfo = sdk.GasInfo{GasWanted: gasWanted, GasUsed: ctx.GasMeter().GasConsumed(), MinGasPrice: gInfo.MinGasPrice} }() blockGasConsumed := false // consumeBlockGas makes sure block gas is consumed at most once. It must happen after - // tx processing, and must be execute even if tx processing fails. Hence we use trick with `defer` + // tx processing, and must be executed even if tx processing fails. Hence we use trick with `defer` consumeBlockGas := func() { if !blockGasConsumed { blockGasConsumed = true diff --git a/client/tx/tx.go b/client/tx/tx.go index de3db2ad4c..8d7dd4cb45 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -77,22 +77,17 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { txf = txf.WithGas(adjusted) _, _ = fmt.Fprintf(os.Stderr, "%s\n", GasEstimateResponse{GasEstimate: txf.Gas()}) - parsedGasPrices, err := sdk.ParseCoinsNormalized(gInfo.GasInfo.MinGasPrices) + parsedGasPrice, err := sdk.ParseCoinNormalized(gInfo.GasInfo.MinGasPrice) if err != nil { return err } - if parsedGasPrices == nil { - return fmt.Errorf("empty gas prices") - } - // we only accept one type coin - gasPrice := parsedGasPrices[0] - fees := make(sdk.Coins, 1) - gasLimit := sdk.NewInt(int64(adjusted)) - fee := gasPrice.Amount.Mul(gasLimit) - fees[0] = sdk.NewCoin(gasPrice.Denom, fee) + if !parsedGasPrice.IsNil() && !parsedGasPrice.IsZero() { + fees := make(sdk.Coins, 1) + fees[0] = sdk.NewCoin(parsedGasPrice.Denom, parsedGasPrice.Amount.Mul(sdk.NewInt(int64(adjusted)))) - txf = txf.WithFees(fees.String()) + txf = txf.WithFees(fees.String()) + } } if clientCtx.Simulate { diff --git a/proto/cosmos/base/abci/v1beta1/abci.proto b/proto/cosmos/base/abci/v1beta1/abci.proto index d575b064fe..a19decf3f3 100644 --- a/proto/cosmos/base/abci/v1beta1/abci.proto +++ b/proto/cosmos/base/abci/v1beta1/abci.proto @@ -84,8 +84,8 @@ message GasInfo { // GasUsed is the amount of gas actually consumed. uint64 gas_used = 2; - // MinGasPrices are the min gas prices. - string min_gas_prices = 3; + // MinGasPrice are the min gas price. + string min_gas_price = 3; } // Result is the union of ResponseFormat and ResponseCheckTx. diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 4dd9b53540..5b6016f015 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -50,7 +50,7 @@ message GetTxsEventRequest { // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; - ; + OrderBy order_by = 3; // page is the page number to query, starts at 1. If not provided, will default to first page. uint64 page = 4; @@ -170,4 +170,4 @@ message GetBlockWithTxsResponse { .tendermint.types.Block block = 3; // pagination defines a pagination for the response. cosmos.base.query.v1beta1.PageResponse pagination = 4; -} \ No newline at end of file +} diff --git a/types/abci.pb.go b/types/abci.pb.go index a079678d37..c83b5dd5f4 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -272,8 +272,8 @@ type GasInfo struct { GasWanted uint64 `protobuf:"varint,1,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"` // GasUsed is the amount of gas actually consumed. GasUsed uint64 `protobuf:"varint,2,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"` - // MinGasPrices are the min gas prices. - MinGasPrices string `protobuf:"bytes,3,opt,name=min_gas_prices,json=minGasPrices,proto3" json:"min_gas_prices,omitempty"` + // MinGasPrice are the min gas price. + MinGasPrice string `protobuf:"bytes,3,opt,name=min_gas_price,json=minGasPrice,proto3" json:"min_gas_price,omitempty"` } func (m *GasInfo) Reset() { *m = GasInfo{} } @@ -322,9 +322,9 @@ func (m *GasInfo) GetGasUsed() uint64 { return 0 } -func (m *GasInfo) GetMinGasPrices() string { +func (m *GasInfo) GetMinGasPrice() string { if m != nil { - return m.MinGasPrices + return m.MinGasPrice } return "" } @@ -646,66 +646,66 @@ func init() { } var fileDescriptor_4e37629bc7eb0df8 = []byte{ - // 932 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xda, 0xdb, 0x75, 0x3c, 0x76, 0x5a, 0x34, 0x8a, 0xd2, 0x49, 0x01, 0xdb, 0xb8, 0x45, - 0xb2, 0x90, 0x58, 0xab, 0x69, 0x85, 0x68, 0x4f, 0xad, 0x0b, 0x94, 0x48, 0x2d, 0x42, 0x1b, 0x57, - 0x48, 0x5c, 0xac, 0xb1, 0x3d, 0x1d, 0xaf, 0xea, 0xdd, 0xb1, 0x76, 0x66, 0x93, 0xcd, 0x8d, 0x1b, - 0x1c, 0x39, 0x71, 0xe6, 0x0a, 0x7f, 0x49, 0x0f, 0x1c, 0x72, 0xec, 0xa1, 0x0a, 0x90, 0xdc, 0xf8, - 0x2b, 0xd0, 0x7b, 0x33, 0xfe, 0x51, 0x82, 0xab, 0x9e, 0xfc, 0xde, 0xf7, 0xde, 0x3c, 0xbf, 0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3e, 0xd4, 0x7e, 0x54, 0x03, 0x64, - 0x00, 0x00, 0x54, 0x9d, 0xc5, 0x49, 0x6c, 0xf0, 0xb9, 0xf6, 0x23, 0xeb, 0xd0, 0xcf, 0x48, 0xc5, - 0x14, 0x9a, 0x05, 0x38, 0xd7, 0xad, 0xcd, 0xdc, 0xac, 0x3e, 0x32, 0x11, 0x1c, 0xb0, 0xe3, 0xf5, - 0x1f, 0xbc, 0xfa, 0xbb, 0x59, 0x7a, 0x79, 0xde, 0xf4, 0x4e, 0xcf, 0x9b, 0xde, 0x5f, 0xe7, 0x4d, - 0xef, 0xe7, 0x8b, 0x66, 0xe9, 0xf4, 0xa2, 0x59, 0x7a, 0x75, 0xd1, 0x2c, 0x7d, 0xdf, 0x91, 0xb1, - 0x99, 0xe6, 0xa3, 0x70, 0xac, 0x92, 0x9e, 0xfb, 0x68, 0xda, 0x9f, 0x4f, 0xf5, 0xe4, 0x85, 0xfd, - 0xc2, 0x8d, 0x02, 0xa4, 0xf0, 0xce, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x9a, 0x1a, 0xc7, - 0x56, 0x07, 0x00, 0x00, + // 931 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4d, 0x8f, 0x1b, 0x45, + 0x10, 0xf5, 0xd8, 0x93, 0xf1, 0xba, 0xbc, 0x26, 0xa8, 0xb5, 0xda, 0xcc, 0x06, 0xb0, 0x8d, 0x13, + 0x24, 0x0b, 0x89, 0xb1, 0xb2, 0x89, 0x10, 0xc9, 0x29, 0x71, 0x80, 0xb0, 0x52, 0x82, 0xd0, 0xac, + 0x23, 0x24, 0x2e, 0x56, 0xdb, 0xee, 0xb4, 0x47, 0xf1, 0x4c, 0x5b, 0xd3, 0xed, 0x5d, 0xef, 0x8d, + 0x1b, 0x1c, 0x39, 0x71, 0xe6, 0x0a, 0xbf, 0x24, 0x07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68, 0x1d, 0x3c, 0x36, 0xe5, 0x52, 0xf4, 0xb3, 0x59, 0x3a, 0x10, 0x39, 0xa9, 0xcf, 0x8f, 0x01, + 0xa1, 0x6f, 0x09, 0x41, 0x69, 0x53, 0x02, 0x55, 0xa2, 0x67, 0xda, 0x8f, 0x2b, 0x88, 0xf4, 0x10, + 0xc0, 0xaa, 0x93, 0x24, 0x4d, 0x0c, 0x3d, 0xd6, 0x7e, 0x6c, 0x1d, 0xf6, 0x39, 0x94, 0xcc, 0x5c, + 0x87, 0x01, 0xcd, 0x75, 0x73, 0x33, 0x37, 0xab, 0x4f, 0x4c, 0x8c, 0x07, 0xec, 0x78, 0xdd, 0xfb, + 0x2f, 0xff, 0xa9, 0x17, 0x5e, 0x9c, 0xd7, 0xbd, 0xd3, 0xf3, 0xba, 0xf7, 0xf7, 0x79, 0xdd, 0xfb, + 0xe5, 0xa2, 0x5e, 0x38, 0xbd, 0xa8, 0x17, 0x5e, 0x5e, 0xd4, 0x0b, 0x3f, 0xb4, 0x64, 0x62, 0xc6, + 0xb3, 0x41, 0x34, 0x54, 0x69, 0xc7, 0x7d, 0x32, 0xed, 0xcf, 0x67, 0x7a, 0xf4, 0xdc, 0x7e, 0xdf, + 0x06, 0x01, 0x51, 0x78, 0xfb, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, 0xca, 0xbe, 0xf4, 0x54, + 0x07, 0x00, 0x00, } func (m *TxResponse) Marshal() (dAtA []byte, err error) { @@ -983,10 +983,10 @@ func (m *GasInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.MinGasPrices) > 0 { - i -= len(m.MinGasPrices) - copy(dAtA[i:], m.MinGasPrices) - i = encodeVarintAbci(dAtA, i, uint64(len(m.MinGasPrices))) + if len(m.MinGasPrice) > 0 { + i -= len(m.MinGasPrice) + copy(dAtA[i:], m.MinGasPrice) + i = encodeVarintAbci(dAtA, i, uint64(len(m.MinGasPrice))) i-- dAtA[i] = 0x1a } @@ -1405,7 +1405,7 @@ func (m *GasInfo) Size() (n int) { if m.GasUsed != 0 { n += 1 + sovAbci(uint64(m.GasUsed)) } - l = len(m.MinGasPrices) + l = len(m.MinGasPrice) if l > 0 { n += 1 + l + sovAbci(uint64(l)) } @@ -2479,7 +2479,7 @@ func (m *GasInfo) Unmarshal(dAtA []byte) error { } case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MinGasPrices", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MinGasPrice", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2507,7 +2507,7 @@ func (m *GasInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.MinGasPrices = string(dAtA[iNdEx:postIndex]) + m.MinGasPrice = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 8c8e0a2347..d9aad5588a 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -133,6 +133,16 @@ func (s txServer) Simulate(ctx context.Context, req *txtypes.SimulateRequest) (* return nil, status.Errorf(codes.Unknown, "%v With gas wanted: '%d' and gas used: '%d' ", err, gasInfo.GasWanted, gasInfo.GasUsed) } + // we only adopt the first gas price in the list + gasPrices, err := sdk.ParseCoinsNormalized(gasInfo.MinGasPrice) + if err != nil { + return nil, status.Errorf(codes.Unknown, "%v With min gas price: '%s' ", err, gasInfo.MinGasPrice) + } + + if !gasPrices.Empty() { + gasInfo.MinGasPrice = gasPrices[0].String() + } + return &txtypes.SimulateResponse{ GasInfo: &gasInfo, Result: result,