From bbdc68cd9a04cdabfa4a1fffd507048f555d5fa5 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sat, 10 Jan 2026 00:03:32 +0000 Subject: fix: return error when negentropy has failures to enable REQ fallback When negentropy sync times out or has other failures, it now properly returns Err() instead of Ok() with empty reconciliation. This ensures historic_sync increments failed_count and triggers fallback to REQ+EOSE instead of treating it as a successful sync with 0 events. Resolves issue where bootstrap relay timeouts were marked as complete instead of falling back to traditional sync. --- src/sync/relay_connection.rs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/sync/relay_connection.rs b/src/sync/relay_connection.rs index 5fabd10..f19abb9 100644 --- a/src/sync/relay_connection.rs +++ b/src/sync/relay_connection.rs @@ -527,11 +527,19 @@ impl RelayConnection { self.nip77_supported .store(2, std::sync::atomic::Ordering::Relaxed); - tracing::debug!( - relay = %self.url, - failures = ?output.failed, - "Negentropy diff had failures (timeout usually means relay doesn't support NIP-77)" - ); + // Log warning only once per relay to avoid spam + if !self + .nip77_warning_logged + .swap(true, std::sync::atomic::Ordering::Relaxed) + { + tracing::warn!( + relay = %self.url, + failures = ?output.failed, + "Negentropy diff had failures (timeout usually means relay doesn't support NIP-77), will fall back to REQ+EOSE" + ); + } + + return Err(format!("Negentropy diff had failures: {:?}", output.failed)); } Ok(reconciliation) -- cgit v1.2.3