fix(dashmate): use live Tenderdash app version for protocol status#4136
fix(dashmate): use live Tenderdash app version for protocol status#4136thepastaclaw wants to merge 3 commits into
Conversation
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.
📝 WalkthroughWalkthroughDashmate platform status now derives Tenderdash’s protocol version from ChangesProtocol version reporting
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
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 `@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
📒 Files selected for processing (2)
packages/dashmate/src/status/scopes/platform.jspackages/dashmate/test/unit/status/scopes/platform.spec.js
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.
a557278 to
592b882
Compare
Issue being fixed or feature implemented
After an in-process Platform protocol upgrade,
dashmate status platformkept reporting a stale Protocol Version from Tenderdashnode_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?
/statusapplication_info.versioninstead of stalenode_info.protocol_version.app./abci_infoapp_version.??tonode_info.protocol_version.apponly whenapplication_info(or itsversion) is omitted — Tenderdash usesjson:",omitempty"and leaves the field empty when ABCIInfo fails — so status does not TypeError intoserviceStatus: error.application_info.versionstill wins when present even ifnode_info.protocol_version.appis intentionally stale; add focused coverage for missingapplication_info.How Has This Been Tested?
yarn workspace dashmate mocha --require ./test/bootstrap.js test/unit/status/scopes/platform.spec.js→ 8 passingyarn workspace dashmate lint→ 0 errors (existing warnings only)application_info: validated against TenderdashResultStatus/Statusimplementation; fallback applied while preserving dashmate status platform reports stale "Protocol Version" after protocol upgrade activation (node_info.protocol_version.app frozen at process start) #4135 live-field preferenceBreaking Changes
None.
Checklist:
For repository code-owners and collaborators only