Skip to content

Update Protos - #2

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
nightly-proto
Open

Update Protos#2
github-actions[bot] wants to merge 1 commit into
mainfrom
nightly-proto

Conversation

@github-actions

Copy link
Copy Markdown
  • Nightly Proto Update

Auto-generated by create-pull-request

@github-actions
github-actions Bot force-pushed the nightly-proto branch 2 times, most recently from 386d90f to 5d414a9 Compare June 22, 2026 15:24
@github-actions
github-actions Bot force-pushed the nightly-proto branch 2 times, most recently from 4726f93 to 7490685 Compare July 20, 2026 12:22
insipx pushed a commit that referenced this pull request Aug 6, 2026
…koff, and catch-up ahead of enablement (xmtp#3887)

Pre-enablement hardening for the XIP-83 bidi surface, from a fresh
adversarial re-review of the now-merged transport + catch-up + lifecycle
code (the interaction bugs that per-PR reviews miss). Bidi still ships
**default-OFF** (`XMTP_BIDI_STREAMS_ENABLED`), so none of these block a
release — they harden the fleet behavior that matters the moment the
flag is flipped. Six atomic commits, one per finding.

## The two that matter most for enablement

- **Order the lifecycle command with the suspend flag under one lock**
(`#1`, medium). `suspend_bidi_streams`/`resume_bidi_streams` set the
process `suspend_requested` flag under the registry lock but sent each
transport's `Cmd::Suspend`/`Cmd::Resume` *after* dropping it. On a
multi-threaded runtime a concurrent suspend+resume could race between
lock-release and their sends, delivering the commands to a transport
opposite to the flag — a wire left **live while backgrounded** (battery)
or **parked while foregrounded** (no delivery). Now the synchronous
command push (`enqueue_suspend`/`enqueue_resume`) happens inside the
same locked section as the flag; only the reply await runs outside.

- **Grow the reconnect backoff on a flapping wire** (`#2`, medium,
pre-existing). The backoff reset to the 100 ms floor the instant a wire
*opened*, before any frame. A server that accepts then immediately
closes (an overloaded node RSTing after accept) pinned every client at
the floor forever, amplifying load against the struggling backend. Now
only a wire that stays up ≥ `MIN_STABLE_UPTIME` resets the backoff; one
that dies inside that window is flapping and keeps backing off. The
explicit `resume()` reset is unchanged.

## Latent hardening

- **Guard the catch-up open against an empty subscription set** (`xmtp#3`,
low). An empty `subs` would seed an adds-nothing open frame that never
earns a `CatchUpComplete`, stalling ~90 s → `Exhausted`. Unreachable
today (the welcome topic is always present), but the safety sat far from
the open; short-circuit it to `Complete`.

- **Time-box the catch-up half-close** (`xmtp#4`, low). `catch_up_attempt`
awaited `conn.finish()` with no deadline; a wedged actor could hang it.
Wrap the half-close and drain under one budget, matching the transport's
own `close_gracefully`.

- **Conclude a superseded resume waiter on suspend** (`xmtp#5`, low). A
`resume()` awaiting catch-up that a `suspend()` preempts was left parked
until some *later* resume, stranding the caller (and its task) for the
whole background sojourn. A suspend supersedes pending resumes; conclude
them at the suspend instead.

## Coverage

- **Chunking × reconnect and × suspend/resume** (`xmtp#6`, test). The
multi-wave-per-lease chunking across a wire death or suspend/resume was
exercised only by the property test (16-case default); every scripted
lifecycle test used the production cap, so none chunked. Adds two
deterministic tests at a shrunk cap (over-cap lease survives a wire
death; survives a suspend/resume), and raises the property test's
default case count.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@github-actions
github-actions Bot force-pushed the nightly-proto branch 2 times, most recently from c441f9d to d136d3b Compare August 17, 2026 10:30
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