-
Notifications
You must be signed in to change notification settings - Fork 20
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 some DI responses synchronous #1920
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## dev #1920 +/- ##
==========================================
- Coverage 17.67% 17.51% -0.16%
==========================================
Files 272 272
Lines 12936 13054 +118
==========================================
Hits 2287 2287
- Misses 10649 10767 +118
|
Hold on - maybe I can finish the streamed trustedCall part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed several warnings in tee-worker logs while running test-identity:local
ts-tests aganist this implementation
[2023-07-24T21:07:06Z INFO itc_direct_rpc_server::rpc_responder] set response value
[2023-07-24T21:07:06Z WARN itp_top_pool::watcher] failed to set response value to rpc client: InvalidConnectionHash
It looks like it doesn't make sense to invoke set_rpc_response_value
for TOPs that originates from indirect calls.
I believe you'll see such warnings even for DI requests due to potential early hash swap. The swap is called in another thread, and there's no guarantee that the previous top is already imported in the sidechain block at that time. In fact, for most of the time it's not yet included in the block. Therefore later when the previous top does get included in the block, the top pool watcher tries to send out the response and finds out the channel doesn't exist any more, hence the warning. It's expected behavior and should be fine in such case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By making these changes and using rpc return values only for indirect calls I managed to get rid of all [WARN itp_top_pool::watcher] failed to set response value to rpc client: InvalidConnectionHash
log entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏼
Context
Partially implemented #1883, it's divided into multiple PRs as otherwise the PR would be too bigsolves #1883
This PR:
top_hash
intoTrustedOperationStatus
link_identity
)Err
so that the synchronous DI response showsInvalid
The parachain callbacks are preserved to make CI backwards compatible. If you send one of the DI requests above, you should see both the rpc response AND the parachain event.
Now the
WorkerRpcReturnValue
would have the following structure, example ofset_user_shielding_key
:value
would contain the encoded*Response
struct, please refer to the test code in DI-sample.TODO (see comment in
trusted_call.rs
)request_vc
#1929