change default maxGasWanted (#1208)

This commit is contained in:
Freddy Caceres 2022-07-28 15:14:46 -04:00 committed by GitHub
parent 29d3abcf09
commit ebbffc685c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View File

@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (feemarket) [\#1165](https://github.com/evmos/ethermint/pull/1165) Add hint in specs about different gas terminology for gas in Cosmos and Ethereum.
* (rpc) [\#1169](https://github.com/evmos/ethermint/pull/1169) Remove unnecessary queries from `getBlockNumber` function
* (ante) [1208](https://github.com/evmos/ethermint/pull/1208) Change default `maxGasWanted` value
### Bug Fixes

View File

@ -194,7 +194,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
return ctx, sdkerrors.Wrap(err, "failed to unpack tx data")
}
if ctx.IsCheckTx() {
if ctx.IsCheckTx() && egcd.maxGasWanted != 0 {
// We can't trust the tx gas limit, because we'll refund the unused gas.
if txData.GetGas() > egcd.maxGasWanted {
gasWanted += egcd.maxGasWanted

View File

@ -280,7 +280,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() {
{
"success",
tx2,
config.DefaultMaxTxGasWanted, // it's capped
tx2GasLimit, // it's capped
func() {
vmdb.AddBalance(addr, big.NewInt(1000000))

View File

@ -28,7 +28,7 @@ const (
// DefaultEVMTracer is the default vm.Tracer type
DefaultEVMTracer = ""
DefaultMaxTxGasWanted = 500000
DefaultMaxTxGasWanted = 0
DefaultGasCap uint64 = 25000000