#2076 introduced silent overflows ("normal" arithmetic) in size and weight calculations - they all need to be fixed / thought about to close this issue.
During work on weight, size, base_size, total_size etc. (on Transaction and Block) it was realized that overflowing ops could potentially be an attack vector. However doing checked_ ops and returning Option is unergonomic considering that overflow should never happen under normal conditions.
Two possible solutions discussed were:
- saturating add/mul
- explicit panic on overflow
Also need to consider if doing bounds checks introducesa any additional/unwanted overhead.
References: