[BUG] Short segment is treated as PASSED (challenger pays a target that did nothing) #2013
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)
solved, thanks
🔄 Auto-synced from Issue #2013 every hour.
https://github.com/gonka-ai/gonka/commit/24a4204de78cefbe14d3e1dda2784ab4fbebc65d