Merge branch 'dev'

This commit is contained in:
Danny Ryan 2021-05-18 16:16:32 -06:00
commit 4a27f85543
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
6 changed files with 10 additions and 24 deletions

View File

@ -34,11 +34,6 @@ MAX_GASPRICE: 8589934592
# 2**3 (= 8) Gwei # 2**3 (= 8) Gwei
MIN_GASPRICE: 8 MIN_GASPRICE: 8
# Time parameters
# ---------------------------------------------------------------
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256
# Signature domains # Signature domains
# --------------------------------------------------------------- # ---------------------------------------------------------------
DOMAIN_SHARD_PROPOSER: 0x80000000 DOMAIN_SHARD_PROPOSER: 0x80000000

View File

@ -4,7 +4,7 @@
# --------------------------------------------------------------- # ---------------------------------------------------------------
SHARDING_FORK_VERSION: 0x03000001 SHARDING_FORK_VERSION: 0x03000001
# TBD, temporarily max uint64 value: 2**64 - 1 # TBD, temporarily max uint64 value: 2**64 - 1
MERGE_FORK_EPOCH: 18446744073709551615 SHARDING_FORK_EPOCH: 18446744073709551615
# Beacon-chain # Beacon-chain
@ -34,11 +34,6 @@ MAX_GASPRICE: 8589934592
# 2**3 (= 8) Gwei # 2**3 (= 8) Gwei
MIN_GASPRICE: 8 MIN_GASPRICE: 8
# Time parameters
# ---------------------------------------------------------------
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256
# Signature domains # Signature domains
# --------------------------------------------------------------- # ---------------------------------------------------------------
DOMAIN_SHARD_PROPOSER: 0x80000000 DOMAIN_SHARD_PROPOSER: 0x80000000

View File

@ -99,7 +99,7 @@ Altair is the first beacon chain hard fork. Its main features are:
| Name | Value | | Name | Value |
| - | - | | - | - |
| `G2_POINT_AT_INFINITY` | `BLSSignature(b'\xc0' + b'\x00' * 95)` | | `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 ## Configuration

View File

@ -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. 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`. 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. 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 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`. 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 ```python
def translate_participation(state: BeaconState, pending_attestations: Sequence[phase0.PendingAttestation]) -> None: def translate_participation(state: BeaconState, pending_attestations: Sequence[phase0.PendingAttestation]) -> None:

View File

@ -16,7 +16,6 @@
- [Shard block configs](#shard-block-configs) - [Shard block configs](#shard-block-configs)
- [Precomputed size verification points](#precomputed-size-verification-points) - [Precomputed size verification points](#precomputed-size-verification-points)
- [Gwei values](#gwei-values) - [Gwei values](#gwei-values)
- [Time parameters](#time-parameters)
- [Domain types](#domain-types) - [Domain types](#domain-types)
- [Updated containers](#updated-containers) - [Updated containers](#updated-containers)
- [`AttestationData`](#attestationdata) - [`AttestationData`](#attestationdata)
@ -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 | | `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 | | `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 ### Domain types
| Name | Value | | Name | Value |
@ -466,7 +459,9 @@ def process_block(state: BeaconState, block: BeaconBlock) -> None:
process_randao(state, block.body) process_randao(state, block.body)
process_eth1_data(state, block.body) process_eth1_data(state, block.body)
process_operations(state, block.body) # [Modified in Sharding] 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 #### Operations
@ -760,8 +755,9 @@ def reset_pending_headers(state: BeaconState) -> None:
# Add dummy "empty" PendingShardHeader (default vote for if no shard header available) # Add dummy "empty" PendingShardHeader (default vote for if no shard header available)
next_epoch = get_current_epoch(state) + 1 next_epoch = get_current_epoch(state) + 1
next_epoch_start_slot = compute_start_slot_at_epoch(next_epoch) 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 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) committee_index = CommitteeIndex(index)
shard = compute_shard_from_committee_index(state, slot, committee_index) shard = compute_shard_from_committee_index(state, slot, committee_index)
committee_length = len(get_beacon_committee(state, slot, committee_index)) committee_length = len(get_beacon_committee(state, slot, committee_index))

View File

@ -1 +1 @@
1.1.0-alpha.4 1.1.0-alpha.5