From 666f847354c4e513960290d8ad2ff4dcfdc43de8 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 20 Apr 2021 23:37:53 +0800 Subject: [PATCH] Update specs and test format note. --- specs/altair/beacon-chain.md | 6 +++--- specs/altair/fork.md | 2 ++ tests/formats/README.md | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/specs/altair/beacon-chain.md b/specs/altair/beacon-chain.md index 978a7eadd..7f6556556 100644 --- a/specs/altair/beacon-chain.md +++ b/specs/altair/beacon-chain.md @@ -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, diff --git a/specs/altair/fork.md b/specs/altair/fork.md index b51466c1e..6312eb09f 100644 --- a/specs/altair/fork.md +++ b/specs/altair/fork.md @@ -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. diff --git a/tests/formats/README.md b/tests/formats/README.md index 8f817220e..16f756fc1 100644 --- a/tests/formats/README.md +++ b/tests/formats/README.md @@ -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 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.