From a18312559507f27cc0092fc55bfee07bfa2d5334 Mon Sep 17 00:00:00 2001 From: Justin Date: Sun, 22 Sep 2019 21:04:48 +0100 Subject: [PATCH] cleanups to get_seed 1) Put `domain_type` and `epoch` upfront. This pattern can be reused for signature domains. 2) Change `int_to_bytes(epoch, length=32)` to `int_to_bytes(epoch, length=8)` to match `uint64` length. --- specs/core/0_beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index cfdf24e71..4f20898a3 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -875,7 +875,7 @@ def get_seed(state: BeaconState, epoch: Epoch, domain_type: DomainType) -> Hash: Return the seed at ``epoch``. """ mix = get_randao_mix(state, Epoch(epoch + EPOCHS_PER_HISTORICAL_VECTOR - MIN_SEED_LOOKAHEAD - 1)) # Avoid underflow - return hash(domain_type + mix + int_to_bytes(epoch, length=32)) + return hash(domain_type + int_to_bytes(epoch, length=8) + mix) ``` #### `get_committee_count`