Repository navigation
fix(platform): start on Dash Core v24, which no longer reports softforks in getblockchaininfo - #5422
Conversation
…rks in getblockchaininfo On a devnet running Dash Core v24.0.0-rc.3, InitChain failed with "JSON decode error: missing field softforks" and Tenderdash restart looped: no new node could start or join. drive-abci read the platform activation fork mn_rr from getblockchaininfo's softforks, which Core v24 reports only with -deprecatedrpc=softforks (dash#6888); deployments moved to the new getdeploymentinfo RPC, built by the same Core function. - Pin rust-dashcore integration/v5.0-core-v24 at 379f0574: the previous pin plus a cherry-pick of dashpay/rust-dashcore#1165, which lets getblockchaininfo decode without softforks and adds get_deployment_info. rs-dapi's getBlockchainStatus decodes again. - drive-abci get_fork_info and rs-sdk get_platform_activation_height ask getdeploymentinfo first and read softforks only when Core answers method not found (-32601), as Core v23 does. Other errors are returned as before. - dashmate allows getdeploymentinfo to the drive_consensus Core RPC user: Core answers a method missing from a user's rpcwhitelist with HTTP 403, not method not found. A 5.0.0-rc.2 migration appends it to existing whitelists and leaves an unrestricted one alone. Core loads the whitelist only when it starts. Not a consensus change: Core v23 and v24 report a buried deployment's active/height identically, so InitChain reads the same values. Tests would have caught this in CI, with answers recorded from Core v24.0.0-rc.3 and v23.1.8 regtest: - drive-abci rpc::core::tests::fork_info (HTTP mock Core through DefaultCoreRPC): before the fix, on the old pin, the v24 test failed with JsonRpc(Json(Error("missing field `softforks`"))) and the v23, no-fallback and absent-fork tests failed; after it, all pass. - rs-sdk core::dash_core_client::tests: the v24 test failed with Json(Error("missing field `softforks`")), the others on the methods asked; all pass after. - dashmate migration test: fails without the 5.0.0-rc.2 migration, passes with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
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 |
|
✅ Final review complete — no blockers (commit 65d6e8e) · triage: normal |
|
Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The PR correctly prefers getdeploymentinfo and retains the Core v23 fallback, but it regresses deployments for nodes whose running Core still has a stale rpcwhitelist. Such nodes return HTTP 403 rather than JSON-RPC -32601, so the fallback is skipped and InitChain fails; this affects the stated v23 compatibility goal even though dashmate-managed fresh configurations are migrated.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a cross-cutting RPC compatibility fix spanning Rust clients, drive startup behavior, dependency updates, and dashmate configuration migration, but it does not change consensus rules, funds, cryptography, storage migrations, or other critical-surface behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-drive-abci/src/rpc/core.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/rpc/core.rs:316-323: Fall back when getdeploymentinfo is denied by a stale Core whitelist
The legacy fallback is selected only for JSON-RPC error code -32601. When the authenticated Core user is not allowed to call getdeploymentinfo, Core returns HTTP 403, which the RPC client surfaces as a transport/HTTP error, so execution reaches `Err(e)` after the retry loop and never tries getblockchaininfo. This regresses Core v23 nodes whose old whitelist is still loaded, including nodes where dashmate was upgraded but Core was not restarted, and also affects externally managed whitelists. Recognize the authorization failure as a compatibility case and try getblockchaininfo; if that response has no usable softfork entry, preserve the original authorization error so a Core v24 node does not turn the denied new endpoint into a misleading missing-fork result.
| Err(Error::JsonRpc(JsonRpcError::Rpc(RpcError { | ||
| code: CORE_RPC_METHOD_NOT_FOUND, | ||
| .. | ||
| }))) => retry!(self | ||
| .inner | ||
| .get_blockchain_info() | ||
| .map(|blockchain_info| blockchain_info.softforks.get(name).cloned())), | ||
| Err(e) => Err(e), |
There was a problem hiding this comment.
✅ Resolved at
65d6e8e6; see the replies below.
🟡 Suggestion: Fall back when getdeploymentinfo is denied by a stale Core whitelist
The legacy fallback is selected only for JSON-RPC error code -32601. When the authenticated Core user is not allowed to call getdeploymentinfo, Core returns HTTP 403, which the RPC client surfaces as a transport/HTTP error, so execution reaches Err(e) after the retry loop and never tries getblockchaininfo. This regresses Core v23 nodes whose old whitelist is still loaded, including nodes where dashmate was upgraded but Core was not restarted, and also affects externally managed whitelists. Recognize the authorization failure as a compatibility case and try getblockchaininfo; if that response has no usable softfork entry, preserve the original authorization error so a Core v24 node does not turn the denied new endpoint into a misleading missing-fork result.
source: muse-spark-1.3-contributor (phase1-reviewer: general, rust-quality); gpt-6.1-sol (phase2-reviewer: general, architecture-layering, rust-quality)
There was a problem hiding this comment.
Resolved (re-reviewed at 65d6e8e6): Your updated get_fork_info now falls back to getblockchaininfo after HTTP 403 without retrying the denied request, allowing Core v23 to initialize with its existing whitelist. It preserves the original refusal when legacy data lacks the deployment, and the new transport-level regression tests assert both outcomes and the exact request sequence.
|
Bots are done — your move: post |
…h HTTP 403
Core refuses a method missing from the RPC user's rpcwhitelist with HTTP
403 and no body, not method not found. dashmate's drive_consensus user
gets getdeploymentinfo only once Core restarts with the 5.0.0-rc.2
whitelist, and a whitelist managed outside dashmate may never list it. On
Core v23, where rc.1 read softforks and worked, InitChain then failed
with "unexpected HTTP code: 403".
- drive-abci get_fork_info and rs-sdk get_platform_activation_height
also fall back to getblockchaininfo's softforks on that 403. Core v24
started without -deprecatedrpc=softforks reports no softforks, so when
the fallback has no entry for the fork the getdeploymentinfo refusal
is returned instead of None: Core v24 behind such a whitelist still
fails loudly. The method-not-found fallback (Core v23) is unchanged.
- drive-abci warns on the 403 and names the rpcwhitelist, since the
error text alone says only "unexpected HTTP code: 403".
- drive-abci's Core RPC retry no longer retries an HTTP 403, for any
call. Core answers 403 only to requests it will never allow
(rpcwhitelist, rpcallowip), so the four retries only delayed the error
by about 11 s, and with the fallback they delayed the Core v23 answer.
Tests would have caught this in CI: x before the fix, v after.
- drive-abci rpc::core::tests::fork_info, through the HTTP mock Core,
which now answers 403 with an empty body like Core does:
- Core v23 refuses getdeploymentinfo: failed with
JsonRpc(Transport(HttpErrorCode(403))); passes.
- Core v24 refuses it and reports no softforks: failed, getblockchaininfo
was never asked; passes, returning the 403. A fallback that answers
Ok(None) there also fails it.
- Both assert the exact methods asked. Without the retry change they
fail with getdeploymentinfo asked four times.
- rs-sdk core::dash_core_client::tests: the same two cases, same
before/after. A new 401 test keeps other HTTP errors from falling back;
treating any transport error as the 403 fails it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
`dashmate status platform` reads mn_rr from getblockchaininfo's softforks, which Core v24 reports only with -deprecatedrpc=softforks. On Core v24 the destructuring threw and the Drive and Tenderdash status showed n/a. @dashevo/dashd-rpc 19.0.0 has no getDeploymentInfo. Render deprecatedrpc=softforks into dash.conf next to deprecatedrpc=service, before any network section so that it applies on every network. Core v23 accepts the option and changes nothing. Existing configs get it when the 5.0.0-rc.2 migration re-renders them, and Core reads it when it restarts. The template comment asks to move the status to getdeploymentinfo before Core drops the option. Test would have caught this in CI: x before the fix, v after. - test/unit/templates/dashConfTemplate.spec.js: on mainnet, testnet, devnet and local, the global part of the rendered dash.conf had only deprecatedrpc=service; it now has service and softforks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
This reverts commit bcbc515. Platform v5.0 activates before nodes move to Core v24, so dashmate's status command still reads softforks from Core v23 there, and Drive no longer depends on softforks at all (it asks getdeploymentinfo). Keeping a deprecated Core option in every node's dash.conf only for a status display is not worth it; the status command can move to getdeploymentinfo with the dashmate release that brings Core v24. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — coderabbitai not yet · thepastaclaw ✓. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the complete PR diff at head 65d6e8e, including the pinned Core RPC dependency changes. The stale-whitelist finding is fixed, and no production correctness or consensus blockers were found; one non-blocking resource-lifecycle issue remains in the new HTTP test fixture. This was static verification only: Rust workspace tests, JS builds, and Docker builds remained queued in the supplied CI snapshot from 2026-10-14T07:20:23Z.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The cross-package RPC compatibility fix, retry changes, dependency update, and configuration migration are substantial but do not themselves change consensus rules or another qualifying critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 14% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `packages/rs-drive-abci/src/rpc/core.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/rpc/core.rs:762-770: Give the mock server an explicit shutdown lifecycle
Each MockCore::start detaches a thread that owns the listener and runs an unbounded accept loop. MockCore retains only the URL and request recorder, so dropping the fixture cannot stop that thread or release its bound socket and captured allocations. All seven tests leave a listener running until the test process exits, even though their client connections close. Retain a shutdown signal and the listener worker's JoinHandle in MockCore, then wake the blocked accept loop and join the worker during teardown so fixture resources are released when each test finishes.
| thread::spawn(move || { | ||
| for stream in listener.incoming() { | ||
| let Ok(stream) = stream else { return }; | ||
| let answers = Arc::clone(&answers); | ||
| let recorder = Arc::clone(&recorder); | ||
| thread::spawn(move || serve(stream, &answers, &recorder)); | ||
| } | ||
| }); | ||
| MockCore { url, asked } |
There was a problem hiding this comment.
🟡 Suggestion: Give the mock server an explicit shutdown lifecycle
Each MockCore::start detaches a thread that owns the listener and runs an unbounded accept loop. MockCore retains only the URL and request recorder, so dropping the fixture cannot stop that thread or release its bound socket and captured allocations. All seven tests leave a listener running until the test process exits, even though their client connections close. Retain a shutdown signal and the listener worker's JoinHandle in MockCore, then wake the blocked accept loop and join the worker during teardown so fixture resources are released when each test finishes.
source: gpt-6.1-sol (phase2-reviewer: general, architecture-layering, rust-quality)
Issue being fixed or feature implemented
On a devnet running Dash Core v24.0.0-rc.3, Platform v5.0.0-rc.1 could not start a fresh chain. drive-abci failed at InitChain with:
Tenderdash then restart-looped.
InitChain reads the Platform activation deployment
mn_rrfrom Core, and the call fails at two levels:DefaultCoreRPC::get_fork_inforead it fromgetblockchaininfo().softforks.getblockchaininfoonly includessoftforkswhen Core runs with-deprecatedrpc=softforks(dash#6888). The replacement is the newgetdeploymentinfoRPC, whosedeploymentscome from the sameDeploymentInfo()function.GetBlockchainInfoResult.softforkswas a required field, so the whole answer failed to decode.The impact:
LowLevelDashCoreClient::get_platform_activation_height.getBlockchainStatus: the Core chain section comes back empty and the status isERROR.This is not a consensus change. Core v23 and v24 build a buried deployment's
active/heightidentically, so InitChain reads the same value either way.What was done?
rust-dashcore pin moved from
7302d0a6to379f0574onintegration/v5.0-core-v24. That is the previous pin plus onecherry-pick -xof fix(rpc): decode Core v24 getblockchaininfo and add getdeploymentinfo rust-dashcore#1165:GetBlockchainInfoResult.softforksdefaults to an empty map, and its type is unchanged.RpcApi::get_deployment_info(Option<&BlockHash>)/GetDeploymentInfoResult.rpc-jsonandrpc-client. rs-dapi's status decodes again with no rs-dapi change.drive-abci
get_fork_infoasksgetdeploymentinfofirst. It falls back togetblockchaininfo().softforksin two cases:-32601). Core v23 answers this way because it has nogetdeploymentinfo.rpcwhitelist. On Core v23 the fallback finds the deployment. Core v24 started without-deprecatedrpc=softforksreports nosoftforks, so when the fallback has no entry for the fork, the original 403 is returned rather than "fork not known yet". Core v24 behind such a whitelist still fails loudly.Any other error is returned unchanged. drive-abci logs a warning on the 403 that names the
rpcwhitelist, because the error text alone is onlyunexpected HTTP code: 403.drive-abci Core RPC retry no longer retries an HTTP 403, for any call. Core answers 403 only to requests it will never allow, through
rpcwhitelistorrpcallowip. The four retries only delayed the error by about 11 s, and with the fallback they would have delayed the Core v23 answer too.rs-sdk
get_platform_activation_heightuses the same rules, throughplatform_activation_fork.dashmate: drive-abci talks to Core as the
drive_consensusRPC user, which has anrpcwhitelist. Core answers a method that is not on the list with HTTP 403, which is not method not found. So:getdeploymentinfois added to the default whitelist.5.0.0-rc.2config migration adds it to existing configs. It appends to the operator's list rather than replacing it, and leaves an unrestricted (null) whitelist alone.-32601(verified on v23.1.8).dash.confis unchanged: Platform v5.0 activates before nodes move to Core v24, sodashmate status platformkeeps readingsoftforksfrom Core v23. Moving the status togetdeploymentinfobelongs to the dashmate release that brings Core v24.Operator note: Core loads
rpcwhitelistonly when it starts. After upgrading dashmate, restart Core itself with a fulldashmate restart, before anyreset --platform/start --platform/restart --platform, because those keep Core running. Until then, a Core v23 node still works through the 403 fallback, and a Core v24 node fails InitChain with the 403.How Has This Been Tested?
All fixtures are real answers from the official Dash Core v24.0.0-rc.3 and v23.1.8 arm64 macOS release binaries, running regtest at height 440 (sha256 matches the release
SHA256SUMS).Red → green:
rpc::core::tests::fork_info): an in-process HTTP JSON-RPC mock Core goes throughDefaultCoreRPC::open, so the jsonrpc transport's mappings are exercised too: 404 →-32601, and 403 with an empty body →Transport(HttpErrorCode(403)).JsonRpc(Json(Error("missing field `softforks`", …))), the devnet error, and the v23, no-fallback and absent-fork tests failed.getdeploymentinfofailed withJsonRpc(Transport(HttpErrorCode(403))). Core v24 refusing it with nosoftforksfailed becausegetblockchaininfowas never asked. A fallback that answersOk(None)there also fails it. Both tests assert the exact methods asked; with the old retry they fail, showinggetdeploymentinfoasked four times.-28) and the call is retried.core::dash_core_client::tests):Json(Error("missing field `softforks`"))and the other two failed on the methods asked. The two 403 tests failed the same way as in drive-abci.5.0.0-rc.2migration and passes with it.getblockchaininfodecode test fails before the fix and passes after it.Live run of
DefaultCoreRPC::get_fork_info("mn_rr")against the real nodes:{buried, active, height 432}fromgetdeploymentinfogetdeploymentinfoThe 403 fallback was not re-run live; the HTTP mock covers it, using the empty-body 403 that real Core sends.
cargo test -p drive-abci --lib rpc::core(13 pass),cargo test -p dash-sdk --lib core::dash_core_client(7 pass), the dashmate template and config unit specs (migrateConfigFileFactory.spec.jsneeds a wasm-dpp build and was not re-run after the first commit; this change does not touch migrations), clippy-D warnings --all-targetson drive-abci and dash-sdk, andcargo fmt --checkall pass.Breaking Changes
None.
get_fork_info's signature is unchanged.Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
65d6e8e/skip-botsproceeds without the ones not yet reported/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.