Skip to content

Do not use saturating_sub for signed types#1485

Merged
sam0x17 merged 3 commits intodevnet-readyfrom
fix/get-rid-of-i96
Mar 31, 2025
Merged

Do not use saturating_sub for signed types#1485
sam0x17 merged 3 commits intodevnet-readyfrom
fix/get-rid-of-i96

Conversation

@gztensor
Copy link
Contributor

Description

  1. Get rid of I96F32 in run_coinbase.rs (use U96F32 instead)
  2. Avoid using saturating_sub for signed types across code base

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run cargo fmt and cargo clippy to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet run-bittensor-e2e-tests labels Mar 29, 2025
@gztensor gztensor changed the base branch from main to devnet-ready March 31, 2025 16:14
@opentensor opentensor deleted a comment from github-actions bot Mar 31, 2025
@sam0x17 sam0x17 added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Mar 31, 2025
.saturating_mul(Self::get_alpha_price(netuid).min(U96F32::saturating_from_num(1.0)));
let current_moving: U96F32 =
one_minus_alpha.saturating_mul(Self::get_moving_alpha_price(netuid));
// Convert batch to signed I96F32 to avoid migration of SubnetMovingPrice for now``
Copy link
Contributor

Choose a reason for hiding this comment

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

Convert batch to signed I96F32 to avoid migration of SubnetMovingPrice for now

Should the migration be included in this PR?

@sam0x17 sam0x17 merged commit 6e896f1 into devnet-ready Mar 31, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants