Repository navigation
feat: add getDeploymentInfo and modernize CI - #79
Conversation
Dash Core v24 reports deployments (softforks) through getdeploymentinfo; getblockchaininfo returns them only with -deprecatedrpc=softforks, which Core marks for removal in v25. The optional argument is the block hash to query, defaulting to the chain tip. Test: "should call getDeploymentInfo at the chain tip or at a given block". Before the callspec entry it fails with "client.getDeploymentInfo is not a function"; after it, it passes. "should callback with error if invalid json" already fails on master under Node 24 and is unchanged here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Node 20 and later word JSON.parse errors differently from Node 16
("Unexpected token 'o', \"not a json string\" is not valid JSON" instead of
"Unexpected token o in JSON at position 1"), so "should callback with
error if invalid json" failed on every supported Node LTS. It now
expects the message JSON.parse produces for the same input, which keeps
the assertion that the client wraps the parse error.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ubuntu-20.04 runners are retired, and the v2 actions and Node 16 are past end of life, so the workflow no longer starts. Run both jobs on ubuntu-latest with Node 24 and current action majors; the steps stay the same. The release job now publishes with npm trusted publishing (OIDC, id-token: write) through npm's own CLI instead of JS-DevTools/npm-publish with the NPM_TOKEN secret, as dashpay/platform does since npm revoked classic tokens. This needs a trusted publisher on npmjs.com for @dashevo/dashd-rpc: organization dashpay, repository dashd-rpc, workflow test_and_release.yml. The tag/version check is now an inline step, so no third-party action runs in the job that holds id-token: write. The package's repository, bugs and homepage URLs move to dashpay/dashd-rpc, where the repository now lives: trusted publishing attaches provenance, and npm rejects it when repository.url names a different repository than the one that built the package. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
With id-token: write every step of the release job can mint an npm publish token, and npm's trusted-publishing guide says never to use caching in release builds. Publishing needs no dependencies (the package has no lifecycle scripts and the test job already ran), so the job no longer restores the npm cache or runs npm ci. The workflow token is read-only by default; the repository default is write. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
Dash Core v24 reports deployments (softforks) only through
getdeploymentinfo.getblockchaininforeturns them only with-deprecatedrpc=softforks, which Core marks for removal in v25. Dashmate readsmn_rractivation from there, and its platform status section is empty on Core v24 (dashpay/platform#5439). The client has nogetDeploymentInfomethod.The release workflow also no longer runs. It uses
ubuntu-20.04runners, which GitHub retired,v2actions, and Node 16, and it publishes with the 2022NPM_TOKENorg secret.What was done?
getDeploymentInfoadded to the callspec ('str': optional block hash, chain tip by default), with a test.ubuntu-latestwith Node 24 (Active LTS) and current action majors (checkout@v7,setup-node@v7,cache@v6,github-script@v9). The steps are the same.id-token: write, through the npm CLI that Node 24 ships, instead ofJS-DevTools/npm-publishwithNPM_TOKEN. dashpay/platform has published this way since npm revoked classic tokens.geritol/match-tag-to-package-version. No third-party action runs in the job that holdsid-token: write.npm ci. Publishing needs no dependencies, and npm's guide says never to cache in release builds; any step in that job can mint a publish token.contents: readby default (the repository default is write).package.jsonrepository,bugsandhomepagenow point todashpay/dashd-rpc, where the repo lives now. Trusted publishing attaches provenance, and npm rejects provenance whoserepository.urldoesn't match the repo that built the package.JSON.parseproduces. Node 20 and later word that message differently, so the test failed on every supported LTS.How Has This Been Tested?
npm ci,npm testandnpm run coverageon Node 24.21 / npm 11.19 in a clean checkout: 24 passing.getDeploymentInfotest fails before the callspec entry ("client.getDeploymentInfo is not a function") and passes after it.dashd24.0.0-rc.3 on regtest, dashmate's status scopes using this branch showmn_rras activated.Breaking Changes
None.
Release prerequisite
The npm side of trusted publishing must exist before the release: on npmjs.com, a trusted publisher for
@dashevo/dashd-rpcwith organizationdashpay, repositorydashd-rpc, workflowtest_and_release.yml, and no environment.npm publish. A configuration created after Sep 03, 2026 allows onlynpm stage publishby default.NPM_TOKENorg secret is no longer used by this repo.🤖 Generated with Claude Code