Merge branch 'master' into patch-5
This commit is contained in:
commit
beddfe4295
|
@ -16,6 +16,7 @@ Accompanying documents can be found in [specs](specs) and include
|
|||
* [SimpleSerialize (SSZ) spec](specs/simple-serialize.md)
|
||||
* [BLS signature verification](specs/bls_signature.md)
|
||||
* [General test format](specs/test-format.md)
|
||||
* [Honest validator implementation doc](specs/validator/0_beacon-chain-validator.md)
|
||||
|
||||
## Design goals
|
||||
The following are the broad design goals for Ethereum 2.0:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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**
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue