Skip to content

fix(wasm-solana): validate Jito intents before key generation - #401

Draft
ralph-bitgo[bot] wants to merge 5 commits into
masterfrom
wcn-1886-jito-stake-validation
Draft

ralph-bitgo[bot] wants to merge 5 commits into
masterfrom
wcn-1886-jito-stake-validation

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

What

  • Reject JITO stake and unstake intents without stakePoolConfig before they can fall through to native instruction builders.
  • Require Jito configuration in the TypeScript intent types and add missing, incomplete, valid Jito, and native-path regressions.
  • Validate all Jito unstake account fields before generating stake-account and transfer-authority keypairs, preserving field-specific errors without generating keys for invalid configuration.

Why

  • An explicit JITO request must not silently switch to native staking or deactivation when pool metadata is absent. Failing closed prevents protocol-misbinding at the intent-builder boundary; validating all fields first also avoids key-generation side effects for malformed pool metadata.

Test plan

  • Added Rust missing-configuration unit tests and public buildFromIntent regressions for both Jito operations, including incomplete-config field errors.
  • Local tests not run: this workspace lacks Cargo/Rust, Node/npm, generated WASM/dist artifacts, and package dependencies. The latest Build and Test run passed, including formatting, Rust tests, and wasm-solana unit tests.

Ticket: WCN-1886

Reject JITO stake and unstake intents without stakePoolConfig instead
of allowing them to produce native Solana operations. Require the
configuration in the TypeScript intent union and test both protocol
paths through the public intent builder.

This prevents explicit Jito requests from silently changing protocols.

Ticket: WCN-1886
Session-Id: 76b47acc-4819-46b2-9c75-deeed43d65a9
Task-Id: 3149eea2-6c79-4b21-a55e-d5e05a4eac7f
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1886-jito-stake-validation branch from b7b2c29 to 31afd67 Compare September 24, 2026 01:04
@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

WCN-1886

Validate all Jito unstake account fields before generating the output
stake and transfer-authority keypairs. This preserves field-specific
errors while ensuring malformed pool metadata has no key-generation
side effects.

Ticket: WCN-1886
Session-Id: 76b47acc-4819-46b2-9c75-deeed43d65a9
Task-Id: 3149eea2-6c79-4b21-a55e-d5e05a4eac7f
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1886-jito-stake-validation branch from e5c64b3 to 202b03c Compare September 24, 2026 01:05
@ralph-bitgo ralph-bitgo Bot changed the title fix(wasm-solana): require configuration for Jito staking fix(wasm-solana): validate Jito intents before key generation Sep 24, 2026
Remove empty lines after the Jito describe declarations to satisfy
the repository's source formatting check.

Ticket: WCN-1886
Session-Id: 76b47acc-4819-46b2-9c75-deeed43d65a9
Task-Id: 3149eea2-6c79-4b21-a55e-d5e05a4eac7f
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1886-jito-stake-validation branch from cb6a28f to ad975e8 Compare September 24, 2026 01:12
Collapse short Jito parser assertions while keeping long assertions
wrapped at the configured print width. This matches the package's
Prettier check.

Ticket: WCN-1886
Session-Id: 76b47acc-4819-46b2-9c75-deeed43d65a9
Task-Id: 3149eea2-6c79-4b21-a55e-d5e05a4eac7f
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1886-jito-stake-validation branch from 506bd16 to 54d8bdf Compare September 24, 2026 01:21
Match rustfmt's layout for the Jito configuration conditional.
This keeps the wasm-solana source formatting check passing.

Ticket: WCN-1886
Session-Id: 76b47acc-4819-46b2-9c75-deeed43d65a9
Task-Id: 3149eea2-6c79-4b21-a55e-d5e05a4eac7f
@ralph-bitgo
ralph-bitgo Bot force-pushed the wcn-1886-jito-stake-validation branch from 1b7b40b to e7e8734 Compare September 24, 2026 01:28

This branch has not been deployed

No deployments
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.

1 participant