Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e4d726

Browse files
authored
params: remove EIP150Hash from chainconfig (ethereum#27087)
The EIP150Hash was an idea where, after the fork, we hardcoded the forked hash as an extra defensive mechanism. It wasn't really used, since forks weren't contentious and for all the various testnets and private networks it's been a hassle to have around. This change removes that config field. --------- Signed-off-by: jsvisa <[email protected]>
1 parent cb66eba commit 5e4d726

File tree

11 files changed

+2
-68
lines changed

11 files changed

+2
-68
lines changed

consensus/clique/clique.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,6 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
304304
if chain.Config().IsCancun(header.Time) {
305305
return fmt.Errorf("clique does not support cancun fork")
306306
}
307-
// If all checks passed, validate any special fields for hard forks
308-
if err := misc.VerifyForkHashes(chain.Config(), header, false); err != nil {
309-
return err
310-
}
311307
// All basic checks passed, verify cascading fields
312308
return c.verifyCascadingFields(chain, header, parents)
313309
}

consensus/ethash/consensus.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,6 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
326326
if err := misc.VerifyDAOHeaderExtraData(chain.Config(), header); err != nil {
327327
return err
328328
}
329-
if err := misc.VerifyForkHashes(chain.Config(), header, uncle); err != nil {
330-
return err
331-
}
332329
return nil
333330
}
334331

consensus/misc/eip1559_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func copyConfig(original *params.ChainConfig) *params.ChainConfig {
3434
DAOForkBlock: original.DAOForkBlock,
3535
DAOForkSupport: original.DAOForkSupport,
3636
EIP150Block: original.EIP150Block,
37-
EIP150Hash: original.EIP150Hash,
3837
EIP155Block: original.EIP155Block,
3938
EIP158Block: original.EIP158Block,
4039
ByzantiumBlock: original.ByzantiumBlock,

consensus/misc/forks.go

Lines changed: 0 additions & 43 deletions
This file was deleted.

core/vm/runtime/runtime.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ func setDefaults(cfg *Config) {
5757
DAOForkBlock: new(big.Int),
5858
DAOForkSupport: false,
5959
EIP150Block: new(big.Int),
60-
EIP150Hash: common.Hash{},
6160
EIP155Block: new(big.Int),
6261
EIP158Block: new(big.Int),
6362
ByzantiumBlock: new(big.Int),

eth/tracers/js/tracer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func TestNoStepExec(t *testing.T) {
229229
}
230230

231231
func TestIsPrecompile(t *testing.T) {
232-
chaincfg := &params.ChainConfig{ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), DAOForkBlock: nil, DAOForkSupport: false, EIP150Block: big.NewInt(0), EIP150Hash: common.Hash{}, EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(100), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), IstanbulBlock: big.NewInt(200), MuirGlacierBlock: big.NewInt(0), BerlinBlock: big.NewInt(300), LondonBlock: big.NewInt(0), TerminalTotalDifficulty: nil, Ethash: new(params.EthashConfig), Clique: nil}
232+
chaincfg := &params.ChainConfig{ChainID: big.NewInt(1), HomesteadBlock: big.NewInt(0), DAOForkBlock: nil, DAOForkSupport: false, EIP150Block: big.NewInt(0), EIP155Block: big.NewInt(0), EIP158Block: big.NewInt(0), ByzantiumBlock: big.NewInt(100), ConstantinopleBlock: big.NewInt(0), PetersburgBlock: big.NewInt(0), IstanbulBlock: big.NewInt(200), MuirGlacierBlock: big.NewInt(0), BerlinBlock: big.NewInt(300), LondonBlock: big.NewInt(0), TerminalTotalDifficulty: nil, Ethash: new(params.EthashConfig), Clique: nil}
233233
chaincfg.ByzantiumBlock = big.NewInt(100)
234234
chaincfg.IstanbulBlock = big.NewInt(200)
235235
chaincfg.BerlinBlock = big.NewInt(300)

miner/stress/1559/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ func makeGenesis(faucets []*ecdsa.PrivateKey) *core.Genesis {
205205
genesis.GasLimit = 8_000_000
206206

207207
genesis.Config.ChainID = big.NewInt(18)
208-
genesis.Config.EIP150Hash = common.Hash{}
209208

210209
genesis.Alloc = core.GenesisAlloc{}
211210
for _, faucet := range faucets {

miner/stress/clique/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ func makeGenesis(faucets []*ecdsa.PrivateKey, sealers []*ecdsa.PrivateKey) *core
153153

154154
genesis.Config.ChainID = big.NewInt(18)
155155
genesis.Config.Clique.Period = 1
156-
genesis.Config.EIP150Hash = common.Hash{}
157156

158157
genesis.Alloc = core.GenesisAlloc{}
159158
for _, faucet := range faucets {

miner/stress/ethash/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ func makeGenesis(faucets []*ecdsa.PrivateKey) *core.Genesis {
139139
genesis.GasLimit = 25000000
140140

141141
genesis.Config.ChainID = big.NewInt(18)
142-
genesis.Config.EIP150Hash = common.Hash{}
143142

144143
genesis.Alloc = core.GenesisAlloc{}
145144
for _, faucet := range faucets {

params/config.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ var (
6262
DAOForkBlock: big.NewInt(1_920_000),
6363
DAOForkSupport: true,
6464
EIP150Block: big.NewInt(2_463_000),
65-
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
6665
EIP155Block: big.NewInt(2_675_000),
6766
EIP158Block: big.NewInt(2_675_000),
6867
ByzantiumBlock: big.NewInt(4_370_000),
@@ -139,7 +138,6 @@ var (
139138
DAOForkBlock: nil,
140139
DAOForkSupport: true,
141140
EIP150Block: big.NewInt(2),
142-
EIP150Hash: common.HexToHash("0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
143141
EIP155Block: big.NewInt(3),
144142
EIP158Block: big.NewInt(3),
145143
ByzantiumBlock: big.NewInt(1_035_301),
@@ -231,7 +229,6 @@ var (
231229
DAOForkBlock: nil,
232230
DAOForkSupport: false,
233231
EIP150Block: big.NewInt(0),
234-
EIP150Hash: common.Hash{},
235232
EIP155Block: big.NewInt(0),
236233
EIP158Block: big.NewInt(0),
237234
ByzantiumBlock: big.NewInt(0),
@@ -261,7 +258,6 @@ var (
261258
DAOForkBlock: nil,
262259
DAOForkSupport: false,
263260
EIP150Block: big.NewInt(0),
264-
EIP150Hash: common.Hash{},
265261
EIP155Block: big.NewInt(0),
266262
EIP158Block: big.NewInt(0),
267263
ByzantiumBlock: big.NewInt(0),
@@ -291,7 +287,6 @@ var (
291287
DAOForkBlock: nil,
292288
DAOForkSupport: false,
293289
EIP150Block: big.NewInt(0),
294-
EIP150Hash: common.Hash{},
295290
EIP155Block: big.NewInt(0),
296291
EIP158Block: big.NewInt(0),
297292
ByzantiumBlock: big.NewInt(0),
@@ -321,7 +316,6 @@ var (
321316
DAOForkBlock: nil,
322317
DAOForkSupport: false,
323318
EIP150Block: nil,
324-
EIP150Hash: common.Hash{},
325319
EIP155Block: nil,
326320
EIP158Block: nil,
327321
ByzantiumBlock: nil,
@@ -415,9 +409,7 @@ type ChainConfig struct {
415409
DAOForkSupport bool `json:"daoForkSupport,omitempty"` // Whether the nodes supports or opposes the DAO hard-fork
416410

417411
// EIP150 implements the Gas price changes (https://github.com/ethereum/EIPs/issues/150)
418-
EIP150Block *big.Int `json:"eip150Block,omitempty"` // EIP150 HF block (nil = no fork)
419-
EIP150Hash common.Hash `json:"eip150Hash,omitempty"` // EIP150 HF hash (needed for header only clients as only gas pricing changed)
420-
412+
EIP150Block *big.Int `json:"eip150Block,omitempty"` // EIP150 HF block (nil = no fork)
421413
EIP155Block *big.Int `json:"eip155Block,omitempty"` // EIP155 HF block
422414
EIP158Block *big.Int `json:"eip158Block,omitempty"` // EIP158 HF block
423415

tests/difficulty_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"math/big"
2121
"testing"
2222

23-
"github.com/ethereum/go-ethereum/common"
2423
"github.com/ethereum/go-ethereum/params"
2524
)
2625

@@ -31,7 +30,6 @@ var (
3130
DAOForkBlock: big.NewInt(1920000),
3231
DAOForkSupport: true,
3332
EIP150Block: big.NewInt(2463000),
34-
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
3533
EIP155Block: big.NewInt(2675000),
3634
EIP158Block: big.NewInt(2675000),
3735
ByzantiumBlock: big.NewInt(4370000),
@@ -43,7 +41,6 @@ var (
4341
DAOForkBlock: nil,
4442
DAOForkSupport: true,
4543
EIP150Block: big.NewInt(0),
46-
EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
4744
EIP155Block: big.NewInt(10),
4845
EIP158Block: big.NewInt(10),
4946
ByzantiumBlock: big.NewInt(1_700_000),

0 commit comments

Comments
 (0)