-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Realtime Subscription RPCs #916
Conversation
Q: Does this handle reorg out of the box? If not, what to do? |
Q: Other than Ethereum block fields, this additionally returns l1FeeRate and l1Hash. Are we fine with that? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
|
I don't think so. But we don't reorg as of now. don't need to think about it |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good implementation. pls also think about @rakanalh 's comment on where the send on channel should happen.
I think we should have one more feature on this PR.
I don't want our rpc nodes to handle subscriptions. let's put a new boolean config on rollup config for RPC. you can call it allow_subscriptions
or smth like that.
also there should be a max_subscriptions on jsonrpsee config, you can pass that through rollup config as well, check max_connections
deafult can be something like 100 idk
After all the comments and discussions, here is how I see this PR going:
With this approach, we don't need cache whatsoever since we just query once and send to everyone. |
IMO there are 2 places where performance can be improved:
|
why not get all logs at once, then use
are we sure if the logs subscription uses the same filter with
|
They also accept block number and filter by that. Even though it doesn't make much sense, I think it is the general behavior of eth nodes, including reth implementation. |
I have 4 questions left for this PR:
|
|
btw keep the subscriptions on prover. we run the prover for the short-mid term future. we just won't enable subscriptions. doesn't matter that much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good with small nits
Description
Initialized realtime RPCs. Currently only contains
newHeads
andlogs
subscriptions. I also introduced new config parameters:disable_subscriptions
andmax_subscription_connections
.Node implementations (sequencer, fullnode, prover) now receives a sender broadcast channel to notify about new L2 soft confirmations. RPC layer has its own wrapper around a receiver to this channel to actually use this notifications to query Ethereum blocks and send them through the Websocket connections.
In the future, when different types of notifications proves to be needed, it would make sense to replace this broadcast channel with ChainEvents struct which would handle different types of events happening on the chain.
Linked Issues