Skip to content

Introduce checked PerThing arithmetics #199

@ggwpez

Description

@ggwpez

Some PerThing functions are prone to zero division panics. This requires the runtime code to pay close attention when calling them.
Instead of relying on proof comments we could add fallible checked functions for:

  • multiply_by_rational_with_rounding
  • rational_mul_correction

(there could be more, did not check all)

Context: paritytech/substrate#13660 (comment)

Metadata

Metadata

Assignees

Labels

C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.D0-easyCan be fixed primarily by duplicating and adapting code by an intermediate coder.I4-refactorCode needs refactoring.I5-enhancementAn additional feature request.T1-FRAMEThis PR/Issue is related to core FRAME, the framework.

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions