* begin 0.5.0 spec update: parent_root -> previous_block_root, BeaconState.justified_epoch -> BeaconState.current_justified_epoch, DOMAIN_PROPOSAL -> DOMAIN_BEACON_BLOCK, temporarily rename BeaconBlockHeader to BeaconBlockHeaderRLP to allow for gradual re-merging without disrupting RLP; mark a few unchanged functions and data types, implement get_temporary_block_header/get_empty_block/should_update_validator_registry/processBlockHeader/cacheState; update a few others
* a dozen or so more trivial mostly comment changes, finding more unchanged parts of 0.5.0
* several more trivial changes; goal is to reduce noise around the upcoming substantial changes (epoch processing, etc)
* remove some redundant state updates
* when attesting late, use correct state / head
* don't send out obsolete attestations
* don't propose obsolete blocks
* remove some more resundant state updates :)
* simplify block logging (experimental)
* document fork choice division
* fix some Slot / Epoch conversion warnings
* keep track of a finalized block
* keep track of all justified blocks
* use naive spec version of LMD ghost
* cache slot number and a few more things in BlockRef
* keep track of the latest vote of each validator
* depend less on the state of node.state (it's a cache, effectively)
Passing along no-name command line arguments when using make (from Nimbus) would need make target revamps that are a bit clumsy AFAIK, so using environment variables in the spirit of USE_MULTITAIL to get the number of validators and nodes makes more sense to me.
This lets us run the sim from nim-beacon-chain with
```bash
VALIDATORS=512 NODES=100 USE_MULTITAIL="yes" tests/simulation/start.sh
```
and from Nimbus with:
```bash
VALIDATORS=512 NODES=100 USE_MULTITAIL="yes" make eth2_network_simulation
```
Also makes for a more verbose launch process.
To enable it, comment out the 'withLibp2p' line in nim.cfg
The history was squashed in order to remove an accidentally
commited binary file.
Other changes:
* SSZ was adapted to use the common serialization framework
* gossibsup.subscribe is not using async handlers at the moment
and this allowed me to simplify it
* set epoch_boundary_root - chain finalizes!
* fix slotStart to offset GENESIS_SLOT
* work around bug that will be fixed by
https://github.com/ethereum/eth2.0-specs/pull/732
* compile with debug info (there was a GC-related crash in C land)
* fix state db lookup typo
* fix randao reveal slot when proposing blocks
* only store blocks that can be applied to a state
* store state at every epoch boundary (yes, needs pruning!)
* split out state advancement function when there's no block
* default state sim to 0.9 attestation ratio
* processEpoch 5x faster, total 2x faster, with 16k validators
* don't recompute active_validator_indices as much
* remove duplicate process_ejections function
* allow running more or fewer validators
* use deterministic key generation for tests to avoid exhausting system
RNG
* update README with simulator docs
* write the data of each validator to separate file, instead of a big
chainstart.json (makes it easier to run different validator counts)
* prevent balance underflow, per spec implementation note
* verify that permutation shuffing works: add YAML dependency to be used for ingesting test cases; switch from blake2 to keccak256 to match EF test cases; remove inefficient naive-spec-version of shuffling algorithm now that protolambda's can be tested directly