mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-15 09:48:20 +00:00
merge ptc branch chagnes
This commit is contained in:
@@ -5,9 +5,9 @@ use slot_clock::SlotClock;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
use task_executor::TaskExecutor;
|
||||
use tokio::time::{Duration, sleep};
|
||||
use tracing::{debug, error, info, warn};
|
||||
use types::{ChainSpec, EthSpec};
|
||||
use tokio::time::sleep;
|
||||
use tracing::{debug, error, info};
|
||||
use types::ChainSpec;
|
||||
use validator_store::ValidatorStore;
|
||||
|
||||
pub struct PayloadAttestationServiceBuilder<S: ValidatorStore, T: SlotClock + 'static> {
|
||||
@@ -230,19 +230,40 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> PayloadAttestationServ
|
||||
}
|
||||
|
||||
let count = messages.len();
|
||||
match self
|
||||
let result = self
|
||||
.beacon_nodes
|
||||
.first_success(|beacon_node| {
|
||||
let messages = messages.clone();
|
||||
async move {
|
||||
beacon_node
|
||||
.post_beacon_pool_payload_attestations(&messages)
|
||||
.post_beacon_pool_payload_attestations_ssz(&messages)
|
||||
.await
|
||||
.map_err(|e| format!("Failed to publish payload attestations: {e:?}"))
|
||||
.map_err(|e| format!("Failed to publish payload attestations (SSZ): {e:?}"))
|
||||
}
|
||||
})
|
||||
.await
|
||||
{
|
||||
.await;
|
||||
|
||||
let result = match result {
|
||||
Ok(()) => Ok(()),
|
||||
Err(_) => {
|
||||
debug!(%slot, "SSZ publish failed, falling back to JSON");
|
||||
self.beacon_nodes
|
||||
.first_success(|beacon_node| {
|
||||
let messages = messages.clone();
|
||||
async move {
|
||||
beacon_node
|
||||
.post_beacon_pool_payload_attestations(&messages)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
format!("Failed to publish payload attestations (JSON): {e:?}")
|
||||
})
|
||||
}
|
||||
})
|
||||
.await
|
||||
}
|
||||
};
|
||||
|
||||
match result {
|
||||
Ok(()) => {
|
||||
info!(
|
||||
%slot,
|
||||
|
||||
Reference in New Issue
Block a user