Resolve merge conflicts

This commit is contained in:
Eitan Seri- Levi
2026-02-03 21:27:18 -08:00
90 changed files with 1395 additions and 960 deletions

View File

@@ -32,7 +32,7 @@ pub fn get_next_withdrawals<T: BeaconChainTypes>(
}
match get_expected_withdrawals(&state, &chain.spec) {
Ok((withdrawals, _)) => Ok(withdrawals),
Ok(expected_withdrawals) => Ok(expected_withdrawals.into()),
Err(e) => Err(warp_utils::reject::custom_server_error(format!(
"failed to get expected withdrawal: {:?}",
e

View File

@@ -1190,7 +1190,28 @@ pub fn serve<T: BeaconChainTypes>(
Priority::P1
};
task_spawner.blocking_json_task(priority, move || {
let (block_root, execution_optimistic, finalized) = block_id.root(&chain)?;
// Fast-path for the head block root. We read from the early attester cache
// so that we can produce sync committee messages for the new head prior
// to it being fully imported (written to the DB/etc). We also check that the
// cache is not stale or out of date by comparing against the cached head
// prior to using it.
//
// See: https://github.com/sigp/lighthouse/issues/8667
let (block_root, execution_optimistic, finalized) =
if let BlockId(eth2::types::BlockId::Head) = block_id
&& let Some((head_block_slot, head_block_root)) =
chain.early_attester_cache.get_head_block_root()
&& head_block_slot >= chain.canonical_head.cached_head().head_slot()
{
// We know execution is NOT optimistic if the block is from the early
// attester cache because only properly validated blocks are added.
// Similarly we know it is NOT finalized.
let execution_optimistic = false;
let finalized = false;
(head_block_root, execution_optimistic, finalized)
} else {
block_id.root(&chain)?
};
Ok(
api_types::GenericResponse::from(api_types::RootData::from(block_root))
.add_execution_optimistic_finalized(execution_optimistic, finalized),

View File

@@ -21,7 +21,6 @@ use futures::TryFutureExt;
use lighthouse_network::PubsubMessage;
use network::NetworkMessage;
use rand::prelude::SliceRandom;
use slot_clock::SlotClock;
use std::marker::PhantomData;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
@@ -771,7 +770,7 @@ fn late_block_logging<T: BeaconChainTypes, P: AbstractExecPayload<T::EthSpec>>(
//
// Check to see the thresholds are non-zero to avoid logging errors with small
// slot times (e.g., during testing)
let too_late_threshold = chain.slot_clock.unagg_attestation_production_delay();
let too_late_threshold = chain.spec.get_unaggregated_attestation_due();
let delayed_threshold = too_late_threshold / 2;
if delay >= too_late_threshold {
error!(

View File

@@ -235,6 +235,7 @@ pub fn process_sync_committee_signatures<T: BeaconChainTypes>(
seen_timestamp,
verified.sync_message(),
&chain.slot_clock,
&chain.spec,
);
verified_for_pool = Some(verified);
@@ -376,6 +377,7 @@ pub fn process_signed_contribution_and_proofs<T: BeaconChainTypes>(
verified_contribution.aggregate(),
verified_contribution.participant_pubkeys(),
&chain.slot_clock,
&chain.spec,
);
verified_contributions.push((index, verified_contribution));

View File

@@ -862,6 +862,7 @@ pub fn post_validator_aggregate_and_proofs<T: BeaconChainTypes>(
verified_aggregate.aggregate(),
verified_aggregate.indexed_attestation(),
&chain.slot_clock,
&chain.spec,
);
verified_aggregates.push((index, verified_aggregate));