Merge branch 'master' into JustinDrake-patch-1

This commit is contained in:
Danny Ryan 2019-01-28 09:15:08 -07:00
commit b6fcf3272e
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
3 changed files with 280 additions and 220 deletions

File diff suppressed because it is too large Load Diff

View File

@ -143,11 +143,8 @@ Lists are a collection of elements of the same homogeneous type.
|:--------------------------------------------|:----------------------------|
| Length of serialized list fits into 4 bytes | ``len(serialized) < 2**32`` |
1. Get the number of raw bytes to serialize: it is ``len(list) * sizeof(element)``.
* Encode that as a `4-byte` **little endian** `uint32`.
2. Append the elements in a packed manner.
* *Note on efficiency*: consider using a container that does not need to iterate over all elements to get its length. For example Python lists, C++ vectors or Rust Vec.
1. Serialize all list elements individually and concatenate them.
2. Prefix the concatenation with its length encoded as a `4-byte` **little-endian** unsigned integer.
**Example in Python**

View File

@ -158,12 +158,12 @@ _Note_: To calculate `state_root`, the validator should first run the state tran
##### Randao reveal
Set `block.randao_reveal = reveal_signature` where `reveal_signature` is defined as:
Set `block.randao_reveal = epoch_signature` where `epoch_signature` is defined as:
```python
reveal_signature = bls_sign(
epoch_signature = bls_sign(
privkey=validator.privkey, # privkey store locally, not in state
message=int_to_bytes32(validator.proposer_slots + 1),
message=int_to_bytes32(block.slot // EPOCH_LENGTH),
domain=get_domain(
fork_data, # `fork_data` is the fork_data at the slot `block.slot`
block.slot,