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

Use runtime_host instead of read_only_runtime_host in JSON-RPC code #259

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Mar 3, 2023

Fix #254

In practice, this affects not only state_call but also state_getMetadata, system_accountNextIndex, and payment_queryInfo. Of course, the last three aren't really affected since the runtime function being called is hardcoded.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       +6512 ┊ smoldot_light::json_rpc_service::Background<TPlat>::runtime_lock::{{closure}}::h11893006d1b4d89a
       -6512 ┊ smoldot_light::json_rpc_service::Background<TPlat>::runtime_lock::{{closure}}::ha437a247f4ae2730
        +726 ┊ smoldot::executor::runtime_host::run::h6353e83230970145
        +696 ┊ smoldot::executor::runtime_host::run::hd0a03319c3bbe6ef
        +655 ┊ smoldot::executor::runtime_host::run::h5bfea10e92832737
        +649 ┊ smoldot::executor::runtime_host::run::had92c81c80d1fbfb
        -395 ┊ smoldot::executor::read_only_runtime_host::run::h422c5e8a0c47f40b
        -368 ┊ smoldot::executor::read_only_runtime_host::run::hac4040d1e839570b
        -327 ┊ smoldot::executor::read_only_runtime_host::run::hd35ee40c4fe7f380
        +302 ┊ <smoldot_light::json_rpc_service::RuntimeCallError as core::fmt::Display>::fmt::h6b5966d41951910f
        -278 ┊ <smoldot_light::json_rpc_service::RuntimeCallError as core::fmt::Display>::fmt::h41d04796709a343d
        -250 ┊ core::ptr::drop_in_place<smoldot_light::json_rpc_service::Background<smoldot_light_wasm::platform::Platform>::runtime_lock::{{closure}}>::h0103481ef2c37f65
        +250 ┊ core::ptr::drop_in_place<smoldot_light::json_rpc_service::Background<smoldot_light_wasm::platform::Platform>::runtime_lock::{{closure}}>::h4c508df58b0e942b
        -243 ┊ <smoldot::executor::read_only_runtime_host::ErrorDetail as core::fmt::Display>::fmt::h96b8f3f7d561c883
        +231 ┊ <&T as core::fmt::Display>::fmt::hd862f2cf1bc458c7
        +180 ┊ smoldot_light::json_rpc_service::Background<TPlat>::handle_request::{{closure}}::h9a0dc66fb4c1420c
        -122 ┊ core::ptr::drop_in_place<smoldot_light::json_rpc_service::state_chain::<impl smoldot_light::json_rpc_service::Background<smoldot_light_wasm::platform::Platform>>::state_call::{{closure}}>::h854de0bf08144451
        +122 ┊ core::ptr::drop_in_place<smoldot_light::json_rpc_service::state_chain::<impl smoldot_light::json_rpc_service::Background<smoldot_light_wasm::platform::Platform>>::state_call::{{closure}}>::heea44efbf8a5750f
        -116 ┊ <T as alloc::string::ToString>::to_string::h0de603db597f7204
        +116 ┊ <T as alloc::string::ToString>::to_string::h494fd2e92dee66ef
        +112 ┊ ... and 32 more.
       +2048 ┊ Σ [52 Total Rows]

@tomaka tomaka enabled auto-merge March 3, 2023 11:10
@tomaka tomaka added this pull request to the merge queue Mar 3, 2023
Merged via the queue into smol-dot:main with commit cd29f59 Mar 3, 2023
@tomaka tomaka deleted the state_call-modif branch March 3, 2023 11:42
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 this pull request may close these issues.

RPC call returns ForbiddenHostCall
1 participant