Skip to content

πŸ“ (signer-solana) [DSDK-1611]: Fix stale comments in the clear-sign code - #1991

Open
fAnselmi-Ledger wants to merge 2 commits into
refactor/dsdk-1608-remove-dead-code-from-tasksfrom
refactor/dsdk-1611-fix-stale-comments
Open

fAnselmi-Ledger wants to merge 2 commits into
refactor/dsdk-1608-remove-dead-code-from-tasksfrom
refactor/dsdk-1611-fix-stale-comments

Conversation

@fAnselmi-Ledger

@fAnselmi-Ledger fAnselmi-Ledger commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

πŸ“ Description

Fixes stale and misleading comments in the signer-solana clear-sign code. Comments and test titles only: no code changes. Stacked on #1990.

Wrong claim about the device

  • Three comments (buildRequirements.ts, model.ts and a buildRequirements test) said the device "signals 0x6d10" for ALT-backed mints and "requires TOKEN_INFO immediately after". In app-solana, 0x6d10 is ApduReplySolanaInvalidAltResolution ("Invalid ALT resolution descriptor"). handle_provide_alt_resolution.c returns it only to reject an ALT_RESOLUTION descriptor: bad TLV, wrong version, challenge mismatch, failed signature, or a full or duplicate ALT cache. It is never a request for TOKEN_INFO, and the host never reacts to it.
  • The replacement describes what the host does: the provide phase streams the ALT_RESOLUTION, then the resolved mint's TOKEN_INFO (best-effort, skipped when that mint was already streamed). The same goes for the "hold-and-conditionally-stream" wording in BuildGeneric: nothing is held back.

Docs that described the code wrongly

  • ProvideGeneric provideDescriptor: fatal failures abort by returning the failed result, not "by throwing". A test already asserts that run() does not reject.
  • ProvisionBasic class doc: there is no GetPubKey step and no transaction-check gate. The machine inspects when SPL is supported, then builds and provides for SPL or swap transactions.
  • loadCertificateIfPresent: not every provider needs this gate. TOKEN skips its whole descriptor without a certificate, and calls loadCertificate directly.
  • provideTokenAccountStateContext: the caller is ProvideGenericClearSignContextTask, not a "stream task".
  • poolFromJson / parsePool: both said "@throws never" but do throw TypePoolDecoderThrow. For poolFromJson, the doc now says that buildRequirements' catch-all turns the throw into a RequirementsDecodeError.
  • TypePoolDecoder: nothing checks cursorEnd, so the comment no longer says the "cursor-end check" catches unread bytes.
  • accountAltRefAt: "exactly one of the two answers" holds only for an in-range slot. Both are undefined out of range.
  • altResolutionRule: drops a changelog-style "now".

Old vocabulary

  • srfc39-only is never produced. BuildGeneric's mode doc says so, and the public ClearSignMode JSDoc gets "(not produced today)". The type itself is unchanged.
  • SignTransactionDeviceAction.test.ts: four "armed" / "alreadyArmed" test titles and two test comments now say "provisioned", and the header no longer mentions a "(delayed) terminal-sign machine". Only titles and comments change; no assertion is touched.

Left alone on purpose

  • The ProvideGeneric "shows ???" comments: which device behaviour is current is still an open firmware question.
  • The [SigningOps] log prefix: changing it would change a log.

❓ Context

βœ… Checklist

Pull Requests must pass CI checks and undergo code review. Set the PR as Draft if it is not yet ready for review.

  • Covered by automatic tests: no code change. The full suite passes unchanged, including the pinned timeline and golden tests.
  • Changeset is provided: patch for @ledgerhq/device-signer-kit-solana
  • Documentation is up-to-date
  • Impact of the changes:
    • Comments and test titles only. tsc, vitest and Prettier are green on signer-solana.
    • Nothing for QA to check.

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.

πŸ€– Generated with Claude Code

@vercel

vercel Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
device-sdk-ts-sample Ready Ready Preview Oct 23, 2026 3:42pm UTC
doc-device-management-kit Ready Ready Preview Oct 23, 2026 3:42pm UTC

Request Review

@fAnselmi-Ledger
fAnselmi-Ledger added this pull request to stack #1985 October 14, 2026 09:11
@fAnselmi-Ledger fAnselmi-Ledger changed the title πŸ“ (signer-solana): Fix stale comments in the clear-sign code πŸ“ (signer-solana) [DSDK-1611]: Fix stale comments in the clear-sign code Oct 14, 2026
@fAnselmi-Ledger
fAnselmi-Ledger marked this pull request as ready for review October 14, 2026 09:14
@fAnselmi-Ledger
fAnselmi-Ledger requested a review from a team as a code owner October 14, 2026 09:14
Copilot AI balanced review requested due to automatic review settings October 14, 2026 09:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟒 Approval recommended

The documentation-only updates accurately reflect the inspected implementation and introduce no unresolved issues.

0 open findings

What changed in this PR

Updates stale Solana clear-sign documentation and test titles without changing runtime behavior.

Changes:

  • Corrects descriptor provisioning, ALT resolution, and decoder documentation.
  • Clarifies clear-sign modes and basic provisioning behavior.
  • Replaces outdated β€œarmed” terminology with β€œprovisioned.”
File Description
.changeset/​rumbling-red-keys.md Adds the signer-solana patch changeset.
ProvideGenericClearSignContextTask.ts Corrects fatal-failure behavior documentation.
provideTokenAccountStateContext.ts Names the actual caller.
loadCertificate.ts Clarifies optional-certificate handling.
BuildGenericClearSignContextTask.ts Corrects ALT mint and mode documentation.
SignTransactionDeviceAction.test.ts Updates terminology in test titles and comments.
ProvisionBasicClearSignDeviceAction.ts Corrects the provisioning workflow description.
valueResolution.ts Documents out-of-range lookup behavior.
altResolutionRule.ts Removes changelog-style wording.
model.ts Corrects ALT-backed mint behavior documentation.
buildRequirements.ts Corrects mint requirement comments.
buildRequirements.test.ts Updates the corresponding test comment.
TypePoolDecoder.ts Corrects unread-payload behavior documentation.
poolFromJson.ts Documents thrown decoder errors and conversion.
parsePool.ts Corrects the function’s throw contract.
SignTransactionDeviceActionTypes.ts Notes that srfc39-only is not currently produced.

🧠 Review effort: Balanced


πŸ’‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Danger Check Results

Messages

βœ…

Danger: All checks passed successfully! πŸŽ‰

Generated by 🚫 dangerJS against 0ac309c

@sonarqubecloud

Copy link
Copy Markdown

This branch was successfully deployed

2 active deployments
Preview – device-sdk-ts-sample β€” 0ac309c5 Deployed Oct 23, 2026 by vercel[bot]
Preview – doc-device-management-kit β€” 0ac309c5 Deployed Oct 23, 2026 by vercel[bot]
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.

2 participants