Skip to content

chore(nodectl): prep v0.4.0 release#93

Merged
Keshoid merged 8 commits into
release/nodectl/v0.4.0from
feature/sma-73-update-rest-api-docs-for-v040-endpoint-changes-and-bump
Apr 15, 2026
Merged

chore(nodectl): prep v0.4.0 release#93
Keshoid merged 8 commits into
release/nodectl/v0.4.0from
feature/sma-73-update-rest-api-docs-for-v040-endpoint-changes-and-bump

Conversation

@Keshoid
Copy link
Copy Markdown
Contributor

@Keshoid Keshoid commented Apr 15, 2026

Release prep for nodectl v0.4.0: bumps all node-control crates and the helm chart to 0.4.0, adds the CHANGELOG entry, and brings the README, security guide, setup guide, and staking-strategies doc in line with the v0.4.0 REST API, CLI, and stake-policy changes. Linear: SMA-73

Copilot AI review requested due to automatic review settings April 15, 2026 21:03
@linear
Copy link
Copy Markdown

linear Bot commented Apr 15, 2026

…-api-docs-for-v040-endpoint-changes-and-bump
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Prepares the nodectl v0.4.0 release by bumping crate/chart versions and aligning docs with the updated REST API surface (unified elections settings, TON HTTP API endpoints, stake policies, and voting commands).

Changes:

  • Bump node-control crate versions and lockfile entries to 0.4.0.
  • Update Helm chart (appVersion + default image tag) for v0.4.0.
  • Refresh documentation (README + setup/security/staking-strategies) to match the v0.4.0 REST API/CLI behavior.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/node/tests/test_load_net/scripts/create-proposal.ts Updates proposal script to fetch transactions/config via HTTP endpoints and decode tx BOCs for inspection.
src/node-control/ton-http-api-client/Cargo.toml Bump crate version to 0.4.0.
src/node-control/service/Cargo.toml Bump crate version to 0.4.0.
src/node-control/nodectl/Cargo.toml Bump crate version to 0.4.0.
src/node-control/elections/Cargo.toml Bump crate version to 0.4.0.
src/node-control/control-client/Cargo.toml Bump crate version to 0.4.0.
src/node-control/contracts/Cargo.toml Bump crate version to 0.4.0.
src/node-control/common/Cargo.toml Bump crate version to 0.4.0.
src/node-control/commands/Cargo.toml Bump crate version to 0.4.0.
src/node-control/docs/staking-strategies.md Expanded/rewritten stake policy documentation (Minimum/Fixed/Split50/AdaptiveSplit50) and configuration details.
src/node-control/docs/nodectl-setup.md Reordered setup flow around service-first + JWT auth; updated image tag and REST-driven config steps.
src/node-control/docs/nodectl-security.md Updated operator capabilities list to reflect new unified endpoints and config entity CRUD.
src/node-control/README.md Updated CLI semantics (REST-client config commands), TON HTTP API flags, stake policies, voting commands, and REST endpoint matrix/examples.
src/node-control/CHANGELOG.md Added v0.4.0 release notes (features, changes, breaking changes).
src/Cargo.lock Lockfile updates for crate version bumps to 0.4.0.
helm/nodectl/values.yaml Default container image tag set to v0.4.0.
helm/nodectl/Chart.yaml Chart version bump + appVersion set to v0.4.0.
helm/nodectl/CHANGELOG.md Added chart release notes for 0.2.1 pointing to nodectl v0.4.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lt, hash,
});
for (const tx of transactions) {
const transactions = await getTransactions(configAddress, 10, parseInt(lt), hash);
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

lt from getContractState().lastTransaction is a 64-bit logical time and can exceed JS Number.MAX_SAFE_INTEGER. Converting it with parseInt(lt) (and typing lt as number in getTransactions) can lose precision and make pagination fetch the wrong transaction set. Keep lt as a string or bigint end-to-end and pass that through to the RPC call.

Suggested change
const transactions = await getTransactions(configAddress, 10, parseInt(lt), hash);
const transactions = await getTransactions(configAddress, 10, lt, hash);

Copilot uses AI. Check for mistakes.
Comment on lines +203 to +224
async function getTransactions(address: Address, limit: number, lt: number, hash: string) {
const result = await fetch(`http://127.0.0.1:3301/jsonRPC`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'getTransactions',
params: {
address: address.toString(),
limit,
lt,
hash,
},
}),
});
const data = await result.json();
if (!data.ok) {
throw new Error(`Failed to get config: ${data.error}`);
throw new Error(`Failed to get transactions: ${data.error}`);
}
return Cell.fromBase64(data.result.config.bytes as string);
return data.result;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

getTransactions posts JSON-RPC but the request omits the required id, and the response handling assumes an { ok, result } envelope (if (!data.ok) ...). Standard TON /jsonRPC returns { jsonrpc, id, result } or { jsonrpc, id, error }, so this will throw even on success. Update the request to include an id and handle data.error / data.result per JSON-RPC 2.0 (or switch back to client.getTransactions if you just need parsed transactions).

Copilot uses AI. Check for mistakes.
Comment on lines +203 to 206
async function getTransactions(address: Address, limit: number, lt: number, hash: string) {
const result = await fetch(`http://127.0.0.1:3301/jsonRPC`, {
method: 'POST',
headers: {
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

getTransactions is hard-coded to http://127.0.0.1:3301/jsonRPC, but getConfig supports overriding the endpoint via --custom. This makes --custom only partially effective and can lead to confusing behavior when pointing at a non-local RPC. Consider reusing the same normalized base URL logic from getConfig (or passing the endpoint in as an argument) so both calls hit the same server.

Copilot uses AI. Check for mistakes.
method: 'GET',
try {
const idx = process.argv.findIndex(arg => arg == '--custom');
const url = idx !== -1 ? process.argv[idx + 1] : 'http://127.0.0.1:3301';
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

--custom parsing assumes a value exists at process.argv[idx + 1]. If the flag is provided without a URL (or is the last arg), url becomes undefined and .endsWith(...) will throw. Add an explicit check and a clear error message when --custom is present but no URL follows it.

Suggested change
const url = idx !== -1 ? process.argv[idx + 1] : 'http://127.0.0.1:3301';
let url = 'http://127.0.0.1:3301';
if (idx !== -1) {
const customUrl = process.argv[idx + 1];
if (!customUrl || customUrl.startsWith('--')) {
throw new Error('--custom requires a URL argument');
}
url = customUrl;
}

Copilot uses AI. Check for mistakes.
@Keshoid Keshoid merged commit d1c07b9 into release/nodectl/v0.4.0 Apr 15, 2026
5 of 6 checks passed
@Keshoid Keshoid deleted the feature/sma-73-update-rest-api-docs-for-v040-endpoint-changes-and-bump branch April 15, 2026 22:12
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.

3 participants