Skip to content

fix(rpc): decode Core v24 getblockchaininfo and add getdeploymentinfo - #1165

Merged
xdustinface merged 2 commits into
devfrom
shumkov/getdeploymentinfo
Oct 14, 2026
Merged

xdustinface merged 2 commits into
devfrom
shumkov/getdeploymentinfo

Conversation

@shumkov

@shumkov shumkov commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Dash Core v24 moved deployment status out of getblockchaininfo into the new getdeploymentinfo RPC (dash#6888). getblockchaininfo now carries softforks only when Core runs with -deprecatedrpc=softforks. GetBlockchainInfoResult.softforks was a required field, so every Core v24 answer failed to decode with missing field `softforks` .

On a devnet running Core v24.0.0-rc.3, this stopped Platform's InitChain (get_fork_info("mn_rr") reads softforks), so no new Platform node could start. It also left the Core section of DAPI's getBlockchainStatus empty.

Changes

  • GetBlockchainInfoResult.softforks is #[serde(default)]: an empty map when Core leaves it out. The type is unchanged, so callers compile as before.
  • New RpcApi::get_deployment_info(block_hash: Option<&BlockHash>) calls getdeploymentinfo, at the chain tip for None, and returns GetDeploymentInfoResult { hash, height, deployments: HashMap<String, SoftforkInfo> }. This matches the RPCHelpMan of v24.0.0-rc.3. Core builds deployments with the same DeploymentInfo() that filled softforks, so the existing SoftforkInfo decodes it. Fields v24 adds to bip9 entries (status_next, ehf, signalling, …) are ignored.
  • Core before v24 answers getdeploymentinfo with HTTP 404 and {"code":-32601,"message":"Method not found"}. Through jsonrpc 0.18's simple_http transport this arrives as Error::JsonRpc(jsonrpc::Error::Rpc(RpcError { code: -32601, .. })), so a caller can fall back to getblockchaininfo().softforks. Platform does that.

Tests

The fixtures are real answers from the official v24.0.0-rc.3 and v23.1.8 arm64 macOS release binaries (sha256 matches the release SHA256SUMS), running regtest at height 440.

  • deserialize_getblockchaininfo_without_softforks_from_core_v24: fails before the fix with missing field `softforks` , the error seen on the devnet, and passes after it.
  • deserialize_getdeploymentinfo_from_core_v24 decodes all 18 deployments, buried and bip9.
  • deserialize_getblockchaininfo_with_softforks_from_core_v23 decodes v23's softforks.
  • getdeploymentinfo_reports_buried_deployments_as_softforks_did checks that each of the 15 buried deployments v23 reports in softforks, v24 reports identically in deployments.
  • In rpc-client, two tests pin the RPC name and the arguments: none for the tip, the hash otherwise.
  • deserialize_signalled_deployments_from_core_v24 decodes a bip9 deployment while it is signalled. It covers started (bit, statistics, signalling) and locked_in (activation_height), captured with -vbparams. One entry that fails to decode fails the whole answer.

A manual run of Client against both live nodes showed v24 decoding mn_rr = {buried, active, 432} from getdeploymentinfo. Against v23 it returned JsonRpc(Rpc(RpcError { code: -32601, message: "Method not found" })).

cargo test -p dashcore-rpc-json -p dashcore-rpc, clippy -D warnings and fmt all pass.

Platform v5.0 needs the fix commit on integration/v5.0-core-v24, and it is there as a cherry-pick -x (379f0574). The follow-up commit only adds a test.

🤖 Generated with Claude Code

PR Hygiene · 09d16a2

  • Bots — coderabbitai skipped after its own rate limit
  • Self-review — post /self-reviewed
  • Build green
  • Approvals
    • files with no dedicated owner (rpc-client/src/client.rs, rpc-json/src/lib.rs) — QuantumExplorer or ZocoLini or xdustinface

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Dash Core v24 moved deployment status out of getblockchaininfo into the
new getdeploymentinfo RPC (dash#6888): getblockchaininfo carries
`softforks` only with -deprecatedrpc=softforks. GetBlockchainInfoResult
required the field, so decoding any Core v24 answer failed with
"missing field `softforks`", which stops Platform's InitChain and
empties DAPI's blockchain status.

- `GetBlockchainInfoResult.softforks` defaults to an empty map when
  Core leaves it out; its type is unchanged.
- `RpcApi::get_deployment_info(block_hash)` calls getdeploymentinfo at
  the given block, or at the chain tip for `None`, and decodes
  `{hash, height, deployments}` into `GetDeploymentInfoResult`. Its deployments are the `SoftforkInfo`
  entries getblockchaininfo reported, built by the same Core function.
  Core v23 answers it with method not found (-32601).

Tests decode real answers of Dash Core v24.0.0-rc.3 and v23.1.8 on
regtest, and pin that each buried deployment v23 reported in softforks
v24 reports identically in deployments.

Test would have caught this in CI: the Core v24 getblockchaininfo test
fails before the fix ("missing field `softforks`", the error seen on a
devnet) and passes after it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: dashpay/rust-dashcore/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3dcd91f-0f6d-49ec-999f-5b4792d9163e
📥 Commits

Reviewing files that changed from the base of the PR and between a6cdc20 and 985dc93.

📒 Files selected for processing: 2
  • rpc-client/src/client.rs
  • rpc-json/src/lib.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The RPC client adds get_deployment_info with an optional block hash. The JSON crate adds a response type and tests for deployment information and softforks data across Core v23 and v24 response formats.

Changes: Deployment Info RPC Support

Layer / File(s) Summary
Deployment response contract
rpc-json/src/lib.rs
Adds GetDeploymentInfoResult with a block hash, height, and deployment map. Updates softforks documentation and tests Core v23 and v24 response deserialization, including missing softforks and buried deployment data.
RPC client call
rpc-client/src/client.rs
Adds get_deployment_info, which omits the block-hash argument when none is supplied. Tests the omitted and supplied argument cases.

Priority: ⬆️ High

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

Change: Bug fix

Suggested reviewers: kwvg

Merge Risk: ⚪ Minimal · up to 985dc

The change addresses Core v24 response compatibility; no outstanding issue identified here prevents merging after normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 84.62% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files.
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes both primary changes: fixing Core v24 getblockchaininfo decoding and adding getdeploymentinfo support.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 14, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Oct 14, 2026
While a version bits deployment is signalled, Core v24 reports the
optional `bit`, `statistics`, `activation_height` and `signalling`
fields in getdeploymentinfo. One entry that fails to decode fails the
whole answer, so pin the started and locked_in states, captured from
Core v24.0.0-rc.3 regtest with -vbparams.

Test-only: no behaviour change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@codecov

codecov Bot commented Oct 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.20635% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 78.80%. Comparing base (a6cdc20) to head (09d16a2).

Files with missing lines Patch % Lines
rpc-client/src/client.rs 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1165      +/-   ##
==========================================
+ Coverage   78.76%   78.80%   +0.04%     
==========================================
  Files         302      302              
  Lines       80644    80770     +126     
==========================================
+ Hits        63518    63650     +132     
+ Misses      17126    17120       -6     
Flag Coverage Δ
core 77.25% <ø> (ø)
ffi 52.13% <ø> (+0.16%) ⬆️
rpc 51.61% <99.20%> (+2.25%) ⬆️
spv 92.59% <ø> (-0.08%) ⬇️
wallet 82.12% <ø> (ø)
Files with missing lines Coverage Δ
rpc-json/src/lib.rs 82.78% <100.00%> (+0.94%) ⬆️
rpc-client/src/client.rs 13.14% <97.29%> (+2.96%) ⬆️

... and 19 files with indirect coverage changes

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Oct 14, 2026
@xdustinface
xdustinface merged commit e95f230 into dev Oct 14, 2026
39 of 41 checks passed
@xdustinface
xdustinface deleted the shumkov/getdeploymentinfo branch October 14, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants