Skip to content

Commit

Permalink
ethash,core,types,vm,light,coregeth,ctypes,genesisT,goethereum,multig…
Browse files Browse the repository at this point in the history
…ethv0,parity: rename EthashEIP2Transition -> EIP2Transition

Signed-off-by: meows <b5c6@protonmail.com>
  • Loading branch information
meowsbits committed Jun 16, 2020
1 parent f57cdfc commit 1c53607
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func CalcDifficulty(config ctypes.ChainConfigurator, time uint64, parent *types.
out.Mul(parent_diff_over_dbd(parent), out)
out.Add(out, parent.Difficulty)

} else if config.IsEnabled(config.GetEthashEIP2Transition, next) {
} else if config.IsEnabled(config.GetEIP2Transition, next) {
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
// algorithm:
// diff = (parent_diff +
Expand Down
2 changes: 1 addition & 1 deletion core/genesis_alloc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func TestSetupGenesis(t *testing.T) {
wantHash: customghash,
wantConfig: customg.Config.(*goethereum.ChainConfig),
wantErr: &confp.ConfigCompatError{
What: "incompatible fork value: GetEIP7Transition",
What: "incompatible fork value: GetEIP2Transition",
StoredConfig: func() *uint64 { b := big.NewInt(2).Uint64(); return &b }(),
NewConfig: func() *uint64 { b := big.NewInt(3).Uint64(); return &b }(),
RewindTo: 1,
Expand Down
2 changes: 1 addition & 1 deletion core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
}
msg := st.msg
sender := vm.AccountRef(msg.From())
eip2f := st.evm.ChainConfig().IsEnabled(st.evm.ChainConfig().GetEthashEIP2Transition, st.evm.BlockNumber)
eip2f := st.evm.ChainConfig().IsEnabled(st.evm.ChainConfig().GetEIP2Transition, st.evm.BlockNumber)
eip2028f := st.evm.ChainConfig().IsEnabled(st.evm.ChainConfig().GetEIP2028Transition, st.evm.BlockNumber)
contractCreation := msg.To() == nil

Expand Down
2 changes: 1 addition & 1 deletion core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func (pool *TxPool) loop() {
// Handle ChainHeadEvent
case ev := <-pool.chainHeadCh:
if ev.Block != nil {
if pool.chainconfig.IsEnabled(pool.chainconfig.GetEthashEIP2Transition, ev.Block.Number()) {
if pool.chainconfig.IsEnabled(pool.chainconfig.GetEIP2Transition, ev.Block.Number()) {
pool.eip2f = true
}
if pool.chainconfig.IsEnabled(pool.chainconfig.GetEIP2028Transition, ev.Block.Number()) {
Expand Down
2 changes: 1 addition & 1 deletion core/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func MakeSigner(config ctypes.ChainConfigurator, blockNumber *big.Int) Signer {
switch {
case config.IsEnabled(config.GetEIP155Transition, blockNumber):
signer = NewEIP155Signer(config.GetChainID())
case config.IsEnabled(config.GetEthashEIP2Transition, blockNumber):
case config.IsEnabled(config.GetEIP2Transition, blockNumber):
signer = HomesteadSigner{}
default:
signer = FrontierSigner{}
Expand Down
2 changes: 1 addition & 1 deletion core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
// When an error was returned by the EVM or when setting the creation code
// above we revert to the snapshot and consume any gas remaining. Additionally
// when we're in homestead this also counts for code storage gas errors.
if maxCodeSizeExceeded || (err != nil && (evm.ChainConfig().IsEnabled(evm.chainConfig.GetEthashEIP2Transition, evm.BlockNumber) || err != ErrCodeStoreOutOfGas)) {
if maxCodeSizeExceeded || (err != nil && (evm.ChainConfig().IsEnabled(evm.chainConfig.GetEIP2Transition, evm.BlockNumber) || err != ErrCodeStoreOutOfGas)) {
evm.StateDB.RevertToSnapshot(snapshot)
if err != ErrExecutionReverted {
contract.UseGas(contract.Gas)
Expand Down
2 changes: 1 addition & 1 deletion core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ func opCreate(pc *uint64, interpreter *EVMInterpreter, callContext *callCtx) ([]
// homestead we must check for CodeStoreOutOfGasError (homestead only
// rule) and treat as an error, if the ruleset is frontier we must
// ignore this error and pretend the operation was successful.
if interpreter.evm.ChainConfig().IsEnabled(interpreter.evm.chainConfig.GetEthashEIP2Transition, interpreter.evm.BlockNumber) && suberr == ErrCodeStoreOutOfGas {
if interpreter.evm.ChainConfig().IsEnabled(interpreter.evm.chainConfig.GetEIP2Transition, interpreter.evm.BlockNumber) && suberr == ErrCodeStoreOutOfGas {
callContext.stack.push(interpreter.intPool.getZero())
} else if suberr != nil && suberr != ErrCodeStoreOutOfGas {
callContext.stack.push(interpreter.intPool.getZero())
Expand Down
2 changes: 1 addition & 1 deletion light/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ func (pool *TxPool) setNewHead(head *types.Header) {
}
m, r := txc.getLists()
pool.relay.NewHead(pool.head, m, r)
pool.eip2f = pool.config.IsEnabled(pool.config.GetEthashEIP2Transition, head.Number)
pool.eip2f = pool.config.IsEnabled(pool.config.GetEIP2Transition, head.Number)

// Update fork indicator by next pending block number
next := new(big.Int).Add(head.Number, big.NewInt(1))
Expand Down
4 changes: 2 additions & 2 deletions params/types/coregeth/chain_config_configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,11 @@ func (c *CoreGethChainConfig) SetEthashHomesteadTransition(n *uint64) error {
return nil
}

func (c *CoreGethChainConfig) GetEthashEIP2Transition() *uint64 {
func (c *CoreGethChainConfig) GetEIP2Transition() *uint64 {
return bigNewU64(c.EIP2FBlock)
}

func (c *CoreGethChainConfig) SetEthashEIP2Transition(n *uint64) error {
func (c *CoreGethChainConfig) SetEIP2Transition(n *uint64) error {
c.EIP2FBlock = setBig(c.EIP2FBlock, n)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions params/types/ctypes/configurator_iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ type ProtocolSpecifier interface {
// It is a messy EIP, specifying diverse changes, like difficulty, intrinsic gas costs for contract creation,
// txpool management, and contract OoG handling.
// It is both Ethash-specific and _not_.
GetEthashEIP2Transition() *uint64
SetEthashEIP2Transition(n *uint64) error
GetEIP2Transition() *uint64
SetEIP2Transition(n *uint64) error

GetEIP7Transition() *uint64
SetEIP7Transition(n *uint64) error
Expand Down
8 changes: 4 additions & 4 deletions params/types/genesisT/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,12 @@ func (g *Genesis) SetEthashHomesteadTransition(n *uint64) error {
return g.Config.SetEthashHomesteadTransition(n)
}

func (g *Genesis) GetEthashEIP2Transition() *uint64 {
return g.Config.GetEthashEIP2Transition()
func (g *Genesis) GetEIP2Transition() *uint64 {
return g.Config.GetEIP2Transition()
}

func (g *Genesis) SetEthashEIP2Transition(n *uint64) error {
return g.Config.SetEthashEIP2Transition(n)
func (g *Genesis) SetEIP2Transition(n *uint64) error {
return g.Config.SetEIP2Transition(n)
}

func (g *Genesis) GetEthashEIP779Transition() *uint64 {
Expand Down
4 changes: 2 additions & 2 deletions params/types/goethereum/goethereum_configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,11 @@ func (c *ChainConfig) SetEthashHomesteadTransition(i *uint64) error {
return nil
}

func (c *ChainConfig) GetEthashEIP2Transition() *uint64 {
func (c *ChainConfig) GetEIP2Transition() *uint64 {
return bigNewU64(c.HomesteadBlock)
}

func (c *ChainConfig) SetEthashEIP2Transition(i *uint64) error {
func (c *ChainConfig) SetEIP2Transition(i *uint64) error {
c.HomesteadBlock = setBig(c.HomesteadBlock, i)
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,11 @@ func (c *ChainConfig) SetEthashHomesteadTransition(n *uint64) error {
return nil
}

func (c *ChainConfig) GetEthashEIP2Transition() *uint64 {
func (c *ChainConfig) GetEIP2Transition() *uint64 {
return bigNewU64(bigMax(c.EIP2FBlock, c.HomesteadBlock))
}

func (c *ChainConfig) SetEthashEIP2Transition(n *uint64) error {
func (c *ChainConfig) SetEIP2Transition(n *uint64) error {
c.EIP2FBlock = setBig(c.EIP2FBlock, n)
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions params/types/parity/parity_configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ func (spec *ParityChainSpec) SetEthashHomesteadTransition(n *uint64) error {
return nil
}

func (spec *ParityChainSpec) GetEthashEIP2Transition() *uint64 {
func (spec *ParityChainSpec) GetEIP2Transition() *uint64 {
return spec.Engine.Ethash.Params.HomesteadTransition.Uint64P()
}

func (spec *ParityChainSpec) SetEthashEIP2Transition(n *uint64) error {
func (spec *ParityChainSpec) SetEIP2Transition(n *uint64) error {
spec.Engine.Ethash.Params.HomesteadTransition = new(ParityU64).SetUint64(n)
return nil
}
Expand Down

0 comments on commit 1c53607

Please sign in to comment.