Skip to content

feat(ev-dev): part 5 – add interactive TUI dashboard#184

Open
randygrok wants to merge 22 commits intoev-deployer-part4-ev-dev-integrationfrom
feat/ev-dev-part5-tui
Open

feat(ev-dev): part 5 – add interactive TUI dashboard#184
randygrok wants to merge 22 commits intoev-deployer-part4-ev-dev-integrationfrom
feat/ev-dev-part5-tui

Conversation

@randygrok
Copy link
Copy Markdown
Contributor

Description

Adds an interactive terminal UI dashboard to ev-dev with the --tui flag. The TUI displays real-time blocks, logs, and accounts panels using ratatui, with a custom tracing layer that captures log events in real-time. Plain log output remains the default behavior.

Type of Change

  • New feature (non-breaking change which adds functionality)

Testing

  • TUI renders blocks, logs, and accounts panels
  • Keyboard navigation works (Tab, arrows, q to quit)
  • Terminal properly restored on exit or panic
  • Plain log output mode (--tui off) unchanged

- Integrate ratatui for terminal UI with blocks, logs, and accounts panels
- Implement custom tracing layer to capture real-time log events
- Add keyboard navigation (Tab for panel switch, arrows for scroll, q to quit)
- Support coexistence of TUI and plain log output modes
- Add crossterm for terminal event handling
@randygrok randygrok requested a review from a team as a code owner March 20, 2026 08:33
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 450ddb20-e989-4f68-b919-f1b76720846b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ev-dev-part5-tui

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 and usage tips.

@claude
Copy link
Copy Markdown

claude bot commented Mar 20, 2026

Claude finished @randygrok's task —— View job


PR Review: Interactive TUI Dashboard for ev-dev

I've completed a comprehensive review of the TUI implementation. Here's my analysis:

Todo List:

  • Analyze main TUI application logic (app.rs)
  • Review terminal UI rendering implementation (ui.rs)
  • Check custom tracing layer implementation (tracing_layer.rs)
  • Examine event handling system (events.rs)
  • Review main.rs integration changes
  • Analyze dependencies and version compatibility
  • Check for async/threading issues
  • Assess terminal cleanup and error handling
  • Evaluate performance implications
  • Check security considerations
  • Assess test coverage
  • Provide comprehensive review feedback

Code Quality Assessment: ✅ High Quality

The TUI implementation demonstrates excellent Rust practices with clean separation of concerns, proper async/await usage, and well-structured modules.

Strengths:

  • Clear module organization (app, events, ui, tracing_layer)
  • Consistent error handling with eyre::Result
  • Well-defined data structures with appropriate visibility (pub(crate))
  • Proper async task spawning with tokio::spawn

Potential Issues and Recommendations

🟡 Minor Issues

1. Missing Error Context in RPC Operations

  • Location: app.rs:246 - ProviderBuilder::new().connect_http(rpc_url.parse().expect("valid RPC URL"))
  • Issue: Hard panic on invalid RPC URL instead of graceful error handling
  • Recommendation: Replace expect() with proper error handling and return early from async task

2. Silent Channel Send Failures

  • Location: tracing_layer.rs:81 - let _ = self.tx.try_send(entry);
  • Location: app.rs:349 - if tx.send(balances).await.is_err() { break; }
  • Issue: Log events may be silently dropped when TUI buffer is full
  • Impact: Users may miss important log information during high activity
  • Recommendation: Consider using a bounded channel with overflow handling or logging dropped messages

3. Potential Integer Overflow in Gas Formatting

  • Location: ui.rs:42-49 - Gas value formatting
  • Issue: No bounds checking on u64 values before f64 conversion
  • Recommendation: Add safety checks for extremely large gas values

🟢 Performance Considerations

Efficient Design Choices:

  • Appropriate buffer limits (1000 logs, 200 blocks) prevent memory growth
  • VecDeque usage for efficient FIFO operations
  • Non-blocking channel operations with try_recv()
  • 100ms UI refresh rate balances responsiveness with CPU usage

Balance Polling Optimization:

  • 2-second polling interval is reasonable for dev environments
  • Could be configurable for production use

🔒 Security Assessment: ✅ Secure

No Critical Security Issues Found:

  • Private key clipboard operations are properly scoped
  • RPC URLs are not logged or exposed insecurely
  • Terminal escape sequences are handled by ratatui library
  • No sensitive data persistence beyond memory

Good Security Practices:

  • Clipboard operations include user confirmation with truncated addresses
  • Private keys only copied on explicit user action (k key)
  • Temporary file cleanup handled by tempfile crate

🧪 Test Coverage: ⚠️ Needs Attention

Current State: No tests found for TUI functionality

Recommendations:

  1. Unit Tests: Add tests for core functions like format_ether(), format_gas(), parse_block_from_fields()
  2. Integration Tests: Test app state transitions, event handling
  3. Mock Testing: Test RPC error scenarios, channel overflow conditions

🔧 Technical Debt and Maintenance

1. Dependency Versions

  • ratatui = "0.30" and crossterm = "0.29" are current stable versions ✅
  • arboard = "3" for clipboard - appropriate choice ✅

2. Error Recovery

  • Terminal panic recovery is properly implemented with custom panic hook
  • TerminalGuard ensures cleanup on normal exit

3. Code Duplication

  • Some address truncation logic is repeated (truncate_hex function addresses this partially)
  • Consider extracting balance polling logic to separate module

Summary

This is a high-quality implementation that adds significant value to the development experience. The code demonstrates:

  • Excellent architecture with proper separation of concerns
  • Robust terminal handling with panic recovery
  • Efficient async operations with appropriate error handling
  • Good security practices for sensitive operations
  • ⚠️ Missing test coverage (main improvement area)
  • 🟡 Minor error handling improvements needed for RPC operations

Recommendation: Approve with minor fixes. The implementation is production-ready with suggested improvements for error handling and test coverage.


@randygrok randygrok changed the title feat(ev-dev): add interactive TUI dashboard feat(ev-dev): part 5 – add interactive TUI dashboard Mar 20, 2026
@randygrok randygrok marked this pull request as draft March 20, 2026 14:33
@randygrok randygrok marked this pull request as ready for review March 25, 2026 10:07
Add Nick's CREATE2 factory (0x4e59b44...956c) to the devnet genesis
so that ev-deployer deploy works against ev-dev out of the box.

On post-merge chains the canonical keyless deployment transaction
cannot be replayed, so the runtime bytecode is embedded directly
in the genesis alloc.

Document the live deployment workflow in both ev-dev and ev-deployer
READMEs.
…dy:evstack/ev-reth into feat/ev-dev-part5-tui

# Conflicts:
#	bin/ev-deployer/src/deploy/pipeline.rs
#	bin/ev-deployer/src/init.rs
Deploy mode now uses the original Uniswap salt so Permit2 lands at its
canonical address (0x000000000022D473030F116dDEE9F6B43aC78BA3) instead
of a random one.
`ev-deployer init genesis` generates config with address fields for
genesis injection. `ev-deployer init deploy` generates config without
addresses (computed via CREATE2) and auto-includes the deterministic
deployer since it is required for deploy mode.
…late

The deterministic deployer cannot be deployed via CREATE2 (circular
dependency). The deploy pipeline already verifies it exists on-chain,
so including it in the deploy config template was misleading.
Reflect the init genesis/deploy split, canonical Permit2 CREATE2 salt,
and removal of deterministic deployer from deploy config.
The flag passes a config for embedding contracts into genesis, not for
deploying to a live chain. The old name was misleading after the init
genesis/deploy split.
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.

2 participants