Skip to content

Mainnet block-height fallback is hard-coded in script utilities #58

@Mosas2000

Description

@Mosas2000

The helper scripts fall back to static block heights when Hiro API requests fail. That makes market timing increasingly inaccurate over time and can produce bad end/resolution dates whenever the API is unreachable.

Evidence:

  • scripts/utils/transaction-helpers.ts returns 6188000 when the mainnet block-height fetch fails.
  • scripts/interact-contract.ts returns 6037876 in its own fallback branch.

Impact:

  • Deadlines and resolution windows can be calculated from stale chain heights.
  • Operators can unknowingly deploy markets with incorrect timing if the API is rate-limited or unavailable.

Reproduction:

  1. Disconnect or block access to the Hiro API.
  2. Run a script that computes future blocks, such as scripts/bulk-create-markets.ts or scripts/interact-contract.ts.
  3. The script silently uses the hard-coded fallback block height instead of a live value.

Priority: High

Suggested scope:
Replace static fallback heights with a safer failure mode or a clearly surfaced manual override, and centralize the fallback policy so all scripts behave consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions