Skip to content

refactor!: retire legacy operator stake indexing - #25

Merged
mswilkison merged 2 commits into
masterfrom
refactor/retire-operator-staking
Oct 4, 2026
Merged

mswilkison merged 2 commits into
masterfrom
refactor/retire-operator-staking

Conversation

@mswilkison

@mswilkison mswilkison commented Oct 4, 2026 •

Copy link
Copy Markdown

Operator registration currently depends on a prior positive TokenStaking record, even though node participation has moved to DAO-managed allowlist weights. The schema also exposes obsolete stake balances and totals. This cleanup indexes operators without economic staking while preserving wallet/group history, rewards, and existing fault telemetry.

  • Remove legacy stake balances, roles, stake events, and stake/bond statistics; rename authorization amount fields to reported weights.
  • Record registration without a stake prerequisite, retain first registration time and each application's operator identity, and remove the obsolete token threshold.
  • Replace aggregate authorization values from the previously indexed value, so migration callbacks from zero and repeated decrease requests do not double count.
  • Reduce TokenStaking to a single TokensSeized telemetry handler. Preserve raw amount, discrepancy, and emitter without changing balances or duplicating application fault counters.
  • Add 12 mapping regression tests and run them in the shared CI/deploy build gate.

Breaking schema: field replacements, weight semantics (including pending decrease requests), and the release checklist are in operator-staking-retirement.md. The new version needs a full sync and a coordinated proxy cutover. Keep the previous published deployment queryable for historical stake queries and rollback. No deployment or production cutover is performed by this PR.

This PR is independent of #24; user rebate staking is unaffected. The two branches merge cleanly in a local validation checkout; codegen, both network builds, and all 17 mapping tests pass together. Explorer companion PR #454 removes the unused group-detail query requesting retired fields; the active wallet fallback's group/public-key query is preserved. The Explorer migration remains in dApp #453.

Validation: codegen, mainnet and Sepolia builds, all 12 new mapping tests, and all 58 existing toolchain/cutover tests pass locally.

Index operator registration independently of token stakes and retain application weights, group history, rewards, and raw fault telemetry.

BREAKING CHANGE: remove legacy Operator stake roles, balances, registration counters, and StatsRecord stake totals; rename authorization amounts to reported weights. Preserve the previous published deployment for historical stake queries and coordinate consumer cutover after a full sync.
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a95122af-65ea-4020-a510-0d45f79245a6
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mswilkison
mswilkison merged commit 32aad53 into master Oct 4, 2026
7 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