Skip to content

Commit

Permalink
Merge pull request #828 from ethereum/vbuterin-patch-20-1
Browse files Browse the repository at this point in the history
Small cosmetic change to slashable attestations
  • Loading branch information
djrtwo committed Mar 21, 2019
2 parents c7172c4 + 3ece05c commit d8ad56f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Code snippets appearing in `this style` are to be interpreted as Python code.
| `SHARD_COUNT` | `2**10` (= 1,024) |
| `TARGET_COMMITTEE_SIZE` | `2**7` (= 128) |
| `MAX_BALANCE_CHURN_QUOTIENT` | `2**5` (= 32) |
| `MAX_INDICES_PER_SLASHABLE_VOTE` | `2**12` (= 4,096) |
| `MAX_SLASHABLE_ATTESTATION_PARTICIPANTS` | `2**12` (= 4,096) |
| `MAX_EXIT_DEQUEUES_PER_EPOCH` | `2**2` (= 4) |
| `SHUFFLE_ROUND_COUNT` | 90 |

Expand Down Expand Up @@ -1197,7 +1197,7 @@ def verify_slashable_attestation(state: BeaconState, slashable_attestation: Slas
if slashable_attestation.custody_bitfield != b'\x00' * len(slashable_attestation.custody_bitfield): # [TO BE REMOVED IN PHASE 1]
return False

if len(slashable_attestation.validator_indices) == 0:
if not (1 <= len(slashable_attestation.validator_indices) <= MAX_SLASHABLE_ATTESTATION_PARTICIPANTS):
return False

for i in range(len(slashable_attestation.validator_indices) - 1):
Expand All @@ -1207,9 +1207,6 @@ def verify_slashable_attestation(state: BeaconState, slashable_attestation: Slas
if not verify_bitfield(slashable_attestation.custody_bitfield, len(slashable_attestation.validator_indices)):
return False

if len(slashable_attestation.validator_indices) > MAX_INDICES_PER_SLASHABLE_VOTE:
return False

custody_bit_0_indices = []
custody_bit_1_indices = []
for i, validator_index in enumerate(slashable_attestation.validator_indices):
Expand Down

0 comments on commit d8ad56f

Please sign in to comment.