mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 19:02:42 +00:00
Update Rust Edition to 2024 (#7766)
* #7749 Thanks @dknopik and @michaelsproul for your help!
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::common::{altair::BaseRewardPerIncrement, decrease_balance, increase_balance};
|
||||
use crate::per_block_processing::errors::{BlockProcessingError, SyncAggregateInvalid};
|
||||
use crate::{signature_sets::sync_aggregate_signature_set, VerifySignatures};
|
||||
use crate::{VerifySignatures, signature_sets::sync_aggregate_signature_set};
|
||||
use safe_arith::SafeArith;
|
||||
use std::borrow::Cow;
|
||||
use types::consts::altair::{PROPOSER_WEIGHT, SYNC_REWARD_WEIGHT, WEIGHT_DENOMINATOR};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
use super::signature_sets::{Error as SignatureSetError, *};
|
||||
use crate::per_block_processing::errors::{AttestationInvalid, BlockOperationError};
|
||||
use crate::{ConsensusContext, ContextError};
|
||||
use bls::{verify_signature_sets, PublicKey, PublicKeyBytes, SignatureSet};
|
||||
use bls::{PublicKey, PublicKeyBytes, SignatureSet, verify_signature_sets};
|
||||
use std::borrow::Cow;
|
||||
use types::{
|
||||
AbstractExecPayload, BeaconState, BeaconStateError, ChainSpec, EthSpec, Hash256,
|
||||
@@ -324,17 +324,17 @@ where
|
||||
&mut self,
|
||||
block: &'a SignedBeaconBlock<E, Payload>,
|
||||
) -> Result<()> {
|
||||
if let Ok(sync_aggregate) = block.message().body().sync_aggregate() {
|
||||
if let Some(signature_set) = sync_aggregate_signature_set(
|
||||
if let Ok(sync_aggregate) = block.message().body().sync_aggregate()
|
||||
&& let Some(signature_set) = sync_aggregate_signature_set(
|
||||
&self.decompressor,
|
||||
sync_aggregate,
|
||||
block.slot(),
|
||||
block.parent_root(),
|
||||
self.state,
|
||||
self.spec,
|
||||
)? {
|
||||
self.sets.push(signature_set);
|
||||
}
|
||||
)?
|
||||
{
|
||||
self.sets.push(signature_set);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use ethereum_hashing::hash_fixed;
|
||||
use types::{KzgCommitment, VersionedHash, VERSIONED_HASH_VERSION_KZG};
|
||||
use types::{KzgCommitment, VERSIONED_HASH_VERSION_KZG, VersionedHash};
|
||||
|
||||
pub fn kzg_commitment_to_versioned_hash(kzg_commitment: &KzgCommitment) -> VersionedHash {
|
||||
let mut hashed_commitment = hash_fixed(&kzg_commitment.0);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use super::*;
|
||||
use crate::VerifySignatures;
|
||||
use crate::common::{
|
||||
get_attestation_participation_flag_indices, increase_balance, initiate_validator_exit,
|
||||
slash_validator,
|
||||
};
|
||||
use crate::per_block_processing::errors::{BlockProcessingError, IntoWithIndex};
|
||||
use crate::VerifySignatures;
|
||||
use types::consts::altair::{PARTICIPATION_FLAG_WEIGHTS, PROPOSER_WEIGHT, WEIGHT_DENOMINATOR};
|
||||
use types::typenum::U33;
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ use crate::per_block_processing::errors::{
|
||||
DepositInvalid, HeaderInvalid, IndexedAttestationInvalid, IntoWithIndex,
|
||||
ProposerSlashingInvalid,
|
||||
};
|
||||
use crate::{per_block_processing, BlockReplayError, BlockReplayer};
|
||||
use crate::{BlockReplayError, BlockReplayer, per_block_processing};
|
||||
use crate::{
|
||||
per_block_processing::{process_operations, verify_exit::verify_exit},
|
||||
BlockSignatureStrategy, ConsensusContext, VerifyBlockRoot, VerifySignatures,
|
||||
per_block_processing::{process_operations, verify_exit::verify_exit},
|
||||
};
|
||||
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
|
||||
use ssz_types::Bitfield;
|
||||
@@ -717,10 +717,10 @@ async fn invalid_attester_slashing_not_slashable() {
|
||||
|
||||
let mut attester_slashing = harness.make_attester_slashing(vec![1, 2]);
|
||||
match &mut attester_slashing {
|
||||
AttesterSlashing::Base(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Base(attester_slashing) => {
|
||||
attester_slashing.attestation_1 = attester_slashing.attestation_2.clone();
|
||||
}
|
||||
AttesterSlashing::Electra(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Electra(attester_slashing) => {
|
||||
attester_slashing.attestation_1 = attester_slashing.attestation_2.clone();
|
||||
}
|
||||
}
|
||||
@@ -752,10 +752,10 @@ async fn invalid_attester_slashing_1_invalid() {
|
||||
|
||||
let mut attester_slashing = harness.make_attester_slashing(vec![1, 2]);
|
||||
match &mut attester_slashing {
|
||||
AttesterSlashing::Base(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Base(attester_slashing) => {
|
||||
attester_slashing.attestation_1.attesting_indices = VariableList::from(vec![2, 1]);
|
||||
}
|
||||
AttesterSlashing::Electra(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Electra(attester_slashing) => {
|
||||
attester_slashing.attestation_1.attesting_indices = VariableList::from(vec![2, 1]);
|
||||
}
|
||||
}
|
||||
@@ -790,10 +790,10 @@ async fn invalid_attester_slashing_2_invalid() {
|
||||
|
||||
let mut attester_slashing = harness.make_attester_slashing(vec![1, 2]);
|
||||
match &mut attester_slashing {
|
||||
AttesterSlashing::Base(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Base(attester_slashing) => {
|
||||
attester_slashing.attestation_2.attesting_indices = VariableList::from(vec![2, 1]);
|
||||
}
|
||||
AttesterSlashing::Electra(ref mut attester_slashing) => {
|
||||
AttesterSlashing::Electra(attester_slashing) => {
|
||||
attester_slashing.attestation_2.attesting_indices = VariableList::from(vec![2, 1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::errors::{AttestationInvalid as Invalid, BlockOperationError};
|
||||
use super::VerifySignatures;
|
||||
use crate::per_block_processing::is_valid_indexed_attestation;
|
||||
use super::errors::{AttestationInvalid as Invalid, BlockOperationError};
|
||||
use crate::ConsensusContext;
|
||||
use crate::per_block_processing::is_valid_indexed_attestation;
|
||||
use safe_arith::SafeArith;
|
||||
use types::*;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::errors::{BlockOperationError, BlsExecutionChangeInvalid as Invalid};
|
||||
use crate::per_block_processing::signature_sets::bls_execution_change_signature_set;
|
||||
use crate::VerifySignatures;
|
||||
use crate::per_block_processing::signature_sets::bls_execution_change_signature_set;
|
||||
use ethereum_hashing::hash;
|
||||
use types::*;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use super::errors::{BlockOperationError, ExitInvalid};
|
||||
use crate::per_block_processing::{
|
||||
signature_sets::{exit_signature_set, get_pubkey_from_state},
|
||||
VerifySignatures,
|
||||
signature_sets::{exit_signature_set, get_pubkey_from_state},
|
||||
};
|
||||
use safe_arith::SafeArith;
|
||||
use types::*;
|
||||
|
||||
Reference in New Issue
Block a user