Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed May 18, 2021
2 parents cfba8f5 + 92a8ca7 commit 4a27f85
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 24 deletions.
5 changes: 0 additions & 5 deletions configs/mainnet/sharding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ MAX_GASPRICE: 8589934592
# 2**3 (= 8) Gwei
MIN_GASPRICE: 8

# Time parameters
# ---------------------------------------------------------------
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256

# Signature domains
# ---------------------------------------------------------------
DOMAIN_SHARD_PROPOSER: 0x80000000
Expand Down
7 changes: 1 addition & 6 deletions configs/minimal/sharding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ---------------------------------------------------------------
SHARDING_FORK_VERSION: 0x03000001
# TBD, temporarily max uint64 value: 2**64 - 1
MERGE_FORK_EPOCH: 18446744073709551615
SHARDING_FORK_EPOCH: 18446744073709551615


# Beacon-chain
Expand Down Expand Up @@ -34,11 +34,6 @@ MAX_GASPRICE: 8589934592
# 2**3 (= 8) Gwei
MIN_GASPRICE: 8

# Time parameters
# ---------------------------------------------------------------
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256

# Signature domains
# ---------------------------------------------------------------
DOMAIN_SHARD_PROPOSER: 0x80000000
Expand Down
2 changes: 1 addition & 1 deletion specs/altair/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Altair is the first beacon chain hard fork. Its main features are:
| Name | Value |
| - | - |
| `G2_POINT_AT_INFINITY` | `BLSSignature(b'\xc0' + b'\x00' * 95)` |
| `PARTICIPATION_FLAG_WEIGHTS` | `[TIMELY_SOURCE_WEIGHT, TIMELY_TARGET_WEIGHT, TIMELY_HEAD_FLAG_INDEX]` |
| `PARTICIPATION_FLAG_WEIGHTS` | `[TIMELY_SOURCE_WEIGHT, TIMELY_TARGET_WEIGHT, TIMELY_HEAD_WEIGHT]` |

## Configuration

Expand Down
4 changes: 2 additions & 2 deletions specs/altair/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Note that for the pure Altair networks, we don't apply `upgrade_to_altair` since
If `state.slot % SLOTS_PER_EPOCH == 0` and `compute_epoch_at_slot(state.slot) == ALTAIR_FORK_EPOCH`, an irregular state change is made to upgrade to Altair.

The upgrade occurs after the completion of the inner loop of `process_slots` that sets `state.slot` equal to `ALTAIR_FORK_EPOCH * SLOTS_PER_EPOCH`.
Care must be taken when transitioning through the fork boundary as implementations will need a modified state transition function that deviates from the Phase 0 spec.
In particular, the outer `state_transition` function defined in the Phase 0 spec will not expose the precise fork slot to execute the upgrade in the presence of skipped slots at the fork boundary. Instead the logic must be within `process_slots`.
Care must be taken when transitioning through the fork boundary as implementations will need a modified [state transition function](../phase0/beacon-chain.md#beacon-chain-state-transition-function) that deviates from the Phase 0 document.
In particular, the outer `state_transition` function defined in the Phase 0 document will not expose the precise fork slot to execute the upgrade in the presence of skipped slots at the fork boundary. Instead the logic must be within `process_slots`.

```python
def translate_participation(state: BeaconState, pending_attestations: Sequence[phase0.PendingAttestation]) -> None:
Expand Down
14 changes: 5 additions & 9 deletions specs/sharding/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
- [Shard block configs](#shard-block-configs)
- [Precomputed size verification points](#precomputed-size-verification-points)
- [Gwei values](#gwei-values)
- [Time parameters](#time-parameters)
- [Domain types](#domain-types)
- [Updated containers](#updated-containers)
- [`AttestationData`](#attestationdata)
Expand Down Expand Up @@ -123,12 +122,6 @@ The following values are (non-configurable) constants used throughout the specif
| `MAX_GASPRICE` | `Gwei(2**33)` (= 8,589,934,592) | Gwei | Max gasprice charged for a TARGET-sized shard block |
| `MIN_GASPRICE` | `Gwei(2**3)` (= 8) | Gwei | Min gasprice charged for a TARGET-sized shard block |

### Time parameters

| Name | Value | Unit | Duration |
| - | - | :-: | :-: |
| `SHARD_COMMITTEE_PERIOD` | `Epoch(2**8)` (= 256) | epochs | ~27 hours |

### Domain types

| Name | Value |
Expand Down Expand Up @@ -466,7 +459,9 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_randao(state, block.body)
process_eth1_data(state, block.body)
process_operations(state, block.body) # [Modified in Sharding]
process_execution_payload(state, block.body) # [New in Merge]
# Pre-merge, skip execution payload processing
if is_execution_enabled(state, block):
process_execution_payload(state, block.body.execution_payload, EXECUTION_ENGINE) # [New in Merge]
```

#### Operations
Expand Down Expand Up @@ -760,8 +755,9 @@ def reset_pending_headers(state: BeaconState) -> None:
# Add dummy "empty" PendingShardHeader (default vote for if no shard header available)
next_epoch = get_current_epoch(state) + 1
next_epoch_start_slot = compute_start_slot_at_epoch(next_epoch)
committees_per_slot = get_committee_count_per_slot(state, next_epoch)
for slot in range(next_epoch_start_slot, next_epoch_start_slot + SLOTS_PER_EPOCH):
for index in range(get_committee_count_per_slot(state, next_epoch)):
for index in range(committees_per_slot):
committee_index = CommitteeIndex(index)
shard = compute_shard_from_committee_index(state, slot, committee_index)
committee_length = len(get_beacon_committee(state, slot, committee_index))
Expand Down
2 changes: 1 addition & 1 deletion tests/core/pyspec/eth2spec/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0-alpha.4
1.1.0-alpha.5

0 comments on commit 4a27f85

Please sign in to comment.