From fbb70e91eb4daef0629a35e1b472bca7e1ea9322 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 25 Feb 2019 07:58:23 -0700 Subject: [PATCH 1/2] remove todo --- specs/core/0_beacon-chain.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 9df89766a..06b4cfb4f 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1702,7 +1702,6 @@ For each `attestation` in `block.body.attestations`: Verify that `len(block.body.deposits) <= MAX_DEPOSITS`. -[TODO: add logic to ensure that deposits from 1.0 chain are processed in order] [TODO: update the call to `verify_merkle_branch` below if it needs to change after we process deposits in order] For each `deposit` in `block.body.deposits`: From b2a3ee4bbc030266fee15bae1299319fc122bac6 Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 25 Feb 2019 09:36:52 -0700 Subject: [PATCH 2/2] skip bad proof of possession deposits --- specs/core/0_beacon-chain.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index 06b4cfb4f..6bff0f705 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -1235,7 +1235,7 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: """ deposit_input = deposit.deposit_data.deposit_input - assert bls_verify( + proof_is_valid = bls_verify( pubkey=deposit_input.pubkey, message_hash=signed_root(deposit_input, "proof_of_possession"), signature=deposit_input.proof_of_possession, @@ -1245,6 +1245,9 @@ def process_deposit(state: BeaconState, deposit: Deposit) -> None: DOMAIN_DEPOSIT, ) ) + + if not proof_is_valid: + return validator_pubkeys = [v.pubkey for v in state.validator_registry] pubkey = deposit_input.pubkey