Rust 1.80.0 lints (#6183)

* Fix lints
This commit is contained in:
Mac L
2024-07-25 19:56:22 +04:00
committed by GitHub
parent 62a39af19e
commit cc55e610b9
25 changed files with 52 additions and 48 deletions

View File

@@ -300,7 +300,9 @@ pub enum BlockError<E: EthSpec> {
/// 1. The block proposer is faulty
/// 2. We received the blob over rpc and it is invalid (inconsistent w.r.t the block).
/// 3. It is an internal error
///
/// For all these cases, we cannot penalize the peer that gave us the block.
///
/// TODO: We may need to penalize the peer that gave us a potentially invalid rpc blob.
/// https://github.com/sigp/lighthouse/issues/4546
AvailabilityCheck(AvailabilityCheckError),

View File

@@ -11,6 +11,7 @@ categories = ["network-programming", "asynchronous"]
[features]
wasm-bindgen = ["getrandom/js"]
rsa = []
[dependencies]
async-channel = { workspace = true }

View File

@@ -214,6 +214,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
/// Check if this new lookup extends a bad chain:
/// - Extending `child_block_root_trigger` would exceed the max depth
/// - `block_root_to_search` is a failed chain
///
/// Returns true if the lookup is created or already exists
pub fn search_parent_of_child(
&mut self,

View File

@@ -175,7 +175,7 @@ impl Serialize for AsyncRecord {
// Convoluted pattern to avoid binding `format_args!` to a temporary.
// See: https://stackoverflow.com/questions/56304313/cannot-use-format-args-due-to-temporary-value-is-freed-at-the-end-of-this-state
let mut f = |msg: std::fmt::Arguments| {
map_serializer.serialize_entry("msg", &msg.to_string())?;
map_serializer.serialize_entry("msg", msg.to_string())?;
let record = Record::new(&rs, &msg, BorrowedKV(&(*kv)));
self.logger_values

View File

@@ -2253,7 +2253,7 @@ fn slasher_broadcast_flag_false() {
});
}
#[cfg(all(feature = "lmdb"))]
#[cfg(all(feature = "slasher-lmdb"))]
#[test]
fn slasher_backend_override_to_default() {
// Hard to test this flag because all but one backend is disabled by default and the backend

View File

@@ -409,7 +409,7 @@ impl<E: EthSpec> SlasherDB<E> {
for target_epoch in (start_epoch..max_target.as_u64()).map(Epoch::new) {
txn.put(
&self.databases.attesters_db,
&AttesterKey::new(validator_index, target_epoch, &self.config),
AttesterKey::new(validator_index, target_epoch, &self.config),
CompactAttesterRecord::null().as_bytes(),
)?;
}
@@ -417,8 +417,8 @@ impl<E: EthSpec> SlasherDB<E> {
txn.put(
&self.databases.attesters_max_targets_db,
&CurrentEpochKey::new(validator_index),
&max_target.as_ssz_bytes(),
CurrentEpochKey::new(validator_index),
max_target.as_ssz_bytes(),
)?;
Ok(())
}
@@ -444,8 +444,8 @@ impl<E: EthSpec> SlasherDB<E> {
) -> Result<(), Error> {
txn.put(
&self.databases.current_epochs_db,
&CurrentEpochKey::new(validator_index),
&current_epoch.as_ssz_bytes(),
CurrentEpochKey::new(validator_index),
current_epoch.as_ssz_bytes(),
)?;
Ok(())
}
@@ -621,7 +621,7 @@ impl<E: EthSpec> SlasherDB<E> {
txn.put(
&self.databases.attesters_db,
&AttesterKey::new(validator_index, target_epoch, &self.config),
AttesterKey::new(validator_index, target_epoch, &self.config),
indexed_attestation_id,
)?;
@@ -699,8 +699,8 @@ impl<E: EthSpec> SlasherDB<E> {
} else {
txn.put(
&self.databases.proposers_db,
&ProposerKey::new(proposer_index, slot),
&block_header.as_ssz_bytes(),
ProposerKey::new(proposer_index, slot),
block_header.as_ssz_bytes(),
)?;
Ok(ProposerSlashingStatus::NotSlashable)
}