core: refactor genesis handling

This commit solves several issues concerning the genesis block:

* Genesis/ChainConfig loading was handled by cmd/geth code. This left
  library users in the cold. They could specify a JSON-encoded
  string and overwrite the config, but didn't get any of the additional
  checks performed by geth.
* Decoding and writing of genesis JSON was conflated in
  WriteGenesisBlock. This made it a lot harder to embed the genesis
  block into the forthcoming config file loader. This commit changes
  things so there is a single Genesis type that represents genesis
  blocks. All uses of Write*Genesis* are changed to use the new type
  instead.
* If the chain config supplied by the user was incompatible with the
  current chain (i.e. the chain had already advanced beyond a scheduled
  fork), it got overwritten. This is not an issue in practice because
  previous forks have always had the highest total difficulty. It might
  matter in the future though. The new code reverts the local chain to
  the point of the fork when upgrading configuration.

The change to genesis block data removes compression library
dependencies from package core.
This commit is contained in:
Felix Lange
2017-03-02 14:03:33 +01:00
parent 67c47459f2
commit 37dd9086ec
45 changed files with 1379 additions and 1275 deletions

View File

@ -23,39 +23,43 @@ import (
"github.com/ethereum/go-ethereum/common"
)
// MainnetChainConfig is the chain parameters to run a node on the main network.
var MainnetChainConfig = &ChainConfig{
ChainId: MainNetChainID,
HomesteadBlock: MainNetHomesteadBlock,
DAOForkBlock: MainNetDAOForkBlock,
DAOForkSupport: true,
EIP150Block: MainNetHomesteadGasRepriceBlock,
EIP150Hash: MainNetHomesteadGasRepriceHash,
EIP155Block: MainNetSpuriousDragon,
EIP158Block: MainNetSpuriousDragon,
}
var (
// MainnetChainConfig is the chain parameters to run a node on the main network.
MainnetChainConfig = &ChainConfig{
ChainId: MainNetChainID,
HomesteadBlock: MainNetHomesteadBlock,
DAOForkBlock: MainNetDAOForkBlock,
DAOForkSupport: true,
EIP150Block: MainNetHomesteadGasRepriceBlock,
EIP150Hash: MainNetHomesteadGasRepriceHash,
EIP155Block: MainNetSpuriousDragon,
EIP158Block: MainNetSpuriousDragon,
}
// TestnetChainConfig is the chain parameters to run a node on the test network.
var TestnetChainConfig = &ChainConfig{
ChainId: big.NewInt(3),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
EIP155Block: big.NewInt(10),
EIP158Block: big.NewInt(10),
}
// TestnetChainConfig contains the chain parameters to run a node on the ropsten test network.
TestnetChainConfig = &ChainConfig{
ChainId: big.NewInt(3),
HomesteadBlock: big.NewInt(0),
DAOForkBlock: nil,
DAOForkSupport: true,
EIP150Block: big.NewInt(0),
EIP150Hash: common.HexToHash("0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
EIP155Block: 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)}
// AllProtocolChanges contains every protocol change (EIPs)
// introduced and accepted by the Ethereum core developers.
// TestChainConfig is like AllProtocolChanges but has chain ID 1.
//
// 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.
AllProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0)}
TestChainConfig = &ChainConfig{big.NewInt(1), 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.
//
@ -77,7 +81,7 @@ type ChainConfig struct {
EIP158Block *big.Int `json:"eip158Block"` // EIP158 HF block
}
// String implements the Stringer interface.
// String implements the fmt.Stringer interface.
func (c *ChainConfig) String() string {
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v}",
c.ChainId,
@ -90,17 +94,26 @@ func (c *ChainConfig) String() string {
)
}
var (
TestChainConfig = &ChainConfig{big.NewInt(1), new(big.Int), new(big.Int), true, new(big.Int), common.Hash{}, new(big.Int), new(big.Int)}
TestRules = TestChainConfig.Rules(new(big.Int))
)
// IsHomestead returns whether num is either equal to the homestead block or greater.
func (c *ChainConfig) IsHomestead(num *big.Int) bool {
if c.HomesteadBlock == nil || num == nil {
return false
}
return num.Cmp(c.HomesteadBlock) >= 0
return isForked(c.HomesteadBlock, num)
}
// IsDAO returns whether num is either equal to the DAO fork block or greater.
func (c *ChainConfig) IsDAOFork(num *big.Int) bool {
return isForked(c.DAOForkBlock, num)
}
func (c *ChainConfig) IsEIP150(num *big.Int) bool {
return isForked(c.EIP150Block, num)
}
func (c *ChainConfig) IsEIP155(num *big.Int) bool {
return isForked(c.EIP155Block, num)
}
func (c *ChainConfig) IsEIP158(num *big.Int) bool {
return isForked(c.EIP158Block, num)
}
// GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).
@ -110,51 +123,110 @@ func (c *ChainConfig) GasTable(num *big.Int) GasTable {
if num == nil {
return GasTableHomestead
}
switch {
case c.EIP158Block != nil && num.Cmp(c.EIP158Block) >= 0:
case c.IsEIP158(num):
return GasTableEIP158
case c.EIP150Block != nil && num.Cmp(c.EIP150Block) >= 0:
case c.IsEIP150(num):
return GasTableHomesteadGasRepriceFork
default:
return GasTableHomestead
}
}
func (c *ChainConfig) IsEIP150(num *big.Int) bool {
if c.EIP150Block == nil || num == nil {
// CheckCompatible checks whether scheduled fork transitions have been imported
// with a mismatching chain configuration.
func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError {
bhead := new(big.Int).SetUint64(height)
// Iterate checkCompatible to find the lowest conflict.
var lasterr *ConfigCompatError
for {
err := c.checkCompatible(newcfg, bhead)
if err == nil || (lasterr != nil && err.RewindTo == lasterr.RewindTo) {
break
}
lasterr = err
bhead.SetUint64(err.RewindTo)
}
return lasterr
}
func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *ConfigCompatError {
if isForkIncompatible(c.HomesteadBlock, newcfg.HomesteadBlock, head) {
return newCompatError("Homestead fork block", c.HomesteadBlock, newcfg.HomesteadBlock)
}
if isForkIncompatible(c.DAOForkBlock, newcfg.DAOForkBlock, head) {
return newCompatError("DAO fork block", c.DAOForkBlock, newcfg.DAOForkBlock)
}
if c.IsDAOFork(head) && c.DAOForkSupport != newcfg.DAOForkSupport {
return newCompatError("DAO fork support flag", c.DAOForkBlock, newcfg.DAOForkBlock)
}
if isForkIncompatible(c.EIP150Block, newcfg.EIP150Block, head) {
return newCompatError("EIP150 fork block", c.EIP150Block, newcfg.EIP150Block)
}
if isForkIncompatible(c.EIP155Block, newcfg.EIP155Block, head) {
return newCompatError("EIP155 fork block", c.EIP155Block, newcfg.EIP155Block)
}
if isForkIncompatible(c.EIP158Block, newcfg.EIP158Block, head) {
return newCompatError("EIP158 fork block", c.EIP158Block, newcfg.EIP158Block)
}
if c.IsEIP158(head) && !configNumEqual(c.ChainId, newcfg.ChainId) {
return newCompatError("EIP158 chain ID", c.EIP158Block, newcfg.EIP158Block)
}
return nil
}
// isForkIncompatible returns true if a fork scheduled at s1 cannot be rescheduled to
// block s2 because head is already past the fork.
func isForkIncompatible(s1, s2, head *big.Int) bool {
return (isForked(s1, head) || isForked(s2, head)) && !configNumEqual(s1, s2)
}
// isForked returns whether a fork scheduled at block s is active at the given head block.
func isForked(s, head *big.Int) bool {
if s == nil || head == nil {
return false
}
return num.Cmp(c.EIP150Block) >= 0
return s.Cmp(head) <= 0
}
func (c *ChainConfig) IsEIP155(num *big.Int) bool {
if c.EIP155Block == nil || num == nil {
return false
func configNumEqual(x, y *big.Int) bool {
if x == nil {
return y == nil
}
return num.Cmp(c.EIP155Block) >= 0
}
func (c *ChainConfig) IsEIP158(num *big.Int) bool {
if c.EIP158Block == nil || num == nil {
return false
if y == nil {
return x == nil
}
return num.Cmp(c.EIP158Block) >= 0
return x.Cmp(y) == 0
}
// Rules wraps ChainConfig and is merely syntatic sugar or can be used for functions
// that do not have or require information about the block.
//
// Rules is a one time interface meaning that it shouldn't be used in between transition
// phases.
type Rules struct {
ChainId *big.Int
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
// ConfigCompatError is raised if the locally-stored blockchain is initialised with a
// ChainConfig that would alter the past.
type ConfigCompatError struct {
What string
// block numbers of the stored and new configurations
StoredConfig, NewConfig *big.Int
// the block number to which the local chain must be rewound to correct the error
RewindTo uint64
}
func (c *ChainConfig) Rules(num *big.Int) Rules {
return Rules{ChainId: new(big.Int).Set(c.ChainId), IsHomestead: c.IsHomestead(num), IsEIP150: c.IsEIP150(num), IsEIP155: c.IsEIP155(num), IsEIP158: c.IsEIP158(num)}
func newCompatError(what string, storedblock, newblock *big.Int) *ConfigCompatError {
var rew *big.Int
switch {
case storedblock == nil:
rew = newblock
case newblock == nil || storedblock.Cmp(newblock) < 0:
rew = storedblock
default:
rew = newblock
}
err := &ConfigCompatError{what, storedblock, newblock, 0}
if rew != nil && rew.Sign() > 0 {
err.RewindTo = rew.Uint64() - 1
}
return err
}
func (err *ConfigCompatError) Error() string {
return fmt.Sprintf("mismatching %s in database (have %d, want %d, rewindto %d)", err.What, err.StoredConfig, err.NewConfig, err.RewindTo)
}

81
params/config_test.go Normal file
View File

@ -0,0 +1,81 @@
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package params
import (
"math/big"
"reflect"
"testing"
)
func TestCheckCompatible(t *testing.T) {
type test struct {
stored, new *ChainConfig
head uint64
wantErr *ConfigCompatError
}
tests := []test{
{stored: AllProtocolChanges, new: AllProtocolChanges, head: 0, wantErr: nil},
{stored: AllProtocolChanges, new: AllProtocolChanges, head: 100, wantErr: nil},
{
stored: &ChainConfig{EIP150Block: big.NewInt(10)},
new: &ChainConfig{EIP150Block: big.NewInt(20)},
head: 9,
wantErr: nil,
},
{
stored: AllProtocolChanges,
new: &ChainConfig{HomesteadBlock: nil},
head: 3,
wantErr: &ConfigCompatError{
What: "Homestead fork block",
StoredConfig: big.NewInt(0),
NewConfig: nil,
RewindTo: 0,
},
},
{
stored: AllProtocolChanges,
new: &ChainConfig{HomesteadBlock: big.NewInt(1)},
head: 3,
wantErr: &ConfigCompatError{
What: "Homestead fork block",
StoredConfig: big.NewInt(0),
NewConfig: big.NewInt(1),
RewindTo: 0,
},
},
{
stored: &ChainConfig{HomesteadBlock: big.NewInt(30), EIP150Block: big.NewInt(10)},
new: &ChainConfig{HomesteadBlock: big.NewInt(25), EIP150Block: big.NewInt(20)},
head: 25,
wantErr: &ConfigCompatError{
What: "EIP150 fork block",
StoredConfig: big.NewInt(10),
NewConfig: big.NewInt(20),
RewindTo: 9,
},
},
}
for _, test := range tests {
err := test.stored.CheckCompatible(test.new, test.head)
if !reflect.DeepEqual(err, test.wantErr) {
t.Errorf("error mismatch:\nstored: %v\nnew: %v\nhead: %v\nerr: %v\nwant: %v", test.stored, test.new, test.head, err, test.wantErr)
}
}
}

View File

@ -17,8 +17,6 @@
package params
import (
"encoding/json"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
@ -47,372 +45,123 @@ var DAORefundContract = common.HexToAddress("0xbf4ed7b27f1d666546e30d74d50d173d2
// DAODrainList is the list of accounts whose full balances will be moved into a
// refund contract at the beginning of the dao-fork block.
var DAODrainList []common.Address
func init() {
// Parse the list of DAO accounts to drain
var list []map[string]string
if err := json.Unmarshal([]byte(daoDrainListJSON), &list); err != nil {
panic(fmt.Errorf("Failed to parse DAO drain list: %v", err))
}
// Collect all the accounts that need draining
for _, dao := range list {
DAODrainList = append(DAODrainList, common.HexToAddress(dao["address"]))
DAODrainList = append(DAODrainList, common.HexToAddress(dao["extraBalanceAccount"]))
func DAODrainList() []common.Address {
return []common.Address{
common.HexToAddress("0xd4fe7bc31cedb7bfb8a345f31e668033056b2728"),
common.HexToAddress("0xb3fb0e5aba0e20e5c49d252dfd30e102b171a425"),
common.HexToAddress("0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f"),
common.HexToAddress("0xecd135fa4f61a655311e86238c92adcd779555d2"),
common.HexToAddress("0x1975bd06d486162d5dc297798dfc41edd5d160a7"),
common.HexToAddress("0xa3acf3a1e16b1d7c315e23510fdd7847b48234f6"),
common.HexToAddress("0x319f70bab6845585f412ec7724b744fec6095c85"),
common.HexToAddress("0x06706dd3f2c9abf0a21ddcc6941d9b86f0596936"),
common.HexToAddress("0x5c8536898fbb74fc7445814902fd08422eac56d0"),
common.HexToAddress("0x6966ab0d485353095148a2155858910e0965b6f9"),
common.HexToAddress("0x779543a0491a837ca36ce8c635d6154e3c4911a6"),
common.HexToAddress("0x2a5ed960395e2a49b1c758cef4aa15213cfd874c"),
common.HexToAddress("0x5c6e67ccd5849c0d29219c4f95f1a7a93b3f5dc5"),
common.HexToAddress("0x9c50426be05db97f5d64fc54bf89eff947f0a321"),
common.HexToAddress("0x200450f06520bdd6c527622a273333384d870efb"),
common.HexToAddress("0xbe8539bfe837b67d1282b2b1d61c3f723966f049"),
common.HexToAddress("0x6b0c4d41ba9ab8d8cfb5d379c69a612f2ced8ecb"),
common.HexToAddress("0xf1385fb24aad0cd7432824085e42aff90886fef5"),
common.HexToAddress("0xd1ac8b1ef1b69ff51d1d401a476e7e612414f091"),
common.HexToAddress("0x8163e7fb499e90f8544ea62bbf80d21cd26d9efd"),
common.HexToAddress("0x51e0ddd9998364a2eb38588679f0d2c42653e4a6"),
common.HexToAddress("0x627a0a960c079c21c34f7612d5d230e01b4ad4c7"),
common.HexToAddress("0xf0b1aa0eb660754448a7937c022e30aa692fe0c5"),
common.HexToAddress("0x24c4d950dfd4dd1902bbed3508144a54542bba94"),
common.HexToAddress("0x9f27daea7aca0aa0446220b98d028715e3bc803d"),
common.HexToAddress("0xa5dc5acd6a7968a4554d89d65e59b7fd3bff0f90"),
common.HexToAddress("0xd9aef3a1e38a39c16b31d1ace71bca8ef58d315b"),
common.HexToAddress("0x63ed5a272de2f6d968408b4acb9024f4cc208ebf"),
common.HexToAddress("0x6f6704e5a10332af6672e50b3d9754dc460dfa4d"),
common.HexToAddress("0x77ca7b50b6cd7e2f3fa008e24ab793fd56cb15f6"),
common.HexToAddress("0x492ea3bb0f3315521c31f273e565b868fc090f17"),
common.HexToAddress("0x0ff30d6de14a8224aa97b78aea5388d1c51c1f00"),
common.HexToAddress("0x9ea779f907f0b315b364b0cfc39a0fde5b02a416"),
common.HexToAddress("0xceaeb481747ca6c540a000c1f3641f8cef161fa7"),
common.HexToAddress("0xcc34673c6c40e791051898567a1222daf90be287"),
common.HexToAddress("0x579a80d909f346fbfb1189493f521d7f48d52238"),
common.HexToAddress("0xe308bd1ac5fda103967359b2712dd89deffb7973"),
common.HexToAddress("0x4cb31628079fb14e4bc3cd5e30c2f7489b00960c"),
common.HexToAddress("0xac1ecab32727358dba8962a0f3b261731aad9723"),
common.HexToAddress("0x4fd6ace747f06ece9c49699c7cabc62d02211f75"),
common.HexToAddress("0x440c59b325d2997a134c2c7c60a8c61611212bad"),
common.HexToAddress("0x4486a3d68fac6967006d7a517b889fd3f98c102b"),
common.HexToAddress("0x9c15b54878ba618f494b38f0ae7443db6af648ba"),
common.HexToAddress("0x27b137a85656544b1ccb5a0f2e561a5703c6a68f"),
common.HexToAddress("0x21c7fdb9ed8d291d79ffd82eb2c4356ec0d81241"),
common.HexToAddress("0x23b75c2f6791eef49c69684db4c6c1f93bf49a50"),
common.HexToAddress("0x1ca6abd14d30affe533b24d7a21bff4c2d5e1f3b"),
common.HexToAddress("0xb9637156d330c0d605a791f1c31ba5890582fe1c"),
common.HexToAddress("0x6131c42fa982e56929107413a9d526fd99405560"),
common.HexToAddress("0x1591fc0f688c81fbeb17f5426a162a7024d430c2"),
common.HexToAddress("0x542a9515200d14b68e934e9830d91645a980dd7a"),
common.HexToAddress("0xc4bbd073882dd2add2424cf47d35213405b01324"),
common.HexToAddress("0x782495b7b3355efb2833d56ecb34dc22ad7dfcc4"),
common.HexToAddress("0x58b95c9a9d5d26825e70a82b6adb139d3fd829eb"),
common.HexToAddress("0x3ba4d81db016dc2890c81f3acec2454bff5aada5"),
common.HexToAddress("0xb52042c8ca3f8aa246fa79c3feaa3d959347c0ab"),
common.HexToAddress("0xe4ae1efdfc53b73893af49113d8694a057b9c0d1"),
common.HexToAddress("0x3c02a7bc0391e86d91b7d144e61c2c01a25a79c5"),
common.HexToAddress("0x0737a6b837f97f46ebade41b9bc3e1c509c85c53"),
common.HexToAddress("0x97f43a37f595ab5dd318fb46e7a155eae057317a"),
common.HexToAddress("0x52c5317c848ba20c7504cb2c8052abd1fde29d03"),
common.HexToAddress("0x4863226780fe7c0356454236d3b1c8792785748d"),
common.HexToAddress("0x5d2b2e6fcbe3b11d26b525e085ff818dae332479"),
common.HexToAddress("0x5f9f3392e9f62f63b8eac0beb55541fc8627f42c"),
common.HexToAddress("0x057b56736d32b86616a10f619859c6cd6f59092a"),
common.HexToAddress("0x9aa008f65de0b923a2a4f02012ad034a5e2e2192"),
common.HexToAddress("0x304a554a310c7e546dfe434669c62820b7d83490"),
common.HexToAddress("0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79"),
common.HexToAddress("0x4deb0033bb26bc534b197e61d19e0733e5679784"),
common.HexToAddress("0x07f5c1e1bc2c93e0402f23341973a0e043f7bf8a"),
common.HexToAddress("0x35a051a0010aba705c9008d7a7eff6fb88f6ea7b"),
common.HexToAddress("0x4fa802324e929786dbda3b8820dc7834e9134a2a"),
common.HexToAddress("0x9da397b9e80755301a3b32173283a91c0ef6c87e"),
common.HexToAddress("0x8d9edb3054ce5c5774a420ac37ebae0ac02343c6"),
common.HexToAddress("0x0101f3be8ebb4bbd39a2e3b9a3639d4259832fd9"),
common.HexToAddress("0x5dc28b15dffed94048d73806ce4b7a4612a1d48f"),
common.HexToAddress("0xbcf899e6c7d9d5a215ab1e3444c86806fa854c76"),
common.HexToAddress("0x12e626b0eebfe86a56d633b9864e389b45dcb260"),
common.HexToAddress("0xa2f1ccba9395d7fcb155bba8bc92db9bafaeade7"),
common.HexToAddress("0xec8e57756626fdc07c63ad2eafbd28d08e7b0ca5"),
common.HexToAddress("0xd164b088bd9108b60d0ca3751da4bceb207b0782"),
common.HexToAddress("0x6231b6d0d5e77fe001c2a460bd9584fee60d409b"),
common.HexToAddress("0x1cba23d343a983e9b5cfd19496b9a9701ada385f"),
common.HexToAddress("0xa82f360a8d3455c5c41366975bde739c37bfeb8a"),
common.HexToAddress("0x9fcd2deaff372a39cc679d5c5e4de7bafb0b1339"),
common.HexToAddress("0x005f5cee7a43331d5a3d3eec71305925a62f34b6"),
common.HexToAddress("0x0e0da70933f4c7849fc0d203f5d1d43b9ae4532d"),
common.HexToAddress("0xd131637d5275fd1a68a3200f4ad25c71a2a9522e"),
common.HexToAddress("0xbc07118b9ac290e4622f5e77a0853539789effbe"),
common.HexToAddress("0x47e7aa56d6bdf3f36be34619660de61275420af8"),
common.HexToAddress("0xacd87e28b0c9d1254e868b81cba4cc20d9a32225"),
common.HexToAddress("0xadf80daec7ba8dcf15392f1ac611fff65d94f880"),
common.HexToAddress("0x5524c55fb03cf21f549444ccbecb664d0acad706"),
common.HexToAddress("0x40b803a9abce16f50f36a77ba41180eb90023925"),
common.HexToAddress("0xfe24cdd8648121a43a7c86d289be4dd2951ed49f"),
common.HexToAddress("0x17802f43a0137c506ba92291391a8a8f207f487d"),
common.HexToAddress("0x253488078a4edf4d6f42f113d1e62836a942cf1a"),
common.HexToAddress("0x86af3e9626fce1957c82e88cbf04ddf3a2ed7915"),
common.HexToAddress("0xb136707642a4ea12fb4bae820f03d2562ebff487"),
common.HexToAddress("0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940"),
common.HexToAddress("0xf14c14075d6c4ed84b86798af0956deef67365b5"),
common.HexToAddress("0xca544e5c4687d109611d0f8f928b53a25af72448"),
common.HexToAddress("0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c"),
common.HexToAddress("0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7"),
common.HexToAddress("0x6d87578288b6cb5549d5076a207456a1f6a63dc0"),
common.HexToAddress("0xb2c6f0dfbb716ac562e2d85d6cb2f8d5ee87603e"),
common.HexToAddress("0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6"),
common.HexToAddress("0x2b3455ec7fedf16e646268bf88846bd7a2319bb2"),
common.HexToAddress("0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a"),
common.HexToAddress("0xd343b217de44030afaa275f54d31a9317c7f441e"),
common.HexToAddress("0x84ef4b2357079cd7a7c69fd7a37cd0609a679106"),
common.HexToAddress("0xda2fef9e4a3230988ff17df2165440f37e8b1708"),
common.HexToAddress("0xf4c64518ea10f995918a454158c6b61407ea345c"),
common.HexToAddress("0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97"),
common.HexToAddress("0xbb9bc244d798123fde783fcc1c72d3bb8c189413"),
common.HexToAddress("0x807640a13483f8ac783c557fcdf27be11ea4ac7a"),
}
}
// daoDrainListJSON is the JSON encoded list of accounts whose full balances will
// be moved into a refund contract at the beginning of the dao-fork block.
const daoDrainListJSON = `
[
{
"address":"0xd4fe7bc31cedb7bfb8a345f31e668033056b2728",
"balance":"186cc8bfaefb7be",
"extraBalance":"0",
"extraBalanceAccount":"0xb3fb0e5aba0e20e5c49d252dfd30e102b171a425"
},
{
"address":"0x2c19c7f9ae8b751e37aeb2d93a699722395ae18f",
"balance":"b14e8feab1ff435",
"extraBalance":"0",
"extraBalanceAccount":"0xecd135fa4f61a655311e86238c92adcd779555d2"
},
{
"address":"0x1975bd06d486162d5dc297798dfc41edd5d160a7",
"balance":"359d26614cb5070c77",
"extraBalance":"0",
"extraBalanceAccount":"0xa3acf3a1e16b1d7c315e23510fdd7847b48234f6"
},
{
"address":"0x319f70bab6845585f412ec7724b744fec6095c85",
"balance":"6e075cd846d2cb1d42",
"extraBalance":"13d34fd41b545b81",
"extraBalanceAccount":"0x06706dd3f2c9abf0a21ddcc6941d9b86f0596936"
},
{
"address":"0x5c8536898fbb74fc7445814902fd08422eac56d0",
"balance":"b1e5593558008fd78",
"extraBalance":"0",
"extraBalanceAccount":"0x6966ab0d485353095148a2155858910e0965b6f9"
},
{
"address":"0x779543a0491a837ca36ce8c635d6154e3c4911a6",
"balance":"392eaa20d1aad59a4c",
"extraBalance":"426938826a96c9",
"extraBalanceAccount":"0x2a5ed960395e2a49b1c758cef4aa15213cfd874c"
},
{
"address":"0x5c6e67ccd5849c0d29219c4f95f1a7a93b3f5dc5",
"balance":"2875d22b29793d4ba7",
"extraBalance":"0",
"extraBalanceAccount":"0x9c50426be05db97f5d64fc54bf89eff947f0a321"
},
{
"address":"0x200450f06520bdd6c527622a273333384d870efb",
"balance":"43c341d9f96954c049",
"extraBalance":"0",
"extraBalanceAccount":"0xbe8539bfe837b67d1282b2b1d61c3f723966f049"
},
{
"address":"0x6b0c4d41ba9ab8d8cfb5d379c69a612f2ced8ecb",
"balance":"75251057154d70fa816",
"extraBalance":"0",
"extraBalanceAccount":"0xf1385fb24aad0cd7432824085e42aff90886fef5"
},
{
"address":"0xd1ac8b1ef1b69ff51d1d401a476e7e612414f091",
"balance":"392409769296cf67f36",
"extraBalance":"0",
"extraBalanceAccount":"0x8163e7fb499e90f8544ea62bbf80d21cd26d9efd"
},
{
"address":"0x51e0ddd9998364a2eb38588679f0d2c42653e4a6",
"balance":"8ac72eccbf4e8083",
"extraBalance":"0",
"extraBalanceAccount":"0x627a0a960c079c21c34f7612d5d230e01b4ad4c7"
},
{
"address":"0xf0b1aa0eb660754448a7937c022e30aa692fe0c5",
"balance":"82289c3bb3e8c98799",
"extraBalance":"0",
"extraBalanceAccount":"0x24c4d950dfd4dd1902bbed3508144a54542bba94"
},
{
"address":"0x9f27daea7aca0aa0446220b98d028715e3bc803d",
"balance":"56bc29049ebed40fd",
"extraBalance":"0",
"extraBalanceAccount":"0xa5dc5acd6a7968a4554d89d65e59b7fd3bff0f90"
},
{
"address":"0xd9aef3a1e38a39c16b31d1ace71bca8ef58d315b",
"balance":"56bc7d3ff79110524",
"extraBalance":"0",
"extraBalanceAccount":"0x63ed5a272de2f6d968408b4acb9024f4cc208ebf"
},
{
"address":"0x6f6704e5a10332af6672e50b3d9754dc460dfa4d",
"balance":"23b651bd48cbc70cc",
"extraBalance":"0",
"extraBalanceAccount":"0x77ca7b50b6cd7e2f3fa008e24ab793fd56cb15f6"
},
{
"address":"0x492ea3bb0f3315521c31f273e565b868fc090f17",
"balance":"13ea6d4fee651dd7c9",
"extraBalance":"0",
"extraBalanceAccount":"0x0ff30d6de14a8224aa97b78aea5388d1c51c1f00"
},
{
"address":"0x9ea779f907f0b315b364b0cfc39a0fde5b02a416",
"balance":"35ac471a3836ae7de5a",
"extraBalance":"0",
"extraBalanceAccount":"0xceaeb481747ca6c540a000c1f3641f8cef161fa7"
},
{
"address":"0xcc34673c6c40e791051898567a1222daf90be287",
"balance":"d529c0b76b7aa0",
"extraBalance":"0",
"extraBalanceAccount":"0x579a80d909f346fbfb1189493f521d7f48d52238"
},
{
"address":"0xe308bd1ac5fda103967359b2712dd89deffb7973",
"balance":"5cd9e7df3a8e5cdd3",
"extraBalance":"0",
"extraBalanceAccount":"0x4cb31628079fb14e4bc3cd5e30c2f7489b00960c"
},
{
"address":"0xac1ecab32727358dba8962a0f3b261731aad9723",
"balance":"2c8442fe35363313b93",
"extraBalance":"0",
"extraBalanceAccount":"0x4fd6ace747f06ece9c49699c7cabc62d02211f75"
},
{
"address":"0x440c59b325d2997a134c2c7c60a8c61611212bad",
"balance":"e77583a3958130e53",
"extraBalance":"0",
"extraBalanceAccount":"0x4486a3d68fac6967006d7a517b889fd3f98c102b"
},
{
"address":"0x9c15b54878ba618f494b38f0ae7443db6af648ba",
"balance":"1f0b6ade348ca998",
"extraBalance":"0",
"extraBalanceAccount":"0x27b137a85656544b1ccb5a0f2e561a5703c6a68f"
},
{
"address":"0x21c7fdb9ed8d291d79ffd82eb2c4356ec0d81241",
"balance":"61725880736659",
"extraBalance":"0",
"extraBalanceAccount":"0x23b75c2f6791eef49c69684db4c6c1f93bf49a50"
},
{
"address":"0x1ca6abd14d30affe533b24d7a21bff4c2d5e1f3b",
"balance":"42948d8dc7ddbc22d",
"extraBalance":"0",
"extraBalanceAccount":"0xb9637156d330c0d605a791f1c31ba5890582fe1c"
},
{
"address":"0x6131c42fa982e56929107413a9d526fd99405560",
"balance":"7306683851d1eafbfa",
"extraBalance":"0",
"extraBalanceAccount":"0x1591fc0f688c81fbeb17f5426a162a7024d430c2"
},
{
"address":"0x542a9515200d14b68e934e9830d91645a980dd7a",
"balance":"2a8457d0d8432e21d0c",
"extraBalance":"0",
"extraBalanceAccount":"0xc4bbd073882dd2add2424cf47d35213405b01324"
},
{
"address":"0x782495b7b3355efb2833d56ecb34dc22ad7dfcc4",
"balance":"d8d7391feaeaa8cdb",
"extraBalance":"0",
"extraBalanceAccount":"0x58b95c9a9d5d26825e70a82b6adb139d3fd829eb"
},
{
"address":"0x3ba4d81db016dc2890c81f3acec2454bff5aada5",
"balance":"1",
"extraBalance":"0",
"extraBalanceAccount":"0xb52042c8ca3f8aa246fa79c3feaa3d959347c0ab"
},
{
"address":"0xe4ae1efdfc53b73893af49113d8694a057b9c0d1",
"balance":"456397665fa74041",
"extraBalance":"0",
"extraBalanceAccount":"0x3c02a7bc0391e86d91b7d144e61c2c01a25a79c5"
},
{
"address":"0x0737a6b837f97f46ebade41b9bc3e1c509c85c53",
"balance":"6324dcb7126ecbef",
"extraBalance":"0",
"extraBalanceAccount":"0x97f43a37f595ab5dd318fb46e7a155eae057317a"
},
{
"address":"0x52c5317c848ba20c7504cb2c8052abd1fde29d03",
"balance":"6c3419b0705c01cd0d",
"extraBalance":"0",
"extraBalanceAccount":"0x4863226780fe7c0356454236d3b1c8792785748d"
},
{
"address":"0x5d2b2e6fcbe3b11d26b525e085ff818dae332479",
"balance":"456397665fa74041",
"extraBalance":"0",
"extraBalanceAccount":"0x5f9f3392e9f62f63b8eac0beb55541fc8627f42c"
},
{
"address":"0x057b56736d32b86616a10f619859c6cd6f59092a",
"balance":"232c025bb44b46",
"extraBalance":"0",
"extraBalanceAccount":"0x9aa008f65de0b923a2a4f02012ad034a5e2e2192"
},
{
"address":"0x304a554a310c7e546dfe434669c62820b7d83490",
"balance":"3034f5ca7d45e17df199b",
"extraBalance":"f7d15162c44e97b6e",
"extraBalanceAccount":"0x914d1b8b43e92723e64fd0a06f5bdb8dd9b10c79"
},
{
"address":"0x4deb0033bb26bc534b197e61d19e0733e5679784",
"balance":"4417e96ed796591e09",
"extraBalance":"0",
"extraBalanceAccount":"0x07f5c1e1bc2c93e0402f23341973a0e043f7bf8a"
},
{
"address":"0x35a051a0010aba705c9008d7a7eff6fb88f6ea7b",
"balance":"d3ff7771412bbcc9",
"extraBalance":"0",
"extraBalanceAccount":"0x4fa802324e929786dbda3b8820dc7834e9134a2a"
},
{
"address":"0x9da397b9e80755301a3b32173283a91c0ef6c87e",
"balance":"32ae324c233816b4c2",
"extraBalance":"0",
"extraBalanceAccount":"0x8d9edb3054ce5c5774a420ac37ebae0ac02343c6"
},
{
"address":"0x0101f3be8ebb4bbd39a2e3b9a3639d4259832fd9",
"balance":"1e530695b705f037c6",
"extraBalance":"0",
"extraBalanceAccount":"0x5dc28b15dffed94048d73806ce4b7a4612a1d48f"
},
{
"address":"0xbcf899e6c7d9d5a215ab1e3444c86806fa854c76",
"balance":"68013bad5b4b1133fc5",
"extraBalance":"0",
"extraBalanceAccount":"0x12e626b0eebfe86a56d633b9864e389b45dcb260"
},
{
"address":"0xa2f1ccba9395d7fcb155bba8bc92db9bafaeade7",
"balance":"456397665fa74041",
"extraBalance":"0",
"extraBalanceAccount":"0xec8e57756626fdc07c63ad2eafbd28d08e7b0ca5"
},
{
"address":"0xd164b088bd9108b60d0ca3751da4bceb207b0782",
"balance":"3635ce47fabaaa336e",
"extraBalance":"0",
"extraBalanceAccount":"0x6231b6d0d5e77fe001c2a460bd9584fee60d409b"
},
{
"address":"0x1cba23d343a983e9b5cfd19496b9a9701ada385f",
"balance":"f3abd9906c170a",
"extraBalance":"0",
"extraBalanceAccount":"0xa82f360a8d3455c5c41366975bde739c37bfeb8a"
},
{
"address":"0x9fcd2deaff372a39cc679d5c5e4de7bafb0b1339",
"balance":"4c6679d9d9b95a4e08",
"extraBalance":"0",
"extraBalanceAccount":"0x005f5cee7a43331d5a3d3eec71305925a62f34b6"
},
{
"address":"0x0e0da70933f4c7849fc0d203f5d1d43b9ae4532d",
"balance":"40f622936475de31849",
"extraBalance":"671e1bbabded39754",
"extraBalanceAccount":"0xd131637d5275fd1a68a3200f4ad25c71a2a9522e"
},
{
"address":"0xbc07118b9ac290e4622f5e77a0853539789effbe",
"balance":"1316ccfa4a35db5e58f",
"extraBalance":"0",
"extraBalanceAccount":"0x47e7aa56d6bdf3f36be34619660de61275420af8"
},
{
"address":"0xacd87e28b0c9d1254e868b81cba4cc20d9a32225",
"balance":"b3ad6bb72000bab9f",
"extraBalance":"0",
"extraBalanceAccount":"0xadf80daec7ba8dcf15392f1ac611fff65d94f880"
},
{
"address":"0x5524c55fb03cf21f549444ccbecb664d0acad706",
"balance":"16f2da372a5c8a70967",
"extraBalance":"0",
"extraBalanceAccount":"0x40b803a9abce16f50f36a77ba41180eb90023925"
},
{
"address":"0xfe24cdd8648121a43a7c86d289be4dd2951ed49f",
"balance":"ea0b1bdc78f500a43",
"extraBalance":"0",
"extraBalanceAccount":"0x17802f43a0137c506ba92291391a8a8f207f487d"
},
{
"address":"0x253488078a4edf4d6f42f113d1e62836a942cf1a",
"balance":"3060e3aed135cc80",
"extraBalance":"0",
"extraBalanceAccount":"0x86af3e9626fce1957c82e88cbf04ddf3a2ed7915"
},
{
"address":"0xb136707642a4ea12fb4bae820f03d2562ebff487",
"balance":"6050bdeb3354b5c98adc3",
"extraBalance":"0",
"extraBalanceAccount":"0xdbe9b615a3ae8709af8b93336ce9b477e4ac0940"
},
{
"address":"0xf14c14075d6c4ed84b86798af0956deef67365b5",
"balance":"1d77844e94c25ba2",
"extraBalance":"0",
"extraBalanceAccount":"0xca544e5c4687d109611d0f8f928b53a25af72448"
},
{
"address":"0xaeeb8ff27288bdabc0fa5ebb731b6f409507516c",
"balance":"2e93a72de4fc5ec0ed",
"extraBalance":"0",
"extraBalanceAccount":"0xcbb9d3703e651b0d496cdefb8b92c25aeb2171f7"
},
{
"address":"0x6d87578288b6cb5549d5076a207456a1f6a63dc0",
"balance":"1afd340799e48c18",
"extraBalance":"0",
"extraBalanceAccount":"0xb2c6f0dfbb716ac562e2d85d6cb2f8d5ee87603e"
},
{
"address":"0xaccc230e8a6e5be9160b8cdf2864dd2a001c28b6",
"balance":"14d0944eb3be947a8",
"extraBalance":"0",
"extraBalanceAccount":"0x2b3455ec7fedf16e646268bf88846bd7a2319bb2"
},
{
"address":"0x4613f3bca5c44ea06337a9e439fbc6d42e501d0a",
"balance":"6202b236a200e365eba",
"extraBalance":"11979be9020f03ec4ec",
"extraBalanceAccount":"0xd343b217de44030afaa275f54d31a9317c7f441e"
},
{
"address":"0x84ef4b2357079cd7a7c69fd7a37cd0609a679106",
"balance":"7ed634ebbba531901e07",
"extraBalance":"f9c5eff28cb08720c85",
"extraBalanceAccount":"0xda2fef9e4a3230988ff17df2165440f37e8b1708"
},
{
"address":"0xf4c64518ea10f995918a454158c6b61407ea345c",
"balance":"39152e15508a96ff894a",
"extraBalance":"14041ca908bcc185c8",
"extraBalanceAccount":"0x7602b46df5390e432ef1c307d4f2c9ff6d65cc97"
},
{
"address":"0xbb9bc244d798123fde783fcc1c72d3bb8c189413",
"balance":"1",
"extraBalance":"5553ebc",
"extraBalanceAccount":"0x807640a13483f8ac783c557fcdf27be11ea4ac7a"
}
]
`