Skip to content

feat(api): surface node mode identity on the overview page - #11

Merged
arkadianet merged 1 commit into
mainfrom
feat/overview-node-identity
Jun 5, 2026
Merged

feat(api): surface node mode identity on the overview page#11
arkadianet merged 1 commit into
mainfrom
feat/overview-node-identity

Conversation

@arkadianet

@arkadianet arkadianet commented Jun 5, 2026

Copy link
Copy Markdown
Owner

What

The dashboard never rendered /api/v1/identity despite the endpoint being registered in the web client and the ApiIdentity.mode doc comment stating it was designed for the dashboard hero strip. The overview's top row now shows the mode label ("archive · utxo", "digest-verifier", "pruned · utxo · keep N", …) with compact pills for mining / extra-index / verify-tx and bootstrap provenance (shown only when a jump actually ran). Fetched once on mount (static config), hidden on fetch failure — the page never breaks.

Plus one real bug

build_api_identity_from_inputs hardcoded mining: false — a live mining node reported mining:false on /api/v1/identity (same class as the /info isMining stub fixed in #7). IdentityInputs now carries mining_enabled from config; all constructors swept; unit test pins the flow both ways.

Verification

fmt/check/clippy(CI-exact) clean; cargo test -p ergo-node --lib 346 green; cargo test -p ergo-api green. UI matches the existing cockpit visual language (existing .pill components, token-based CSS, no new design primitives); assets are compile-time embedded so this rides the next binary deploy.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a node identity strip to the dashboard overview displaying mining status and node feature information.
  • Bug Fixes

    • Mining status in the node identity API now accurately reflects configuration (previously always reported as disabled).
  • Style

    • Improved dashboard layout alignment and spacing for better readability of the overview section.

…l mining flag

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Ready to act? Review this PR in Change Stack to turn feedback into patch suggestions you can inspect and refine.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8bb4d073-3816-469a-a573-c2194ba1d558

📥 Commits

Reviewing files that changed from the base of the PR and between 65fe0e8 and ece7393.

📒 Files selected for processing (5)
  • ergo-api/web/dashboard.css
  • ergo-api/web/js/overview.js
  • ergo-node/src/node/identity.rs
  • ergo-node/src/node/tests.rs
  • ergo-node/tests/identity_live_refresh.rs

📝 Walkthrough

Walkthrough

The PR adds mining enablement tracking to the node identity model by introducing a mining_enabled field to IdentityInputs, sourced from config, and projecting it through the /api/v1/identity endpoint. The web overview UI now displays a cached identity strip showing node mode and feature flags (mining, extra index, verify transactions) with conditional bootstrap provenance chips. Layout styles are updated to center and space the new identity strip appropriately.

Changes

Node identity mining enablement and overview UI display

Layer / File(s) Summary
Mining enablement field in IdentityInputs
ergo-node/src/node/identity.rs
IdentityInputs gains a mining_enabled boolean field initialized from config.mining_config.enabled, and build_api_identity_from_inputs now populates ApiIdentity.mining from that field instead of the previous hardcoded false value.
Test coverage for mining flag projection
ergo-node/src/node/tests.rs, ergo-node/tests/identity_live_refresh.rs
Test fixtures (make_state_with_backend, inputs_for, archive_inputs) now explicitly set mining_enabled: false, and a new test build_api_identity_mining_flag_tracks_mining_enabled verifies the mining field is correctly projected for both true and false values.
Node identity strip in overview UI
ergo-api/web/js/overview.js
The overview page now includes a cached node identity strip displayed at mount time. The state.identity field stores identity data; fetchIdentity() calls the API once per session and caches the result; renderIdentity() populates the UI with node mode and feature flag chips (mining, extra_index_enabled, verify_transactions) plus conditional bootstrap provenance chips.
Overview cockpit layout styling
ergo-api/web/dashboard.css
CSS for the Overview cockpit section (.ov-top, .ov-ident, .ov-ident__chips) is updated to center-align items, distribute with space-between, add explicit gaps, support flex wrapping, and prevent content overflow with min-width: 0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

A node's identity now shines so bright,
Mining flags flutter in the dashboard light! 🐰✨
Feature chips dance in their flexbox way,
While tests ensure they behave today.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically summarizes the main feature: surfacing node identity information on the overview page, which matches the primary objective of rendering the /api/v1/identity response on the dashboard.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/overview-node-identity

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.

@arkadianet
arkadianet merged commit f16f308 into main Jun 5, 2026
8 checks passed
@arkadianet
arkadianet deleted the feat/overview-node-identity branch June 5, 2026 21:08
arkadianet added a commit that referenced this pull request Jun 8, 2026
…index (#23)

read_ergo_box parses the 32-byte transaction id and the VLQ output index
from the box tail, but the SBox-constant EvalBox in sigma_to_value hardcoded
transaction_id: [0u8;32] and output_index: 0, discarding them. This
corrupted ExtractCreationInfo (0xC7) — whose R3 reference is
transactionId.toBytes ++ Shorts.toByteArray(index) (FIXED 2-byte big-endian)
— and ExtractBytesWithNoRef (0xC4), whose strip length is 32 + VLQ(index)
(so a zeroed index strips the wrong number of bytes for index >= 128).

Now carries the parsed ergo_box.transaction_id / ergo_box.index. Matches
Scala ErgoBox.get(ReferenceRegId) and bytesWithNoRef.

Closes sbox-const-discards-txid-index (3 entries: Box_properties_equivalence
0xC7 #10/#11 and 0xC4 #8).

Co-authored-by: arkadianet <rkadias@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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