op-geth/eth
Felix Lange 37dd9086ec 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.
2017-03-23 15:58:43 +01:00
..
downloader all: import "context" instead of "golang.org/x/net/context" 2017-03-22 20:49:15 +01:00
fetcher Logger updates 3 (#3730) 2017-03-02 14:06:16 +01:00
filters core: refactor genesis handling 2017-03-23 15:58:43 +01:00
gasprice all: import "context" instead of "golang.org/x/net/context" 2017-03-22 20:49:15 +01:00
api.go all: import "context" instead of "golang.org/x/net/context" 2017-03-22 20:49:15 +01:00
api_backend.go all: import "context" instead of "golang.org/x/net/context" 2017-03-22 20:49:15 +01:00
backend.go core: refactor genesis handling 2017-03-23 15:58:43 +01:00
backend_test.go core: refactor genesis handling 2017-03-23 15:58:43 +01:00
bad_block.go Logger updates 3 (#3730) 2017-03-02 14:06:16 +01:00
bind.go all: import "context" instead of "golang.org/x/net/context" 2017-03-22 20:49:15 +01:00
db_upgrade.go Logger updates 3 (#3730) 2017-03-02 14:06:16 +01:00
handler.go all: update light logs (and a few others) to the new model 2017-03-03 11:41:52 +02:00
handler_test.go core: refactor genesis handling 2017-03-23 15:58:43 +01:00
helper_test.go core: refactor genesis handling 2017-03-23 15:58:43 +01:00
metrics.go eth, eth/downloader, eth/fetcher: delete eth/61 code 2016-07-22 13:17:19 +02:00
peer.go all: update light logs (and a few others) to the new model 2017-03-03 11:41:52 +02:00
protocol.go core: bugfix state change race condition in txpool (#3412) 2016-12-10 23:54:58 +01:00
protocol_test.go eth, les: shorten genesis block mismatch error message 2017-02-27 17:19:41 +01:00
sync.go core, eth, les: support resuming fast sync on heavy rollback (#3743) 2017-03-22 01:37:24 +01:00
sync_test.go eth: skip transaction handling during fast sync 2016-05-17 14:17:20 +03:00