Add tests and ssz suppport

This commit is contained in:
Eitan Seri-Levi
2026-04-27 09:46:09 +02:00
parent d42784229a
commit 68bfb33430
6 changed files with 215 additions and 21 deletions

View File

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