Skip to content

feat(mnStats): expose superblock_next_epoch_sec#13

Merged
sidhujag merged 1 commit intomainfrom
gov-proposals-next-sb-epoch-sec
Apr 23, 2026
Merged

feat(mnStats): expose superblock_next_epoch_sec#13
sidhujag merged 1 commit intomainfrom
gov-proposals-next-sb-epoch-sec

Conversation

@sidhujag
Copy link
Copy Markdown
Member

Summary

The governance proposal wizard (sysnode-info) needs a numeric next-superblock anchor to derive the on-chain voting window from a user-facing duration input. Today /mnStats only surfaces the next-superblock time as a human-formatted string (superblock_date), which is for display only and not safe to parse.

  • Add superblock_next_epoch_sec (UNIX seconds) to superblock_stats on the /mnStats response.
  • Compute it from the same sbDate value that produces superblock_date in services/sysMain.js, so the two stay in sync.
  • Persist it on the in-memory dataStore alongside the existing formatted string.

Non-breaking additive change — no existing field removed or reshaped.

Pairing PR

Consumed by the frontend PR on sysnode-info that replaces the wizard's raw start/end epoch inputs with a single "Duration (months)" field. Merge + deploy this one first; without it the frontend wizard detects the missing field and disables "Prepare proposal" rather than submitting an unanchored window.

Test plan

  • Manual: curl /mnStats and confirm stats.superblock_stats.superblock_next_epoch_sec is a positive integer within a few seconds of Math.floor(new Date(superblock_date).getTime() / 1000).
  • Manual: restart the service, observe the value stabilises once the background sysMain poll completes.

Made with Cursor

Governance payouts align to superblocks, and the proposal wizard
needs a numeric anchor to derive the on-chain voting window from
a duration input. The existing /mnStats feed only exposed the
next-superblock time as a human-formatted string (superblock_date),
which can't be parsed reliably by the frontend.

Add a numeric `superblock_next_epoch_sec` (UNIX seconds) alongside
the formatted date. Both are computed from the same `sbDate` value
in sysMain.js so they stay in sync. Non-breaking additive change.

Made-with: Cursor
@sidhujag sidhujag merged commit 38b92bd into main Apr 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant