-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Add --rollup.sequencer-ws
to support WebSocket
#15499
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
Conversation
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.
I see,
the question here is do we want the AddOns
setup to be async or not.
I'd prefer if we could avoid this and instead try moving the client setup in here:
reth/crates/optimism/node/src/node.rs
Lines 295 to 298 in ef18f95
async fn launch_add_ons( | |
self, | |
ctx: reth_node_api::AddOnsContext<'_, N>, | |
) -> eyre::Result<Self::Handle> { |
but need to take a closer look first, but I feel like this should be doable, because we can get access to the
reth/crates/optimism/node/src/node.rs
Line 244 in ef18f95
OpEthApiBuilder, |
which also needs an instance
Thanks for quick feedback @mattsse, let me try to fix it then! |
#[tokio::test] | ||
#[ignore = "Start if WS is reachable at ws://localhost:8546"] | ||
async fn test_ws_body_str() { | ||
let client = SequencerClient::new("ws://localhost:8546").await.unwrap(); |
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.
This requires a node though. Can remove this test, but just in case, it works for me locally
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.
cool, way less invasive now.
still have a few nits
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.
I see,
let me make the last remaining changes so that we can get rid of the block_on call
crates/optimism/rpc/src/eth/mod.rs
Outdated
ctx.components | ||
.task_executor() | ||
.handle() | ||
.block_on(SequencerClient::new(url)) | ||
.expect("Failed to init sequencer client") |
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.
this doesn't quite work
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.
Fixed with ur changes. Thanks!
--rollup.sequencer-ws
to support WebSocket--rollup.sequencer-ws
to support WebSocket
…5499) Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Closes #15286
This pr firstly makesNode::add_ons
async (as it is required for making WS connection) and adds flags for sequencer WS (both--rollup.sequencer-ws
and--rollup.sequencer
which supports both).Unfortunately nowSequencerClient
can panic during initialization, as I didn't want to addResult
for add-ons construction.I can remove
--rollup.sequencer
and add specific constructors forSequencerClient
for http and ws