Validate 'jup' and the configured signer when constructing SolanaWalletImpl #84

Closed
opened 2026-09-04 11:23:02 +02:00 by minimons · 0 comments
Owner

Background

Components constructed by Nenjim are expected to be operational when they are used later.

com.r35157.cryptowallet.solana.impl.ref.SolanaWalletImpl receives a wallet address and a signerKeyName. Transactions are subsequently signed using the external jup CLI.

Currently, this configuration is only validated when a transaction is signed. In production, the evelyn_burner_prod signer key was missing, which was discovered during a swap:

2026-09-04T10:19:45,944 ERROR com.fanitas.evelyn.service.burner.impl.ref.EvelynIOUBurnerServiceImpl - Evelyn IOU buyback swap may have an unknown outcome; later swaps are suspended: currencyId=c8669973-0045-468e-8b2b-781d06d123b2, failureType=java.io.IOException

The failure occurs too late and does not clearly identify the missing signer configuration.

Task

Extend the SolanaWalletImpl constructor so that it validates the following before the instance can be constructed and registered:

  1. The jup executable exists and can be executed.
  2. The installed jup version is compatible with the CLI calls made by SolanaWalletImpl.
  3. signerKeyName is available to jup.
  4. The address belonging to that signer key matches the wallet address supplied to the constructor.

Run jup --version to verify both that the executable can be started and which version is installed.

Define the expected jup version in the code and compare it with the reported version. A version mismatch must be handled explicitly by either failing construction or emitting a clear warning, so that an unverified CLI version cannot go unnoticed.

The configured keys and their addresses can, for example, be obtained using:

jup -f json keys list

If validation fails, construction must be aborted with a descriptive exception. The error must clearly identify whether:

  • jup could not be found or started;
  • jup --version failed or returned an invalid version;
  • the installed jup version is unsupported;
  • signerKeyName is unavailable;
  • or the signer address does not match the configured wallet address.

Include relevant information such as signerKeyName, expected version, actual version, expected address, actual address, exit code, and stderr where applicable. Private keys and other sensitive material must not be included.

The existing signer-address validation performed after signing should remain as a defence-in-depth check.

Acceptance criteria

  • Constructing SolanaWalletImpl runs jup --version.
  • The expected jup version is defined in the code.
  • The reported version is compared with the expected version.
  • A version mismatch either prevents construction or produces a clear warning. The selected behaviour is documented in the code.
  • Construction fails immediately with a descriptive exception if jup cannot be found, started, or executed successfully.
  • Construction fails immediately with a descriptive exception if signerKeyName is unavailable to jup.
  • Construction fails immediately with a descriptive exception if the signer key address differs from the configured wallet address.
  • Construction succeeds when jup is usable, the version check passes or is handled according to the selected policy, the signer key exists, and its address matches the wallet address.
  • Configuration errors are detected while Nenjim initializes its components, before any transaction is signed.
  • No unit tests are required as part of this issue.
## Background Components constructed by Nenjim are expected to be operational when they are used later. `com.r35157.cryptowallet.solana.impl.ref.SolanaWalletImpl` receives a wallet address and a `signerKeyName`. Transactions are subsequently signed using the external `jup` CLI. Currently, this configuration is only validated when a transaction is signed. In production, the `evelyn_burner_prod` signer key was missing, which was discovered during a swap: ```text 2026-09-04T10:19:45,944 ERROR com.fanitas.evelyn.service.burner.impl.ref.EvelynIOUBurnerServiceImpl - Evelyn IOU buyback swap may have an unknown outcome; later swaps are suspended: currencyId=c8669973-0045-468e-8b2b-781d06d123b2, failureType=java.io.IOException ``` The failure occurs too late and does not clearly identify the missing signer configuration. ## Task Extend the `SolanaWalletImpl` constructor so that it validates the following before the instance can be constructed and registered: 1. The `jup` executable exists and can be executed. 2. The installed `jup` version is compatible with the CLI calls made by `SolanaWalletImpl`. 3. `signerKeyName` is available to `jup`. 4. The address belonging to that signer key matches the wallet address supplied to the constructor. Run `jup --version` to verify both that the executable can be started and which version is installed. Define the expected `jup` version in the code and compare it with the reported version. A version mismatch must be handled explicitly by either failing construction or emitting a clear warning, so that an unverified CLI version cannot go unnoticed. The configured keys and their addresses can, for example, be obtained using: ```shell jup -f json keys list ``` If validation fails, construction must be aborted with a descriptive exception. The error must clearly identify whether: - `jup` could not be found or started; - `jup --version` failed or returned an invalid version; - the installed `jup` version is unsupported; - `signerKeyName` is unavailable; - or the signer address does not match the configured wallet address. Include relevant information such as `signerKeyName`, expected version, actual version, expected address, actual address, exit code, and stderr where applicable. Private keys and other sensitive material must not be included. The existing signer-address validation performed after signing should remain as a defence-in-depth check. ## Acceptance criteria - Constructing `SolanaWalletImpl` runs `jup --version`. - The expected `jup` version is defined in the code. - The reported version is compared with the expected version. - A version mismatch either prevents construction or produces a clear warning. The selected behaviour is documented in the code. - Construction fails immediately with a descriptive exception if `jup` cannot be found, started, or executed successfully. - Construction fails immediately with a descriptive exception if `signerKeyName` is unavailable to `jup`. - Construction fails immediately with a descriptive exception if the signer key address differs from the configured wallet address. - Construction succeeds when `jup` is usable, the version check passes or is handled according to the selected policy, the signer key exists, and its address matches the wallet address. - Configuration errors are detected while Nenjim initializes its components, before any transaction is signed. - No unit tests are required as part of this issue.
minimons added the enhancement label 2026-09-04 11:23:02 +02:00
minimons self-assigned this 2026-09-04 11:23:02 +02:00
minimons added this to the AssetAZ project 2026-09-04 11:23:02 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: r35157/com_r35157_nenjim-hubd-impl_ref#84