Skip to content

add Epoch.start_block_height legacy data-plane bridge (ENGN-9039) - #973

Closed
zale144 wants to merge 45 commits into
devfrom
alek/engn-9039-epoch-identity-bridge-noncev2-legacy-blockheight-data-plane
Closed

add Epoch.start_block_height legacy data-plane bridge (ENGN-9039)#973
zale144 wants to merge 45 commits into
devfrom
alek/engn-9039-epoch-identity-bridge-noncev2-legacy-blockheight-data-plane

Conversation

@zale144

@zale144 zale144 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Purpose of Changes and their Description

Transitional identity bridge for scheduler epochs: record Epoch.start_block_height at StartNewEpoch and expose Epoch.LegacyNonce() so FSM side effects can call the existing BlockHeight-keyed submission/inference/reward APIs without coercing NonceV2.Payload() to a height. Canonical epoch id remains NonceV2.

This branch also carries the stacked scheduler epoch work behind it (module/FSM scaffold + ENGN-8910/8911) relative to dev.

Link(s) to Ticket(s) or Issue(s) resolved by this PR

Are these changes tested and documented?

  • If tested, please describe how. If not, why tests are not needed.
    • Unit tests: TestEpochLegacyNonce, TestStartNewEpochRecordsStartBlockHeightBridge, and existing StartNewEpoch / activate / inactivate schedule tests.
  • If documented, please describe where. If not, describe why docs are not needed.
  • Added to Unreleased section of CHANGELOG.md?

Still Left Todo

Fill this out if this is a Draft PR so others can help.

Made with Cursor


Summary by cubic

Adds a legacy block-height bridge for scheduler epochs by recording Epoch.start_block_height at StartNewEpoch and exposing Epoch.LegacyNonce() so side effects can use existing height-keyed APIs while NonceV2 stays canonical. Connects epoch FSM to x/scheduler with events and RPC/CLI queries to support transitions (Linear ENGN-9039).

  • New Features
    • x/emissions: Introduce NonceV2 and persist per-topic last nonce in genesis.
    • Epoch: Add FSM-backed type, start_block_height, and LegacyNonce() helper.
    • StartNewEpoch: Open worker window immediately; schedule close/open transitions and completion; apply ExtraLag to reputer windows.
    • Topic lifecycle hooks: Start/stop a periodic StartNewEpoch task on activation/inactivation.
    • x/scheduler: Emit task events; add RPC and CLI queries for tasks, scheduled tasks, and handlers.
    • Utilities: Simple FSM engine and index-to-collection pagination helpers with tests.

Written for commit 558bf83. Summary will update on new commits.

Review in cubic

amimart and others added 15 commits January 29, 2026 10:19
…heduler-epoch-fsm

Port epoch FSM/scheduler wiring onto the refactored emissions keeper and multi-label store prefixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Wire AllocateNextEpochNonce into StartEpoch and round-trip the last-nonce
map through genesis so epochs stay unique across restarts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Open the worker window immediately, schedule later transitions, apply
ExtraLag to reputer windows, and start/stop a per-topic periodic task
when topics activate or inactivate.

Co-authored-by: Cursor <cursoragent@cursor.com>
Record the block height at StartNewEpoch and expose LegacyNonce so
FSM side effects can call height-keyed APIs without coercing NonceV2.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf Linter / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed❌ failed (3)❌ failed (8)⏩ skippedJul 31, 2026, 12:41 PM

@zale144

zale144 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Closing as redundant: bridge review PR is #972 (stacked on #971). This draft was opened against dev by mistake from the Create PR action.

@zale144 zale144 closed this Jul 31, 2026
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.

2 participants