Skip to content

Commit 682b11f

Browse files
authored
Merge pull request #550 from sigp/protobuf-2.8
Fix the build for Rust 1.38, protobuf releases
2 parents 3d559d8 + 392b420 commit 682b11f

File tree

22 files changed

+22
-64
lines changed

22 files changed

+22
-64
lines changed

beacon_node/network/src/message_handler.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,9 @@ impl<T: BeaconChainTypes + 'static> MessageHandler<T> {
146146
) {
147147
// an error could have occurred.
148148
match error_response {
149-
RPCErrorResponse::InvalidRequest(error) => {
150-
warn!(self.log, "Peer indicated invalid request";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string())
151-
}
152-
RPCErrorResponse::ServerError(error) => {
153-
warn!(self.log, "Peer internal server error";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string())
154-
}
155-
RPCErrorResponse::Unknown(error) => {
156-
warn!(self.log, "Unknown peer error";"peer" => format!("{:?}", peer_id), "error" => error.as_string())
157-
}
149+
RPCErrorResponse::InvalidRequest(error) => warn!(self.log, "Peer indicated invalid request";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()),
150+
RPCErrorResponse::ServerError(error) => warn!(self.log, "Peer internal server error";"peer_id" => format!("{:?}", peer_id), "error" => error.as_string()),
151+
RPCErrorResponse::Unknown(error) => warn!(self.log, "Unknown peer error";"peer" => format!("{:?}", peer_id), "error" => error.as_string()),
158152
RPCErrorResponse::Success(response) => {
159153
match response {
160154
RPCResponse::Hello(hello_message) => {

eth2/state_processing/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ criterion = "0.2"
1313
env_logger = "0.6.0"
1414
serde = "1.0"
1515
serde_derive = "1.0"
16-
lazy_static = "0.1"
16+
lazy_static = "1.4"
1717
serde_yaml = "0.8"
1818
eth2_ssz = { path = "../utils/ssz" }
1919
beacon_chain = { path = "../../beacon_node/beacon_chain" }

eth2/types/src/attestation.rs

-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,4 @@ mod tests {
5858
use crate::*;
5959

6060
ssz_tests!(Attestation<MainnetEthSpec>);
61-
6261
}

eth2/types/src/attestation_data_and_custody_bit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ mod test {
1919
use super::*;
2020

2121
ssz_tests!(AttestationDataAndCustodyBit);
22-
2322
}

eth2/types/src/attester_slashing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ mod tests {
2121
use crate::*;
2222

2323
ssz_tests!(AttesterSlashing<MainnetEthSpec>);
24-
2524
}

eth2/types/src/checkpoint.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ mod tests {
3232
use super::*;
3333

3434
ssz_tests!(Checkpoint);
35-
3635
}

eth2/types/src/crosslink.rs

-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,4 @@ mod tests {
3737
use super::*;
3838

3939
ssz_tests!(Crosslink);
40-
4140
}

eth2/types/src/deposit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ mod tests {
2121
use super::*;
2222

2323
ssz_tests!(Deposit);
24-
2524
}

eth2/types/src/deposit_data.rs

-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@ mod tests {
5555
use super::*;
5656

5757
ssz_tests!(DepositData);
58-
5958
}

eth2/types/src/eth1_data.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ mod tests {
2323
use super::*;
2424

2525
ssz_tests!(Eth1Data);
26-
2726
}

eth2/types/src/historical_batch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ mod tests {
2323
pub type FoundationHistoricalBatch = HistoricalBatch<MainnetEthSpec>;
2424

2525
ssz_tests!(FoundationHistoricalBatch);
26-
2726
}

eth2/types/src/pending_attestation.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ mod tests {
2323
use crate::*;
2424

2525
ssz_tests!(PendingAttestation<MainnetEthSpec>);
26-
2726
}

eth2/types/src/proposer_slashing.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ mod tests {
2121
use super::*;
2222

2323
ssz_tests!(ProposerSlashing);
24-
2524
}

eth2/types/src/transfer.rs

-1
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,4 @@ mod tests {
4242
use super::*;
4343

4444
ssz_tests!(Transfer);
45-
4645
}

eth2/types/src/validator.rs

-1
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,4 @@ mod tests {
117117
}
118118

119119
ssz_tests!(Validator);
120-
121120
}

eth2/types/src/voluntary_exit.rs

-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,4 @@ mod tests {
3535
use super::*;
3636

3737
ssz_tests!(VoluntaryExit);
38-
3938
}

eth2/utils/tree_hash/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ types = { path = "../../types" }
1919
[dependencies]
2020
ethereum-types = "0.6"
2121
eth2_hashing = "0.1"
22-
lazy_static = "0.1"
22+
lazy_static = "1.4"

eth2/utils/tree_hash_derive/src/lib.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
extern crate proc_macro;
33

44
use proc_macro::TokenStream;
5-
use quote::{quote, ToTokens};
5+
use quote::quote;
66
use syn::{parse_macro_input, DeriveInput};
77

88
/// Returns a Vec of `syn::Ident` for each named field in the struct, whilst filtering out fields
@@ -130,8 +130,8 @@ fn get_signed_root_named_field_idents(struct_data: &syn::DataStruct) -> Vec<&syn
130130
}
131131

132132
fn should_skip_signed_root(field: &syn::Field) -> bool {
133-
field
134-
.attrs
135-
.iter()
136-
.any(|attr| attr.into_token_stream().to_string() == "# [ signed_root ( skip_hashing ) ]")
133+
field.attrs.iter().any(|attr| {
134+
attr.path.is_ident("signed_root")
135+
&& attr.tts.to_string().replace(" ", "") == "(skip_hashing)"
136+
})
137137
}

protos/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Google protobuf message and service definitions used in Lighthous
88
[dependencies]
99
futures = "0.1"
1010
grpcio = { version = "0.4", default-features = false, features = ["protobuf-codec"] }
11-
protobuf = "2.0"
11+
protobuf = "~2.8.1"
1212

1313
[build-dependencies]
1414
protoc-grpcio = "0.3.1"

validator_client/src/attestation_producer/mod.rs

+5-15
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,11 @@ impl<'a, B: BeaconNodeAttestation, S: Signer, E: EthSpec> AttestationProducer<'a
5757
"slot" => slot,
5858
),
5959
Err(e) => error!(log, "Attestation production error"; "Error" => format!("{:?}", e)),
60-
Ok(ValidatorEvent::SignerRejection(_slot)) => {
61-
error!(log, "Attestation production error"; "Error" => "Signer could not sign the attestation".to_string())
62-
}
63-
Ok(ValidatorEvent::IndexedAttestationNotProduced(_slot)) => {
64-
error!(log, "Attestation production error"; "Error" => "Rejected the attestation as it could have been slashed".to_string())
65-
}
66-
Ok(ValidatorEvent::PublishAttestationFailed) => {
67-
error!(log, "Attestation production error"; "Error" => "Beacon node was unable to publish an attestation".to_string())
68-
}
69-
Ok(ValidatorEvent::InvalidAttestation) => {
70-
error!(log, "Attestation production error"; "Error" => "The signed attestation was invalid".to_string())
71-
}
72-
Ok(v) => {
73-
warn!(log, "Unknown result for attestation production"; "Error" => format!("{:?}",v))
74-
}
60+
Ok(ValidatorEvent::SignerRejection(_slot)) => error!(log, "Attestation production error"; "Error" => "Signer could not sign the attestation".to_string()),
61+
Ok(ValidatorEvent::IndexedAttestationNotProduced(_slot)) => error!(log, "Attestation production error"; "Error" => "Rejected the attestation as it could have been slashed".to_string()),
62+
Ok(ValidatorEvent::PublishAttestationFailed) => error!(log, "Attestation production error"; "Error" => "Beacon node was unable to publish an attestation".to_string()),
63+
Ok(ValidatorEvent::InvalidAttestation) => error!(log, "Attestation production error"; "Error" => "The signed attestation was invalid".to_string()),
64+
Ok(v) => warn!(log, "Unknown result for attestation production"; "Error" => format!("{:?}",v)),
7565
}
7666
}
7767

validator_client/src/block_producer/mod.rs

+4-12
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,10 @@ impl<'a, B: BeaconNodeBlock, S: Signer, E: EthSpec> BlockProducer<'a, B, S, E> {
6969
"slot" => slot,
7070
),
7171
Err(e) => error!(self.log, "Block production error"; "Error" => format!("{:?}", e)),
72-
Ok(ValidatorEvent::SignerRejection(_slot)) => {
73-
error!(self.log, "Block production error"; "Error" => "Signer Could not sign the block".to_string())
74-
}
75-
Ok(ValidatorEvent::SlashableBlockNotProduced(_slot)) => {
76-
error!(self.log, "Block production error"; "Error" => "Rejected the block as it could have been slashed".to_string())
77-
}
78-
Ok(ValidatorEvent::BeaconNodeUnableToProduceBlock(_slot)) => {
79-
error!(self.log, "Block production error"; "Error" => "Beacon node was unable to produce a block".to_string())
80-
}
81-
Ok(v) => {
82-
warn!(self.log, "Unknown result for block production"; "Error" => format!("{:?}",v))
83-
}
72+
Ok(ValidatorEvent::SignerRejection(_slot)) => error!(self.log, "Block production error"; "Error" => "Signer Could not sign the block".to_string()),
73+
Ok(ValidatorEvent::SlashableBlockNotProduced(_slot)) => error!(self.log, "Block production error"; "Error" => "Rejected the block as it could have been slashed".to_string()),
74+
Ok(ValidatorEvent::BeaconNodeUnableToProduceBlock(_slot)) => error!(self.log, "Block production error"; "Error" => "Beacon node was unable to produce a block".to_string()),
75+
Ok(v) => warn!(self.log, "Unknown result for block production"; "Error" => format!("{:?}",v)),
8476
}
8577
}
8678

validator_client/src/duties/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ impl<U: BeaconNodeDuties, S: Signer + Display> DutiesManager<U, S> {
7777
pub fn run_update(&self, epoch: Epoch, log: slog::Logger) -> Result<Async<()>, ()> {
7878
match self.update(epoch) {
7979
Err(error) => error!(log, "Epoch duties poll error"; "error" => format!("{:?}", error)),
80-
Ok(UpdateOutcome::NoChange(epoch)) => {
81-
debug!(log, "No change in duties"; "epoch" => epoch)
82-
}
83-
Ok(UpdateOutcome::DutiesChanged(epoch, duties)) => {
84-
info!(log, "Duties changed (potential re-org)"; "epoch" => epoch, "duties" => format!("{:?}", duties))
85-
}
80+
Ok(UpdateOutcome::NoChange(epoch)) => debug!(log, "No change in duties"; "epoch" => epoch),
81+
Ok(UpdateOutcome::DutiesChanged(epoch, duties)) => info!(log, "Duties changed (potential re-org)"; "epoch" => epoch, "duties" => format!("{:?}", duties)),
8682
Ok(UpdateOutcome::NewDuties(epoch, duties)) => {
8783
info!(log, "New duties obtained"; "epoch" => epoch);
8884
print_duties(&log, duties);

0 commit comments

Comments
 (0)