Skip to content

fix(dashmate): use live Tenderdash app version for protocol status#4136

Draft
thepastaclaw wants to merge 3 commits into
dashpay:v4.1-devfrom
thepastaclaw:tracker-2094
Draft

fix(dashmate): use live Tenderdash app version for protocol status#4136
thepastaclaw wants to merge 3 commits into
dashpay:v4.1-devfrom
thepastaclaw:tracker-2094

Conversation

@thepastaclaw

@thepastaclaw thepastaclaw commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

After an in-process Platform protocol upgrade, dashmate status platform kept reporting a stale Protocol Version from Tenderdash node_info.protocol_version.app (snapshotted at process start), while live RPC fields already reflected the activated version. That made healthy upgraded nodes look stuck on the previous protocol during rollout windows.

Fixes #4135

What was done?

  • Source Protocol Version (active/current) from Tenderdash /status application_info.version instead of stale node_info.protocol_version.app.
  • Keep Desired Protocol Version (installed/supported) from /abci_info app_version.
  • Fall back with optional chaining / ?? to node_info.protocol_version.app only when application_info (or its version) is omitted — Tenderdash uses json:",omitempty" and leaves the field empty when ABCIInfo fails — so status does not TypeError into serviceStatus: error.
  • Update unit fixtures so live application_info.version still wins when present even if node_info.protocol_version.app is intentionally stale; add focused coverage for missing application_info.

How Has This Been Tested?

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Source Protocol Version from status.application_info.version instead of
the process-start snapshot in node_info.protocol_version.app, while
keeping Desired Protocol Version from abci_info.app_version.

Adds a regression unit test covering a stale node_info app protocol with
a newer live application_info version after in-process upgrade.

Fixes dashpay#4135
Prove protocolVersion prefers live application_info.version by setting a
stale node_info.protocol_version.app in the existing success case instead
of duplicating the full mock bootstrap.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Dashmate platform status now derives Tenderdash’s protocol version from application_info.version rather than the process-start snapshot in node_info.protocol_version.app. Unit-test mocks are updated with live application versions.

Changes

Protocol version reporting

Layer / File(s) Summary
Use live protocol version in platform status
packages/dashmate/src/status/scopes/platform.js, packages/dashmate/test/unit/status/scopes/platform.spec.js
getTenderdashInfo reads the live application version, with comments documenting the distinction from the snapshotted node protocol version; affected test fixtures now include application_info.version.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: quantumexplorer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code and tests match #4135 by sourcing the current protocol version from application_info.version while preserving the desired version path.
Out of Scope Changes check ✅ Passed The PR appears scoped to the protocol-version fix and its regression tests, with no unrelated changes evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: using the live Tenderdash app version for protocol status in dashmate.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added this to the v4.1.0 milestone Jul 16, 2026
@thepastaclaw

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@packages/dashmate/src/status/scopes/platform.js`:
- Around line 147-151: Update the protocolVersion assignment near the
application_info status handling to safely read application_info.version with
optional chaining and fall back to node_info.protocol_version.app when
application_info is absent or its version is unavailable, while preserving
numeric parsing.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8945dc9d-24a9-43d0-9276-f096a91edfed

📥 Commits

Reviewing files that changed from the base of the PR and between dc1d645 and 5542624.

📒 Files selected for processing (2)
  • packages/dashmate/src/status/scopes/platform.js
  • packages/dashmate/test/unit/status/scopes/platform.spec.js

Comment thread packages/dashmate/src/status/scopes/platform.js Outdated
Prefer live application_info.version for protocol status. When
application_info is omitted (Tenderdash json omitempty if ABCIInfo
fails, or older responses), fall back to node_info.protocol_version.app
so status does not TypeError and report the service as error. The live
field still wins when present, even if node_info is stale.

Adds a regression unit test for the missing application_info case.
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.

dashmate status platform reports stale "Protocol Version" after protocol upgrade activation (node_info.protocol_version.app frozen at process start)

1 participant