From d0249a5518c7b271f9ab3ae8cbbf6e1b3a7b8043 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Mon, 11 Nov 2019 16:02:22 +1100 Subject: [PATCH] Formatting, fix CI failures --- .gitlab-ci.yml | 2 +- beacon_node/network/src/message_handler.rs | 12 +++++++++--- eth2/operation_pool/src/lib.rs | 3 +-- validator_client/src/block_producer/mod.rs | 16 ++++++++++++---- validator_client/src/duties/mod.rs | 8 ++++++-- 5 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07a2758d9f..7f68a0fd19 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,7 +47,7 @@ test-ef-fake-crypto: GIT_SUBMODULE_STRATEGY: normal script: - make make-ef-tests - - cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests fake_crypto + - cargo test --manifest-path tests/ef_tests/Cargo.toml --release --features ef_tests,fake_crypto documentation: stage: document diff --git a/beacon_node/network/src/message_handler.rs b/beacon_node/network/src/message_handler.rs index 0e56b4c331..898304272e 100644 --- a/beacon_node/network/src/message_handler.rs +++ b/beacon_node/network/src/message_handler.rs @@ -146,9 +146,15 @@ impl MessageHandler { ) { // an error could have occurred. match error_response { - RPCErrorResponse::InvalidRequest(error) => warn!(self.log, "Peer indicated invalid request";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()), - RPCErrorResponse::ServerError(error) => warn!(self.log, "Peer internal server error";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()), - RPCErrorResponse::Unknown(error) => warn!(self.log, "Unknown peer error";"peer" => format!("{:?}", peer_id), "error" => error.as_string()), + RPCErrorResponse::InvalidRequest(error) => { + warn!(self.log, "Peer indicated invalid request";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()) + } + RPCErrorResponse::ServerError(error) => { + warn!(self.log, "Peer internal server error";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()) + } + RPCErrorResponse::Unknown(error) => { + warn!(self.log, "Unknown peer error";"peer" => format!("{:?}", peer_id), "error" => error.as_string()) + } RPCErrorResponse::Success(response) => { match response { RPCResponse::Hello(hello_message) => { diff --git a/eth2/operation_pool/src/lib.rs b/eth2/operation_pool/src/lib.rs index 333439cb95..b6f3a7d7c5 100644 --- a/eth2/operation_pool/src/lib.rs +++ b/eth2/operation_pool/src/lib.rs @@ -578,7 +578,7 @@ mod tests { let mut builder = TestingAttestationBuilder::new(state, committee, slot, index); let signers = &committee[signing_range]; let committee_keys = signers.iter().map(|&i| &keypairs[i].sk).collect::>(); - builder.sign(signers, &committee_keys, &state.fork, spec, false); + builder.sign(signers, &committee_keys, &state.fork, spec); extra_signer.map(|c_idx| { let validator_index = committee[c_idx]; builder.sign( @@ -586,7 +586,6 @@ mod tests { &[&keypairs[validator_index].sk], &state.fork, spec, - false, ) }); builder.build() diff --git a/validator_client/src/block_producer/mod.rs b/validator_client/src/block_producer/mod.rs index 0d8b39991a..d88ac15f63 100644 --- a/validator_client/src/block_producer/mod.rs +++ b/validator_client/src/block_producer/mod.rs @@ -68,10 +68,18 @@ impl<'a, B: BeaconNodeBlock, S: Signer, E: EthSpec> BlockProducer<'a, B, S, E> { "slot" => slot, ), Err(e) => error!(self.log, "Block production error"; "Error" => format!("{:?}", e)), - Ok(ValidatorEvent::SignerRejection(_slot)) => error!(self.log, "Block production error"; "Error" => "Signer Could not sign the block".to_string()), - Ok(ValidatorEvent::SlashableBlockNotProduced(_slot)) => error!(self.log, "Block production error"; "Error" => "Rejected the block as it could have been slashed".to_string()), - Ok(ValidatorEvent::BeaconNodeUnableToProduceBlock(_slot)) => error!(self.log, "Block production error"; "Error" => "Beacon node was unable to produce a block".to_string()), - Ok(v) => warn!(self.log, "Unknown result for block production"; "Error" => format!("{:?}",v)), + Ok(ValidatorEvent::SignerRejection(_slot)) => { + error!(self.log, "Block production error"; "Error" => "Signer Could not sign the block".to_string()) + } + Ok(ValidatorEvent::SlashableBlockNotProduced(_slot)) => { + error!(self.log, "Block production error"; "Error" => "Rejected the block as it could have been slashed".to_string()) + } + Ok(ValidatorEvent::BeaconNodeUnableToProduceBlock(_slot)) => { + error!(self.log, "Block production error"; "Error" => "Beacon node was unable to produce a block".to_string()) + } + Ok(v) => { + warn!(self.log, "Unknown result for block production"; "Error" => format!("{:?}",v)) + } } } diff --git a/validator_client/src/duties/mod.rs b/validator_client/src/duties/mod.rs index 429aea6480..f0269a41f6 100644 --- a/validator_client/src/duties/mod.rs +++ b/validator_client/src/duties/mod.rs @@ -77,8 +77,12 @@ impl DutiesManager { pub fn run_update(&self, epoch: Epoch, log: slog::Logger) -> Result, ()> { match self.update(epoch) { Err(error) => error!(log, "Epoch duties poll error"; "error" => format!("{:?}", error)), - Ok(UpdateOutcome::NoChange(epoch)) => debug!(log, "No change in duties"; "epoch" => epoch), - Ok(UpdateOutcome::DutiesChanged(epoch, duties)) => info!(log, "Duties changed (potential re-org)"; "epoch" => epoch, "duties" => format!("{:?}", duties)), + Ok(UpdateOutcome::NoChange(epoch)) => { + debug!(log, "No change in duties"; "epoch" => epoch) + } + Ok(UpdateOutcome::DutiesChanged(epoch, duties)) => { + info!(log, "Duties changed (potential re-org)"; "epoch" => epoch, "duties" => format!("{:?}", duties)) + } Ok(UpdateOutcome::NewDuties(epoch, duties)) => { info!(log, "New duties obtained"; "epoch" => epoch); print_duties(&log, duties);