[BUG] Validator database CLI handler needs updates for new schema
Bug Description
The validator's database CLI handler at crates/validator/src/cli/handlers/database.rs is using an outdated schema that doesn't reflect the current database structure. The handler is missing tables for GPU profiles, emission metrics, weight allocation history, and other new features that have been added to the validator.
Expected Behavior
The database handler should:
- Create and manage all current tables including new ones
- Show accurate statistics for all tables
- Handle migrations for new schema additions
- Support cleanup operations for all entity types
Actual Behavior
Current handler only manages basic tables:
- miners
- miner_executors
- verification_requests
- verification_logs
- rentals
Missing tables:
- miner_gpu_profiles
- emission_metrics
- weight_allocation_history
- miner_prover_results
- environment_validations
- challenge_results
Steps to Reproduce
- Run
validator database status
- Notice missing tables in statistics output
- Check actual SQLite database - contains tables not shown in status
- Run migrations - doesn't create new tables
- Cleanup command doesn't handle new entity types
Component
Validator
Environment
- OS: Linux
- Database: SQLite
- Validator version: Latest main branch
Checklist
Additional Context
The database schema has evolved as new features were added (GPU profiling, emission calculations, etc.) but the CLI handler wasn't updated to match. This makes database management and debugging difficult.
Related Code
Current tables defined in:
crates/validator/src/persistence/entities/
crates/validator/migrations/
Priority
High - Database management is critical for validator operations and debugging
[BUG] Validator database CLI handler needs updates for new schema
Bug Description
The validator's database CLI handler at
crates/validator/src/cli/handlers/database.rsis using an outdated schema that doesn't reflect the current database structure. The handler is missing tables for GPU profiles, emission metrics, weight allocation history, and other new features that have been added to the validator.Expected Behavior
The database handler should:
Actual Behavior
Current handler only manages basic tables:
Missing tables:
Steps to Reproduce
validator database statusComponent
Validator
Environment
Checklist
create_schema()function to include all current tablesshow_database_status()cleanup_old_records()database export- Export data for analysisdatabase compact- Optimize database sizedatabase validate- Check integrity and constraintsAdditional Context
The database schema has evolved as new features were added (GPU profiling, emission calculations, etc.) but the CLI handler wasn't updated to match. This makes database management and debugging difficult.
Related Code
Current tables defined in:
crates/validator/src/persistence/entities/crates/validator/migrations/Priority
High - Database management is critical for validator operations and debugging