mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Merge unstable
This commit is contained in:
@@ -8,6 +8,7 @@ authors = ["Sigma Prime <contact@sigmaprime.io>"]
|
||||
beacon_node_fallback = { workspace = true }
|
||||
bls = { workspace = true }
|
||||
doppelganger_service = { workspace = true }
|
||||
either = { workspace = true }
|
||||
environment = { workspace = true }
|
||||
eth2 = { workspace = true }
|
||||
futures = { workspace = true }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use crate::duties_service::{DutiesService, DutyAndProof};
|
||||
use beacon_node_fallback::{ApiTopic, BeaconNodeFallback};
|
||||
use either::Either;
|
||||
use environment::RuntimeContext;
|
||||
use futures::future::join_all;
|
||||
use slog::{crit, debug, error, info, trace, warn};
|
||||
@@ -457,8 +458,34 @@ impl<T: SlotClock + 'static, E: EthSpec> AttestationService<T, E> {
|
||||
&[validator_metrics::ATTESTATIONS_HTTP_POST],
|
||||
);
|
||||
if fork_name.electra_enabled() {
|
||||
let single_attestations = attestations
|
||||
.iter()
|
||||
.zip(validator_indices)
|
||||
.filter_map(|(a, i)| {
|
||||
match a.to_single_attestation_with_attester_index(*i) {
|
||||
Ok(a) => Some(a),
|
||||
Err(e) => {
|
||||
// This shouldn't happen unless BN and VC are out of sync with
|
||||
// respect to the Electra fork.
|
||||
error!(
|
||||
log,
|
||||
"Unable to convert to SingleAttestation";
|
||||
"error" => ?e,
|
||||
"committee_index" => attestation_data.index,
|
||||
"slot" => slot.as_u64(),
|
||||
"type" => "unaggregated",
|
||||
);
|
||||
None
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
beacon_node
|
||||
.post_beacon_pool_attestations_v2(attestations, fork_name)
|
||||
.post_beacon_pool_attestations_v2::<E>(
|
||||
Either::Right(single_attestations),
|
||||
fork_name,
|
||||
)
|
||||
.await
|
||||
} else {
|
||||
beacon_node
|
||||
|
||||
@@ -258,7 +258,7 @@ impl<T: SlotClock + 'static, E: EthSpec> PreparationService<T, E> {
|
||||
.slot_clock
|
||||
.now()
|
||||
.map_or(E::genesis_epoch(), |slot| slot.epoch(E::slots_per_epoch()));
|
||||
spec.bellatrix_fork_epoch.map_or(false, |fork_epoch| {
|
||||
spec.bellatrix_fork_epoch.is_some_and(|fork_epoch| {
|
||||
current_epoch + PROPOSER_PREPARATION_LOOKAHEAD_EPOCHS >= fork_epoch
|
||||
})
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ impl<E: EthSpec> SyncDutiesMap<E> {
|
||||
self.committees
|
||||
.read()
|
||||
.get(&committee_period)
|
||||
.map_or(false, |committee_duties| {
|
||||
.is_some_and(|committee_duties| {
|
||||
let validator_duties = committee_duties.validators.read();
|
||||
validator_indices
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user