Date: 2026-01-02
Status: 🔴 CRITICAL - Most UI features are NOT wired to real backend/blockchain data
The BitSage Validator dashboard has a complete and well-structured SDK that connects to backend APIs, BUT the backend is returning MOCK DATA for most endpoints. Additionally, several features have no backend implementation at all.
- ✅ SDK Architecture: Excellent - Clean TypeScript SDK with React hooks
- ✅ API Routes: Implemented - All routes exist in rust-node
- 🔴 Backend Logic: MOCKED - Most endpoints return hardcoded test data
- 🔴 Blockchain Integration: MISSING - No real on-chain calls
- 🟡 WebSocket: PARTIAL - Infrastructure exists but limited real data
- Validator Status Banner (reputation, active status)
- Stats Grid (GPUs, staked amount, total earnings, pending rewards)
- GPU Cards (individual GPU metrics, utilization, temperature)
- Recent Activity (job list)
- Real-time Network Stats (WebSocket)
✅ Well Integrated - Uses proper hooks:
useValidatorStatus()→/api/validator/statususeGpuMetrics()→/api/validator/gpususeRewardsInfo()→/api/validator/rewardsuseStakeInfo()→ On-chain contract calluseRecentJobs()→/api/jobs/recentuseNetworkStatsStream()→ WebSocket/ws/prover
🔴 MOCKED DATA:
File: rust-node/src/api/dashboard.rs:259-284
async fn get_validator_status() {
// TODO: Integrate with actual data sources (blockchain, metrics, etc.)
// For now, return mock data structure that dashboard can use
Json(ValidatorStatusResponse {
is_active: true, // HARDCODED
is_registered: true, // HARDCODED
staked_amount: "5000000000000000000000".to_string(), // HARDCODED 5000 SAGE
reputation_score: 850, // HARDCODED
jobs_completed: 1847, // HARDCODED
// ...all mock values
})
}File: rust-node/src/api/dashboard.rs:287-315
async fn get_gpu_metrics() {
// TODO: Integrate with NVML or similar for real GPU metrics
Json(GpuMetricsResponse {
gpus: vec![
GpuInfo {
model: "NVIDIA H100 80GB HBM3".to_string(), // HARDCODED
compute_utilization: 87.5, // HARDCODED
temperature_celsius: 62.0, // HARDCODED
// ...all mock GPU data
},
],
})
}-
Validator Status → Needs:
- ✅ Starknet contract calls to
ProverStaking.get_stake(address) - ✅ Starknet contract calls to
ReputationManager.get_reputation(address) - ❌ Real job count from coordinator database
- ❌ Real uptime tracking
- ✅ Starknet contract calls to
-
GPU Metrics → Needs:
- ❌ NVIDIA NVML integration for real GPU stats
- ❌ Query actual GPU devices on the system
- ❌ Real-time GPU temperature/utilization monitoring
- ❌ Current job ID lookup from coordinator
-
Rewards → Needs:
- ✅ On-chain query to
ProverStaking.get_pending_rewards(address) - ❌ Real earnings calculation from completed jobs
- ❌ Claim history from blockchain events
- ✅ On-chain query to
- Jobs list with filters (status, type, date)
- Job details modal
- Job cancellation
- Retry failed jobs
- Pagination
✅ Uses /api/jobs endpoints via SDK
🟡 PARTIALLY IMPLEMENTED
Database Layer Exists: src/api/jobs_db.rs has real PostgreSQL queries
File: rust-node/src/api/jobs_db.rs:984-995
pub async fn get_jobs_from_db(
State(state): State<Arc<AppState>>,
Query(params): Query<JobQueryParams>,
) -> Result<Json<JobsResponse>, (StatusCode, Json<ErrorResponse>)> {
// Real PostgreSQL query
let query_result = sqlx::query_as::<_, JobRow>(&query_str)
.fetch_all(&state.db)
.await✅ Jobs ARE stored in database
✅ Query endpoints work
❌ Job submission may not create real compute jobs
❌ Job status updates may not reflect real execution
- Does job submission actually create work for GPU workers?
- Are job status updates coming from real execution or mock transitions?
- Is proof generation actually happening for completed jobs?
- Total earnings chart
- Earnings breakdown (mining vs staking)
- Claim rewards button
- Historical earnings graph
Uses /api/validator/rewards and /api/earnings/*
🔴 FULLY MOCKED
File: rust-node/src/api/dashboard.rs:318-332
async fn get_rewards_info() {
Json(RewardsInfoResponse {
total_earned: "1250000000000000000000".to_string(), // HARDCODED
pending_rewards: "125000000000000000000".to_string(), // HARDCODED
apy_estimate: 12.5, // HARDCODED
})
}- ❌ Real-time earnings calculation from completed jobs
- ❌ On-chain rewards query from MiningRewards contract
- ❌ Staking rewards from ProverStaking contract
- ❌ Claim transaction integration with wallet
- ❌ Historical earnings from blockchain events or database
- Stake SAGE tokens
- Unstake with cooldown period
- Stake tier display
- APY calculator
- Transaction toasts
✅ Well structured - Uses StarknetReact hooks + BitSage SDK
File: BitSage-Validator/src/app/(app)/stake/page.tsx
const { writeAsync: stakeWrite } = useStake();
const handleStake = async () => {
const result = await stakeWrite({ amount: BigInt(amount) });
// Shows transaction hash, waits for confirmation
};🟡 CONTRACT INTEGRATION EXISTS BUT NEEDS TESTING
✅ Contract addresses configured in src/lib/contracts/addresses.ts
✅ Starknet hooks imported from SDK
❌ No real testing with deployed contracts
❌ APY calculation is likely hardcoded
❌ Tier benefits may not match actual contract logic
- Are contracts actually deployed to Sepolia?
- Do stake transactions actually go through?
- Is the APY calculation real or estimated?
- Does tier upgrade work correctly?
- Order book display
- Place buy/sell orders
- Trade history
- Market stats
- Privacy-preserving orders
Uses /api/trading/* endpoints
🔴 NO IMPLEMENTATION
File: rust-node/src/api/trading.rs:40-47
pub fn trading_routes() -> Router {
Router::new()
.route("/api/trading/pairs", get(get_trading_pairs))
.route("/api/trading/orderbook/:pair_id", get(get_orderbook))
.route("/api/trading/orders", get(get_user_orders))
// ...routes exist
}File: rust-node/src/api/trading.rs:140-165
async fn get_orderbook(
Path(pair_id): Path<String>,
) -> Json<OrderbookResponse> {
debug!("Getting orderbook for pair: {}", pair_id);
// TODO: Query from database
Json(OrderbookResponse { // RETURNS EMPTY
pair_id,
bids: vec![],
asks: vec![],
// ...
})
}❌ ALL ENDPOINTS RETURN EMPTY DATA
- ❌ OTC orderbook storage (database or on-chain)
- ❌ Order matching engine
- ❌ Privacy-preserving order encryption
- ❌ Trade execution with settlement
- ❌ Price discovery and TWAP calculations
- Balance display
- Send SAGE tokens
- Privacy Pool deposits/withdrawals
- Stealth addresses
- Transaction history
🟡 BASIC INTEGRATION
- ✅ Balance from Starknet RPC
- ✅ Send transactions via StarknetReact
- ❌ Transaction history not from blockchain
- ❌ Contact management is local-only
🔴 NO REAL IMPLEMENTATION
const handleDeposit = async () => {
// TODO: Implement privacy pool deposit
console.log("Privacy pool deposit not implemented");
};What's Missing:
- ❌ Privacy pool contract integration
- ❌ Note commitment generation
- ❌ Nullifier tracking
- ❌ Withdrawal proof generation
🔴 NO IMPLEMENTATION
const handleGenerateStealth = () => {
// Mock stealth address generation
setStealthAddress("0x" + "a".repeat(64));
};What's Missing:
- ❌ Real stealth address cryptography
- ❌ On-chain stealth registry
- ❌ Payment scanning
- ❌ Key derivation
- Browse proposals
- Create proposals
- Vote on proposals
- Delegation
- Voting power display
Has proper hooks: useProposals(), useVote(), useDelegate()
🔴 ENDPOINTS RETURN EMPTY
File: rust-node/src/api/governance.rs
async fn get_proposals() -> Json<ProposalsResponse> {
Json(ProposalsResponse {
proposals: vec![], // EMPTY
total: 0,
})
}- ❌ Governance contract deployment
- ❌ Proposal creation on-chain
- ❌ Voting mechanism
- ❌ Vote tallying
- ❌ Execution queue
✅ FULLY FUNCTIONAL
File: rust-node/src/api/faucet.rs
- Has real implementation with rate limiting
- Calls deployed faucet contract
- Stores claim history in database
- Has captcha integration
This is one of the few fully working features!
Timeline: 1-2 days
-
Validator Status - Wire to real data
- Connect to ProverStaking contract for stake info
- Connect to ReputationManager for reputation
- Query real job counts from coordinator database
-
GPU Metrics - Integrate NVML
- Add
nvml-wrappercrate to detect real GPUs - Query actual GPU utilization, temperature, VRAM
- Remove hardcoded H100 mock data
- Add
-
Rewards - Calculate from real sources
- Query
MiningRewardscontract for pending rewards - Sum completed job payments from database
- Calculate real APY from historical data
- Query
Files to Modify:
rust-node/src/api/dashboard.rs(remove all TODOs)- Add new module:
rust-node/src/gpu/nvml.rs - Update:
rust-node/src/coordinator/metrics.rs
Timeline: 2-3 days
-
Verify Job Pipeline
- Test job submission → worker assignment → execution
- Ensure proof generation is real
- Verify payment distribution
-
Earnings Calculation
- Real-time earnings from job completion events
- Historical earnings from database
- Chart data generation
Files to Verify:
rust-node/src/coordinator/job_processor.rsrust-node/src/compute/obelysk_executor.rsrust-node/src/api/earnings_db.rs
Timeline: 1-2 weeks
These are advanced features that can be added later:
- OTC orderbook
- Privacy pools
- Stealth addresses
- Governance
# 1. Check if endpoints return real data
curl http://localhost:3030/api/validator/status
# Should see:
# - Your actual wallet address
# - Real stake amount from blockchain
# - Actual GPU count from system
# NOT hardcoded values
# 2. Check GPU metrics
curl http://localhost:3030/api/validator/gpus
# Should see:
# - Actual GPUs detected on system
# - Real utilization from nvidia-smi
# NOT "NVIDIA H100 80GB HBM3" if you don't have one
# 3. Check jobs are real
curl http://localhost:3030/api/jobs/recent
# Should see:
# - Jobs that were actually executed
# - Real proof hashes
# - Actual completion times
# NOT empty array or mock data
# 4. Check blockchain calls work
# In browser console with StarknetReact:
const stake = await contracts.proverStaking.get_stake(address);
console.log(stake); // Should match UI display| Feature | UI Status | SDK Status | Backend Status | Blockchain Status | Priority |
|---|---|---|---|---|---|
| Dashboard Stats | ✅ Complete | ✅ Integrated | 🔴 MOCKED | 🟡 Partial | 🔴 HIGH |
| GPU Metrics | ✅ Complete | ✅ Integrated | 🔴 MOCKED | N/A | 🔴 HIGH |
| Rewards/Earnings | ✅ Complete | ✅ Integrated | 🔴 MOCKED | ❌ Missing | 🔴 HIGH |
| Job List | ✅ Complete | ✅ Integrated | ✅ DB Wired | 🟡 Partial | 🟡 MEDIUM |
| Job Submission | ✅ Complete | ✅ Integrated | 🟡 Unclear | ❌ Missing | 🟡 MEDIUM |
| Staking | ✅ Complete | ✅ Integrated | N/A | 🟡 Untested | 🟡 MEDIUM |
| Faucet | ✅ Complete | ✅ Integrated | ✅ Working | ✅ Deployed | ✅ DONE |
| Trading/OTC | ✅ Complete | ✅ Integrated | ❌ Empty | ❌ Missing | 🟢 LOW |
| Privacy Pools | ✅ Complete | ✅ Integrated | ❌ Missing | ❌ Missing | 🟢 LOW |
| Stealth Addresses | ✅ Complete | ✅ Integrated | ❌ Missing | ❌ Missing | 🟢 LOW |
| Governance | ✅ Complete | ✅ Integrated | ❌ Empty | ❌ Missing | 🟢 LOW |
Legend:
- ✅ Complete/Working
- 🟡 Partial/Needs Testing
- 🔴 Critical Issue
- ❌ Not Implemented
- 🟢 Nice-to-Have
- Remove Mock Data from dashboard.rs
- Integrate NVML for real GPU metrics
- Connect Blockchain for stake/rewards
- Verify Job Pipeline end-to-end
- Test Contract Calls on Sepolia
The UI is excellent and production-ready. The backend just needs the real data sources wired up!