From b2855f9be44fea6610ce0c708b1778b9dfb39c14 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 28 Jan 2019 21:13:25 +0000 Subject: [PATCH 1/2] Stricter aggregation_bitfield validation Make sure that there's at least one vote in attestations (`bls_verify_multiple` can return `True` with zero votes) --- specs/core/0_beacon-chain.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 910ebd378..56b5813f4 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1604,8 +1604,9 @@ For each `attestation` in `block.body.attestations`: * Verify that either `attestation.data.latest_crosslink_root` or `attestation.data.shard_block_root` equals `state.latest_crosslinks[shard].shard_block_root`. * Verify bitfields and aggregate signature: -```python +```python assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1] + assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield) for i in range(len(crosslink_committee)): if get_bitfield_bit(attestation.aggregation_bitfield) == 0b0: From 3068e6483d0ffcc718c74d1dadb591c8564ae1a9 Mon Sep 17 00:00:00 2001 From: Justin Date: Mon, 28 Jan 2019 21:13:58 +0000 Subject: [PATCH 2/2] Update 0_beacon-chain.md --- 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 56b5813f4..9990c5d73 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1604,7 +1604,7 @@ For each `attestation` in `block.body.attestations`: * Verify that either `attestation.data.latest_crosslink_root` or `attestation.data.shard_block_root` equals `state.latest_crosslinks[shard].shard_block_root`. * Verify bitfields and aggregate signature: -```python +```python assert attestation.custody_bitfield == b'\x00' * len(attestation.custody_bitfield) # [TO BE REMOVED IN PHASE 1] assert attestation.aggregation_bitfield != b'\x00' * len(attestation.aggregation_bitfield)