Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

RPC port default behavior changed #2529

Closed
BulatSaif opened this issue May 5, 2023 · 2 comments · Fixed by #2539
Closed

RPC port default behavior changed #2529

BulatSaif opened this issue May 5, 2023 · 2 comments · Fixed by #2539

Comments

@BulatSaif
Copy link
Contributor

BulatSaif commented May 5, 2023

After #2417 merged the default behavior for JSON-RPC changed:

Old behavior:

Node Port
Relaychain 9945
Parachain 9944

Example:

docker run -it paritypr/polkadot-parachain-debug:v0.9.400-269fb073 --unsafe-rpc-external --unsafe-ws-external --rpc-cors=all --rpc-methods=unsafe --tmp -- --chain rococo  | grep JSON-RPC
2023-05-05 13:52:43 [Relaychain] Running JSON-RPC HTTP server: addr=127.0.0.1:9934, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 13:52:43 [Relaychain] Running JSON-RPC WS server: addr=127.0.0.1:9945, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 13:52:44 [Parachain] Running JSON-RPC HTTP server: addr=0.0.0.0:9933, allowed origins=["*"]    
2023-05-05 13:52:44 [Parachain] Running JSON-RPC WS server: addr=0.0.0.0:9944, allowed origins=["*"]  

New behavior:

Node Port
Relaychain 9944
Parachain Random
docker run -it paritypr/polkadot-parachain-debug:master-ab7ce3bc --unsafe-rpc-external  --rpc-cors=all --rpc-methods=unsafe --tmp -- --chain rococo  | grep JSON-RPC
2023-05-05 13:53:27 [Relaychain] Running JSON-RPC server: addr=127.0.0.1:9944, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2023-05-05 13:53:27 [Parachain] Running JSON-RPC server: addr=0.0.0.0:45755, allowed origins=["*"] 

Expected behavior:

Node Port
Relaychain 9945
Parachain 9944
[Relaychain] Running JSON-RPC server: addr=127.0.0.1:9945, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
[Parachain] Running JSON-RPC server: addr=0.0.0.0:9944, allowed origins=["*"] 
@PierreBesson
Copy link
Contributor

IMO this is really dangerous for Parachain RPC node operators who have not have set an explicit port in flags (ie. most users) as this will direct RPC traffic to the Relay-chain node. It will also be hard to troubleshoot for them as it will initially appear to work but return the wrong data.

Please hold off the release until it is fixed.

@niklasad1
Copy link
Member

niklasad1 commented May 5, 2023

hmm, weird lemme have a look at it.

EDIT:
Ok, the substrate PR changed the default value for the port from Option<Port> to Port so the rpc_listen_port override isn't used because it's already a value in there.

So, either change to port to Option<port> in substrate or just override it in cumulus.

PierreBesson added a commit to paritytech/helm-charts that referenced this issue May 8, 2023
PierreBesson added a commit to paritytech/helm-charts that referenced this issue May 10, 2023
* add node.perNodeServices.apiService.rpcPort config value while keeping backward compatible with wsPort and httpPort for legacy flags

* remove setting of collator relay-chain rpc-port to 9945 which was a workaround for paritytech/cumulus#2529

* bump node chart patch version

* use correct 'containerPort' and omit protocol=TCP as it is the default value

* remove websocket-rpc and http-rpc port from podspec but set as targetPort in service

* set wsPort default to 9955 as it can't be set be the same as another port

* call new rpc pod portfor startup probe

* add back line that was erroneously removed

* revert to hardcoded 9933/9944 for rpc-http and rpc-websocket ports when using legacy rpc flags

* hardcode port numbers for legacy rpc flags per node services
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants