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

Commit

Permalink
merge pr #730 (#862)
Browse files Browse the repository at this point in the history
* merge pr #730

* test fix

Co-authored-by: Freddy Li <freddyli@Freddys-MacBook-Pro-2.local>
  • Loading branch information
freddyli7 and Freddy Li authored Apr 15, 2021
1 parent da10092 commit a00ab1d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ corresponding Ethereum API namespace:

### Bug Fixes

* (evm) [\#730](https://github.com/cosmos/ethermint/issues/730) Fix 'EIP2028' not open when Istanbul version has been enabled.
* (app) [\#749](https://github.com/cosmos/ethermint/issues/749) Fix panic in `AnteHandler` when gas price larger than 100000
* (rpc) [\#305](https://github.com/cosmos/ethermint/issues/305) Update `eth_getTransactionCount` to check for account existence before getting sequence and return 0 as the nonce if it doesn't exist.
* (`x/evm`) [\#319](https://github.com/cosmos/ethermint/pull/319) Fix `SetBlockHash` that was setting the incorrect height during `BeginBlock`.
Expand Down
2 changes: 1 addition & 1 deletion tests/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func TestEth_EstimateGas_ContractDeployment(t *testing.T) {
err := json.Unmarshal(rpcRes.Result, &gas)
require.NoError(t, err, string(rpcRes.Result))

require.Equal(t, "0x1c2c4", gas.String())
require.Equal(t, "0x1ab8d", gas.String())
}

func TestEth_GetBlockByNumber(t *testing.T) {
Expand Down
10 changes: 10 additions & 0 deletions x/evm/types/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,13 @@ func validateBlock(block sdk.Int) error {

return nil
}

// IsIstanbul returns whether the Istanbul version is enabled.
func (cc ChainConfig) IsIstanbul() bool {
return getBlockValue(cc.IstanbulBlock) != nil
}

// IsHomestead returns whether the Homestead version is enabled.
func (cc ChainConfig) IsHomestead() bool {
return getBlockValue(cc.HomesteadBlock) != nil
}
2 changes: 1 addition & 1 deletion x/evm/types/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (st StateTransition) newEVM(
func (st StateTransition) TransitionDb(ctx sdk.Context, config ChainConfig) (*ExecutionResult, error) {
contractCreation := st.Recipient == nil

cost, err := core.IntrinsicGas(st.Payload, contractCreation, true, false)
cost, err := core.IntrinsicGas(st.Payload, contractCreation, config.IsHomestead(), config.IsIstanbul())
if err != nil {
return nil, sdkerrors.Wrap(err, "invalid intrinsic gas for transaction")
}
Expand Down

0 comments on commit a00ab1d

Please sign in to comment.