Skip to content
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

rpc_port ignored in the configuration #1219

Open
Dinonard opened this issue Aug 3, 2023 · 1 comment
Open

rpc_port ignored in the configuration #1219

Dinonard opened this issue Aug 3, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Dinonard
Copy link

Dinonard commented Aug 3, 2023

Issue Description

In case of a configuration such as this one:

  [[parachains.collators]]
  name = "collator1"
  command = "./some-collator"
  rpc_port = 6969

The RPC port value will be ignored, and instead a random one will be used.

I assume it's due to this code:

if (nodeSetup.substrateCliArgsVersion === SubstrateCliArgsVersion.V0) {
    portFlags["--rpc-port"] = (nodeSetup.rpcPort || RPC_HTTP_PORT).toString();
    portFlags["--ws-port"] = (nodeSetup.wsPort || RPC_WS_PORT).toString();
  } else {
    // use ws port as default
    const portToUse = nodeSetup.wsPort
      ? nodeSetup.wsPort
      : nodeSetup.rpcPort || RPC_HTTP_PORT;
    portFlags["--rpc-port"] = portToUse.toString();
  }

wsPort will always be defined, since in case it's omitted, a random one will be generated at that point.

It's also a bit confusing to specify ws_port in the config file - both WS & HTTP are RPC ports.
Maybe it would be better to use rpc_port and stop using the ws_port?

Steps to reproduce the issue

Just specify rpc_port in the config file, as explained in the issue description.

Describe the results you received

Random RPC port was used.

Describe the results you expected

The one I specified to be used.

Zombienet version

1.3.63

Provider

Native

Provider version

## For binaries
polkadot 0.9.43-a2b62fb872b

Upstream Latest Release

Yes

Additional environment details

None

Additional information

No response

Screenshots

No response

@pepoviola
Copy link
Collaborator

pepoviola commented Aug 3, 2023

Hi @Dinonard, thanks for your feedback and to open this issue. Yes, the issue was introduced when we add support for diff cli args version, since in older versions of polkadot you can specify ws-port and rpc-port (paritytech/substrate#13384). We want to still support older versions so we keep the ws-port option, but we need to fix the way we calculate which port you want to use.

As workaround, if you set ws_port = 6969 the collator will use that port as rpc-port.
Thanks!!

@pepoviola pepoviola added the bug Something isn't working label Aug 3, 2023
@pepoviola pepoviola added the good first issue Good for newcomers label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants