Commit 7ff75ac2 authored by Jeffrey Wilcke's avatar Jeffrey Wilcke Committed by GitHub

cmd/utils, core, params: fork all teh things for dev mode (#3697)

parent 167be7f2
...@@ -861,6 +861,8 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon ...@@ -861,6 +861,8 @@ func MakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *params.ChainCon
if defaults { if defaults {
if ctx.GlobalBool(TestNetFlag.Name) { if ctx.GlobalBool(TestNetFlag.Name) {
config = params.TestnetChainConfig config = params.TestnetChainConfig
} else if ctx.GlobalBool(DevModeFlag.Name) {
config = params.AllProtocolChanges
} else { } else {
// Homestead fork // Homestead fork
config.HomesteadBlock = params.MainNetHomesteadBlock config.HomesteadBlock = params.MainNetHomesteadBlock
......
...@@ -64,6 +64,9 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block, ...@@ -64,6 +64,9 @@ func WriteGenesisBlock(chainDb ethdb.Database, reader io.Reader) (*types.Block,
if err := json.Unmarshal(contents, &genesis); err != nil { if err := json.Unmarshal(contents, &genesis); err != nil {
return nil, err return nil, err
} }
if genesis.ChainConfig == nil {
genesis.ChainConfig = params.AllProtocolChanges
}
// creating with empty hash always works // creating with empty hash always works
statedb, _ := state.New(common.Hash{}, chainDb) statedb, _ := state.New(common.Hash{}, chainDb)
......
...@@ -47,6 +47,16 @@ var TestnetChainConfig = &ChainConfig{ ...@@ -47,6 +47,16 @@ var TestnetChainConfig = &ChainConfig{
EIP158Block: big.NewInt(10), EIP158Block: big.NewInt(10),
} }
// AllProtocolChanges contains every protocol change (EIPs)
// introduced and accepted by the Ethereum core developers.
//
// This configuration is intentionally not using keyed fields.
// This configuration must *always* have all forks enabled, which
// means that all fields must be set at all times. This forces
// anyone adding flags to the config to also have to set these
// fields.
var AllProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0)}
// ChainConfig is the core config which determines the blockchain settings. // ChainConfig is the core config which determines the blockchain settings.
// //
// ChainConfig is stored in the database on a per block basis. This means // ChainConfig is stored in the database on a per block basis. This means
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment