Skip to content
This repository was archived by the owner on Nov 30, 2021. It is now read-only.

Commit 9a2d39b

Browse files
authored
update minimum gas price to be 1 (#515)
* update minimum gas price to be 1 * update changelog
1 parent cf9662c commit 9a2d39b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ Ref: https://keepachangelog.com/en/1.0.0/
5151
* (`x/evm`) [\#458](https://github.com/ChainSafe/ethermint/pull/458) Define parameter for token denomination used for the EVM module.
5252
* (`x/evm`) [\#443](https://github.com/ChainSafe/ethermint/issues/443) Support custom Ethereum `ChainConfig` params.
5353
* (types) [\#434](https://github.com/ChainSafe/ethermint/issues/434) Update default denomination to Atto Photon (`aphoton`).
54+
* (types) [\#515](https://github.com/ChainSafe/ethermint/pull/515) Update minimum gas price to be 1.
5455

5556
### Bug Fixes
5657

5758
* (types) [\#507](https://github.com/ChainSafe/ethermint/pull/507) Fix hardcoded `aphoton` on `EthAccount` balance getter and setter.
5859
* (`x/evm`) [\#496](https://github.com/ChainSafe/ethermint/pull/496) Fix bugs on `journal.revert` and `CommitStateDB.Copy`.
5960
* (types) [\#480](https://github.com/ChainSafe/ethermint/pull/480) Update [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) coin type to `60` to satisfy [EIP84](https://github.com/ethereum/EIPs/issues/84).
61+
* (types) [\#513](https://github.com/ChainSafe/ethermint/pull/513) Fix simulated transaction bug that was causing a consensus error by unintentionally affecting the state.
6062

6163
## [v0.1.0] - 2020-08-23
6264

x/evm/types/msg.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ func (msg MsgEthermint) GetSignBytes() []byte {
8282

8383
// ValidateBasic runs stateless checks on the message
8484
func (msg MsgEthermint) ValidateBasic() error {
85+
if msg.Price.IsZero() {
86+
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be 0")
87+
}
88+
8589
if msg.Price.Sign() == -1 {
86-
return sdkerrors.Wrapf(types.ErrInvalidValue, "price cannot be negative %s", msg.Price)
90+
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be negative %s", msg.Price)
8791
}
8892

8993
// Amount can be 0
@@ -185,8 +189,12 @@ func (msg MsgEthereumTx) Type() string { return TypeMsgEthereumTx }
185189
// ValidateBasic implements the sdk.Msg interface. It performs basic validation
186190
// checks of a Transaction. If returns an error if validation fails.
187191
func (msg MsgEthereumTx) ValidateBasic() error {
192+
if msg.Data.Price.Cmp(big.NewInt(0)) == 0 {
193+
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be 0")
194+
}
195+
188196
if msg.Data.Price.Sign() == -1 {
189-
return sdkerrors.Wrapf(types.ErrInvalidValue, "price cannot be negative %s", msg.Data.Price)
197+
return sdkerrors.Wrapf(types.ErrInvalidValue, "gas price cannot be negative %s", msg.Data.Price)
190198
}
191199

192200
// Amount can be 0

0 commit comments

Comments
 (0)