merge ptc branch chagnes

This commit is contained in:
Eitan Seri-Levi
2026-04-27 09:58:01 +02:00
6 changed files with 222 additions and 30 deletions

View File

@@ -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,