• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

vocdoni / vocdoni-node / 34843966668
65%
main: 65%

Build:
Build:
LAST BUILD BRANCH: cleanup/lts-1.3-entry
DEFAULT BRANCH: main
Ran 14 Sep 2026 12:44PM UTC
Jobs 2
Files 188
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Sep 2026 12:32PM UTC coverage: 64.774% (+0.1%) from 64.625%
34843966668

Pull #1454

github

altergui
fix(vochain/ist): guard uint32 underflow in score gap and grace-period check

`updateValidatorScore` computes `gap := height - windowStart` and
`height - since` as bare `uint32` subtractions. If the window boundary
(TreeExtra `vldSW/`) or the inactive-since marker (TreeExtra `vldIS/`)
ever lands ahead of the current chain height — after a `cometbft
rollback`, or a chain restart whose `InitialHeight` is below a
previously recorded height — both subtractions wrap to ~4e9. The
downstream effect on the grace-period check is a validator evicted
with no grace at all; on the score branch the ratio collapses to 0
and every validator decays each period.

Guard both boundaries against underflow:

- gap: `if windowStart >= height { gap = updatePowerPeriod }`.
- windowVotes: `if v.Votes >= votesAtStart { windowVotes = v.Votes -
  votesAtStart }` (paired safety when the lifetime counter has
  regressed below the recorded boundary).
- eviction: extend the case guard with `height >= since` so the
  grace-period window is only evaluated on well-ordered inputs.

Both new tests fail against the pre-guard code:
- TestNoEvictionWhenInactiveSinceAheadOfHeight: 4 validators marked at
  height 10_000, chain rolled back to 100 — pre-guard evicts the first
  visited validator via the underflow; with the guard, all four
  survive and `DrainRemovedPubKeys` is empty.
- TestScoreGapDoesNotWrapWhenWindowStartAheadOfHeight: 4 validators
  with `vldSW/` boundary at height 10_000, chain rolled back to 100 —
  pre-guard decays power from 500 to 450 via the wrap-induced
  newScore==0 branch; with the guard, gap falls back to
  updatePowerPeriod and power climbs to 510.

Fixes argos review finding 9 on PR#1454.
Pull Request #1454: feat(vochain/ist): rework validator voting-power dynamics

143 of 176 new or added lines in 4 files covered. (81.25%)

2 existing lines in 2 files now uncovered.

18587 of 28695 relevant lines covered (64.77%)

39514.12 hits per line

Uncovered Changes

Lines Coverage ∆ File
17
75.46
25.46% vochain/state/validators.go
15
78.72
11.28% vochain/ist/validators.go
1
66.97
0.06% vochain/cometbft.go

Coverage Regressions

Lines Coverage ∆ File
1
78.72
11.28% vochain/ist/validators.go
1
77.19
-1.75% subpub/stream.go
Jobs
ID Job ID Ran Files Coverage
1 unit - 34843966668.1 14 Sep 2026 12:44PM UTC 171
53.55
GitHub Action Run
2 integration - 34843966668.2 14 Sep 2026 12:44PM UTC 179
51.62
GitHub Action Run
Source Files on build 34843966668
  • Tree
  • List 188
  • Changed 12
  • Source Changed 0
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #1454
  • PR Base - main (#33769441146)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc