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

Get listen.sh on the transfers app to run only when there are requests in the queue #65

Open
davekaj opened this issue Jun 27, 2024 · 3 comments
Labels
devx Issues related to improving dev experience / tooling

Comments

@davekaj
Copy link
Contributor

davekaj commented Jun 27, 2024

Summary

The transfers app listen.sh script was more or less copied from the mtcs app during the hackathon. mtcs is expected to run once every few days/weeks, where transfers runs on every block. But we clear the entire queue on one listening event, so it calls to the enclave redundantly with an empty Requests vector

Acceptance Criteria

Get the listen.sh script to only run as necessary. There should be no calls to the enclave when the Requests vector is empty.

@ebuchman
Copy link
Member

ebuchman commented Jun 27, 2024

I think the thing to do is to only run it at most once per block. So we should just keep track of the highest block we ran for and then if we get multiple events for a block only run it on the first one.

Keep in mind we want to figure out a way to make this listen script generic for any app (currently things are hard coded which it should ultimately get from the enclave binary, per #61)

@ebuchman ebuchman added this to the Quartz Cleanup milestone Jul 5, 2024
@dangush dangush added the devx Issues related to improving dev experience / tooling label Jul 10, 2024
@davekaj
Copy link
Contributor Author

davekaj commented Jul 23, 2024

Yes we could run it once per block, inside the enclave code, we can store the block number and compare.

We could also just prevent the listen script from calling the enclave at all. This would prevent the listen script from having to call the enclave, wait for a response, parse it, and realize there is nothing to update. Saving the round trip.

However, this makes the listen script less generic, since it depends on reading the requests length, and making a decision to send a msg to the enclave or not.

It seems to me that we should still go with putting it inside the enclave code, to allow the listen script to still be generic, do you agree @ebuchman ?

@ebuchman
Copy link
Member

i think we're going to get rid of the listen script all together and just move it all into the enclave: #100 so lets do that

@davekaj davekaj removed this from the Quartz v0.1 milestone Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devx Issues related to improving dev experience / tooling
Projects
None yet
Development

No branches or pull requests

3 participants