This commit is contained in:
Eitan Seri-Levi
2026-04-27 10:10:06 +02:00
parent 68bfb33430
commit 812dc31b15
3 changed files with 23 additions and 7 deletions

View File

@@ -577,7 +577,7 @@ pub fn post_beacon_pool_payload_attestations_ssz<T: BeaconChainTypes>(
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>| {
task_spawner.blocking_json_task(Priority::P0, move || {
let item_len = <PayloadAttestationMessage as Encode>::ssz_fixed_len();
if body_bytes.len() % item_len != 0 {
if !body_bytes.len().is_multiple_of(item_len) {
return Err(warp_utils::reject::custom_bad_request(format!(
"SSZ body length {} is not a multiple of PayloadAttestationMessage size {}",
body_bytes.len(),

View File

@@ -643,7 +643,7 @@ impl<E: EthSpec> ProductionValidatorClient<E> {
self.payload_attestation_service
.clone()
.start_update_service(&self.context.eth2_config.spec)
.start_update_service()
.map_err(|e| format!("Unable to start payload attestation service: {}", e))?;
self.preparation_service

View File

@@ -5,8 +5,8 @@ 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 tokio::time::sleep;
use tracing::{debug, error, info};
use types::{ChainSpec, EthSpec};
use validator_store::ValidatorStore;
@@ -19,6 +19,14 @@ pub struct PayloadAttestationServiceBuilder<S: ValidatorStore, T: SlotClock + 's
chain_spec: Option<Arc<ChainSpec>>,
}
impl<S: ValidatorStore + 'static, T: SlotClock + 'static> Default
for PayloadAttestationServiceBuilder<S, T>
{
fn default() -> Self {
Self::new()
}
}
impl<S: ValidatorStore + 'static, T: SlotClock + 'static> PayloadAttestationServiceBuilder<S, T> {
pub fn new() -> Self {
Self {
@@ -117,9 +125,9 @@ impl<S, T> Deref for PayloadAttestationService<S, T> {
}
impl<S: ValidatorStore + 'static, T: SlotClock + 'static> PayloadAttestationService<S, T> {
pub fn start_update_service(self, spec: &ChainSpec) -> Result<(), String> {
let slot_duration = spec.get_slot_duration();
let payload_attestation_due = spec.get_payload_attestation_due();
pub fn start_update_service(self) -> Result<(), String> {
let slot_duration = self.chain_spec.get_slot_duration();
let payload_attestation_due = self.chain_spec.get_payload_attestation_due();
info!(
payload_attestation_due_ms = payload_attestation_due.as_millis(),
@@ -143,6 +151,14 @@ impl<S: ValidatorStore + 'static, T: SlotClock + 'static> PayloadAttestationServ
continue;
};
if !self
.chain_spec
.fork_name_at_slot::<S::E>(current_slot)
.gloas_enabled()
{
continue;
}
let duties = self.duties_service.get_ptc_duties_for_slot(current_slot);
if duties.is_empty() {
continue;