diff options
Diffstat (limited to 'docs/explanation/grasp-02-proactive-sync.md')
| -rw-r--r-- | docs/explanation/grasp-02-proactive-sync.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/explanation/grasp-02-proactive-sync.md b/docs/explanation/grasp-02-proactive-sync.md index e983316..ed8fdbf 100644 --- a/docs/explanation/grasp-02-proactive-sync.md +++ b/docs/explanation/grasp-02-proactive-sync.md | |||
| @@ -729,6 +729,41 @@ If negentropy fails (relay doesn't support NIP-77, network error, etc.): | |||
| 729 | 2. The sync falls back to traditional REQ+EOSE | 729 | 2. The sync falls back to traditional REQ+EOSE |
| 730 | 3. No error is raised - fallback is automatic | 730 | 3. No error is raised - fallback is automatic |
| 731 | 731 | ||
| 732 | ### Integration with Rejected Events Index | ||
| 733 | |||
| 734 | The rejected events index prevents wasteful re-fetching during negentropy sync by excluding rejected event IDs from the reconciliation process: | ||
| 735 | |||
| 736 | **During Negentropy Reconciliation:** | ||
| 737 | |||
| 738 | 1. **Build "already have" set**: Combine event IDs from: | ||
| 739 | - Events in database | ||
| 740 | - Events in purgatory | ||
| 741 | - **Events in rejected index (hot cache + cold index)** | ||
| 742 | |||
| 743 | 2. **Send to negentropy**: This combined set represents "events we already have or don't want" | ||
| 744 | |||
| 745 | 3. **Receive differences**: Relay only sends events we don't have and haven't rejected | ||
| 746 | |||
| 747 | 4. **Process received events**: New events go through normal validation: | ||
| 748 | - If accepted → saved to database | ||
| 749 | - If rejected → added to rejected index | ||
| 750 | - If waiting for dependencies → added to purgatory | ||
| 751 | |||
| 752 | **Why This Matters:** | ||
| 753 | |||
| 754 | Without the rejected events index, negentropy would repeatedly download events that don't list this service or are from unauthorized maintainers, wasting bandwidth on every sync cycle. | ||
| 755 | |||
| 756 | **Re-Processing on Dependency Arrival:** | ||
| 757 | |||
| 758 | When a dependency is satisfied (e.g., owner announcement accepted): | ||
| 759 | 1. Related entries are **invalidated** (removed) from cold index | ||
| 760 | 2. If event still in hot cache → immediate re-processing | ||
| 761 | 3. If event expired from hot cache → will be re-fetched on next sync (now that dependency exists) | ||
| 762 | |||
| 763 | This prevents permanently excluding events that could become valid after dependencies arrive. | ||
| 764 | |||
| 765 | See [work/rejected-events-index-summary.md](../../work/rejected-events-index-summary.md) for complete implementation details. | ||
| 766 | |||
| 732 | --- | 767 | --- |
| 733 | 768 | ||
| 734 | ## REQ+EOSE Pagination | 769 | ## REQ+EOSE Pagination |