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

protorev: Remove unneeded AllBalances call #7605

Merged
merged 1 commit into from
Feb 24, 2024

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Feb 24, 2024

Minor protorev speedup, by removing an AllBalances call that happens after protorev has been determined to have non-zero minimum profit.

This is a 30ms speedup on a 2000 bloc syncs in IAVL v1 nfn, so very minor. Just came across it as I am going through the logic.

Comment on lines +22 to 23
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
Copy link
Member

Choose a reason for hiding this comment

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

Is GetAllBalances still needed or can be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question, let me check

Copy link
Member Author

Choose a reason for hiding this comment

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

We still need it for a query

@ValarDragon ValarDragon merged commit ab7865f into main Feb 24, 2024
1 check passed
@ValarDragon ValarDragon deleted the dev/minor_protorev_speedup branch February 24, 2024 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants