Skip to content

Conversation

@steph-rs
Copy link
Contributor

Proposed solution, addressing #118

Implementation:

  • New base_subscribe RPC endpoint with newFlashblocks subscription kind
  • Returns full RpcBlock on each flashblock update (similar to eth_subscribe("newHeads"))
  • Follows reth's EthPubSub patterns using jsonrpsee subscriptions and broadcast channels
  • Only available when flashblocks enabled via --websocket-url flag

@haardikk21
Copy link
Contributor

haardikk21 commented Oct 28, 2025

I wonder if instead of a new RPC method, we should override eth_subscribe with special handling in case params includes the newPendingTransactions subscription type

Edit: nevermind, i guess that doesn't allow consumers to use logs as the subscription type then. we want logs based off of flashblock data

Edit 2: i just saw your comment on the issue

@steph-rs
Copy link
Contributor Author

@danyalprout please let me know what you think🙏

@steph-rs steph-rs marked this pull request as ready for review October 28, 2025 22:49
@haardikk21
Copy link
Contributor

Could you add some tests for this? Probably in tests/rpc.rs

@haardikk21
Copy link
Contributor

haardikk21 commented Nov 11, 2025

cc @cody-wang-cb to take a look at this

@github-actions github-actions bot added the Stale label Nov 26, 2025
@base base deleted a comment from github-actions bot Nov 26, 2025
@haardikk21 haardikk21 removed the Stale label Nov 26, 2025
@refcell refcell force-pushed the feat/flashblocks-subscription branch from 4bccb73 to b64553b Compare December 4, 2025 19:52
@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Dec 4, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@refcell refcell requested a review from danyalprout December 4, 2025 20:26
Copy link
Contributor

@refcell refcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've ported these changes to the new test-utils setup. Won't approve since I've made a bunch of changes that could use another set of eyes.

@steph-rs
Copy link
Contributor Author

steph-rs commented Dec 4, 2025

now we are talking! @refcell it's nice to see new contributors here🔥

@refcell
Copy link
Contributor

refcell commented Dec 4, 2025

now we are talking! @refcell it's nice to see new contributors here🔥

Thx, LMK if I missed something and I'll fix it @steph-rs

Copy link
Collaborator

@danyalprout danyalprout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. Thank you @steph-rs and @refcell!

I personally prefer the idea overriding the existing eth_subscribe if possible. I wonder if we could have eth_subscribe(ExtendedSubscriptionKind), where ExtendedSubscriptionKind = {...SubscriptionKind, NewFlashblocks, PendingLogs }.

This would:

  1. Keep it consistent with the rest of the Flashblock API's (that override the underlying eth_ RPC's)
  2. Should be backwards compatible with the existing eth_subscribe setup
  3. We could potentially override the existing newPendingTransactions event to use the Flashblocks pending state

Happy for us to merge this now and do a follow up to see if we can move it into the eth namespace.

@steph-rs
Copy link
Contributor Author

steph-rs commented Dec 4, 2025

I would be happy to try my best in follow-up. should we update the issue then?

@refcell
Copy link
Contributor

refcell commented Dec 4, 2025

I would be happy to try my best in follow-up. should we update the issue then?

How about we just open up a new issue and point the old issue to the new one? And yes, doing this in a follow-on PR will make it easier to prevent more git conflicts - if you could work in a follow-on pr that would be much appreciated!!

@refcell refcell merged commit 65a4278 into base:main Dec 4, 2025
9 checks passed
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.

5 participants