-
Notifications
You must be signed in to change notification settings - Fork 9
doc: adr broadcast offline #662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| # Architecture Decision Record: Offline Broadcast | ||
|
|
||
| Title: Record: Offline Broadcast | ||
|
|
||
| ## status | ||
|
|
||
| In progress | ||
|
|
||
| Updated on 15-06-2025 | ||
|
|
||
| ## contributors | ||
|
|
||
| - Main contributor(s): fmar | ||
|
|
||
| - Reviewer(s): fmar, leo, nogringo | ||
|
|
||
| - Final decision made by: fmar, leo, nogringo | ||
|
|
||
| ## Context and Problem Statement | ||
|
|
||
| NDK does not remember events broadcasted when offline. | ||
| As a user, I want to be able to draft something in a remote location (e.g. plane) without thinking about Nostr relay constraints. | ||
|
|
||
|
|
||
| ## Main Proposal | ||
|
|
||
| #### Requirements: | ||
| - relay specific | ||
| - gossip | ||
| - Consider done % | ||
| - different modes, | ||
| specific: relay broadcast must succeed | ||
| - eviction policy (keep in cache, delete old ones) | ||
| - Streamlined reject handling (retry, dismiss, paymentRequired, POW, blocked, etc.) | ||
|
|
||
|
Comment on lines
+27
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tighten the acceptance criteria and preserve This section still reads like notes ( 🧰 Tools🪛 markdownlint-cli2 (0.22.1)[warning] 27-27: Heading levels should only increment by one level at a time (MD001, heading-increment) 🤖 Prompt for AI Agents |
||
| - Gossip: % of relays is ok | ||
|
|
||
|
|
||
|
|
||
|
|
||
| #### Refactor the Broadcast use case into several concerns. | ||
|
|
||
| - cache with state information | ||
| ``` | ||
| PriorityBroadcast: 0 | ||
| PolicyBroadcast: all ok | ||
| PolicyEviction: replace | ||
| event1: broadcast: { | ||
| relay 1 ok | ||
| relay 2 failed, timeout | ||
| } | ||
| ``` | ||
| - cache of deleted events | ||
| - Broadcast monitor (checks for broadcast state, delegates work, runs periodically) | ||
| - broadcast (stateless, broadcasts and returns results with comprehensive err handeling) | ||
|
|
||
| To model the constraints on each event, we are implementing a BroadcastPolicy, EvictionPolicy and priority broadcast. | ||
| Depending on the use case, an event must be accepted by one or multiple relays or just be accepted by a few. \ | ||
| These policies are checked and executed by the broadcast monitor depending on the current conditions.\ | ||
| \ | ||
| Broadcast just executes a given policy/strategy given by the broadcast monitor and reports back. | ||
|
|
||
| #### BroadcastPolicys | ||
| - consider done % | ||
| - all ok | ||
| - todo | ||
|
|
||
| #### EvictionPolicys | ||
| - todo | ||
|
|
||
|
|
||
| ## Consequences | ||
|
|
||
| The main difficulty is the remote signer setup. | ||
| As a workaround, we store unsigned events in cache (so they are queriable) and check with the broadcast monitor whether we can sign them before broadcasting. | ||
|
|
||
|
|
||
| #### Impact Radius | ||
|
|
||
| Accounts: | ||
| edit, set up acc | ||
|
|
||
| Blossom/Files: | ||
| publish blossom servers | ||
|
|
||
| Cashu: | ||
| Not impacted rn | ||
|
|
||
| Connectivity: | ||
| Not impacted | ||
|
|
||
| Domain verification: | ||
| Not impacted | ||
|
|
||
| Follows: | ||
| edit, setup | ||
|
|
||
| Gift Wrap | ||
| publish | ||
|
|
||
| Lists: | ||
| publish, edit | ||
|
|
||
| Metadata: | ||
| publish, edit | ||
|
|
||
| Nwc: | ||
| rpc method, offline zaps? | ||
|
|
||
| Relay sets | ||
| publish, edit | ||
|
|
||
| Requests: | ||
| Not impacted | ||
|
|
||
| User relay lists | ||
| publish, edit | ||
|
|
||
| Wallets | ||
| not impacted | ||
|
|
||
| Zaps | ||
| offline zap? (how to get invoice) | ||
|
|
||
|
|
||
|
|
||
| ## Alternative proposals | ||
|
|
||
| Monolithc archetecture with a broadcast manager that encapsulates most of the retry logic attached to a state/cache class. | ||
|
|
||
| ## Final Notes | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the ADR metadata consistent.
In progressconflicts withFinal decision made by, and theUpdated on 15-06-2025stamp looks stale for this PR. Please either keep this as a draft and remove the final-decision field, or mark it accepted with the correct date.🤖 Prompt for AI Agents