<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/src/sync/relay_connection.rs, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/atom?h=master</id>
<link rel='self' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/'/>
<updated>2026-01-21T13:45:31+00:00</updated>
<entry>
<title>refactor: use mark_negentropy_unsupported() consistently</title>
<updated>2026-01-21T13:45:31+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-21T13:23:41+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=214fa5cbb7dacedfb3227e623e0542351c7d7956'/>
<id>urn:sha1:214fa5cbb7dacedfb3227e623e0542351c7d7956</id>
<content type='text'>
Refactor internal code to use the mark_negentropy_unsupported() method
instead of direct field access for improved readability.
</content>
</entry>
<entry>
<title>fix: fall back to REQ+EOSE when negentropy retry fails</title>
<updated>2026-01-21T13:45:30+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-21T13:20:14+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=fbcf2e3896b008f15f02a0df804405a346fd3656'/>
<id>urn:sha1:fbcf2e3896b008f15f02a0df804405a346fd3656</id>
<content type='text'>
When negentropy retry makes no progress (relay returns zero events),
this indicates the relay's negentropy implementation is broken. Instead
of marking the batch as failed, we now:

1. Mark the relay as not supporting NIP-77 so future batches skip
   negentropy and use REQ+EOSE directly
2. Fall back to REQ+EOSE using semantic filters (kind/author/tags)
   for the current batch, which may succeed where ID-based queries fail

This addresses the issue where some relays (e.g., azzamo.net, snort.social)
return event IDs during negentropy diff but fail to serve those events
when requested by ID.
</content>
</entry>
<entry>
<title>fix: detect NIP-77 NOTICE immediately during negentropy sync</title>
<updated>2026-01-10T00:11:20+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-10T00:11:20+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=ced6ef15a1e2ff4babd8a291f6d423846d986302'/>
<id>urn:sha1:ced6ef15a1e2ff4babd8a291f6d423846d986302</id>
<content type='text'>
Previously, when a relay didn't support NIP-77, the negentropy_sync_diff
function would wait for the full client.sync() timeout even after receiving
a NOTICE message that marked the relay as not supporting NIP-77.

This change uses tokio::select! to race the sync operation against a
polling task that checks the nip77_supported flag every 10ms. When a NOTICE
is received (detected in the message handler), the poll task detects the
status change and immediately returns an error, allowing quick fallback to
REQ+EOSE without waiting for timeouts.

Benefits:
- Fast failure (within 10ms) when relay sends NIP-77 NOTICE
- No artificial timeout reduction that could hurt legitimate operations
- Maintains full timeout for relays that actually support NIP-77
</content>
</entry>
<entry>
<title>fix: return error when negentropy has failures to enable REQ fallback</title>
<updated>2026-01-10T00:03:32+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-10T00:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=bbdc68cd9a04cdabfa4a1fffd507048f555d5fa5'/>
<id>urn:sha1:bbdc68cd9a04cdabfa4a1fffd507048f555d5fa5</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>improve: detect and skip negentropy for unsupported relays</title>
<updated>2026-01-09T22:55:36+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-09T22:55:36+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=615bfa0e3e892a22f1691a6a1172ea755a7c3149'/>
<id>urn:sha1:615bfa0e3e892a22f1691a6a1172ea755a7c3149</id>
<content type='text'>
- Upgrade NOTICE log level to INFO when relay rejects negentropy (envelope/NEG- errors)
- Track NIP-77 support status per relay connection to avoid repeated failed attempts
- Mark relay as unsupported when NOTICE rejection or timeout occurs
- Skip negentropy on subsequent syncs during same connection session
- Reset support status on reconnect to allow retry after relay upgrades

This reduces log noise and eliminates 10-second timeout delays on each historic
sync attempt for relays that don't support NIP-77 negentropy.

Fixes negentropy-timeout-10-seconds issue by learning from relay behavior.
</content>
</entry>
<entry>
<title>fix: downgrade negentropy timeout warning to debug level</title>
<updated>2026-01-09T22:02:02+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-09T22:02:02+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=1079db274ed97fc84f7a6ca756707e5fa30cd3c9'/>
<id>urn:sha1:1079db274ed97fc84f7a6ca756707e5fa30cd3c9</id>
<content type='text'>
Negentropy diff timeouts are expected when relays don't support NIP-77.
The relay responds with NOTICE 'unknown envelope label' and the timeout
is hit before we recognize this is unsupported rather than a failure.

Changes:
- Downgrade from warn! to debug! in negentropy_sync_filter()
  (src/sync/relay_connection.rs:493)
- Add comment explaining timeouts are common for non-NIP-77 relays
- Update message to clarify timeout typically means no NIP-77 support

The existing fallback mechanism (lines 505-509) properly handles this
case and logs a one-time warning about falling back to REQ+EOSE.

Discovered via production sync testing against wss://git.shakespeare.diy
</content>
</entry>
<entry>
<title>chore: cargo fmt</title>
<updated>2026-01-09T19:58:41+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-09T19:58:41+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=b28a356cb41077ccee12a9c52f4ef2054e76cac6'/>
<id>urn:sha1:b28a356cb41077ccee12a9c52f4ef2054e76cac6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat: replace owner-npub with relay-owner-nsec for persistent operator identity</title>
<updated>2026-01-09T07:57:54+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-09T07:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=7cc5d37cbf4f02f0bb7eee6342dc1ede5a841a7b'/>
<id>urn:sha1:7cc5d37cbf4f02f0bb7eee6342dc1ede5a841a7b</id>
<content type='text'>
Replace the owner-npub configuration option with relay-owner-nsec to provide
a persistent cryptographic identity for the relay operator. This addresses
NIP-42 authentication requirements discovered during sync debugging.

Motivation:
- Some relays (e.g., relay.damus.io) require NIP-42 authentication for
  advanced features like NIP-77 negentropy sync
- Previously used random ephemeral keys per connection, providing no
  persistent identity
- Other relays can now recognize us by pubkey for reputation-based rate
  limiting
- Ensures consistency between NIP-11 pubkey and authentication key

Changes:
- Config: relay_owner_nsec with auto-load/generate from .relay-owner.nsec
- NIP-11: Pubkey derived from nsec instead of separate npub field
- Sync: RelayConnection now uses operator keys for NIP-42 auth
- Docs: Updated README, .env.example, and added .relay-owner.nsec to gitignore

Key Features:
- Auto-generates key on first run and saves to .relay-owner.nsec
- Loads existing key from file on subsequent runs
- Can override via CLI flag or environment variable
- Enables reputation building across relay network
- Future-ready for event signing and WoT calculations

Testing:
- 225/232 tests passing (7 pre-existing purgatory failures unrelated)
- Verified key generation, loading, and NIP-11 derivation
- Release build successful

Related: work/sync-debug-analysis.md, work/relay-owner-nsec-implementation.md
</content>
</entry>
<entry>
<title>fix: sync-bootstrap-relay-url scheme optional</title>
<updated>2026-01-08T12:14:27+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2026-01-08T12:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=0356740d11c9fb6524060e6755ab0c2186096724'/>
<id>urn:sha1:0356740d11c9fb6524060e6755ab0c2186096724</id>
<content type='text'>
</content>
</entry>
<entry>
<title>chore: cargo fmt and clippy</title>
<updated>2025-12-22T21:03:49+00:00</updated>
<author>
<name>DanConwayDev</name>
<email>DanConwayDev@protonmail.com</email>
</author>
<published>2025-12-22T21:03:49+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1tkq8unhsd5jqx6ueex5lcpsgknrpquxuk44ftpjlpm3ulaake7xs76txrw/ngit-grasp-mirror/commit/?id=6b55efedba7c069eff7a3e335845a961d40274db'/>
<id>urn:sha1:6b55efedba7c069eff7a3e335845a961d40274db</id>
<content type='text'>
</content>
</entry>
</feed>
