# Fixing a Farcaster hub from a browser client: what our pull requests to Hypersnap changed

> Building Quilcast directly on Hypersnap led to 37 upstream PRs: 22 merged, 11 open as of 29 Nov 2026. What broke in notifications, threads and sync.

Published November 29, 2026 on Quilcast Notes: https://blog.quilcast.com/fixing-farcaster-hub-hypersnap-pull-requests/

[Quilcast](https://quilcast.com) does not run a hosted API between your browser and Farcaster. It talks straight to [Hypersnap](https://github.com/farcasterorg/hypersnap), Quilibrium's Farcaster node software, reading from `haatz.quilibrium.com` by default or from any node you set in Settings. Because there is no private backend papering over hub bugs, every missing index, bad label or slow endpoint shows up in the browser right away. Between 22 October and 24 November 2026, we opened 37 pull requests against `farcasterorg/hypersnap`: as of 29 November 2026, 22 are merged, 11 are open, and 4 were closed without merging.

That direct path is also why [Quilcast](https://quilcast.com) stays small and private, keeping your signing keys in IndexedDB with no middleman reading your feeds. Fixing Hypersnap upstream makes Quilcast faster and more reliable while improving the hub for every other client on the network at the same time.

Every PR status, diff and node stat below was checked on 29 November 2026 against GitHub (`farcasterorg/hypersnap`), Quilcast `0.116.0` (commit `b2115ee5f8` in [backmeupplz/quilcast](https://github.com/backmeupplz/quilcast)), and `GET https://haatz.quilibrium.com/v1/info`, which reported Hypersnap `0.17.22` holding `914,815,741` messages, `3,358,375` registered FIDs and `799.8 GB` across two data shards plus shard 0.

## Why notifications broke for active users

Three of our five pull requests merged on 20 November 2026 came straight from Quilcast users reporting missing or broken notifications.

### Mentions came back labeled as replies (#76, merged 20 Nov)

A user got tagged in a top-level cast and received no mention alert. Checking the node showed her FID in the cast's `mentions` array, and `/v2/farcaster/notifications` returned the cast, except it labeled the event `"reply"`.

In `src/api/http.rs`, `handle_notifications` mapped every non-quote `CastAdd` to `"reply"`. The `"mention"` label lived only in a `_ => "mention"` fallback that no message ever hit, so any client with a Mentions tab or mention push toggle received zero mentions.

[PR #76](https://github.com/farcasterorg/hypersnap/pull/76) (`+201/-8`, 4 files) adds `is_mention_of(data, fid)` so a cast tagging the user without directly replying to one of their casts comes back as `"mention"`, while direct replies stay `"reply"` even when the posting client includes an `@mention`. The same rule was applied to `/v2/farcaster/notifications/channel` and `/v2/farcaster/notifications/parent_url`.

### Tagging yourself notified you (#86, merged 20 Nov)

Every other notification source in `get_notifications` (`src/network/server.rs`) checked `fid != requesting_fid` so you would not get alerted by your own reactions, replies or quotes. `get_casts_by_mention` was the one source missing that filter, so tagging yourself in your own cast put it in your notifications. [PR #86](https://github.com/farcasterorg/hypersnap/pull/86) (`+84/-2`, 2 files) drops `d.fid == fid` on the mention scan and adds `test_notifications_excludes_self_mentions`.

### Activity vanished past your 100 newest casts (#79, merged 20 Nov)

A user (`fid 190218`) had a cast pick up 10 likes on 14 November. The node listed all 10 likers when queried directly, yet none showed up in notifications because they had posted 118 times since. On `haatz`, the cutoff was exact: casts in positions 0 to 96 with likes appeared in notifications, and nothing from position 101 onward appeared at all.

In `get_notifications`, the hub fetched `(limit * 3).min(100)` of the user's newest casts (replies included) and fanned out reaction and reply lookups across every shard for those 100 casts alone. The cursor filtered that same fixed set, so paging never reached further back and older notifications disappeared as you kept posting.

[PR #79](https://github.com/farcasterorg/hypersnap/pull/79) (`+1775/-64`, 12 files) adds a dedicated RocksDB notifications index in `src/api/notifications_index.rs` (741 new lines) under prefix `0xED`:

```text
[0xED][0x01][notified_fid:8][timestamp:4][hash:20][kind:1][actor_fid:8] -> empty
```

It indexes likes, recasts, direct replies, deeper replies up to five levels down a thread, quotes, mentions and follows, never notifying the author. A page is now one reverse range scan from the cursor plus one point read per message (`Store::get_by_ts_hash`). Reading the message itself automatically drops unlikes, deleted casts and unfollows without tracking removes in the index. Quilcast's `Notifications` pager in `src/app.tsx` handles the index's early or empty pages by continuing as long as `next.cursor` changes.

## Cutting wasted work in threads, consensus and sync

Once notifications worked past cast 100, the next bottlenecks showed up in conversation loads and read-node sync speed.

### Resolving a thread root once instead of 500 times (#82, merged 20 Nov)

`/v2/farcaster/cast/conversation` returns up to 500 replies. For every reply, `message_to_cast` walked back up to the thread root via `thread_root`, paying one cast read and decode per hop.

Because every reply in a conversation shares the same root, [PR #82](https://github.com/farcasterorg/hypersnap/pull/82) (`+159/-19`, 4 files) walks `thread_root` once from the root and passes the root hash and depth down the tree, keeping the exact `MAX_THREAD_HOPS` cutoff while cutting hundreds of extra reads.

Profiling that endpoint also showed where not to optimize: reply-count scans took roughly `4 µs` per cast (`1.8 ms` down to `1.2 ms` across 500 casts), so we left them untouched. On `haatz`, a 500-reply conversation ran about `300 ms` over the network baseline, mostly spent hydrating distinct authors at `~1.5 ms` each, which pointed directly to our open caching PRs (`#81` and `#83`).

### Checking validator membership without cloning the set (#96, merged 28 Nov)

Every consensus vote, proposal and proposal part passes through `Participation` in `src/consensus/malachite/network_connector.rs`, calling `is_active()` and `accepts_height()`. Both went through `StoredValidatorSets::get_validator_set()`, which cloned the entire `Vec<SnapchainValidator>` just to answer a boolean check.

[PR #96](https://github.com/farcasterorg/hypersnap/pull/96) (`+156/-8`, 4 files, fixing `#64`) moves set lookup into a private `set_at()` helper in `src/consensus/validator.rs` and adds `contains(height, &address)` so `Participation` checks membership without allocating.

### Pipelining read-node catch-up from 7.4 blocks/s (#100, merged 28 Nov)

A read node roughly 9,000 blocks behind on shard 1 caught up at a steady `7.4 blocks/s` (458 blocks in 62 seconds, sampled every two seconds from `/v1/info`). With blocks arriving around one per second, every hour behind took about 10 minutes to recover.

`ReadSync` in `src/consensus/malachite/read_sync.rs` asked peers for one height at a time and waited for commit before asking for `h + 1`, leaving the read validator's 100-block out-of-order buffer (`max_num_buffered_blocks`) unused. [PR #100](https://github.com/farcasterorg/hypersnap/pull/100) (`+454/-52`, 5 files) keeps a 32-block `SYNC_WINDOW` in flight across peers whose status covers each height without changing the wire protocol, and fixes four bugs on the same path, including an `inflight` map that leaked one entry per synced block and malformed or vote-set replies that could wedge a height permanently.

Here is the PR's `catch_up_rate` benchmark (300 blocks through read-node actors, debug build, ranges across runs on a shared machine):

| Round trip | Before | After |
|---|---|---|
| 0 ms | 379 blocks/s | 250-876 blocks/s |
| 50 ms | 17.9 blocks/s | 213-443 blocks/s |
| 100 ms | 9.4 blocks/s | 169-250 blocks/s |
| 200 ms | 4.8 blocks/s | 125-139 blocks/s |

On loopback against a 2,000-block devnet seeded with real mainnet accounts and seven validators, both builds replayed shard 0 at `70-80 blocks/s` (`40-46 s` total), confirming that per-block network wait rather than commit speed had pinned mainnet at `7.4 blocks/s`.

## Keeping main green so reviews move (#80 and #99)

Two merged PRs existed purely to fix failing tests on `main` that turned every branch red:

- [PR #80](https://github.com/farcasterorg/hypersnap/pull/80) (merged 20 Nov, `+70/-8`) fixed two integration tests. `legacy_index_keeps_serving_until_the_rebuild_completes` failed 12 of 100 runs under CPU load because Tantivy's `ReloadPolicy::OnCommitWithDelay` watcher thread recreated `.tantivy-meta.lock` during `remove_dir_all`; switching to `ReloadPolicy::Manual` and reloading inside `CastIndex::commit` took it to 250 of 250 passes and cut up to 500 ms of search commit lag. `test_malformed_decided_values_do_not_stall_the_read_node` had waited for three unroutable malformed values (`0xa1`, `0xa2`, and shard-7 `0xa3`) that `Schedule::publications` intentionally drops.
- [PR #99](https://github.com/farcasterorg/hypersnap/pull/99) (merged 28 Nov, `+2/-1`) changed `discovery_default_seeds_exclude_offline_peers_without_removing_validators` in `src/network/gossip.rs` from `== 8` to `>= 8` after validator rotations grew `validators.toml` to 11 keys.

Earlier, between 30 October and 14 November, we also merged 14 PRs (`#40`, `#42`–`#44`, `#52`–`#59`, `#67`, `#69`) adding `with_recasts`, `include_quotes_and_deep_replies`, `viewer_fid` context and `thread_hash` on v2 casts, newest-first channel feeds, zero-downtime social graph rebuilds, hashtag search, large-follow-list performance, and `format_version`/`chain` fields that Quilcast reads in `src/api.ts` and `src/app.tsx`.

## What is still open on 29 November 2026

Eleven pull requests remain open for review. Two clusters matter most for node operators.

### Walking 4.3 billion FIDs instead of 3.36 million (#89, open)

Native FIDs start at `2^32` (`FIRST_NATIVE_FID = 4,294,967,296`). Three loops walked densely over `1..=max_registered_fid`: `run_hyper_reconcile` (`src/hyper/reconcile.rs`), `UserSearchIndexer::backfill` (`src/api/user_search_index.rs`), and `find_cast_fid_by_hash` (`src/network/server.rs`). Once a single native account exists, each loop walks roughly 4.3 billion IDs even though mainnet holds only `3,358,375` registered FIDs today. A CI log printed `Hyper reconciliation progress shard_id=1 fid=1450000 max_fid=4294967296 ... elapsed_secs=209`, which extrapolates to days of I/O after every restart and stalls the notifications walk that waits for reconcile to finish. [PR #89](https://github.com/farcasterorg/hypersnap/pull/89) (`+162/-90`, 5 files) switches all three to `FIDIterator`.

### Notifications surviving restarts and gap repair (#90-#93, open)

Testing `#79` on a local devnet (7 validators, 2 read nodes seeded with mainnet accounts) showed two read nodes on the same release returning different notifications for `fid 3`, even though `/v1/reactionsByCast` had the missing like on both. When a node stops, the indexer worker drops queued events; on restart, `initialize` replays each shard from its stored mark (`[0xED][0xFC][shard]`) to the tip, skipping any shard with no mark yet. On our devnet run, fresh read nodes stopped with 297 and 295 of 742 entries and reached only 507 after restarting.

Four stacked PRs close every variant of that gap: [#90](https://github.com/farcasterorg/hypersnap/pull/90) stores an initial mark for unmarked shards at startup and re-walks affected shards; [#91](https://github.com/farcasterorg/hypersnap/pull/91) moves checkpoint keys to `notifications_index_v2` and `[0xED][0xFB]` so upgraded nodes heal once; [#92](https://github.com/farcasterorg/hypersnap/pull/92) holds the stored mark at or below the lowest unreplayed gap in `IndexGaps`; and [#93](https://github.com/farcasterorg/hypersnap/pull/93) passes height `0` during gap repair so out-of-order replays never jump past blocks still queued in the live worker.

The remaining open PRs cover following-feed pruning and `/v1/info` caching (`#81`, targeting a `600 ms` following feed on `fid 1356` with 8,708 follows), persistent hydrated profiles (`#83`), `Ogre` 10-node devnet rollout CI (`#94`), hyper shadow merge event-ID exhaustion (`#97`), clearing the Tantivy index before snapshot restores (`#98`), and pinned casts (`#60`).

## Status of the November PRs

| PR | Area | Status | Date |
|---|---|---|---|
| [#76](https://github.com/farcasterorg/hypersnap/pull/76) | Mention labels | Merged | 20 Nov |
| [#79](https://github.com/farcasterorg/hypersnap/pull/79) | Notifications index | Merged | 20 Nov |
| [#80](https://github.com/farcasterorg/hypersnap/pull/80) | Integration tests | Merged | 20 Nov |
| [#82](https://github.com/farcasterorg/hypersnap/pull/82) | Thread root walk | Merged | 20 Nov |
| [#86](https://github.com/farcasterorg/hypersnap/pull/86) | Self-mention filter | Merged | 20 Nov |
| [#96](https://github.com/farcasterorg/hypersnap/pull/96) | Validator check | Merged | 28 Nov |
| [#99](https://github.com/farcasterorg/hypersnap/pull/99) | Discovery test | Merged | 28 Nov |
| [#100](https://github.com/farcasterorg/hypersnap/pull/100) | 32-block sync | Merged | 28 Nov |
| [#89](https://github.com/farcasterorg/hypersnap/pull/89) | FIDIterator walk | Open | 22 Nov |
| [#90](https://github.com/farcasterorg/hypersnap/pull/90)-[#93](https://github.com/farcasterorg/hypersnap/pull/93) | Index restart replay | Open | 22 Nov |
| [#81](https://github.com/farcasterorg/hypersnap/pull/81), [#83](https://github.com/farcasterorg/hypersnap/pull/83) | Feed and user cache | Open | 16 Nov |
| [#94](https://github.com/farcasterorg/hypersnap/pull/94), [#97](https://github.com/farcasterorg/hypersnap/pull/97), [#98](https://github.com/farcasterorg/hypersnap/pull/98) | Devnet CI and storage | Open | 22 Nov |

## Frequently asked questions

### Does Quilcast need its own Farcaster API server?

No. [Quilcast](https://quilcast.com) reads directly from a Hypersnap node's HTTP API and posts browser-signed protobuf messages to `/v1/submitMessage`. Its static host only fetches link previews and proxies external images so third-party sites never see your IP, plus optional push notifications or scheduled casts if you enable them.

### Can I point Quilcast at my own Hypersnap node?

Yes. Open Settings in Quilcast and change the Hypersnap node URL from `https://haatz.quilibrium.com` to your own node. Any node running current `farcasterorg/hypersnap` picks up the merged notification, thread and sync fixes automatically.

### Where can I try Quilcast or inspect the code?

Open [Quilcast in your browser](https://quilcast.com), install the iPhone, iPad or Android app, or read the MIT-licensed source in [backmeupplz/quilcast](https://github.com/backmeupplz/quilcast).

