Skip to content

bgpo: convert BTO from subscription to polling#19095

Merged
sebastianst merged 1 commit intodevelopfrom
seb/fix-bto-sub
Feb 5, 2026
Merged

bgpo: convert BTO from subscription to polling#19095
sebastianst merged 1 commit intodevelopfrom
seb/fix-bto-sub

Conversation

@sebastianst
Copy link
Member

Summary

Convert the Blob Tip Oracle (BTO) from using ethclient.SubscribeNewHead() (WebSocket-only) to polling for new headers. This enables BTO to work with HTTP connections and removes the WebSocket requirement.

Changes remove the SubscribeNewHead method from BTOBackend, convert the subscription-based processing loop to a polling loop using the existing PollRate configuration (2.5s default), and update tests accordingly.

Test Plan

  • BTO unit tests pass (go test ./op-service/bgpo/...)
  • txmgr tests pass (go test ./op-service/txmgr/...)
  • Batcher builds successfully

🤖 Generated with Claude Code

The Blob Tip Oracle (BTO) previously used ethclient.SubscribeNewHead() for header notifications, which only works over WebSocket connections. This change converts it to polling for new headers instead, allowing it to work with HTTP connections. The polling uses the existing PollRate configuration (2.5s default) to check for new headers at regular intervals.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@sebastianst sebastianst requested a review from a team as a code owner February 5, 2026 13:09
@sebastianst sebastianst requested review from nonsense and zhwrd and removed request for zhwrd February 5, 2026 13:10
@sebastianst sebastianst enabled auto-merge February 5, 2026 13:29
@sebastianst sebastianst added this pull request to the merge queue Feb 5, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 5, 2026
The Blob Tip Oracle (BTO) previously used ethclient.SubscribeNewHead() for header notifications, which only works over WebSocket connections. This change converts it to polling for new headers instead, allowing it to work with HTTP connections. The polling uses the existing PollRate configuration (2.5s default) to check for new headers at regular intervals.

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Merged via the queue into develop with commit 16592fd Feb 5, 2026
78 checks passed
@sebastianst sebastianst deleted the seb/fix-bto-sub branch February 5, 2026 15:06
@ajsutton
Copy link
Contributor

ajsutton commented Feb 5, 2026

For the record, you can use SubscribeNewHead with a http connection, but you need to setup a polling rpc client:

func NewPollingClient(ctx context.Context, lgr log.Logger, c RPC, opts ...WrappedHTTPClientOption) *PollingClient {

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.

3 participants