Skip to content

Conversation

@SachinMeier
Copy link
Contributor

Refactors the logic for finding balances for accounts to be faster.

@SachinMeier SachinMeier force-pushed the sachin--speed-up-balance-finding-using-async branch from 54590f2 to 51a0e87 Compare September 23, 2024 18:14
Comment on lines +148 to 154
left_task =
Task.async(fn -> do_find_balances_for_accounts(left_leaves, leaf_idx, account_balances) end)

right_task =
Task.async(fn ->
do_find_balances_for_accounts(right_leaves, leaf_idx + mid_idx, account_balances)
end)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic can easily run into the max number of beam processes. Does that make this not the right solution?

One option is an explicit conditional to use async or sequential searches depending on the number of leaves.

@Kushlord101
Copy link

``git clone https://github.com/RiverFinancial/proof-of-reserves.git cd proof-of-reserves ./scripts/setup.sh source "$HOME/.asdf/asdf.sh"

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.

3 participants