Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul committed Oct 5, 2020
1 parent 463d4c8 commit 1542737
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 25 deletions.
11 changes: 5 additions & 6 deletions beacon_node/beacon_chain/src/attestation_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use state_processing::{
errors::{AttestationValidationError, BlockOperationError, IndexedAttestationInvalid},
VerifySignatures,
},
per_slot_processing,
signature_sets::{
indexed_attestation_signature_set_from_pubkeys,
signed_aggregate_selection_proof_signature_set, signed_aggregate_signature_set,
Expand Down Expand Up @@ -633,7 +632,7 @@ impl<T: BeaconChainTypes> VerifiedUnaggregatedAttestation<T> {
committees_per_slot: u64,
subnet_id: Option<SubnetId>,
chain: &BeaconChain<T>,
) -> Result<u64, Error> {
) -> Result<(u64, SubnetId), Error> {
let expected_subnet_id = SubnetId::compute_subnet_for_attestation_data::<T::EthSpec>(
&indexed_attestation.data,
committees_per_slot,
Expand Down Expand Up @@ -671,7 +670,7 @@ impl<T: BeaconChainTypes> VerifiedUnaggregatedAttestation<T> {
});
}

Ok(validator_index)
Ok((validator_index, expected_subnet_id))
}

fn verify_late_checks(
Expand Down Expand Up @@ -714,7 +713,7 @@ impl<T: BeaconChainTypes> VerifiedUnaggregatedAttestation<T> {

pub fn verify_slashable(
attestation: Attestation<T::EthSpec>,
subnet_id: SubnetId,
subnet_id: Option<SubnetId>,
chain: &BeaconChain<T>,
) -> Result<Self, AttestationSlashInfo<T, Error>> {
use AttestationSlashInfo::*;
Expand All @@ -731,14 +730,14 @@ impl<T: BeaconChainTypes> VerifiedUnaggregatedAttestation<T> {
}
};

let validator_index = match Self::verify_middle_checks(
let (validator_index, expected_subnet_id) = match Self::verify_middle_checks(
&attestation,
&indexed_attestation,
committees_per_slot,
subnet_id,
chain,
) {
Ok(idx) => idx,
Ok(t) => t,
Err(e) => return Err(SignatureNotCheckedIndexed(indexed_attestation, e)),
};

Expand Down
20 changes: 4 additions & 16 deletions beacon_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,33 +137,21 @@ impl<E: EthSpec> ProductionBeaconNode<E> {
let discv5_executor = Discv5Executor(executor);
client_config.network.discv5_config.executor = Some(Box::new(discv5_executor));

builder
let builder = builder
.build_beacon_chain()?
.network(&client_config.network)
.await?
<<<<<<< HEAD
.notifier()?
.http_api_config(client_config.http_api.clone())
.http_metrics_config(client_config.http_metrics.clone())
.build()
.map(Self)
=======
.notifier()?;

let builder = if client_config.rest_api.enabled {
builder.http_server(&client_config, &http_eth2_config, events)?
} else {
builder
};
.http_metrics_config(client_config.http_metrics.clone());

// FIXME(sproul): chain this
let builder = if client_config.slasher.is_some() {
builder.slasher_server()?
} else {
builder
};

Ok(Self(builder.build()))
>>>>>>> 039b06603... Experimental slasher implementation
builder.build().map(Self)
}

pub fn into_inner(self) -> ProductionClient<E> {
Expand Down
4 changes: 2 additions & 2 deletions slasher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ edition = "2018"
bincode = "1.3.1"
blake2b_simd = "0.5.10"
byte-slice-cast = "0.3.5"
environment = { path = "../lighthouse/environment" }
task_executor = { path = "../common/task_executor" }
eth2_ssz = { path = "../consensus/ssz" }
eth2_ssz_derive = { path = "../consensus/ssz_derive" }
flate2 = { version = "1.0.17", features = ["zlib"], default-features = false }
flate2 = { version = "1.0.14", features = ["zlib"], default-features = false }
lmdb = "0.8"
parking_lot = "0.11.0"
rand = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion slasher/src/slasher_server.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::Slasher;
use environment::TaskExecutor;
use slog::{debug, error, info, trace};
use slot_clock::SlotClock;
use std::sync::mpsc::{sync_channel, TrySendError};
use std::sync::Arc;
use task_executor::TaskExecutor;
use tokio::stream::StreamExt;
use tokio::time::{interval_at, Duration, Instant};
use types::EthSpec;
Expand Down

0 comments on commit 1542737

Please sign in to comment.