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

Run in-memory aex9 tasks asynchronously #749

Closed
jyeshe opened this issue Jun 29, 2022 · 7 comments
Closed

Run in-memory aex9 tasks asynchronously #749

jyeshe opened this issue Jun 29, 2022 · 7 comments
Assignees

Comments

@jyeshe
Copy link
Member

jyeshe commented Jun 29, 2022

The #730 enables the in-memory aex9 balance update.

It's performed synchronously (with parallel tasks) and with a timeout of 1 second per task (that involves a contract dry-run).

Pending cases to be handled having the instantaneous AEX9 sync requirement in mind:

  • Process update for contracts with bigger balances (currently discarded and as a reference balances contract dry-run with thousand entries takes more than 1 minute)
  • Process multiple calls to same contract only once if already enqueued (dedup tasks)
  • Handle many aex9 balance updates avoiding the result of other transactions (like :spend_tx for AE transfer) to be available with a delay. An example of delay lower limit would be 10 seconds for 80+ balance updates taking 1 second each on a machine with 8 threads.
@jyeshe jyeshe changed the title run in-memory aex9 tasks asynchronously Run in-memory aex9 tasks asynchronously Jul 4, 2022
@jyeshe
Copy link
Member Author

jyeshe commented Jul 4, 2022

  • Differentiate on balance endpoints when it is not yet available (pending dry-run) from not existing ones.

@jyeshe
Copy link
Member Author

jyeshe commented Aug 12, 2022

From #818 notes:

  • Keep the sorting while enqueuing with State
  • Allow enqueuing tasks to rerun if it's in processing state
  • Avoid rerunning the tasks during in-memory sync by detecting invalidations outside of the task
  • After 3, cache next hashes in a way to avoid walking through the blocks repeatedly for every task call.

@thepiwo
Copy link
Collaborator

thepiwo commented Oct 20, 2022

I feel this get way less important when we will be moving more towards tracking events, any thoughts @jyeshe

@thepiwo thepiwo added this to the 2022-10-21 Planning milestone Oct 20, 2022
@jyeshe
Copy link
Member Author

jyeshe commented Oct 20, 2022

I feel this get way less important when we will be moving more towards tracking events, any thoughts @jyeshe

Yes, except for the contract init that is still needed to be async to avoid blocking the txs sync.

@thepiwo
Copy link
Collaborator

thepiwo commented Oct 20, 2022

@jyeshe agree, but usually after init there is not much load on dry-running (except for discussed attack vectors) as init is gas limited, so not high priority

also referencing #969 here

@jyeshe
Copy link
Member Author

jyeshe commented Oct 20, 2022

@jyeshe agree, but usually after init there is not much load on dry-running (except for discussed attack vectors) as init is gas limited, so not high priority

also referencing #969 here

On AEX-9 the need for the feature continues the same by any mdw solution to balances. I would like to close this as the event based solution will coexist on at least on one release.

@thepiwo
Copy link
Collaborator

thepiwo commented Oct 21, 2022

done except for the events adaptation and the total_pending counter that are covered by #969 and #869

(copy pasted from @jyeshe chat)

@thepiwo thepiwo closed this as completed Oct 21, 2022
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

No branches or pull requests

2 participants