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 call returns ForbiddenHostCall #254

Closed
skunert opened this issue Mar 2, 2023 · 1 comment · Fixed by #259
Closed

RPC call returns ForbiddenHostCall #254

skunert opened this issue Mar 2, 2023 · 1 comment · Fixed by #259

Comments

@skunert
Copy link
Contributor

skunert commented Mar 2, 2023

When performing an RPC call with method state_call, I get a "ForbiddenHostCall" error message for certain calls. I am not sure what that means or why the call is forbidden. Until now I have only observed this for state_call with method ParachainHost_availability_cores.

Error Message

ErrorObject { code: ServerError(-32000), message: "ForbiddenHostCall", data: None }

Reproduction

  • Start network (chain spec was rococo-local in my case)
  • Join network with smoldot light-client
  • Send payload via websocket: {"id": "some_id", "method": "state_call", "params": ["ParachainHost_availability_cores", "0x"], "jsonrpc": "2.0"}
  • I verified that this call works fine on the other relay chain nodes in the network
@tomaka
Copy link
Contributor

tomaka commented Mar 2, 2023

This is semi-intended.

This ForbiddenHostCall means that the runtime has tried to modify the storage.

Since I was generally expecting the runtime calls made by the JSON-RPC layer to not modify the storage, I had decided at the time to forbid modifications to the storage.

I'll change that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants