You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove unused AddAssign impl for AggregateActiveSwarmMetadata #2823
Part of EPIC #1347 (finding F4 of the packages/primitives analysis).
impl AddAssign for AggregateActiveSwarmMetadata in packages/primitives/src/swarm_metadata.rs does a plain += on four u64 fields. On overflow it panics in debug and silently wraps in release. Overflow is practically impossible, but we want the edge case to be an explicit, documented decision so agents stop reporting it again and again.
Unused code should not be kept, so the first step is to check whether the impl is used. A removal experiment shows it is not: with the impl deleted, cargo check --workspace --all-targets --all-features and cargo test --doc --workspace both pass. The registry (get_aggregate_swarm_metadata) and torrent-repository-benchmarking sum the fields by hand instead.
Decision (approved by the maintainer): delete the impl and its import. If a user turns up, the fallback is checked_add(..).expect(..) on each field, a #[should_panic] test and a comment saying overflow is practically impossible.
The spec also records, as a lessons-style note, that the registry and the five benchmarking repositories duplicate the aggregate summation.
Activity
docs(issues): [torrust#2824] record F4 as torrust#2823 and the AddAss…
docs(issues): [torrust#2823] address review round 1 of the spec
docs(issues): [torrust#2823] correct spec stamps, commit citation and…
refactor(primitives): [#2823] remove unused AddAssign for AggregateAc…
Merge torrust#2827: refactor(primitives): [torrust#2823] remove unuse…
Merge #2828: docs(issues): [#2824] add issue specification for primit…
chore(issues): archive closed issue #2823 spec to docs/issues/closed
Merge #2831: chore(issues): archive closed issue #2823 spec to docs/i…