At first thought that running a private network with Ethereum is going to be easy. Just download the source, modify your difficulty function and you are done. But after getting deeper into the source base I am seeing many if
conditions that modify the functionality depending on the block number. And there are a lot of block numbers that affect the branch of execution:
MainnetChainConfig = &ChainConfig{
ChainId: big.NewInt(1),
HomesteadBlock: big.NewInt(1150000),
DAOForkBlock: big.NewInt(1920000),
DAOForkSupport: true,
EIP150Block: big.NewInt(2463000),
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
EIP155Block: big.NewInt(2675000),
EIP158Block: big.NewInt(2675000),
MetropolisBlock: big.NewInt(math.MaxInt64), // Don't enable yet
Ethash: new(EthashConfig),
}
for example, this if
is a Use Case only for Metropolis release:
func AccumulateRewards(config *params.ChainConfig, state *state.StateDB, header *types.Header, uncles []*types.Header) {
// Select the correct block reward based on chain progression
blockReward := frontierBlockReward
if config.IsMetropolis(header.Number) {
blockReward = metropolisBlockReward
}
So.... the question is, to all of those who have set up a private network already, what has to be done to obtain a generic version of today's latest code of Ethereum but without all those old fixes. Because, I guess, when you start running your own private network from block 0 you will reach the day when some hardcoded block number will be created and the rules will apply. For example, the DAO hack happened at block 1920000, will your own private Ethereum based network also try to repeat the same fixes as the original Ethereum network had to ???
This is kind of quesiton I want to as, how to configure the installation so you can use the latest source code but without patches for things happened in the past.