-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: add param arguments for initializing websocket #992
Conversation
Ok I am just removing WS from starting with the HTTP rpc in that case, as properly supporting WS isn't high priority right now |
Looks like it was probably to follow geth's behavior ... #757 (comment) unless I'm missing some other part of the conversation |
I think the optimal solution in this case is to add a cli flag that allows for custom ws ports, which we could use when running bridge with > 1 node to avoid collisions |
taken from #757 (comment) Sounds like the solution was to optionally run WS simulatneously if a port was provided. Which is different then
^ which requires we run WS regardless of if we pass a port param or not I am confused cause the comment linked says running WS is optional. I think WS running optionally is the better solution here. As then users don't have to worry or wonder why there 2nd trin instance isn't running. Also why run WS if the user isn't using it. |
Yup, I agree. And if I remember correctly, I also pushed for this argument. Unfortunately, I can't remember the justification, all I remember is @ogenev pushed for running WS by default. Maybe, I'm misremembering, but would like a final confirmation from Ognyan here that we're good to go ahead with making WS optional (and will only be enabled via an cli flag) |
Okie dokie sounds like a plan |
I'm ok with removing the WS by default but IMO this is not solving the real issue mentioned in the PR description and I don't think it justifies disabling WS. If a bridge runs multiple nodes and all of those nodes bind to the same WS address, it is either a bridge configuration issue or Trin issue that doesn't allow using a custom WS address, or both :) |
So are you ok with us only enabling ws if somebody specifies the port on running trin so |
In this situation, I feel like following what geth does is the easiest way to proceed, unless somebody can produce a strong use case for another setup... Using just the We could do something like .... |
c77158b
to
49c71c3
Compare
Ok PR is ready to review with the geth styled ws pattern nick posted above |
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! My only question is w/ regards to this comment by @ogenev
HTTP and WS must run on a separate port. Current defaults are 8545 for HTTP and 8546 for WS.
Why do we require separate ports? From what I can tell, it seems technically possible to run both ws & http processes on the same port. Now, it's a different question about whether this is something we want to support or not?
Right now, it looks like we support running ws & http on the same port, but I'm leaning towards requiring separate ports...
I have few comments / suggestions
If this PR is blocking some other work, you can merge it like this and I can look into making these changes. |
Following up from the discussion in today's sync.... Let's shelve the Regarding @morph-dev 's suggestions...
|
@njgheorghita I resolved these 2 concerns. PR is ready for another review |
|
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.
🚢
ethportal-api/src/types/cli.rs
Outdated
#[arg( | ||
long = "ws-port", | ||
help = "The WebSocket port to listen on.", | ||
default_value_t = DEFAULT_WEB3_WS_PORT |
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 think we should add requires
the ws
argument here
ethportal-api/src/types/cli.rs
Outdated
Web3TransportType::IPC => { | ||
match config.web3_http_address.as_str() { | ||
DEFAULT_WEB3_HTTP_ADDRESS => {} | ||
p => return Err(Error::raw(ErrorKind::ArgumentConflict,format!("Must not supply an http address when using ipc protocol for json-rpc (received: {p})"))), |
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 know it's not your change, but can you update this single letter variable to something more descriptive
b9c647a
to
36503d2
Compare
What was wrong?
When I run bridge with multiple nodes I get an error on the lines of
WS socker address already bound
When bridge makes X connections it WS binds to 8456 everytime.Closes #757
How was it fixed?
I am just removing WS from starting with HTTP as it isn't high priority enough to properly support WS