diff --git a/specs/casper_sharding_v2.1.md b/specs/casper_sharding_v2.1.md index 9d7e1f023..eb6ce5ec3 100644 --- a/specs/casper_sharding_v2.1.md +++ b/specs/casper_sharding_v2.1.md @@ -298,19 +298,15 @@ def get_block_hash(active_state, curblock, slot): `get_block_hash(*, *, h)` should always return the block in the chain at slot `h`, and `get_shards_and_committees_for_slot(*, h)` should not change unless the dynasty changes. -Finally, we define `integer_sqrt` for use in reward/penalty calculations: - +Finally, we abstractly define `integer_sqrt` for use in reward/penalty calculations: ```python def integer_sqrt(n): - # Utilizes "Newton's Method" - x = n - y = (x + 1) // 2 - while y < x: - x = y - y = (x + n // x) // 2 - return x + return max(n in Z: n**2 <= x) ``` +We leave `integer_sqrt` implementation details to each particular language/framework. + + ### On startup * Let `x = get_new_shuffling(bytes([0] * 32), validators, 1, 0)` and set `crystallized_state.shard_and_committee_for_slots` to `x + x`