* Typing problem fixed: `process_block_header` passes `Bytes32()` to `state_root` of `BeaconBlockHeader`, which type is `Root`
* Typing problem fixed in `initialize_beacon_state_from_eth1`: `len` returns an `int` value, while `deposit_count=uint64` of `Eth1Data` has type `uint64`
* Typing problem fixed in `process_rewards_and_penalties`: `numerator` of type `int` passed to `weight` parameter of `get_flag_index_deltas`, which has type `uint64`
* Typing problem fixed in `process_attestation`; `False` passes as `crosslink_success` parameter of `PendingAttestation`, which has type `boolean`. `False` is an instance of `(python.)bool` and is not an instance of `(ssz.)boolean`
* Typing problem fixed: `shard_data_roots` of `ShardTransition` has type `List[Bytes32]`, but its elements are used as if they were `Root` values, e.g. in `process_chunk_challenge` method: passed to `data_root` of `CustodyChunkChallengeRecord` which has type `Root`
* Typing problem fixed in `process_custody_final_updates`: `index` has type `int`, while `validator_indices_in_records` has type `Set[ValidatorIndex]`, so tesing whether `index in validator_indices_in_records` can be risky, depending on implementation details. `ValidatorIndex(index) in validator_indices_in_records` is a safer variant.
* Typing problem fixed: `slashed` parameter of `pack_compact_validator` has type `(python.)bool`, however in `committee_to_compact_committee` a value of `(ssz.)boolean` is passed as a value of the parameter
* Typing problem fixed: `inactivity_scores` is a `List[uint64,...]`, while it is intialized/appended with values of `(python.)int` type
* fixed according to @protolambda suggestions
* changed types of _WEIGHT constants and appropriate variables/parameters, according to @protolambda suggestions
* revert code formatting back
* Introduced ZERO_ROOT according to @protolambda 's suggestion
* Reverted back to , according to @protolambda comments
Miscellaneous cosmetic cleanups to the " BLS signatures" section:
1) fix section capitalisation for spec consistency
2) avoid uncapitalised "eth2" for spec consistency
3) avoid contractions (such as `PK` for `pubkey`) for spec consistency
4) various copyedits
`data.target.epoch` is used to count the active validator set.
Because `get_committee_count_per_slot` is extremely inefficient the way
the spec is written, clients cache it, or the underlying active
validator set.
Performing the checks in the given order leads to a (very unlikely)
security issue where the a cold and above all, distant value may get
used which may be costly - reordering the checks brings the value into a
more reasonable range before using it.
Rename `bytes_to_int` to `bytes_to_uint64`
Use `encode_bytes` to implement `int_to_bytes`
Rename `int_to_bytes` to `uint_to_bytes` and move it to `ssz_impl.py`