Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.12.1 #1868

Merged
merged 49 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
5630934
Use `Bytes32` for `error_message`
arnetheduck May 21, 2020
5e8457e
Fix phase1 on-time sign_indexed_attestation
hwwhww May 23, 2020
ce1d22d
Use helper `compute_previous_slot`
terencechain May 23, 2020
d3c26d6
`compute_shard_transition_digest` expects `Root` as a fourth parameter
ericsson49 May 25, 2020
75787d9
broken link
0xalizk May 25, 2020
0520b1c
Merge pull request #1845 from aliatiia/patch-1
djrtwo May 26, 2020
753a25e
Merge pull request #1843 from terencechain/patch-99
djrtwo May 26, 2020
d020d49
Merge pull request #1842 from ethereum/phase1_on_time_sign_indexed_at…
djrtwo May 26, 2020
8eb1d2e
Merge pull request #1844 from ericsson49/ericsson49/fix_shard_state_t…
djrtwo May 26, 2020
75633cf
Update link so gossipsub encodings match the correct section
ralexstokes May 26, 2020
05b1d91
Merge pull request #1847 from ethereum/networking-misc-fixes
djrtwo May 26, 2020
c437578
Add `shard` field to `ShardBlock`
hwwhww May 28, 2020
ca48963
Rename `head_shard_root` to `shard_head_root`
hwwhww May 28, 2020
8c9bbc4
Rework `is_shard_attestation`
hwwhww May 28, 2020
1926288
Rename `verify_shard_transition_false_positives` to `verify_empty_sha…
hwwhww May 28, 2020
7509ecb
Add comments, minor refactoring
hwwhww May 28, 2020
8ae7f5b
Refactor `is_valid_indexed_attestation`: extract `verify_attestation_…
hwwhww May 28, 2020
4cbe51b
Merge pull request #1853 from ethereum/hwwhww/shard_block
djrtwo May 28, 2020
bd9f983
Minor fix
hwwhww May 28, 2020
b16e6d7
PR feedback from Danny
hwwhww May 29, 2020
f70224b
Extract `compute_committee_source_epoch`
hwwhww May 29, 2020
9b9507c
Merge branch 'dev' into hwwhww/phase1_refactor_part2
hwwhww May 29, 2020
cceeab2
Combine `process_crosslinks` and `verify_empty_shard_transition` into…
hwwhww May 28, 2020
327deb4
Adjust function blocks
hwwhww May 28, 2020
437b2eb
Update fork choice spec comment for clarity
ralexstokes May 30, 2020
33e115f
Clean up remaining `[]` List syntax
arnetheduck May 30, 2020
82f9f3e
Merge pull request #1859 from ethereum/ralexstokes-patch-1
djrtwo May 31, 2020
8f570b4
Merge pull request #1854 from ethereum/hwwhww/phase1_refactor
hwwhww Jun 1, 2020
8e5db1b
Merge pull request #1856 from ethereum/hwwhww/verify_empty_shard_tran…
hwwhww Jun 1, 2020
6317bd6
PR feedback from Danny
hwwhww Jun 1, 2020
31127b7
Merge branch 'dev' into hwwhww/phase1_refactor_part2
hwwhww Jun 1, 2020
09d8636
Merge pull request #1855 from ethereum/hwwhww/phase1_refactor_part2
hwwhww Jun 1, 2020
2a21852
Tidying up `shard_state_transition`
terencechain Jun 1, 2020
c6aac16
Reword fork choice comment
paulhauner Jun 2, 2020
2a125e8
Update fork-choice.md
paulhauner Jun 2, 2020
bdf9f02
Merge pull request #1864 from paulhauner/patch-21
djrtwo Jun 2, 2020
2442794
Moved transition_digest to last
terencechain Jun 2, 2020
3441213
phase0: enable a tunable genesis time
q9f Jun 1, 2020
b3f2d81
reflect changes in mainnet.yaml
q9f Jun 1, 2020
d5ed78e
reflect changes in minimal.yaml
q9f Jun 1, 2020
671fae6
change note about genesis delay in p2p spec to match new GENESIS_DELA…
djrtwo Jun 2, 2020
06dfff0
add comment about default of 0x00 for genesis finalized checkpoint in…
djrtwo Jun 2, 2020
cf7b999
clarify `head_root` is for a `BeaconBlock`
djrtwo Jun 2, 2020
1f470b3
Merge pull request #1867 from ethereum/p2p-genesis-root
protolambda Jun 2, 2020
e814d52
Merge pull request #1866 from ethereum/tunable-genesis
protolambda Jun 2, 2020
09b387b
Merge pull request #1862 from terencechain/patch-100
djrtwo Jun 2, 2020
cc5116b
Merge pull request #1837 from status-im/ssz-string
djrtwo Jun 2, 2020
314dea9
bump VERSION.txt to 0.12.1
djrtwo Jun 2, 2020
8ad2e93
Merge pull request #1869 from ethereum/bump-v0121
djrtwo Jun 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ BLS_WITHDRAWAL_PREFIX: 0x00

# Time parameters
# ---------------------------------------------------------------
# 86400 seconds (1 day)
MIN_GENESIS_DELAY: 86400
# 172800 seconds (2 days)
GENESIS_DELAY: 172800
# 12 seconds
SECONDS_PER_SLOT: 12
# 2**0 (= 1) slots 12 seconds
Expand Down
2 changes: 1 addition & 1 deletion configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ BLS_WITHDRAWAL_PREFIX: 0x00
# Time parameters
# ---------------------------------------------------------------
# [customized] Faster to spin up testnets, but does not give validator reasonable warning time for genesis
MIN_GENESIS_DELAY: 300
GENESIS_DELAY: 300
# [customized] Faster for testing purposes
SECONDS_PER_SLOT: 6
# 2**0 (= 1) slots 6 seconds
Expand Down
6 changes: 3 additions & 3 deletions specs/phase0/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ The following values are (non-configurable) constants used throughout the specif

| Name | Value | Unit | Duration |
| - | - | :-: | :-: |
| `MIN_GENESIS_DELAY` | `86400` | seconds | 1 day |
| `GENESIS_DELAY` | `172800` | seconds | 2 days |
| `SECONDS_PER_SLOT` | `12` | seconds | 12 seconds |
| `SECONDS_PER_ETH1_BLOCK` | `14` | seconds | 14 seconds |
| `MIN_ATTESTATION_INCLUSION_DELAY` | `2**0` (= 1) | slots | 12 seconds |
Expand Down Expand Up @@ -1137,7 +1137,7 @@ Before the Ethereum 2.0 genesis has been triggered, and for every Ethereum 1.0 b
- `eth1_timestamp` is the Unix timestamp corresponding to `eth1_block_hash`
- `deposits` is the sequence of all deposits, ordered chronologically, up to (and including) the block with hash `eth1_block_hash`

Eth1 blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `MIN_GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case.
Eth1 blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case.

```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32,
Expand All @@ -1149,7 +1149,7 @@ def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32,
epoch=GENESIS_EPOCH,
)
state = BeaconState(
genesis_time=eth1_timestamp - eth1_timestamp % MIN_GENESIS_DELAY + 2 * MIN_GENESIS_DELAY,
genesis_time=eth1_timestamp + GENESIS_DELAY,
fork=fork,
eth1_data=Eth1Data(block_hash=eth1_block_hash, deposit_count=len(deposits)),
latest_block_header=BeaconBlockHeader(body_root=hash_tree_root(BeaconBlockBody())),
Expand Down
4 changes: 2 additions & 2 deletions specs/phase0/fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_ancestor(store: Store, root: Root, slot: Slot) -> Root:
elif block.slot == slot:
return root
else:
# root is older than queried slot, thus a skip slot. Return earliest root prior to slot
# root is older than queried slot, thus a skip slot. Return most recent root prior to slot
return root
```

Expand Down Expand Up @@ -285,7 +285,7 @@ def validate_on_attestation(store: Store, attestation: Attestation) -> None:
# Attestations must not be for blocks in the future. If not, the attestation should not be considered
assert store.blocks[attestation.data.beacon_block_root].slot <= attestation.data.slot

# FFG and LMD vote must be consistent with each other
# LMD vote must be consistent with FFG vote target
target_slot = compute_start_slot_at_epoch(target.epoch)
assert target.root == get_ancestor(store, attestation.data.beacon_block_root, target_slot)

Expand Down
27 changes: 15 additions & 12 deletions specs/phase0/p2p-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ This section outlines constants that are used in this spec.
| Name | Value | Description |
|---|---|---|
| `GOSSIP_MAX_SIZE` | `2**20` (= 1048576, 1 MiB) | The maximum allowed size of uncompressed gossip messages. |
| `MAX_REQUEST_BLOCKS` | `2**10` (= 1024) | Maximum number of blocks in a single request |
| `MAX_CHUNK_SIZE` | `2**20` (1048576, 1 MiB) | The maximum allowed size of uncompressed req/resp chunked responses. |
| `TTFB_TIMEOUT` | `5s` | The maximum time to wait for first byte of request response (time-to-first-byte). |
| `RESP_TIMEOUT` | `10s` | The maximum time for complete response transfer. |
Expand Down Expand Up @@ -203,7 +204,7 @@ Topics are plain UTF-8 strings and are encoded on the wire as determined by prot
- `current_fork_version` is the fork version of the epoch of the message to be sent on the topic
- `genesis_validators_root` is the static `Root` found in `state.genesis_validators_root`
- `Name` - see table below
- `Encoding` - the encoding strategy describes a specific representation of bytes that will be transmitted over the wire. See the [Encodings](#Encoding-strategies) section for further details.
- `Encoding` - the encoding strategy describes a specific representation of bytes that will be transmitted over the wire. See the [Encodings](#Encodings) section for further details.

*Note*: `ForkDigestValue` is composed of values that are not known until the genesis block/state are available. Due to this, clients SHOULD NOT subscribe to gossipsub topics until these genesis values are known.

Expand Down Expand Up @@ -391,11 +392,11 @@ The `ErrorMessage` schema is:

```
(
error_message: String
error_message: List[byte, 256]
)
```

*Note*: The String type is encoded as UTF-8 bytes without NULL terminator when SSZ-encoded. As the `ErrorMessage` is not an SSZ-container, only the UTF-8 bytes will be sent when SSZ-encoded.
*Note*: By convention, the `error_message` is a sequence of bytes that MAY be interpreted as a UTF-8 string (for debugging purposes). Clients MUST treat as valid any byte sequences.

### Encoding strategies

Expand Down Expand Up @@ -443,9 +444,9 @@ In case of an invalid input (header or payload), a reader MUST:

All messages that contain only a single field MUST be encoded directly as the type of that field and MUST NOT be encoded as an SSZ container.

Responses that are SSZ-lists (for example `[]SignedBeaconBlock`) send their
Responses that are SSZ-lists (for example `List[SignedBeaconBlock, ...]`) send their
constituents individually as `response_chunk`s. For example, the
`[]SignedBeaconBlock` response type sends zero or more `response_chunk`s. Each _successful_ `response_chunk` contains a single `SignedBeaconBlock` payload.
`List[SignedBeaconBlock, ...]` response type sends zero or more `response_chunk`s. Each _successful_ `response_chunk` contains a single `SignedBeaconBlock` payload.

### Messages

Expand All @@ -468,9 +469,9 @@ The fields are, as seen by the client at the time of sending the message:
- `fork_digest`: The node's `ForkDigest` (`compute_fork_digest(current_fork_version, genesis_validators_root)`) where
- `current_fork_version` is the fork version at the node's current epoch defined by the wall-clock time (not necessarily the epoch to which the node is sync)
- `genesis_validators_root` is the static `Root` found in `state.genesis_validators_root`
- `finalized_root`: `state.finalized_checkpoint.root` for the state corresponding to the head block.
- `finalized_root`: `state.finalized_checkpoint.root` for the state corresponding to the head block (Note this defaults to `Root(b'\x00' * 32)` for the genesis finalized checkpoint).
- `finalized_epoch`: `state.finalized_checkpoint.epoch` for the state corresponding to the head block.
- `head_root`: The hash_tree_root root of the current head block.
- `head_root`: The `hash_tree_root` root of the current head block (`BeaconBlock`).
- `head_slot`: The slot of the block corresponding to the `head_root`.

The dialing client MUST send a `Status` request upon connection.
Expand Down Expand Up @@ -528,7 +529,7 @@ Request Content:
Response Content:
```
(
[]SignedBeaconBlock
List[SignedBeaconBlock, MAX_REQUEST_BLOCKS]
)
```

Expand All @@ -545,7 +546,7 @@ The response MUST consist of zero or more `response_chunk`. Each _successful_ `r

Clients MUST keep a record of signed blocks seen since the since the start of the weak subjectivity period and MUST support serving requests of blocks up to their own `head_block_root`.

Clients MUST respond with at least the first block that exists in the range, if they have it.
Clients MUST respond with at least the first block that exists in the range, if they have it, and no more than `MAX_REQUEST_BLOCKS` blocks.

The following blocks, where they exist, MUST be send in consecutive order.

Expand All @@ -568,20 +569,22 @@ Request Content:

```
(
[]Root
List[Root, MAX_REQUEST_BLOCKS]
)
```

Response Content:

```
(
[]SignedBeaconBlock
List[SignedBeaconBlock, MAX_REQUEST_BLOCKS]
)
```

Requests blocks by block root (= `hash_tree_root(SignedBeaconBlock.message)`). The response is a list of `SignedBeaconBlock` whose length is less than or equal to the number of requested blocks. It may be less in the case that the responding peer is missing blocks.

No more than `MAX_REQUEST_BLOCKS` may be requested at a time.

`BeaconBlocksByRoot` is primarily used to recover recent blocks (e.g. when receiving a block or attestation whose parent is unknown).

The request MUST be encoded as an SSZ-field.
Expand Down Expand Up @@ -1052,7 +1055,7 @@ discv5 uses ENRs and we will presumably need to:

Although client software might very well be running locally prior to the solidification of the eth2 genesis state and block, clients cannot form valid ENRs prior to this point. ENRs contain `fork_digest` which utilizes the `genesis_validators_root` for a cleaner separation between chains so prior to knowing genesis, we cannot use `fork_digest` to cleanly find peers on our intended chain. Once genesis data is known, we can then form ENRs and safely find peers.

When using an eth1 deposit contract for deposits, `fork_digest` will be known at least `MIN_GENESIS_DELAY` (24 hours in mainnet configuration) before `genesis_time`, providing ample time to find peers and form initial connections and gossip subnets prior to genesis.
When using an eth1 deposit contract for deposits, `fork_digest` will be known `GENESIS_DELAY` (48hours in mainnet configuration) before `genesis_time`, providing ample time to find peers and form initial connections and gossip subnets prior to genesis.

## Compression/Encoding

Expand Down
Loading