Skip to content

[BUG] Time-decay scoring formula overflows for wallets with reputation accumulated over long periods #883

Open

Description

@meshackyaro

Bug Description

The exponential decay calculation uses Math.exp() on an exponent that grows unbounded with wallet age in days, producing Infinity/NaN for sufficiently old wallets.

Component

  • Backend
  • Frontend
  • Smart Contract
  • SDK
  • Documentation
  • Other:

Steps to Reproduce

  1. Seed a wallet with a reputation event timestamped several years in the past.
  2. Trigger a reputation score recalculation.
  3. Inspect the computed score.
  4. Check for NaN/Infinity in the result.

Expected Behavior

The decay formula should remain numerically stable regardless of wallet age (e.g. clamp or use a normalized time base).

Actual Behavior

Sufficiently old timestamps produce NaN, which then poisons any aggregate score that includes that event.

Environment

  • Node Version: 20.x
  • OS: Linux / macOS
  • Browser (if applicable): N/A
  • Network (Testnet/Mainnet): Testnet

Error Messages/Logs

NaN

Screenshots

N/A — backend/API issue, not applicable.

Additional Context

The decay exponent isn't clamped to a sane maximum age before being passed to Math.exp.

Possible Solution

Clamp the age input to a reasonable maximum (e.g. decay effectively reaches ~0 after N days) before computing the exponential.

Activity

  1. added
    bug
    good first issue
    difficulty: easy
    priority: medium
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugcoredifficulty: easygood first issuepriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions