Skip to content

Keep a re-keyed shared key when its grant lands but the call fails - #106

Merged
Ocnrb merged 5 commits into
mainfrom
fix/rekey-recovery
Oct 5, 2026
Merged

Ocnrb merged 5 commits into
mainfrom
fix/rekey-recovery

Conversation

@Ocnrb

@Ocnrb Ocnrb commented Oct 5, 2026

Copy link
Copy Markdown
Member
  • A reset minted the new key in memory, sent the grant and only then saved it: a grant that landed while the call failed left the old key revoked and the new one lost until a manual reset
  • The new key is now saved as pending before the grant goes out, promoted and announced once it returns, and settled from the chain on the call's failure and on the owner's next open; a pending key travels through sync and a reset over an unsettled one refuses while the chain cannot be read
  • A held shared key whose rev no announce carries is announced regardless of the old announce's freshness
  • A publish key reset whose grant landed on one stream only is finished on the other
  • Restoring a backup over a channel that already has local keys keeps the higher-rev shared keys instead of dropping them

Ocnrb and others added 5 commits October 5, 2026 18:44
- A fresh announce of the older rev kept the self-heal quiet, so a key adopted without its announce stayed unannounced until retention aged the old one out

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- The new key is written down as pending before the grant is sent, and only replaces the old one once the chain shows its grant
- A failed call, and every owner open after it, settle the pending key from the chain: promote it, keep it while the grant may still land, or drop it an hour after it clearly never did
- A reset over a pending key that the chain left unsettled revokes that key too, so whichever grant lands last leaves one holder; while the chain cannot be read the reset is refused, since it would drop the only record of a key that may hold the grant

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Merged by the higher rev like the shared keys, and dropped once a key or announce at its rev shows a device settled it
- Pushed as soon as it is written, so a device lost before the grant settles leaves the key with the others
- Parity vectors gain the merge cases, and both pending fields count as news

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…cal keys

- The import only joined epochs, announces and the current epoch, so a backup restored where the channel already existed lost its publish and interactions keys
- The higher rev wins, as in the sync merge and the Android fold; pending re-keys come along and are dropped once settled

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- The publish key's grants are one transaction per stream, so a reset can stop with -1 moved and -2 not; settling it sends the missing stream's grant, the one the owner already authorised, and then adopts the key

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
p2p-public-chat Ready Ready Preview Oct 5, 2026 7:41pm UTC
pombo Ready Ready Preview Oct 5, 2026 7:41pm UTC

@Ocnrb
Ocnrb merged commit 2f05447 into main Oct 5, 2026
2 of 3 checks passed

This branch was successfully deployed

2 active deployments
Preview – p2p-public-chat — 6a86d50a Deployed Oct 5, 2026 by vercel[bot]
Preview – pombo — 6a86d50a Deployed Oct 5, 2026 by vercel[bot]
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