Skip to content
Snippets Groups Projects
  1. Jan 29, 2025
    • Valery Gantchev's avatar
      Use checked math in frame-balances named_reserve (#7365) · 503bae47
      Valery Gantchev authored
      
      This PR modifies `named_reserve()` in frame-balances to use checked math
      instead of defensive saturating math.
      
      The use of saturating math relies on the assumption that the sum of the
      values will always fit in `u128::MAX`. However, there is nothing
      preventing the implementing pallet from passing a larger value which
      overflows. This can happen if the implementing pallet does not validate
      user input and instead relies on `named_reserve()` to return an error
      (this saves an additional read)
      
      This is not a security concern, as the method will subsequently return
      an error thanks to `<Self as ReservableCurrency<_>>::reserve(who,
      value)?;`. However, the `defensive_saturating_add` will panic in
      `--all-features`, creating false positive crashes in fuzzing operations.
      
      ---------
      
      Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
      (cherry picked from commit f373af0d)
      503bae47
  2. Jan 15, 2025
  3. Jan 13, 2025
  4. Jan 10, 2025
  5. Jan 08, 2025
  6. Dec 18, 2024
  7. Dec 11, 2024
  8. Dec 10, 2024
  9. Dec 04, 2024
  10. Dec 03, 2024
  11. Nov 27, 2024
  12. Nov 21, 2024
  13. Nov 12, 2024
  14. Nov 07, 2024
  15. Nov 05, 2024
  16. Oct 25, 2024
  17. Oct 17, 2024
  18. Oct 15, 2024
  19. Oct 08, 2024
  20. Oct 07, 2024
  21. Sep 19, 2024
  22. Sep 17, 2024
  23. Sep 16, 2024
  24. Sep 10, 2024
  25. Sep 09, 2024