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

Optimize get_address_deferred_credits in pos_final_state.rs #4179

Open
Leo-Besancon opened this issue Jun 30, 2023 · 0 comments
Open

Optimize get_address_deferred_credits in pos_final_state.rs #4179

Leo-Besancon opened this issue Jun 30, 2023 · 0 comments
Labels
enhancement New feature or request production Issues related to block/operation production

Comments

@Leo-Besancon
Copy link
Collaborator

Currently, we iterate over all the DeferredCredits keys while we're only interested in a specific address.

We don't have to visit every keys. We might want instead to use a while loop, and query only the keys corresponding to the wanted address.

slot_serializer.serialize(cur_slot, &mut key)
addr_serializer.serialize(address, &mut key)
deferred_credit_prefix!(key)

In the case it's not found, go immediatly to the next existing slot key instead of iterating over all addresses.

Originally posted by @Leo-Besancon in #4152 (comment)

@AurelienFT AurelienFT added enhancement New feature or request production Issues related to block/operation production and removed optimization labels Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request production Issues related to block/operation production
Projects
None yet
Development

No branches or pull requests

2 participants