Skip to content

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Dec 27, 2025

  • Subtensor handles CRv4/commit-reveal automatically based on chain config
  • Fetch weights from platform-server each epoch
  • Submit burn weights (UID 0) if no challenges available
  • Reveal pending commits in RevealWindowOpen (for non-CRv4)
  • Clean centralized architecture (no P2P)

Summary by CodeRabbit

Release Notes

  • New Features

    • Weight submission now integrates with Subtensor persistence layer for enhanced state management.
    • Automatic reveal handling for validator transactions replaces manual process.
    • Validator node operates in centralized validator mode.
  • Updates

    • Streamlined dependency footprint for reduced complexity.
    • Enhanced validator submission workflow with improved reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

- Subtensor handles CRv4/commit-reveal automatically based on chain config
- Fetch weights from platform-server each epoch
- Submit burn weights (UID 0) if no challenges available
- Reveal pending commits in RevealWindowOpen (for non-CRv4)
- Clean centralized architecture (no P2P)
@echobt echobt merged commit eda164e into main Dec 27, 2025
3 of 4 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Dec 27, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The validator-node crate undergoes dependency cleanup and major control-flow refactoring. Cargo.toml removes unused platform and utility crates while standardizing workspace dependencies. Main.rs integrates Subtensor persistence with CRv4-aware submission, updates CLI arguments, and modifies handle_block_event to wire in new signer and Subtensor parameters throughout the event loop.

Changes

Cohort / File(s) Summary
Dependency Cleanup
bins/validator-node/Cargo.toml
Removed platform crates (network, consensus, storage, challenge-runtime, etc.) and utility crates (futures, uuid, sha2, chrono, rand). Retained core platform dependencies and switched to workspace = true for shared crates (bittensor-rs, tokio, serde, reqwest, etc.).
Subtensor Integration & Function Signature Refactor
bins/validator-node/src/main.rs
Added version_key to Args; integrated Subtensor::with_persistence for state persistence; replaced BlockSync with Subtensor-backed weight submission. Updated handle_block_event signature to accept platform_client, subtensor, signer, netuid, version_key. Implemented CRv4-aware reveals and commit-window weight translation. Added Arc wrapping for platform_client and optional subsystems; adjusted logging to reflect centralized validator mode.

Sequence Diagram

sequenceDiagram
    participant EvtLoop as Event Loop
    participant Handler as handle_block_event
    participant PSClient as PlatformServerClient
    participant Subtensor
    participant Signer as BittensorSigner
    
    EvtLoop->>Handler: block_event + platform_client + subtensor + signer + netuid + version_key
    
    rect rgb(230, 245, 240)
        Note over Handler: COMMIT WINDOW
        Handler->>PSClient: fetch platform weights
        PSClient-->>Handler: weights
        Handler->>Handler: translate to mechanism weights
        Handler->>Signer: create signature
        Signer-->>Handler: signature
        Handler->>Subtensor: submit weights via ExtrinsicWait
        Subtensor-->>Handler: submission confirmed
    end
    
    rect rgb(245, 240, 230)
        Note over Handler: REVEAL WINDOW
        Handler->>Subtensor: trigger automatic reveal (CRv4)
        Subtensor-->>Handler: reveal complete
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Poem

🐰 A validator hops with glee,
Dependencies fall from the tree,
Subtensor's persistence takes the stage,
CRv4 reveals mark a brand new age,
With tighter bonds and cleaner code to see! 🌿✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66477bd and 3e0b1e5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • bins/validator-node/Cargo.toml
  • bins/validator-node/src/main.rs

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

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