From 990cc55db74628c045ba9919a65c2d9f5d8d0692 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Thu, 27 Jun 2019 16:32:10 -0600 Subject: [PATCH] fix committee typing error --- motes.md | 42 ++++++++++++++++++++++++++++++++++++ notes.txt | 1 + specs/core/0_beacon-chain.md | 4 ++-- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 motes.md create mode 100644 notes.txt diff --git a/motes.md b/motes.md new file mode 100644 index 000000000..e01ba19b7 --- /dev/null +++ b/motes.md @@ -0,0 +1,42 @@ +* `BLS_WITHDRAWAL_PREFIX` + * Why int rather than bytes? +* `MIN_SEED_LOOKAHEAD` + * Is this actually tunable? + * If so, what are the reprecussions? +* `ACTIVATION_EXIT_DELAY` + * Reaquaint with purpose +* AttesterSlashings + * `MAX_ATTESTER_SLASHINGS` is 1. + * Are there scenarios in which validators can create more effective slashable + messages than can be included on chain? For example, Validators split up to + create double attestations for checkpoints but different (junk) crosslink + data to prevent them from being aggregatable to the fullest + * Max is for block size, no? +* Signature domains + * Max 4byte ints +* `Version` not defined in one of the lists of custom types (2!!). ensure in spec +* `PendingAttestation` + * Don't think `proposer_index` is actually necessary here because effective + balance is stable until end of epoch so can do dynamic lookups +* is_genesis_trigger + * only run at ends of blocks to preserve invariant that eth1data.deposit_root + is the deposit root at the _end_ of an eth1 block +* `Attestation` + * why bitfields not together? +* `Transfer` + * replay mechanism... say the slot gets missed and you sign another transfer + * in a fork you could include both transfers +* `get_previous_epoch` + * do a once over on the genesis stuff +* `get_epoch_start_shard` + * checking next hinges upon the fact that the validator set for the next + epoch is 100% known at the current epoch. Ensure this is the case +* `get_block_root_at_slot` .. `generate_seed` can be bade into one line + function signatures +* `get_shuffled_index` + * I think it should be maybe `assert index_count <= VALIDATOR_REGISTRY_LIMIT` + * is the `2**40` special for security of alg? probably. + + +pubkey/privkey g1 vs g2 + diff --git a/notes.txt b/notes.txt new file mode 100644 index 000000000..421ad7750 --- /dev/null +++ b/notes.txt @@ -0,0 +1 @@ +* `BLS_WITHDRAWAL_PREFIX` -- diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index ba2cf771b..842b16b98 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -758,7 +758,7 @@ def get_compact_committees_root(state: BeaconState, epoch: Epoch) -> Hash: """ Return the compact committee root for the current epoch. """ - committees = Vector[CompactCommittee, SHARD_COUNT]() + committees = [CompactCommittee() for _ in range(SHARD_COUNT)] start_shard = get_epoch_start_shard(state, epoch) for committee_number in range(get_epoch_committee_count(state, epoch)): shard = (start_shard + committee_number) % SHARD_COUNT @@ -769,7 +769,7 @@ def get_compact_committees_root(state: BeaconState, epoch: Epoch) -> Hash: # `index` (top 6 bytes) + `slashed` (16th bit) + `compact_balance` (bottom 15 bits) compact_validator = uint64(index << 16 + validator.slashed << 15 + compact_balance) committees[shard].compact_validators.append(compact_validator) - return hash_tree_root(committees) + return hash_tree_root(Vector[CompactCommittee, SHARD_COUNT](committees)) ``` ### `generate_seed`