Skip to content

Commit

Permalink
Update specs and test format note.
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Apr 20, 2021
1 parent 1961831 commit 666f847
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions specs/altair/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,11 +663,11 @@ def process_sync_committee_updates(state: BeaconState) -> None:
state.next_sync_committee = get_sync_committee(state, next_epoch + EPOCHS_PER_SYNC_COMMITTEE_PERIOD)
```

## Initialize state for Altair testnets
## Initialize state for pure Altair testnets and test vectors

This helper function is only for initializing the pure Altair testnets and tests, where we set `ALTAIR_FORK_SLOT = GENESIS_SLOT`.
This helper function is only for initializing the state for pure Altair testnets and tests.

*Note*: The function `initialize_beacon_state_from_eth1` is modified with `ALTAIR_FORK_VERSION` fork version and initial sync committees.
*Note*: The function `initialize_beacon_state_from_eth1` is modified with `ALTAIR_FORK_VERSION` fork version and initial sync committees.

```python
def initialize_beacon_state_from_eth1(eth1_block_hash: Bytes32,
Expand Down
2 changes: 2 additions & 0 deletions specs/altair/fork.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Warning: this configuration is not definitive.

TBD. Social consensus, along with state conditions such as epoch boundary, finality, deposits, active validator count, etc. may be part of the decision process to trigger the fork. For now we assume the condition will be triggered at slot `ALTAIR_FORK_SLOT`, where `ALTAIR_FORK_SLOT % SLOTS_PER_EPOCH == 0`.

Note that for the pure Altair testnets, we don't apply `upgrade_to_altair` since it starts with Altair version logic.

### Upgrading the state

After `process_slots` of Phase 0 finishes, if `state.slot == ALTAIR_FORK_SLOT`, an irregular state change is made to upgrade to Altair.
Expand Down
2 changes: 2 additions & 0 deletions tests/formats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ E.g. `pre.ssz_snappy`, `deposit.ssz_snappy`, `post.ssz_snappy`.
Diffing a `pre.ssz_snappy` and `post.ssz_snappy` provides all the information for testing, when decompressed and decoded.
Then the difference between pre and post can be compared to anything that changes the pre state, e.g. `deposit.ssz_snappy`

Note that by default, the SSZ data is in the given test case's <fork or phase name> version, e.g., if it's `altair` test case, use `altair.BeaconState` container to deserialize the given state.

YAML is generally used for test metadata, and for tests that do not use SSZ: e.g. shuffling and BLS tests.
In this case, there is no point in adding special SSZ types. And the size and efficiency of YAML is acceptable.

Expand Down

0 comments on commit 666f847

Please sign in to comment.