Skip to content

feat: replace BundlePoller polling with SSE streaming#269

Draft
Evalir wants to merge 1 commit intoevalir/eop/sse-tx-pollerfrom
evalir/eop/sse-bundle-poller
Draft

feat: replace BundlePoller polling with SSE streaming#269
Evalir wants to merge 1 commit intoevalir/eop/sse-tx-pollerfrom
evalir/eop/sse-bundle-poller

Conversation

@Evalir
Copy link
Copy Markdown
Member

@Evalir Evalir commented Apr 23, 2026

Description

Mirrors #259 (tx-poller SSE) for bundles. Replaces the 1s polling loop in BundlePoller with an SSE subscription to /bundles/feed via BuilderTxCache::subscribe_bundles (newly exposed by the SDK, matched by the tx-pool-webservice endpoint).

The structure matches TxPoller exactly:

  • Initial full_fetch paginates through stream_bundles to seed the cache on startup.
  • subscribe opens the SSE stream and yields CachedBundles in real time.
  • On stream error / stream end, reconnects with exponential backoff (1s → 30s cap), racing the sleep against the block-env watcher so an env change wins and triggers a fresh full refetch immediately.
  • On block-env change, the full_fetch runs again to cover anything missed during disconnection.
  • NotOurSlot is logged at trace level (expected when the builder is not slot-permissioned) in both the full-fetch and subscribe paths — avoids spurious warn-level noise.

The public check_bundle_cache() wrapper is dropped; the integration test now uses BuilderTxCache::stream_bundles directly, matching the style of tx_poller_test.rs.

Related Issue

Stacked on #259.

Testing

  • make fmt passes
  • make clippy passes
  • make test passes
  • cargo doc --no-deps passes with -D warnings
  • cargo test --features test-utils --no-run builds all integration tests
  • Exercise against a live tx-pool-webservice to verify SSE reconnect and env-driven refetch behavior end-to-end

Copy link
Copy Markdown
Member Author

Evalir commented Apr 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Mirrors the TxPoller SSE change: subscribe to /bundles/feed via
BuilderTxCache::subscribe_bundles for real-time delivery of new bundles,
with an initial full_fetch on startup/block-env change and exponential
backoff reconnect on error or stream end. Drops the 1s polling loop.
@Evalir Evalir force-pushed the evalir/eop/sse-bundle-poller branch from b4f7193 to 8c472ae Compare April 23, 2026 21:45
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