mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-01 20:04:41 +00:00
lint fixes
This commit is contained in:
@@ -819,7 +819,7 @@ where
|
||||
.get_block(&block.parent_root())
|
||||
.ok_or_else(|| Error::InvalidBlock(InvalidBlock::UnknownParent(block.parent_root())))?;
|
||||
|
||||
// If the block builds on a full payload envelope, the envelope must be known.
|
||||
// If the block builds on a full payload envelope, the envelope must be known.
|
||||
if let Some(parent_block_hash) = parent_block.execution_payload_block_hash {
|
||||
let builds_on_full = block
|
||||
.body()
|
||||
|
||||
@@ -192,7 +192,8 @@ pub fn per_block_processing<E: EthSpec, Payload: AbstractExecPayload<E>>(
|
||||
let body = block.body();
|
||||
if state.fork_name_unchecked().gloas_enabled() {
|
||||
withdrawals::gloas::process_withdrawals::<E>(state, spec)?;
|
||||
process_execution_payload_bid(state, block, verify_signatures, spec)?;
|
||||
let signed_bid = block.body().signed_execution_payload_bid()?;
|
||||
process_execution_payload_bid(state, signed_bid, verify_signatures, spec)?;
|
||||
} else {
|
||||
if state.fork_name_unchecked().capella_enabled() {
|
||||
withdrawals::capella_electra::process_withdrawals::<E, Payload>(
|
||||
@@ -671,15 +672,13 @@ pub fn settle_builder_payment<E: EthSpec>(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn process_execution_payload_bid<E: EthSpec, Payload: AbstractExecPayload<E>>(
|
||||
pub fn process_execution_payload_bid<E: EthSpec>(
|
||||
state: &mut BeaconState<E>,
|
||||
block: BeaconBlockRef<'_, E, Payload>,
|
||||
signed_bid: &SignedExecutionPayloadBid<E>,
|
||||
verify_signatures: VerifySignatures,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
// Verify the bid signature
|
||||
let signed_bid = block.body().signed_execution_payload_bid()?;
|
||||
|
||||
let bid = &signed_bid.message;
|
||||
let amount = bid.value;
|
||||
let builder_index = bid.builder_index;
|
||||
@@ -754,10 +753,10 @@ pub fn process_execution_payload_bid<E: EthSpec, Payload: AbstractExecPayload<E>
|
||||
|
||||
// Verify that the bid is for the current slot
|
||||
block_verify!(
|
||||
bid.slot == block.slot(),
|
||||
bid.slot == state.slot(),
|
||||
ExecutionPayloadBidInvalid::SlotMismatch {
|
||||
bid_slot: bid.slot,
|
||||
block_slot: block.slot(),
|
||||
block_slot: state.slot(),
|
||||
}
|
||||
.into()
|
||||
);
|
||||
@@ -773,10 +772,11 @@ pub fn process_execution_payload_bid<E: EthSpec, Payload: AbstractExecPayload<E>
|
||||
.into()
|
||||
);
|
||||
|
||||
let expected_parent_root = *state.get_block_root(state.slot().safe_sub(1)?)?;
|
||||
block_verify!(
|
||||
bid.parent_block_root == block.parent_root(),
|
||||
bid.parent_block_root == expected_parent_root,
|
||||
ExecutionPayloadBidInvalid::ParentBlockRootMismatch {
|
||||
block_parent_root: block.parent_root(),
|
||||
block_parent_root: expected_parent_root,
|
||||
bid_parent_root: bid.parent_block_root,
|
||||
}
|
||||
.into()
|
||||
@@ -794,6 +794,7 @@ pub fn process_execution_payload_bid<E: EthSpec, Payload: AbstractExecPayload<E>
|
||||
|
||||
// Record the pending payment if there is some payment
|
||||
if amount > 0 {
|
||||
let proposer_index = state.get_beacon_proposer_index(state.slot(), spec)? as u64;
|
||||
let pending_payment = BuilderPendingPayment {
|
||||
weight: 0,
|
||||
withdrawal: BuilderPendingWithdrawal {
|
||||
@@ -801,7 +802,7 @@ pub fn process_execution_payload_bid<E: EthSpec, Payload: AbstractExecPayload<E>
|
||||
amount,
|
||||
builder_index,
|
||||
},
|
||||
proposer_index: block.proposer_index(),
|
||||
proposer_index,
|
||||
};
|
||||
|
||||
let payment_index = E::SlotsPerEpoch::to_usize()
|
||||
|
||||
@@ -4,11 +4,7 @@ use crate::common::{
|
||||
get_attestation_participation_flag_indices, increase_balance, initiate_validator_exit,
|
||||
slash_validator,
|
||||
};
|
||||
use crate::per_block_processing::builder::{
|
||||
convert_validator_index_to_builder_index, is_builder_index,
|
||||
};
|
||||
use crate::per_block_processing::errors::{BlockProcessingError, ExitInvalid, IntoWithIndex};
|
||||
use crate::per_block_processing::signature_sets::{exit_signature_set, get_pubkey_from_state};
|
||||
use crate::per_block_processing::verify_payload_attestation::verify_payload_attestation;
|
||||
use bls::{PublicKeyBytes, SignatureBytes};
|
||||
use ssz_types::FixedVector;
|
||||
|
||||
@@ -5,10 +5,7 @@ use ssz::Encode;
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use tree_hash_derive::TreeHash;
|
||||
|
||||
use crate::{
|
||||
Address, BeaconStateError, ChainSpec, DepositMessage, Domain, SignedRoot, core::Hash256,
|
||||
fork::ForkName,
|
||||
};
|
||||
use crate::{ChainSpec, DepositMessage, Domain, SignedRoot, core::Hash256, fork::ForkName};
|
||||
|
||||
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
|
||||
#[derive(Debug, PartialEq, Hash, Clone, Serialize, Deserialize, Encode, Decode, TreeHash)]
|
||||
|
||||
Reference in New Issue
Block a user