feat(mnStats): expose superblock_next_epoch_sec#13
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/mnStatsonly surfaces the next-superblock time as a human-formatted string (superblock_date), which is for display only and not safe to parse.superblock_next_epoch_sec(UNIX seconds) tosuperblock_statson the /mnStats response.sbDatevalue that producessuperblock_dateinservices/sysMain.js, so the two stay in sync.dataStorealongside 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
curl /mnStatsand confirmstats.superblock_stats.superblock_next_epoch_secis a positive integer within a few seconds ofMath.floor(new Date(superblock_date).getTime() / 1000).Made with Cursor