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

merge pr #730 #862

Merged
merged 3 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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