From c8e9ff3d87c22e3b0e4dce8f04b6c28fe8957021 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 22 Nov 2018 20:13:08 +0800 Subject: [PATCH 1/2] `shard_id` -> `shard` patch --- specs/core/0_beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 326bca17b..608abb564 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -160,8 +160,8 @@ A `ProposalSignedData` has the following fields: 'fork_version': 'uint64', # Slot number 'slot': 'uint64', - # Shard ID (or `2**64 - 1` for beacon chain) - 'shard_id': 'uint64', + # Shard number (or `2**64 - 1` for beacon chain) + 'shard': 'uint64', # Block hash 'block_hash': 'hash32', } From 4ba62bb80a38a620670d25e6db27b7eaa509d157 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Sun, 25 Nov 2018 00:22:28 +0800 Subject: [PATCH 2/2] Remove leftover --- specs/core/0_beacon-chain.md | 54 ------------------------------------ 1 file changed, 54 deletions(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 608abb564..28fee7b20 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -764,60 +764,6 @@ def exit_validator(index, state, block, penalize, current_slot): add_validator_set_change_record(state, index, validator.pubkey, EXIT) ``` -## On startup - -Run the following code: - -```python -def on_startup(initial_validator_entries: List[Any]) -> BeaconState: - # Induct validators - validators = [] - for pubkey, proof_of_possession, withdrawal_shard, withdrawal_address, \ - randao_commitment in initial_validator_entries: - add_validator( - validators=validators, - pubkey=pubkey, - proof_of_possession=proof_of_possession, - withdrawal_shard=withdrawal_shard, - withdrawal_address=withdrawal_address, - randao_commitment=randao_commitment, - current_slot=0, - status=ACTIVE, - ) - # Setup state - x = get_new_shuffling(bytes([0] * 32), validators, 0) - crosslinks = [ - CrosslinkRecord( - slot=0, - hash=bytes([0] * 32) - ) - for i in range(SHARD_COUNT) - ] - state = BeaconState( - validator_set_change_slot=0, - validators=validators, - crosslinks=crosslinks, - last_state_recalculation_slot=0, - last_finalized_slot=0, - last_justified_slot=0, - justified_streak=0, - shard_and_committee_for_slots=x + x, - persistent_committees=split(shuffle(validators, bytes([0] * 32)), SHARD_COUNT), - persistent_committee_reassignments=[], - deposits_penalized_in_period=[], - next_shuffling_seed=bytes([0] * 32), - validator_set_delta_hash_chain=bytes([0] * 32), # stub - pre_fork_version=INITIAL_FORK_VERSION, - post_fork_version=INITIAL_FORK_VERSION, - fork_slot_number=0, - pending_attestations=[], - recent_block_hashes=[bytes([0] * 32) for _ in range(CYCLE_LENGTH * 2)], - randao_mix=bytes([0] * 32) # stub - ) - - return state -``` - ## Per-block processing This procedure should be carried out every beacon block.