Skip to content

feat(announcements): add the project's announcement keys - #892

Open
grunch wants to merge 1 commit into
feat/announcements-toolfrom
feat/announcements-allowlist
Open

grunch wants to merge 1 commit into
feat/announcements-toolfrom
feat/announcements-allowlist

Conversation

@grunch

@grunch grunch commented Oct 23, 2026

Copy link
Copy Markdown
Member

Linked issue

Closes #319 (step 6 of specs/006-announcement-channel/spec.md §10, the last of the stack: #889 → #890 → #891 → this).

Type

feat

What changes and why

The one commit that makes the channel live: the three project keys go into ALLOWLIST (rust/src/nostr/announcements.rs), as npubs, each with its hex form in a comment and all three pinned by a test (the_shipped_allowlist_is_the_project_keys) so a bech32 slip that still decodes cannot trust a stranger. With a non-empty allowlist the reader opens its kind 38387 subscription on the next release that carries this; until then nothing changes for users.

00005b73d9f868d7ed4ab555c1d34e462608a4e0d0c93f27cd95ad5470911b8b  npub1qqq9ku7elp5d0m22k42ur56wgcnq3f8q6ryn7f7djkk4guy3rw9su9q2k5
000021340198eb372618e44309a705dec3e6c084a121076de0fde5c7b786aa00  npub1qqqzzdqpnr4nwfscu3psnfc9mmp7dsyy5ysswm0qlhju0dux4gqqzurqvu
0000025590337c61ed410aa017fee518cf86c9047b406fbd56f036dc040cc14f  npub1qqqqy4vsxd7xrm2pp2sp0lh9rr8cdjgy0dqxl02k7qmdcpqvc98s0x0lqw

Reviewer: check the three hex keys against the source outside this repository (spec §4.1 rule 2). They were handed over by the maintainer on 2026-10-23 and converted with nak encode npub.

Affected flow

Every launch and resume: subscribe_announcements now issues one more REQ on the shared pool (kind 38387, these three authors, since = now − 30 days, limit 20) — after the order book and the daemon subscriptions, never in front of them. Notifications shows what arrives (#890). No trade flow, no order status.

Blast radius

  • The subscription is opened on the pool's ephemeral key, carries nothing about the user, and nothing is ever published back (spec §4.4). A relay learns what the kind-38383 subscription already told it: a Mostro client.
  • Off switch: Settings → Notifications → Announcements (feat(announcements): bridge the cache to Dart and add the Announcements toggle #889) closes it at the tap.
  • No persisted data change, no bindings, no localization, no wire change for the daemon or the v1 app.

Platforms tested

Linux: cargo test allowlist, flutter test test/l10n.

Manual testing

Setup

The stack built from this branch, flutter run -d linux or Android; one of the three keys' nsec at hand (offline), nak, and a draft validated with cargo run --bin announce (#891, docs/ANNOUNCEMENTS.md).

Steps

  1. Launch with debug logs on. Expected: [announcements] subscribed to 3 key(s).
  2. Publish an info announcement signed with one of the keys to the three default relays. Expected: within seconds the bell gets a badge and Notifications shows the card (feat(announcements): show announcements in the notification surface #890 steps 1–4).
  3. Publish one signed with any other key. Expected: nothing — no card, no error, [announcements] … turned away: Invalid(AuthorNotAllowed) in the debug log.
  4. Turn the Announcements toggle off, publish another with a project key, turn it back on. Expected: nothing arrived while off; it shows after the toggle is on again (it is still within the 30-day window).
  5. Regression: the order book and a trade's daemon messages arrive as on main.

Not covered

iOS, web.

Screenshots

No visible change beyond #890's.

Automated tests

nostr::announcements::tests::the_shipped_allowlist_is_the_project_keys (the three npubs decode to exactly these hex keys, in order) next to the existing the_shipped_allowlist_decodes_in_full; test/l10n/locale_lists_test.dart still holds the spec's locale list equal to the ARBs.

Checklist

  • cd rust && cargo clippy -- -D warnings && cargo test pass locally on the file of this PR
  • flutter analyze and flutter test unaffected
  • Changed rust/src/api/ or an .arb: no
  • New or changed user-facing text: none
  • Changed an automation identifier: n/a
  • Protocol or transport change: the client now subscribes to kind 38387 (docs: reserve kind 38387 for announcement events protocol#56); the daemon and the v1 app see nothing new
  • Behaviour change: spec §4.1 and §10 updated, status "Built"
  • Commits are signed
  • I ran the Manual testing steps myself — not yet

AI assistance

Written with Claude Code. The keys are the maintainer's; the conversion to npub and the pinning test are the part to verify.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between ee60f28 and 8583bef.

Files selected for processing: 2
  • rust/src/nostr/announcements.rs
  • specs/006-announcement-channel/spec.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T23:52:38.614941Z 607bde2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@grunch

grunch commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Step 6 of specs/006 §10, the one commit that makes the channel live:
the three npubs the maintainer handed over, pinned to their hex form by
a test so a bech32 slip cannot trust a stranger. The reader subscribes
to them on the next release that carries this.
@grunch
grunch force-pushed the feat/announcements-tool branch from fa4e2c3 to ee60f28 Compare October 24, 2026 00:36
@grunch
grunch force-pushed the feat/announcements-allowlist branch from 607bde2 to 8583bef Compare October 24, 2026 00:36
@grunch

grunch commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@grunch

grunch commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@grunch

grunch commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant