Fix proof-of-possession issues.

These were introduced in an earlier commit
This commit is contained in:
Paul Hauner
2019-03-11 19:47:33 +11:00
parent 292991810d
commit e81f1c31c9
6 changed files with 41 additions and 23 deletions

View File

@@ -140,7 +140,7 @@ fn build_block(state: &mut BeaconState, keypairs: &[Keypair], spec: &ChainSpec)
// Insert the maximum possible number of `Deposit` objects.
for i in 0..spec.max_deposits {
builder.insert_deposit(32_000_000_000, state.deposit_index + i, spec);
builder.insert_deposit(32_000_000_000, state.deposit_index + i, state, spec);
}
// Insert the maximum possible number of `Exit` objects.

View File

@@ -1,5 +1,4 @@
use super::errors::{DepositInvalid as Invalid, DepositValidationError as Error};
use bls::verify_proof_of_possession;
use hashing::hash;
use merkle_proof::verify_merkle_proof;
use ssz::ssz_encode;
@@ -27,13 +26,14 @@ pub fn verify_deposit(
spec: &ChainSpec,
) -> Result<(), Error> {
verify!(
// TODO: update proof of possession.
//
// https://github.com/sigp/lighthouse/issues/239
verify_proof_of_possession(
&deposit.deposit_data.deposit_input.proof_of_possession,
&deposit.deposit_data.deposit_input.pubkey
),
deposit
.deposit_data
.deposit_input
.validate_proof_of_possession(
state.slot.epoch(spec.slots_per_epoch),
&state.fork,
spec
),
Invalid::BadProofOfPossession
);