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

View File

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

View File

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

View File

@@ -175,7 +175,7 @@ impl Serialize for AsyncRecord {
// Convoluted pattern to avoid binding `format_args!` to a temporary. // 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 // 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| { 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))); let record = Record::new(&rs, &msg, BorrowedKV(&(*kv)));
self.logger_values self.logger_values

View File

@@ -2253,7 +2253,7 @@ fn slasher_broadcast_flag_false() {
}); });
} }
#[cfg(all(feature = "lmdb"))] #[cfg(all(feature = "slasher-lmdb"))]
#[test] #[test]
fn slasher_backend_override_to_default() { fn slasher_backend_override_to_default() {
// Hard to test this flag because all but one backend is disabled by default and the backend // 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) { for target_epoch in (start_epoch..max_target.as_u64()).map(Epoch::new) {
txn.put( txn.put(
&self.databases.attesters_db, &self.databases.attesters_db,
&AttesterKey::new(validator_index, target_epoch, &self.config), AttesterKey::new(validator_index, target_epoch, &self.config),
CompactAttesterRecord::null().as_bytes(), CompactAttesterRecord::null().as_bytes(),
)?; )?;
} }
@@ -417,8 +417,8 @@ impl<E: EthSpec> SlasherDB<E> {
txn.put( txn.put(
&self.databases.attesters_max_targets_db, &self.databases.attesters_max_targets_db,
&CurrentEpochKey::new(validator_index), CurrentEpochKey::new(validator_index),
&max_target.as_ssz_bytes(), max_target.as_ssz_bytes(),
)?; )?;
Ok(()) Ok(())
} }
@@ -444,8 +444,8 @@ impl<E: EthSpec> SlasherDB<E> {
) -> Result<(), Error> { ) -> Result<(), Error> {
txn.put( txn.put(
&self.databases.current_epochs_db, &self.databases.current_epochs_db,
&CurrentEpochKey::new(validator_index), CurrentEpochKey::new(validator_index),
&current_epoch.as_ssz_bytes(), current_epoch.as_ssz_bytes(),
)?; )?;
Ok(()) Ok(())
} }
@@ -621,7 +621,7 @@ impl<E: EthSpec> SlasherDB<E> {
txn.put( txn.put(
&self.databases.attesters_db, &self.databases.attesters_db,
&AttesterKey::new(validator_index, target_epoch, &self.config), AttesterKey::new(validator_index, target_epoch, &self.config),
indexed_attestation_id, indexed_attestation_id,
)?; )?;
@@ -699,8 +699,8 @@ impl<E: EthSpec> SlasherDB<E> {
} else { } else {
txn.put( txn.put(
&self.databases.proposers_db, &self.databases.proposers_db,
&ProposerKey::new(proposer_index, slot), ProposerKey::new(proposer_index, slot),
&block_header.as_ssz_bytes(), block_header.as_ssz_bytes(),
)?; )?;
Ok(ProposerSlashingStatus::NotSlashable) Ok(ProposerSlashingStatus::NotSlashable)
} }