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

Make clear which RPC methods are safe/unsafe #68

Open
bkchr opened this issue May 5, 2020 · 13 comments
Open

Make clear which RPC methods are safe/unsafe #68

bkchr opened this issue May 5, 2020 · 13 comments
Labels
I5-enhancement An additional feature request.

Comments

@bkchr
Copy link
Member

bkchr commented May 5, 2020

It would be nice to have some sort of list that says which RPC methods are safe or unsafe to make it easier for the user.

Maybe this could be exposed using the RPC that lists all available RPC calls?

CC @Xanewok

@AurevoirXavier
Copy link
Contributor

Really need this. Thanks.

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale label Jul 7, 2021
@mario-sangar
Copy link

mario-sangar commented Sep 17, 2021

This would be awesome to track what methods are unsafe. Right now is kind of hidden in the code which methods are unsafe... Do you know when this could go in?

@tomaka
Copy link
Contributor

tomaka commented Mar 7, 2022

Maybe this could be exposed using the RPC that lists all available RPC calls?

The rpc_methods RPC call returns the list of all RPC calls that are supported.
But instead of modifying rpc_methods to add, say, a new field, I would suggest instead to make rpc_methods only return safe methods if the node is configured to allow only safe methods, and safe+unsafe methods if the node is configured allow both.

@stale stale bot removed the A5-stale label Mar 7, 2022
@tomaka
Copy link
Contributor

tomaka commented Mar 7, 2022

The proper solution IMO, however, is to document this list on a website, rather than use Substrate's source code as the reference point

@ToufeeqP
Copy link
Contributor

ToufeeqP commented Sep 1, 2022

Any progress on this?

@kianenigma
Copy link
Contributor

@the-right-joyce addding this to SDK node, please remove if off topic.

@jamesbayly
Copy link

jamesbayly commented Sep 21, 2022

Throwing some more weight into this, we'd like to start allowing access to certain unsafe methods for our customers, but without being able to easily determine which methods are unsafe, we can't build an allowlist (without exposing everything).

In addition, we can autogenerate documentation using this RPC that lists all available RPC calls as nodes run in safe mode show all safe and unsafe RPC calls. This API isn't really telling the truth for a node run in safe mode.

A simple boolean property would suffice

@kianenigma
Copy link
Contributor

I am not in the weeds but it sounds to me like a fairly simple fix. I am surprised we don't have this already.

@jamesbayly
Copy link

@kianenigma would you be able to give any indication if this can be added, and if so, any idea on the timeline?

@sourabhniyogi
Copy link

sourabhniyogi commented Oct 28, 2022

For indexing, it would be very useful to have the rpc_methods return which methods are "safe" vs "unsafe" and similarly for ws [for our own indexing we check for subscribeStorage availability on public endpoints, and use "unsafe" state_traceBlock a lot] -- We have found many public ws endpoints differ slightly on subscribeStorage for mysterious reasons and this would help.

Even more importantly, we request support for some form of permissioning beyond the overly permissive options of "allow ALL unsafe calls on rpc/ws port" vs overly restrictive "deny ALL unsafe calls on rpc/ws port".

Specifically, full archive nodes should be able to expose their "unsafe" RPC/WS calls to permissioned entities in the "allowlist" model that @jamesbayly suggests -- could be by IP, putting unsafe calls on another port, a HTTP header, some whitelisted apikeys. Out of these options, there may be better options for node operators that need to meter and rate limit here. Not having this form of permissioning required one node type which is "allow ALL unsafe" and another node which is "deny ALL unsafe", which doesn't make sense.

@dcolley
Copy link
Contributor

dcolley commented Dec 2, 2022

Could we at least decorate methods so the https://polkadot.js.org/docs/ site has this?

@jamesbayly
Copy link

Would be very useful just to have some decoration here

@the-right-joyce the-right-joyce transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. and removed J0-enhancement labels Aug 25, 2023
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 26, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Mar 27, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this issue Apr 10, 2024
jonathanudd pushed a commit to jonathanudd/polkadot-sdk that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request.
Projects
Status: backlog
Development

No branches or pull requests

10 participants