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

Merged
merged 5 commits into from
Mar 10, 2025

Conversation

rflechtner
Copy link
Contributor

@rflechtner rflechtner commented Nov 28, 2024

fixes https://github.com/KILTprotocol/ticket/issues/3807

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

@rflechtner
Copy link
Contributor Author

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

Base automatically changed from pallet_bonded_coins to develop December 12, 2024 16:28
@rflechtner rflechtner force-pushed the rf-less-overflow-on-polynomial branch from e6d513f to 50f3ccf Compare February 6, 2025 09:30
@rflechtner rflechtner changed the base branch from develop to bonded-coins-audit-fixes March 6, 2025 17:04
@rflechtner rflechtner force-pushed the rf-less-overflow-on-polynomial branch from 50f3ccf to 121c870 Compare March 6, 2025 17:47
@rflechtner rflechtner marked this pull request as ready for review March 6, 2025 18:08
@rflechtner rflechtner requested a review from ntn-x2 March 6, 2025 18:09
@rflechtner rflechtner merged commit dd08d84 into bonded-coins-audit-fixes Mar 10, 2025
13 of 15 checks passed
@rflechtner rflechtner deleted the rf-less-overflow-on-polynomial branch March 10, 2025 12:31
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.

2 participants