Update to Rust 1.59 and 2021 edition (#3038)

## Proposed Changes

Lots of lint updates related to `flat_map`, `unwrap_or_else` and string patterns. I did a little more creative refactoring in the op pool, but otherwise followed Clippy's suggestions.

## Additional Info

We need this PR to unblock CI.
This commit is contained in:
Michael Sproul 2022-02-25 00:10:17 +00:00
parent c1df5d29cb
commit 5e1f8a8480
115 changed files with 173 additions and 188 deletions

View File

@ -2,7 +2,7 @@
name = "account_manager" name = "account_manager"
version = "0.3.5" version = "0.3.5"
authors = ["Paul Hauner <paul@paulhauner.com>", "Luke Anderson <luke@sigmaprime.io>"] authors = ["Paul Hauner <paul@paulhauner.com>", "Luke Anderson <luke@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
bls = { path = "../crypto/bls" } bls = { path = "../crypto/bls" }

View File

@ -2,7 +2,7 @@
name = "beacon_node" name = "beacon_node"
version = "2.1.3" version = "2.1.3"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com"] authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com"]
edition = "2018" edition = "2021"
[lib] [lib]
name = "beacon_node" name = "beacon_node"

View File

@ -2,7 +2,7 @@
name = "beacon_chain" name = "beacon_chain"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"] authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"]
edition = "2018" edition = "2021"
autotests = false # using a single test binary compiles faster autotests = false # using a single test binary compiles faster
[features] [features]

View File

@ -2289,7 +2289,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.position(|(_root, block)| { .position(|(_root, block)| {
block.slot().epoch(T::EthSpec::slots_per_epoch()) > start_epoch block.slot().epoch(T::EthSpec::slots_per_epoch()) > start_epoch
}) })
.unwrap_or_else(|| filtered_chain_segment.len()); .unwrap_or(filtered_chain_segment.len());
// Split off the first section blocks that are all either within the current epoch of // Split off the first section blocks that are all either within the current epoch of
// the first block. These blocks can all be signature-verified with the same // the first block. These blocks can all be signature-verified with the same

View File

@ -421,10 +421,7 @@ impl<T: AggregateMap> NaiveAggregationPool<T> {
/// Iterate all items in all slots of `self`. /// Iterate all items in all slots of `self`.
pub fn iter(&self) -> impl Iterator<Item = &T::Value> { pub fn iter(&self) -> impl Iterator<Item = &T::Value> {
self.maps self.maps.values().flat_map(|map| map.get_map().values())
.iter()
.map(|(_slot, map)| map.get_map().iter().map(|(_key, value)| value))
.flatten()
} }
/// Removes any items with a slot lower than `current_slot` and bars any future /// Removes any items with a slot lower than `current_slot` and bars any future

View File

@ -635,7 +635,7 @@ pub fn verify_sync_committee_message<T: BeaconChainTypes>(
let pubkey = pubkey_cache let pubkey = pubkey_cache
.get_pubkey_from_pubkey_bytes(pubkey_bytes) .get_pubkey_from_pubkey_bytes(pubkey_bytes)
.map(Cow::Borrowed) .map(Cow::Borrowed)
.ok_or_else(|| Error::UnknownValidatorPubkey(*pubkey_bytes))?; .ok_or(Error::UnknownValidatorPubkey(*pubkey_bytes))?;
let next_slot_epoch = (sync_message.get_slot() + 1).epoch(T::EthSpec::slots_per_epoch()); let next_slot_epoch = (sync_message.get_slot() + 1).epoch(T::EthSpec::slots_per_epoch());
let fork = chain.spec.fork_at_epoch(next_slot_epoch); let fork = chain.spec.fork_at_epoch(next_slot_epoch);

View File

@ -198,14 +198,11 @@ impl MonitoredValidator {
/// as the value recorded by the validator monitor ignores skip slots. /// as the value recorded by the validator monitor ignores skip slots.
fn min_inclusion_distance(&self, epoch: &Epoch) -> Option<u64> { fn min_inclusion_distance(&self, epoch: &Epoch) -> Option<u64> {
let summaries = self.summaries.read(); let summaries = self.summaries.read();
summaries summaries.get(epoch).and_then(|summary| {
.get(epoch) summary
.map(|summary| { .attestation_min_block_inclusion_distance
summary .map(Into::into)
.attestation_min_block_inclusion_distance })
.map(Into::into)
})
.flatten()
} }
/// Maps `func` across the `self.summaries`. /// Maps `func` across the `self.summaries`.

View File

@ -175,9 +175,7 @@ impl<T: BeaconChainTypes> ValidatorPubkeyCache<T> {
/// Get the `PublicKey` for a validator with `PublicKeyBytes`. /// Get the `PublicKey` for a validator with `PublicKeyBytes`.
pub fn get_pubkey_from_pubkey_bytes(&self, pubkey: &PublicKeyBytes) -> Option<&PublicKey> { pub fn get_pubkey_from_pubkey_bytes(&self, pubkey: &PublicKeyBytes) -> Option<&PublicKey> {
self.get_index(pubkey) self.get_index(pubkey).and_then(|index| self.get(index))
.map(|index| self.get(index))
.flatten()
} }
/// Get the public key (in bytes form) for a validator with index `i`. /// Get the public key (in bytes form) for a validator with index `i`.

View File

@ -179,7 +179,7 @@ fn aggregated_gossip_verification() {
get_valid_sync_contribution(&harness, RelativeSyncCommittee::Current); get_valid_sync_contribution(&harness, RelativeSyncCommittee::Current);
macro_rules! assert_invalid { macro_rules! assert_invalid {
($desc: tt, $attn_getter: expr, $($error: pat) |+ $( if $guard: expr )?) => { ($desc: tt, $attn_getter: expr, $($error: pat_param) |+ $( if $guard: expr )?) => {
assert!( assert!(
matches!( matches!(
harness harness
@ -505,7 +505,7 @@ fn unaggregated_gossip_verification() {
get_valid_sync_committee_message(&harness, current_slot, RelativeSyncCommittee::Current); get_valid_sync_committee_message(&harness, current_slot, RelativeSyncCommittee::Current);
macro_rules! assert_invalid { macro_rules! assert_invalid {
($desc: tt, $attn_getter: expr, $subnet_getter: expr, $($error: pat) |+ $( if $guard: expr )?) => { ($desc: tt, $attn_getter: expr, $subnet_getter: expr, $($error: pat_param) |+ $( if $guard: expr )?) => {
assert!( assert!(
matches!( matches!(
harness harness

View File

@ -2,7 +2,7 @@
name = "client" name = "client"
version = "0.2.0" version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
toml = "0.5.6" toml = "0.5.6"

View File

@ -2,7 +2,7 @@
name = "eth1" name = "eth1"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
eth1_test_rig = { path = "../../testing/eth1_test_rig" } eth1_test_rig = { path = "../../testing/eth1_test_rig" }

View File

@ -449,7 +449,7 @@ fn response_result_or_error(response: &str) -> Result<Value, RpcError> {
let json = serde_json::from_str::<Value>(response) let json = serde_json::from_str::<Value>(response)
.map_err(|e| RpcError::InvalidJson(e.to_string()))?; .map_err(|e| RpcError::InvalidJson(e.to_string()))?;
if let Some(error) = json.get("error").map(|e| e.get("message")).flatten() { if let Some(error) = json.get("error").and_then(|e| e.get("message")) {
let error = error.to_string(); let error = error.to_string();
if error.contains(EIP155_ERROR_STR) { if error.contains(EIP155_ERROR_STR) {
Err(RpcError::Eip155Error) Err(RpcError::Eip155Error)

View File

@ -1,7 +1,7 @@
[package] [package]
name = "execution_layer" name = "execution_layer"
version = "0.1.0" version = "0.1.0"
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "genesis" name = "genesis"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
eth1_test_rig = { path = "../../testing/eth1_test_rig" } eth1_test_rig = { path = "../../testing/eth1_test_rig" }

View File

@ -2,7 +2,7 @@
name = "http_api" name = "http_api"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
autotests = false # using a single test binary compiles faster autotests = false # using a single test binary compiles faster
[dependencies] [dependencies]

View File

@ -2,7 +2,7 @@
name = "http_metrics" name = "http_metrics"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "lighthouse_network" name = "lighthouse_network"
version = "0.2.0" version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
discv5 = { version = "0.1.0-beta.13", features = ["libp2p"] } discv5 = { version = "0.1.0-beta.13", features = ["libp2p"] }

View File

@ -458,7 +458,7 @@ impl<TSpec: EthSpec> Behaviour<TSpec> {
GossipKind::Attestation(subnet_id) => { GossipKind::Attestation(subnet_id) => {
if let Some(v) = metrics::get_int_gauge( if let Some(v) = metrics::get_int_gauge(
&metrics::FAILED_ATTESTATION_PUBLISHES_PER_SUBNET, &metrics::FAILED_ATTESTATION_PUBLISHES_PER_SUBNET,
&[&subnet_id.to_string()], &[subnet_id.as_ref()],
) { ) {
v.inc() v.inc()
}; };

View File

@ -2,7 +2,7 @@
name = "network" name = "network"
version = "0.2.0" version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
sloggers = { version = "2.1.1", features = ["json"] } sloggers = { version = "2.1.1", features = ["json"] }

View File

@ -2,7 +2,7 @@
name = "operation_pool" name = "operation_pool"
version = "0.2.0" version = "0.2.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
derivative = "2.1.1" derivative = "2.1.1"

View File

@ -560,9 +560,8 @@ impl<T: EthSpec> OperationPool<T> {
pub fn get_all_attestations(&self) -> Vec<Attestation<T>> { pub fn get_all_attestations(&self) -> Vec<Attestation<T>> {
self.attestations self.attestations
.read() .read()
.iter() .values()
.map(|(_, attns)| attns.iter().cloned()) .flat_map(|attns| attns.iter().cloned())
.flatten()
.collect() .collect()
} }
@ -575,10 +574,10 @@ impl<T: EthSpec> OperationPool<T> {
{ {
self.attestations self.attestations
.read() .read()
.iter() .values()
.map(|(_, attns)| attns.iter().cloned()) .flat_map(|attns| attns.iter())
.flatten() .filter(|attn| filter(*attn))
.filter(filter) .cloned()
.collect() .collect()
} }

View File

@ -97,20 +97,19 @@ impl<T: EthSpec> PersistedOperationPool<T> {
/// Reconstruct an `OperationPool`. Sets `sync_contributions` to its `Default` if `self` matches /// Reconstruct an `OperationPool`. Sets `sync_contributions` to its `Default` if `self` matches
/// `PersistedOperationPool::Base`. /// `PersistedOperationPool::Base`.
pub fn into_operation_pool(self) -> Result<OperationPool<T>, OpPoolError> { pub fn into_operation_pool(self) -> Result<OperationPool<T>, OpPoolError> {
let attestations = RwLock::new(self.attestations().to_vec().into_iter().collect()); let attestations = RwLock::new(self.attestations().iter().cloned().collect());
let attester_slashings = let attester_slashings = RwLock::new(self.attester_slashings().iter().cloned().collect());
RwLock::new(self.attester_slashings().to_vec().into_iter().collect());
let proposer_slashings = RwLock::new( let proposer_slashings = RwLock::new(
self.proposer_slashings() self.proposer_slashings()
.to_vec() .iter()
.into_iter() .cloned()
.map(|slashing| (slashing.signed_header_1.message.proposer_index, slashing)) .map(|slashing| (slashing.signed_header_1.message.proposer_index, slashing))
.collect(), .collect(),
); );
let voluntary_exits = RwLock::new( let voluntary_exits = RwLock::new(
self.voluntary_exits() self.voluntary_exits()
.to_vec() .iter()
.into_iter() .cloned()
.map(|exit| (exit.message.validator_index, exit)) .map(|exit| (exit.message.validator_index, exit))
.collect(), .collect(),
); );
@ -125,7 +124,7 @@ impl<T: EthSpec> PersistedOperationPool<T> {
}, },
PersistedOperationPool::Altair(_) => { PersistedOperationPool::Altair(_) => {
let sync_contributions = let sync_contributions =
RwLock::new(self.sync_contributions()?.to_vec().into_iter().collect()); RwLock::new(self.sync_contributions()?.iter().cloned().collect());
OperationPool { OperationPool {
attestations, attestations,

View File

@ -705,13 +705,15 @@ pub fn set_network_config(
// Appending enr-port to the dns hostname to appease `to_socket_addrs()` parsing. // Appending enr-port to the dns hostname to appease `to_socket_addrs()` parsing.
// Since enr-update is disabled with a dns address, not setting the enr-udp-port // Since enr-update is disabled with a dns address, not setting the enr-udp-port
// will make the node undiscoverable. // will make the node undiscoverable.
if let Some(enr_udp_port) = config.enr_udp_port.or_else(|| { if let Some(enr_udp_port) =
if use_listening_port_as_enr_port_by_default { config
Some(config.discovery_port) .enr_udp_port
} else { .or(if use_listening_port_as_enr_port_by_default {
None Some(config.discovery_port)
} } else {
}) { None
})
{
addr.push_str(&format!(":{}", enr_udp_port)); addr.push_str(&format!(":{}", enr_udp_port));
} else { } else {
return Err( return Err(

View File

@ -2,7 +2,7 @@
name = "store" name = "store"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
tempfile = "3.1.0" tempfile = "3.1.0"

View File

@ -762,7 +762,7 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
let partial_state_bytes = self let partial_state_bytes = self
.cold_db .cold_db
.get_bytes(DBColumn::BeaconState.into(), state_root.as_bytes())? .get_bytes(DBColumn::BeaconState.into(), state_root.as_bytes())?
.ok_or_else(|| HotColdDBError::MissingRestorePoint(*state_root))?; .ok_or(HotColdDBError::MissingRestorePoint(*state_root))?;
let mut partial_state: PartialBeaconState<E> = let mut partial_state: PartialBeaconState<E> =
PartialBeaconState::from_ssz_bytes(&partial_state_bytes, &self.spec)?; PartialBeaconState::from_ssz_bytes(&partial_state_bytes, &self.spec)?;

View File

@ -2,7 +2,7 @@
name = "timer" name = "timer"
version = "0.2.0" version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
beacon_chain = { path = "../beacon_chain" } beacon_chain = { path = "../beacon_chain" }

View File

@ -2,7 +2,7 @@
name = "boot_node" name = "boot_node"
version = "2.1.3" version = "2.1.3"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
beacon_node = { path = "../beacon_node" } beacon_node = { path = "../beacon_node" }

View File

@ -2,7 +2,7 @@
name = "account_utils" name = "account_utils"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "clap_utils" name = "clap_utils"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -31,7 +31,7 @@ pub fn get_eth2_network_config(cli_args: &ArgMatches) -> Result<Eth2NetworkConfi
if let Some(string) = parse_optional::<String>(cli_args, "terminal-total-difficulty-override")? if let Some(string) = parse_optional::<String>(cli_args, "terminal-total-difficulty-override")?
{ {
let stripped = string.replace(",", ""); let stripped = string.replace(',', "");
let terminal_total_difficulty = Uint256::from_dec_str(&stripped).map_err(|e| { let terminal_total_difficulty = Uint256::from_dec_str(&stripped).map_err(|e| {
format!( format!(
"Could not parse --terminal-total-difficulty-override as decimal value: {:?}", "Could not parse --terminal-total-difficulty-override as decimal value: {:?}",

View File

@ -2,7 +2,7 @@
name = "compare_fields" name = "compare_fields"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
compare_fields_derive = { path = "../compare_fields_derive" } compare_fields_derive = { path = "../compare_fields_derive" }

View File

@ -2,7 +2,7 @@
name = "compare_fields_derive" name = "compare_fields_derive"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[lib] [lib]
proc-macro = true proc-macro = true

View File

@ -8,7 +8,7 @@ use syn::{parse_macro_input, DeriveInput};
fn is_slice(field: &syn::Field) -> bool { fn is_slice(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| { field.attrs.iter().any(|attr| {
attr.path.is_ident("compare_fields") attr.path.is_ident("compare_fields")
&& attr.tokens.to_string().replace(" ", "") == "(as_slice)" && attr.tokens.to_string().replace(' ', "") == "(as_slice)"
}) })
} }

View File

@ -2,7 +2,7 @@
name = "deposit_contract" name = "deposit_contract"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
build = "build.rs" build = "build.rs"

View File

@ -2,7 +2,7 @@
name = "directory" name = "directory"
version = "0.1.0" version = "0.1.0"
authors = ["pawan <pawandhananjay@gmail.com>"] authors = ["pawan <pawandhananjay@gmail.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "eth2" name = "eth2"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "eth2_config" name = "eth2_config"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
types = { path = "../../consensus/types" } types = { path = "../../consensus/types" }

View File

@ -2,7 +2,7 @@
name = "eth2_interop_keypairs" name = "eth2_interop_keypairs"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "eth2_network_config" name = "eth2_network_config"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
build = "build.rs" build = "build.rs"

View File

@ -2,7 +2,7 @@
name = "eth2_wallet_manager" name = "eth2_wallet_manager"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "fallback" name = "fallback"
version = "0.1.0" version = "0.1.0"
authors = ["blacktemplar <blacktemplar@a1.net>"] authors = ["blacktemplar <blacktemplar@a1.net>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "filesystem" name = "filesystem"
version = "0.1.0" version = "0.1.0"
authors = ["Mark Mackey <mark@sigmaprime.io>"] authors = ["Mark Mackey <mark@sigmaprime.io>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "hashset_delay" name = "hashset_delay"
version = "0.2.0" version = "0.2.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
futures = "0.3.7" futures = "0.3.7"

View File

@ -2,7 +2,7 @@
name = "lighthouse_metrics" name = "lighthouse_metrics"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "lighthouse_version" name = "lighthouse_version"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "lockfile" name = "lockfile"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
fs2 = "0.4.3" fs2 = "0.4.3"

View File

@ -2,7 +2,7 @@
name = "logging" name = "logging"
version = "0.2.0" version = "0.2.0"
authors = ["blacktemplar <blacktemplar@a1.net>"] authors = ["blacktemplar <blacktemplar@a1.net>"]
edition = "2018" edition = "2021"
[features] [features]
test_logger = [] # Print log output to stderr when running tests instead of dropping it test_logger = [] # Print log output to stderr when running tests instead of dropping it

View File

@ -3,13 +3,11 @@ use std::process::Command;
use std::process::Output; use std::process::Output;
fn run_cmd(cmd_line: &str) -> Result<Output, std::io::Error> { fn run_cmd(cmd_line: &str) -> Result<Output, std::io::Error> {
let output;
if cfg!(target_os = "windows") { if cfg!(target_os = "windows") {
output = Command::new(r#"cmd"#).args(["/C", cmd_line]).output(); Command::new(r#"cmd"#).args(["/C", cmd_line]).output()
} else { } else {
output = Command::new(r#"sh"#).args(["-c", cmd_line]).output(); Command::new(r#"sh"#).args(["-c", cmd_line]).output()
} }
output
} }
#[test] #[test]

View File

@ -2,7 +2,7 @@
name = "lru_cache" name = "lru_cache"
version = "0.1.0" version = "0.1.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
fnv = "1.0.7" fnv = "1.0.7"

View File

@ -2,7 +2,7 @@
name = "malloc_utils" name = "malloc_utils"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "monitoring_api" name = "monitoring_api"
version = "0.1.0" version = "0.1.0"
authors = ["pawan <pawandhananjay@gmail.com>"] authors = ["pawan <pawandhananjay@gmail.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "sensitive_url" name = "sensitive_url"
version = "0.1.0" version = "0.1.0"
authors = ["Mac L <mjladson@pm.me>"] authors = ["Mac L <mjladson@pm.me>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "slot_clock" name = "slot_clock"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
types = { path = "../../consensus/types" } types = { path = "../../consensus/types" }

View File

@ -2,7 +2,7 @@
name = "target_check" name = "target_check"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
static_assertions = "1.1.0" static_assertions = "1.1.0"

View File

@ -2,7 +2,7 @@
name = "task_executor" name = "task_executor"
version = "0.1.0" version = "0.1.0"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
tokio = { version = "1.14.0", features = ["rt"] } tokio = { version = "1.14.0", features = ["rt"] }

View File

@ -2,7 +2,7 @@
name = "test_random_derive" name = "test_random_derive"
version = "0.2.0" version = "0.2.0"
authors = ["thojest <thojest@gmail.com>"] authors = ["thojest <thojest@gmail.com>"]
edition = "2018" edition = "2021"
description = "Procedural derive macros for implementation of TestRandom trait" description = "Procedural derive macros for implementation of TestRandom trait"
[lib] [lib]

View File

@ -10,7 +10,7 @@ use syn::{parse_macro_input, DeriveInput};
/// The field attribute is: `#[test_random(default)]` /// The field attribute is: `#[test_random(default)]`
fn should_use_default(field: &syn::Field) -> bool { fn should_use_default(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| { field.attrs.iter().any(|attr| {
attr.path.is_ident("test_random") && attr.tokens.to_string().replace(" ", "") == "(default)" attr.path.is_ident("test_random") && attr.tokens.to_string().replace(' ', "") == "(default)"
}) })
} }

View File

@ -2,7 +2,7 @@
name = "validator_dir" name = "validator_dir"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[features] [features]
insecure_keys = [] insecure_keys = []

View File

@ -2,7 +2,7 @@
name = "warp_utils" name = "warp_utils"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "cached_tree_hash" name = "cached_tree_hash"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
ethereum-types = "0.12.1" ethereum-types = "0.12.1"

View File

@ -127,7 +127,7 @@ impl<T: Encode + Decode> CacheArena<T> {
.offsets .offsets
.get(alloc_id + 1) .get(alloc_id + 1)
.copied() .copied()
.unwrap_or_else(|| self.backing.len()); .unwrap_or(self.backing.len());
Ok(end - start) Ok(end - start)
} }
@ -168,7 +168,7 @@ impl<T: Encode + Decode> CacheArena<T> {
.offsets .offsets
.get(alloc_id + 1) .get(alloc_id + 1)
.copied() .copied()
.unwrap_or_else(|| self.backing.len()); .unwrap_or(self.backing.len());
Ok(start..end) Ok(start..end)
} }

View File

@ -2,7 +2,7 @@
name = "fork_choice" name = "fork_choice"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -219,7 +219,7 @@ fn dequeue_attestations(
queued_attestations queued_attestations
.iter() .iter()
.position(|a| a.slot >= current_slot) .position(|a| a.slot >= current_slot)
.unwrap_or_else(|| queued_attestations.len()), .unwrap_or(queued_attestations.len()),
); );
std::mem::replace(queued_attestations, remaining) std::mem::replace(queued_attestations, remaining)

View File

@ -613,7 +613,7 @@ fn justified_balances() {
} }
macro_rules! assert_invalid_block { macro_rules! assert_invalid_block {
($err: tt, $($error: pat) |+ $( if $guard: expr )?) => { ($err: tt, $($error: pat_param) |+ $( if $guard: expr )?) => {
assert!( assert!(
matches!( matches!(
$err, $err,
@ -719,7 +719,7 @@ fn invalid_block_finalized_descendant() {
} }
macro_rules! assert_invalid_attestation { macro_rules! assert_invalid_attestation {
($err: tt, $($error: pat) |+ $( if $guard: expr )?) => { ($err: tt, $($error: pat_param) |+ $( if $guard: expr )?) => {
assert!( assert!(
matches!( matches!(
$err, $err,

View File

@ -2,7 +2,7 @@
name = "int_to_bytes" name = "int_to_bytes"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
bytes = "1.0.1" bytes = "1.0.1"

View File

@ -2,7 +2,7 @@
name = "merkle_proof" name = "merkle_proof"
version = "0.2.0" version = "0.2.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
ethereum-types = "0.12.1" ethereum-types = "0.12.1"

View File

@ -2,7 +2,7 @@
name = "proto_array" name = "proto_array"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@sigmaprime.io>"] authors = ["Paul Hauner <paul@sigmaprime.io>"]
edition = "2018" edition = "2021"
[[bin]] [[bin]]
name = "proto_array" name = "proto_array"

View File

@ -313,7 +313,7 @@ impl ProtoArray {
.indices .indices
.get(justified_root) .get(justified_root)
.copied() .copied()
.ok_or_else(|| Error::JustifiedNodeUnknown(*justified_root))?; .ok_or(Error::JustifiedNodeUnknown(*justified_root))?;
let justified_node = self let justified_node = self
.nodes .nodes

View File

@ -2,7 +2,7 @@
name = "safe_arith" name = "safe_arith"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "eth2_serde_utils" name = "eth2_serde_utils"
version = "0.1.1" version = "0.1.1"
authors = ["Paul Hauner <paul@paulhauner.com", "Michael Sproul <michael@sigmaprime.io>"] authors = ["Paul Hauner <paul@paulhauner.com", "Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
description = "Serialization and deserialization utilities useful for JSON representations of Ethereum 2.0 types." description = "Serialization and deserialization utilities useful for JSON representations of Ethereum 2.0 types."
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -51,7 +51,7 @@ where
let raw = hex::encode(num.to_be_bytes()); let raw = hex::encode(num.to_be_bytes());
let trimmed = raw.trim_start_matches('0'); let trimmed = raw.trim_start_matches('0');
let hex = if trimmed.is_empty() { "0" } else { &trimmed }; let hex = if trimmed.is_empty() { "0" } else { trimmed };
serializer.serialize_str(&format!("0x{}", &hex)) serializer.serialize_str(&format!("0x{}", &hex))
} }

View File

@ -2,7 +2,7 @@
name = "eth2_ssz" name = "eth2_ssz"
version = "0.4.1" version = "0.4.1"
authors = ["Paul Hauner <paul@sigmaprime.io>"] authors = ["Paul Hauner <paul@sigmaprime.io>"]
edition = "2018" edition = "2021"
description = "SimpleSerialize (SSZ) as used in Ethereum 2.0" description = "SimpleSerialize (SSZ) as used in Ethereum 2.0"
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -187,12 +187,13 @@ impl<'a> SszDecoderBuilder<'a> {
let start = self.items_index; let start = self.items_index;
self.items_index += ssz_fixed_len; self.items_index += ssz_fixed_len;
let slice = self.bytes.get(start..self.items_index).ok_or_else(|| { let slice =
DecodeError::InvalidByteLength { self.bytes
len: self.bytes.len(), .get(start..self.items_index)
expected: self.items_index, .ok_or(DecodeError::InvalidByteLength {
} len: self.bytes.len(),
})?; expected: self.items_index,
})?;
self.items.push(slice); self.items.push(slice);
} else { } else {
@ -347,12 +348,12 @@ pub fn split_union_bytes(bytes: &[u8]) -> Result<(UnionSelector, &[u8]), DecodeE
/// Reads a `BYTES_PER_LENGTH_OFFSET`-byte length from `bytes`, where `bytes.len() >= /// Reads a `BYTES_PER_LENGTH_OFFSET`-byte length from `bytes`, where `bytes.len() >=
/// BYTES_PER_LENGTH_OFFSET`. /// BYTES_PER_LENGTH_OFFSET`.
pub fn read_offset(bytes: &[u8]) -> Result<usize, DecodeError> { pub fn read_offset(bytes: &[u8]) -> Result<usize, DecodeError> {
decode_offset(bytes.get(0..BYTES_PER_LENGTH_OFFSET).ok_or_else(|| { decode_offset(bytes.get(0..BYTES_PER_LENGTH_OFFSET).ok_or(
DecodeError::InvalidLengthPrefix { DecodeError::InvalidLengthPrefix {
len: bytes.len(), len: bytes.len(),
expected: BYTES_PER_LENGTH_OFFSET, expected: BYTES_PER_LENGTH_OFFSET,
} },
})?) )?)
} }
/// Decode bytes as a little-endian usize, returning an `Err` if `bytes.len() != /// Decode bytes as a little-endian usize, returning an `Err` if `bytes.len() !=

View File

@ -2,7 +2,7 @@
name = "eth2_ssz_derive" name = "eth2_ssz_derive"
version = "0.3.0" version = "0.3.0"
authors = ["Paul Hauner <paul@sigmaprime.io>"] authors = ["Paul Hauner <paul@sigmaprime.io>"]
edition = "2018" edition = "2021"
description = "Procedural derive macros to accompany the eth2_ssz crate." description = "Procedural derive macros to accompany the eth2_ssz crate."
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -2,7 +2,7 @@
name = "eth2_ssz_types" name = "eth2_ssz_types"
version = "0.2.2" version = "0.2.2"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
description = "Provides types with unique properties required for SSZ serialization and Merklization." description = "Provides types with unique properties required for SSZ serialization and Merklization."
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -2,7 +2,7 @@
name = "state_processing" name = "state_processing"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Michael Sproul <michael@sigmaprime.io>"] authors = ["Paul Hauner <paul@paulhauner.com>", "Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dev-dependencies] [dev-dependencies]
env_logger = "0.9.0" env_logger = "0.9.0"

View File

@ -3,7 +3,7 @@
not(test), not(test),
deny( deny(
clippy::integer_arithmetic, clippy::integer_arithmetic,
clippy::disallowed_method, clippy::disallowed_methods,
clippy::indexing_slicing, clippy::indexing_slicing,
clippy::unwrap_used, clippy::unwrap_used,
clippy::expect_used, clippy::expect_used,

View File

@ -177,7 +177,7 @@ where
Ok(SignatureSet::single_pubkey( Ok(SignatureSet::single_pubkey(
block.body().randao_reveal(), block.body().randao_reveal(),
get_pubkey(proposer_index).ok_or_else(|| Error::ValidatorUnknown(proposer_index as u64))?, get_pubkey(proposer_index).ok_or(Error::ValidatorUnknown(proposer_index as u64))?,
message, message,
)) ))
} }
@ -199,15 +199,13 @@ where
block_header_signature_set( block_header_signature_set(
state, state,
&proposer_slashing.signed_header_1, &proposer_slashing.signed_header_1,
get_pubkey(proposer_index) get_pubkey(proposer_index).ok_or(Error::ValidatorUnknown(proposer_index as u64))?,
.ok_or_else(|| Error::ValidatorUnknown(proposer_index as u64))?,
spec, spec,
), ),
block_header_signature_set( block_header_signature_set(
state, state,
&proposer_slashing.signed_header_2, &proposer_slashing.signed_header_2,
get_pubkey(proposer_index) get_pubkey(proposer_index).ok_or(Error::ValidatorUnknown(proposer_index as u64))?,
.ok_or_else(|| Error::ValidatorUnknown(proposer_index as u64))?,
spec, spec,
), ),
)) ))
@ -363,7 +361,7 @@ where
Ok(SignatureSet::single_pubkey( Ok(SignatureSet::single_pubkey(
&signed_exit.signature, &signed_exit.signature,
get_pubkey(proposer_index).ok_or_else(|| Error::ValidatorUnknown(proposer_index as u64))?, get_pubkey(proposer_index).ok_or(Error::ValidatorUnknown(proposer_index as u64))?,
message, message,
)) ))
} }
@ -521,7 +519,7 @@ where
{ {
let mut pubkeys = Vec::with_capacity(T::SyncSubcommitteeSize::to_usize()); let mut pubkeys = Vec::with_capacity(T::SyncSubcommitteeSize::to_usize());
for pubkey in pubkey_bytes { for pubkey in pubkey_bytes {
pubkeys.push(get_pubkey(pubkey).ok_or_else(|| Error::ValidatorPubkeyUnknown(*pubkey))?); pubkeys.push(get_pubkey(pubkey).ok_or(Error::ValidatorPubkeyUnknown(*pubkey))?);
} }
let domain = spec.get_domain(epoch, Domain::SyncCommittee, fork, genesis_validators_root); let domain = spec.get_domain(epoch, Domain::SyncCommittee, fork, genesis_validators_root);

View File

@ -4,7 +4,6 @@ use crate::per_epoch_processing::{
Delta, Error, Delta, Error,
}; };
use safe_arith::SafeArith; use safe_arith::SafeArith;
use std::array::IntoIter as ArrayIter;
use types::{BeaconState, ChainSpec, EthSpec}; use types::{BeaconState, ChainSpec, EthSpec};
/// Combination of several deltas for different components of an attestation reward. /// Combination of several deltas for different components of an attestation reward.
@ -30,13 +29,13 @@ impl AttestationDelta {
inactivity_penalty_delta, inactivity_penalty_delta,
} = self; } = self;
let mut result = Delta::default(); let mut result = Delta::default();
for delta in ArrayIter::new([ for delta in [
source_delta, source_delta,
target_delta, target_delta,
head_delta, head_delta,
inclusion_delay_delta, inclusion_delay_delta,
inactivity_penalty_delta, inactivity_penalty_delta,
]) { ] {
result.combine(delta)?; result.combine(delta)?;
} }
Ok(result) Ok(result)

View File

@ -2,7 +2,7 @@
name = "swap_or_not_shuffle" name = "swap_or_not_shuffle"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[[bench]] [[bench]]
name = "benches" name = "benches"

View File

@ -2,7 +2,7 @@
name = "tree_hash" name = "tree_hash"
version = "0.4.1" version = "0.4.1"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Efficient Merkle-hashing as used in Ethereum 2.0" description = "Efficient Merkle-hashing as used in Ethereum 2.0"

View File

@ -376,8 +376,8 @@ mod test {
fn compare_with_reference(leaves: &[Hash256], depth: usize) { fn compare_with_reference(leaves: &[Hash256], depth: usize) {
let reference_bytes = leaves let reference_bytes = leaves
.iter() .iter()
.map(|hash| hash.as_bytes().to_vec()) .flat_map(|hash| hash.as_bytes())
.flatten() .copied()
.collect::<Vec<_>>(); .collect::<Vec<_>>();
let reference_root = merkleize_padded(&reference_bytes, 1 << (depth - 1)); let reference_root = merkleize_padded(&reference_bytes, 1 << (depth - 1));

View File

@ -2,7 +2,7 @@
name = "tree_hash_derive" name = "tree_hash_derive"
version = "0.4.0" version = "0.4.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
description = "Procedural derive macros to accompany the tree_hash crate." description = "Procedural derive macros to accompany the tree_hash crate."
license = "Apache-2.0" license = "Apache-2.0"

View File

@ -109,7 +109,7 @@ fn cached_tree_hash_attr_metas(attrs: &[Attribute]) -> Vec<Meta> {
fn should_skip_hashing(field: &syn::Field) -> bool { fn should_skip_hashing(field: &syn::Field) -> bool {
field.attrs.iter().any(|attr| { field.attrs.iter().any(|attr| {
attr.path.is_ident("tree_hash") attr.path.is_ident("tree_hash")
&& attr.tokens.to_string().replace(" ", "") == "(skip_hashing)" && attr.tokens.to_string().replace(' ', "") == "(skip_hashing)"
}) })
} }

View File

@ -2,7 +2,7 @@
name = "types" name = "types"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"] authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"]
edition = "2018" edition = "2021"
[[bench]] [[bench]]
name = "benches" name = "benches"

View File

@ -1,5 +1,5 @@
#![allow(clippy::integer_arithmetic)] #![allow(clippy::integer_arithmetic)]
#![allow(clippy::disallowed_method)] #![allow(clippy::disallowed_methods)]
#![allow(clippy::indexing_slicing)] #![allow(clippy::indexing_slicing)]
use super::Error; use super::Error;

View File

@ -7,7 +7,7 @@
not(test), not(test),
deny( deny(
clippy::integer_arithmetic, clippy::integer_arithmetic,
clippy::disallowed_method, clippy::disallowed_methods,
clippy::indexing_slicing clippy::indexing_slicing
) )
)] )]

View File

@ -2,7 +2,7 @@
name = "bls" name = "bls"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
eth2_ssz = "0.4.1" eth2_ssz = "0.4.1"

View File

@ -2,7 +2,7 @@
name = "eth2_hashing" name = "eth2_hashing"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
description = "Hashing primitives used in Ethereum 2.0" description = "Hashing primitives used in Ethereum 2.0"

View File

@ -2,7 +2,7 @@
name = "eth2_key_derivation" name = "eth2_key_derivation"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -148,8 +148,7 @@ fn parent_sk_to_lamport_pk(ikm: &[u8], index: u32) -> ZeroizeHash {
lamports lamports
.iter() .iter()
.map(LamportSecretKey::iter_chunks) .flat_map(LamportSecretKey::iter_chunks)
.flatten()
.enumerate() .enumerate()
.for_each(|(i, chunk)| { .for_each(|(i, chunk)| {
let mut hasher = Sha256::new(); let mut hasher = Sha256::new();

View File

@ -2,7 +2,7 @@
name = "eth2_keystore" name = "eth2_keystore"
version = "0.1.0" version = "0.1.0"
authors = ["Pawan Dhananjay <pawan@sigmaprime.io", "Paul Hauner <paul@paulhauner.com>"] authors = ["Pawan Dhananjay <pawan@sigmaprime.io", "Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -2,7 +2,7 @@
name = "eth2_wallet" name = "eth2_wallet"
version = "0.1.0" version = "0.1.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -3,7 +3,7 @@ name = "lcli"
description = "Lighthouse CLI (modeled after zcli)" description = "Lighthouse CLI (modeled after zcli)"
version = "2.1.3" version = "2.1.3"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[features] [features]
portable = ["bls/supranational-portable"] portable = ["bls/supranational-portable"]

View File

@ -74,9 +74,9 @@ async fn get_block_attestations_set<'a, T: EthSpec>(
.graffiti() .graffiti()
.as_utf8_lossy() .as_utf8_lossy()
// Remove commas and apostropes from graffiti to ensure correct CSV format. // Remove commas and apostropes from graffiti to ensure correct CSV format.
.replace(",", "") .replace(',', "")
.replace("\"", "") .replace('"', "")
.replace("'", ""), .replace('\'', ""),
}; };
let attestations = block.message().body().attestations(); let attestations = block.message().body().attestations();

View File

@ -2,7 +2,7 @@
name = "lighthouse" name = "lighthouse"
version = "2.1.3" version = "2.1.3"
authors = ["Sigma Prime <contact@sigmaprime.io>"] authors = ["Sigma Prime <contact@sigmaprime.io>"]
edition = "2018" edition = "2021"
autotests = false autotests = false
[features] [features]

View File

@ -2,7 +2,7 @@
name = "environment" name = "environment"
version = "0.1.2" version = "0.1.2"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
tokio = { version = "1.14.0", features = ["macros", "rt", "rt-multi-thread", "signal" ] } tokio = { version = "1.14.0", features = ["macros", "rt", "rt-multi-thread", "signal" ] }

View File

@ -2,7 +2,7 @@
name = "slasher" name = "slasher"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
bincode = "1.3.1" bincode = "1.3.1"

View File

@ -2,7 +2,7 @@
name = "slasher_service" name = "slasher_service"
version = "0.1.0" version = "0.1.0"
authors = ["Michael Sproul <michael@sigmaprime.io>"] authors = ["Michael Sproul <michael@sigmaprime.io>"]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
beacon_chain = { path = "../../beacon_node/beacon_chain" } beacon_chain = { path = "../../beacon_node/beacon_chain" }

View File

@ -2,7 +2,7 @@
name = "ef_tests" name = "ef_tests"
version = "0.2.0" version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>"] authors = ["Paul Hauner <paul@paulhauner.com>"]
edition = "2018" edition = "2021"
[features] [features]
# `ef_tests` feature must be enabled to actually run the tests # `ef_tests` feature must be enabled to actually run the tests

Some files were not shown because too many files have changed in this diff Show More