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

fix: do not compute terms if we know the result to be 0 #817

Draft
wants to merge 1 commit into
base: pallet_bonded_coins
Choose a base branch
from

Conversation

rflechtner
Copy link
Contributor

This means we don't compute the overflowing quadratic terms if we do not need the result.

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)
    • Either PR or Ticket to update the Docs
    • Link the PR/Ticket here

@@ -747,6 +747,7 @@ fn mint_without_collateral() {
});
}

#[ignore]
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 now does not easily overflow any more, so still needs to be fixed up

@rflechtner
Copy link
Contributor Author

@Ad96el do you think we'd have to make changes to benchmarking for this?

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.

1 participant