mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-04 05:14:33 +00:00
Rename integer_arithmetic to arithmetic_side_effects
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
not(test),
|
not(test),
|
||||||
deny(
|
deny(
|
||||||
clippy::integer_arithmetic,
|
clippy::arithmetic_side_effects,
|
||||||
clippy::disallowed_methods,
|
clippy::disallowed_methods,
|
||||||
clippy::indexing_slicing,
|
clippy::indexing_slicing,
|
||||||
clippy::unwrap_used,
|
clippy::unwrap_used,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::arithmetic_side_effects)]
|
||||||
|
|
||||||
use super::signature_sets::{Error as SignatureSetError, *};
|
use super::signature_sets::{Error as SignatureSetError, *};
|
||||||
use crate::per_block_processing::errors::{AttestationInvalid, BlockOperationError};
|
use crate::per_block_processing::errors::{AttestationInvalid, BlockOperationError};
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ impl<E: EthSpec> VerifyOperation<E> for SignedVoluntaryExit {
|
|||||||
Ok(SigVerifiedOp::new(self, state))
|
Ok(SigVerifiedOp::new(self, state))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
||||||
smallvec![self.message.epoch]
|
smallvec![self.message.epoch]
|
||||||
}
|
}
|
||||||
@@ -156,7 +156,7 @@ impl<E: EthSpec> VerifyOperation<E> for AttesterSlashing<E> {
|
|||||||
Ok(SigVerifiedOp::new(self, state))
|
Ok(SigVerifiedOp::new(self, state))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
||||||
smallvec![
|
smallvec![
|
||||||
self.attestation_1.data.target.epoch,
|
self.attestation_1.data.target.epoch,
|
||||||
@@ -177,7 +177,7 @@ impl<E: EthSpec> VerifyOperation<E> for ProposerSlashing {
|
|||||||
Ok(SigVerifiedOp::new(self, state))
|
Ok(SigVerifiedOp::new(self, state))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
||||||
// Only need a single epoch because the slots of the two headers must be equal.
|
// Only need a single epoch because the slots of the two headers must be equal.
|
||||||
smallvec![self
|
smallvec![self
|
||||||
@@ -200,7 +200,7 @@ impl<E: EthSpec> VerifyOperation<E> for SignedBlsToExecutionChange {
|
|||||||
Ok(SigVerifiedOp::new(self, state))
|
Ok(SigVerifiedOp::new(self, state))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
fn verification_epochs(&self) -> SmallVec<[Epoch; MAX_FORKS_VERIFIED_AGAINST]> {
|
||||||
smallvec![]
|
smallvec![]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ impl<T: EthSpec> BeaconState<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Specialised deserialisation method that uses the `ChainSpec` as context.
|
/// Specialised deserialisation method that uses the `ChainSpec` as context.
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
pub fn from_ssz_bytes(bytes: &[u8], spec: &ChainSpec) -> Result<Self, ssz::DecodeError> {
|
pub fn from_ssz_bytes(bytes: &[u8], spec: &ChainSpec) -> Result<Self, ssz::DecodeError> {
|
||||||
// Slot is after genesis_time (u64) and genesis_validators_root (Hash256).
|
// Slot is after genesis_time (u64) and genesis_validators_root (Hash256).
|
||||||
let slot_start = <u64 as Decode>::ssz_fixed_len() + <Hash256 as Decode>::ssz_fixed_len();
|
let slot_start = <u64 as Decode>::ssz_fixed_len() + <Hash256 as Decode>::ssz_fixed_len();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::arithmetic_side_effects)]
|
||||||
|
|
||||||
use super::BeaconState;
|
use super::BeaconState;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::arithmetic_side_effects)]
|
||||||
#![allow(clippy::disallowed_methods)]
|
#![allow(clippy::disallowed_methods)]
|
||||||
#![allow(clippy::indexing_slicing)]
|
#![allow(clippy::indexing_slicing)]
|
||||||
|
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ impl ChainSpec {
|
|||||||
Hash256::from(domain)
|
Hash256::from(domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
pub const fn attestation_subnet_prefix_bits(&self) -> u32 {
|
pub const fn attestation_subnet_prefix_bits(&self) -> u32 {
|
||||||
let attestation_subnet_count_bits = self.attestation_subnet_count.ilog2();
|
let attestation_subnet_count_bits = self.attestation_subnet_count.ilog2();
|
||||||
self.attestation_subnet_extra_bits as u32 + attestation_subnet_count_bits
|
self.attestation_subnet_extra_bits as u32 + attestation_subnet_count_bits
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ impl<T: EthSpec> ExecutionPayload<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
/// Returns the maximum size of an execution payload.
|
/// Returns the maximum size of an execution payload.
|
||||||
pub fn max_execution_payload_merge_size() -> usize {
|
pub fn max_execution_payload_merge_size() -> usize {
|
||||||
// Fixed part
|
// Fixed part
|
||||||
@@ -117,7 +117,7 @@ impl<T: EthSpec> ExecutionPayload<T> {
|
|||||||
+ (T::max_transactions_per_payload() * (ssz::BYTES_PER_LENGTH_OFFSET + T::max_bytes_per_transaction()))
|
+ (T::max_transactions_per_payload() * (ssz::BYTES_PER_LENGTH_OFFSET + T::max_bytes_per_transaction()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
/// Returns the maximum size of an execution payload.
|
/// Returns the maximum size of an execution payload.
|
||||||
pub fn max_execution_payload_capella_size() -> usize {
|
pub fn max_execution_payload_capella_size() -> usize {
|
||||||
// Fixed part
|
// Fixed part
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
not(test),
|
not(test),
|
||||||
deny(
|
deny(
|
||||||
clippy::integer_arithmetic,
|
clippy::arithmetic_side_effects,
|
||||||
clippy::disallowed_methods,
|
clippy::disallowed_methods,
|
||||||
clippy::indexing_slicing
|
clippy::indexing_slicing
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::arithmetic_side_effects)]
|
||||||
|
|
||||||
use crate::{Hash256, ParticipationFlags, Unsigned, VariableList};
|
use crate::{Hash256, ParticipationFlags, Unsigned, VariableList};
|
||||||
use cached_tree_hash::{int_log, CacheArena, CachedTreeHash, Error, TreeHashCache};
|
use cached_tree_hash::{int_log, CacheArena, CachedTreeHash, Error, TreeHashCache};
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ impl SubnetId {
|
|||||||
.into())
|
.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(clippy::integer_arithmetic)]
|
#[allow(clippy::arithmetic_side_effects)]
|
||||||
/// Computes the set of subnets the node should be subscribed to during the current epoch,
|
/// Computes the set of subnets the node should be subscribed to during the current epoch,
|
||||||
/// along with the first epoch in which these subscriptions are no longer valid.
|
/// along with the first epoch in which these subscriptions are no longer valid.
|
||||||
pub fn compute_subnets_for_epoch<T: EthSpec>(
|
pub fn compute_subnets_for_epoch<T: EthSpec>(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#![allow(clippy::integer_arithmetic)]
|
#![allow(clippy::arithmetic_side_effects)]
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user