Skip to content

[BUG] Short segment is treated as PASSED (challenger pays a target that did nothing) #2013

Closed @maria-mitina opened 2026-10-15 09:44 UTC 2 comments Updated 2026-10-21 09:38 UTC
bug

Summary

decideCurrentChallengeSegment skips evaluation whenever the segment is shorter than min_punishable_segment_blocks and returns nil; the caller treats nil as "passed":

if finish <= ch.StartHeight { return nil } duration := finish - ch.StartHeight // ... if duration < types.EffectiveMinPunishableSegmentBlocks(params.PocChallengeParams) { return am.advanceAfterDecision(ctx, ch, rotate) }

if !rotate { if err := am.keeper.MarkChallengePassed(cacheCtx, ch.Target); err != nil {

Both segments in my test were below the threshold (18744−18648 = 96 at cPoC rotation, 18870−18788 = 82 at the final decision), so the challenge was never evaluated at all and defaulted to PASSED → lock paid to target. "Not enough data to punish" must not equal "target passed". Expected: ABORTED (refund the challenger, payLockedChallengePayment already handles ABORTED → poc_challenge_refund), or carry the segment over / require at least one punishable segment before PASSED is possible.


💬 Comments (2)

@x0152 commented 2026-10-15 21:22 UTC

https://github.com/gonka-ai/gonka/commit/24a4204de78cefbe14d3e1dda2784ab4fbebc65d

@maria-mitina commented 2026-10-21 09:37 UTC

solved, thanks


🔄 Auto-synced from Issue #2013 every hour.