feat(validator): add --no-tui runtime flag#1252
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds a Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(none) Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@magicblock-validator/src/main.rs`:
- Around line 133-167: The duplicated headless startup/banner/shutdown sequence
should be extracted into a single helper function (e.g., run_headless_startup)
that accepts the needed context (rpc_url, ws_url, remote_rpc_url,
validator_identity, api, overall_start) and performs the print_info calls,
version reporting, the initial debug log, waits on Shutdown::wait().await and
logs the shutdown debug/error using the same shutdown_wait measurement; replace
the duplicated blocks in both the tui + no_tui and not(feature = "tui") branches
with a call to this new helper, ensuring the helper uses the existing
print_info, debug!, and error! calls and returns/awaits as appropriate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: cea00d67-459b-4d52-adfb-05fb078198c6
📒 Files selected for processing (4)
magicblock-config/src/config/cli.rsmagicblock-config/src/lib.rsmagicblock-validator/src/main.rstools/magicblock-tui-client/README.md
GabrielePicco
left a comment
There was a problem hiding this comment.
Thanks for the cotribution @0xzrf, LGTM!
Please address the nit: #1252 (comment) and we are good to merge
|
@GabrielePicco addressed #1252 (comment) All ready for review 🫡 |
Allow TUI-enabled builds to run headless via `--no-tui` (default: TUI on). Closes magicblock-labs#1239. Co-authored-by: Cursor <cursoragent@cursor.com>
Summery
Adds
--no-tuiso published TUI builds can run without the in-process terminal UI.--features tui.--no-tui: headless startup (banner + graceful shutdown on SIGINT/SIGTERM).Compatibility
no-tuifield (CLI:--no-tui; env:MBV_NO_TUI=true).--no-tuiis set.Testing
cargo run -p magicblock-validator --features tui→ TUIcargo run -p magicblock-validator --features tui -- --no-tui→ headlessFixes #1239.
Summary by CodeRabbit
New Features
--no-tuiflag to run the validator in headless mode, allowing the terminal UI to be disabled at runtime.Documentation
--no-tuiruntime option and clarify behavior when the TUI feature is not enabled.