The number of votes and polls are stored as unsigned ints for the computation, causing an overflow when 2 * votes - polls is negative. This can happen if a node never responded any poll, and cause the score to turn high instead of going negative. The test case was checking the score response against a rise then fall, so it didn't check for negative values and missed the edge case.
Details
Details
- Reviewers
deadalnix - Group Reviewers
Restricted Project - Commits
- rABCb590f6440265: Fix an unsigned issue in the availability score calculation
ninja all check
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- avalanche_availability_score_negative
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 17905 Build 35633: Build Diff build-without-wallet · build-diff · lint-circular-dependencies · build-debug · build-clang-tidy · build-clang Build 35632: arc lint + arc unit