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

open eip2028 when the version of Istanbul was enabled #731

Merged
merged 15 commits into from
Jan 28, 2021
10 changes: 10 additions & 0 deletions x/evm/types/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig {
}
}

// IsIstanbul returns whether the Istanbul version enabled.
KamiD marked this conversation as resolved.
Show resolved Hide resolved
func (cc ChainConfig) IsIstanbul() bool {
return getBlockValue(cc.IstanbulBlock) != nil
}

// IsIstanbul returns whether the Istanbul version enabled.
KamiD marked this conversation as resolved.
Show resolved Hide resolved
func (cc ChainConfig) IsHomestead() bool {
return getBlockValue(cc.HomesteadBlock) != nil
}

// String implements the fmt.Stringer interface
func (cc ChainConfig) String() string {
out, _ := yaml.Marshal(cc)
Expand Down
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