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

go/worker/txnscheduler: CheckTx should use a queue #2548

Closed
abukosek opened this issue Jan 14, 2020 · 4 comments · Fixed by #4131
Closed

go/worker/txnscheduler: CheckTx should use a queue #2548

abukosek opened this issue Jan 14, 2020 · 4 comments · Fixed by #4131
Assignees
Labels
c:performance Category: performance c:runtime/compute Category: runtime compute worker golang
Projects

Comments

@abukosek
Copy link
Contributor

PR #2502 implemented optional checking of transactions before queuing them in the transaction scheduler. However, the way it's currently implemented, each check is done serially, which can slow-down execution if checking is enabled.

This should be optimized by using a separate queue for CheckTx requests and batching them, as suggested in #2502 (comment).

@samohyes
Copy link

So basiclly, right now, the txs are checked before added in txnscheduler. The checks including like whether there is enough balance in the accout or whether it's a successful contract call, right? The code looks complicated now.

@abukosek
Copy link
Contributor Author

The checks are disabled by default for now, so the behavior is the same as before. If enabled, the checks depend on the runtime that's used. In our oasis-runtime, the checks are done here: https://github.com/oasislabs/oasis-runtime/blob/9bc96c04d1e6503096aaefdfa6b999b26b972943/src/methods.rs#L26-L45

@samohyes
Copy link

Thanks for the reply.
As I can see the core check here in the CheckTx function is here
https://github.com/oasislabs/oasis-core/blob/master/go/worker/txnscheduler/committee/node.go#L164
with the call
resp, err := workerHost.Call(ctx, checkRq)

So according to what you said, this workerHost.Call will call the check in oasis-runtime(the link you provides), right?

@abukosek
Copy link
Contributor Author

Yes, the workerHost.Call() will make a call into the SGX enclave that's running the runtime and the method I linked before will be executed. The rest of the new code is basically just error checking and serialization/deserialization.

@kostko kostko added c:runtime/compute Category: runtime compute worker and removed c:worker-txnsched labels Aug 19, 2020
@kostko kostko added this to Planned in Core 21.3 via automation Jun 14, 2021
@ptrus ptrus self-assigned this Jun 24, 2021
@kostko kostko moved this from Planned to In Progress in Core 21.3 Jul 15, 2021
Core 21.3 automation moved this from In Progress to Done Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:performance Category: performance c:runtime/compute Category: runtime compute worker golang
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants