Skip to content

feat: update code to work with new solana patch#7677

Open
kamiyaa wants to merge 3 commits intomainfrom
jeff/sealevel-fix
Open

feat: update code to work with new solana patch#7677
kamiyaa wants to merge 3 commits intomainfrom
jeff/sealevel-fix

Conversation

@kamiyaa
Copy link
Copy Markdown
Contributor

@kamiyaa kamiyaa commented Dec 30, 2025

Description

Related PR: hyperlane-xyz/solana#6
We need to merge this PR first, then update the dependencies for this PR

This PR updates the codebase to work with the new patch made in the solana package.

Summary by CodeRabbit

  • Refactor

    • Updated Solana crate resolution to use a development branch instead of pinned tags.
    • Simplified error payloads across many components so Borsh I/O errors no longer include original error text.
  • Tests

    • Adjusted test fixtures and assertions to reflect the reduced Borsh error payload and removed an explicit embedded transaction success status.

✏️ Tip: You can customize this high-level summary in your review settings.

Greptile Summary

This PR adapts the Hyperlane Sealevel codebase to work with API changes from the new Solana patch in the jeff/encoded-tx-2 branch. The primary change updates ProgramError::BorshIoError from accepting a String parameter to being a unit variant.

Key Changes:

  • Switched all Solana dependency patches from tag = "hyperlane-1.14.13-2025-05-21" to branch = "jeff/encoded-tx-2" in Cargo.toml
  • Updated 40+ error handling callsites from .map_err(|err| ProgramError::BorshIoError(err.to_string())) to .map_err(|_err| ProgramError::BorshIoError)
  • Changes span libraries (account-utils, hyperlane-sealevel-token, interface traits) and programs (mailbox, igp, multisig ISM, validator-announce, test programs)

The changes are mechanical and consistent - replacing the old error construction pattern everywhere it appeared. All affected code involves Borsh serialization error handling when encoding/decoding instructions and return data.

Confidence Score: 4/5

  • Safe to merge once the Solana dependency branch is stable and tested
  • The changes are mechanical API updates applied consistently across the codebase. All modifications follow the same pattern of removing the string parameter from ProgramError::BorshIoError. The score is 4 rather than 5 because: (1) the Solana dependency uses a development branch rather than a tagged release, which introduces some uncertainty about stability, and (2) there's no evidence in this PR of compilation testing or integration tests being run to verify the changes work correctly with the new Solana patch.
  • rust/main/Cargo.toml requires attention - verify the jeff/encoded-tx-2 branch is stable before merging, and consider creating a tagged release once changes are finalized

Important Files Changed

Filename Overview
rust/main/Cargo.toml Updated Solana dependency patches from tagged release to jeff/encoded-tx-2 branch (commented out previous tags)
rust/sealevel/libraries/account-utils/src/discriminator.rs Updated error handling in DiscriminatorEncode to match new ProgramError::BorshIoError signature without string parameter
rust/sealevel/libraries/account-utils/src/lib.rs Updated error handling in AccountData::store to match new ProgramError::BorshIoError signature
rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs Updated error handling in InterchainSecurityModuleInstruction encode/decode to match new ProgramError::BorshIoError signature
rust/sealevel/libraries/message-recipient-interface/src/lib.rs Updated error handling in MessageRecipientInstruction encode/decode to match new ProgramError::BorshIoError signature
rust/sealevel/programs/mailbox/src/processor.rs Updated error handling across multiple mailbox processor functions to match new ProgramError::BorshIoError signature

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Solana as Solana Fork (jeff/encoded-tx-2)
    participant ProgramError as ProgramError::BorshIoError
    participant Codebase as Hyperlane Sealevel Code

    Dev->>Solana: Update to new branch with API changes
    Solana-->>ProgramError: Change signature (no String param)
    
    Note over Codebase: Update all error handling callsites
    
    Codebase->>ProgramError: Old: .map_err(|err| ProgramError::BorshIoError(err.to_string()))
    ProgramError-->>Codebase: Error: wrong signature
    
    Codebase->>ProgramError: New: .map_err(|_err| ProgramError::BorshIoError)
    ProgramError-->>Codebase: Success: compiles correctly
    
    Note over Codebase: Changes applied across:<br/>- Libraries (account-utils, interfaces)<br/>- Programs (mailbox, ISM, IGP, etc.)
Loading

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 30, 2025

⚠️ No Changeset found

Latest commit: 2a5dcdd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

15 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +304 to +305
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
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.

style: Consider using a tagged release instead of branch = "jeff/encoded-tx-2" once the changes are stable. Branch references can change unexpectedly and make builds non-reproducible.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: rust/main/Cargo.toml
Line: 304:305

Comment:
**style:** Consider using a tagged release instead of `branch = "jeff/encoded-tx-2"` once the changes are stable. Branch references can change unexpectedly and make builds non-reproducible.

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 30, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR removes string payloads from ProgramError::BorshIoError constructions across sealevel libraries and programs and switches several Solana crate patches from pinned tags to a branch (jeff/encoded-tx-2) in Cargo manifests; it also updates tests/fixtures to match the new, payload-less error shapes and a removed UiTransactionStatusMeta field.

Changes

Cohort / File(s) Summary
Top-level & Sealevel Manifests
rust/main/Cargo.toml, rust/sealevel/Cargo.toml
Replace pinned tag-based patches with branch-based patch (jeff/encoded-tx-2) for multiple solana-* crates while preserving =1.14.13 version declarations; commented old tag lines remain.
Core libraries (error mapping)
rust/sealevel/libraries/...
\rust/sealevel/libraries/account-utils/src/discriminator.rs`, `rust/sealevel/libraries/account-utils/src/lib.rs`, `rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs`, `rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs`, `rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs`, `rust/sealevel/libraries/message-recipient-interface/src/lib.rs``
Standardize error mapping to drop .to_string() payloads: change `map_err(
Programs (instruction/processor error handling)
rust/sealevel/programs/...
\rust/sealevel/programs/helloworld/src/processor.rs`, `rust/sealevel/programs/hyperlane-sealevel-igp/src/instruction.rs`, `rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs`, `rust/sealevel/programs/ism/test-ism/src/program.rs`, `rust/sealevel/programs/mailbox/src/instruction.rs`, `rust/sealevel/programs/mailbox/src/processor.rs`, `rust/sealevel/programs/test-send-receiver/src/program.rs`, `rust/sealevel/programs/validator-announce/src/instruction.rs``
Apply same Borsh error payload removal across instruction serialization/deserialization and processor return-data paths; unchanged success paths and control flow.
Tests & Fixtures
rust/main/lander/src/adapter/chains/sealevel/adapter/tests/tests_common.rs, rust/main/lander/tests/integration_sealevel.rs, rust/sealevel/programs/mailbox-test/src/functional.rs
Update fixtures to drop the status field from UiTransactionStatusMeta and adjust assertions to expect BorshIoError without inner payload (pattern-match without inner value).

Sequence Diagram(s)

(omitted — changes are refactors of error construction and dependency patch targets, not new multi-component control flows)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ameten
  • yjamin

Poem

Layers peeled, the errors turn plain and lean,
Borsh lost its babble, now tidy and clean.
Branches point forward where tags once did cling,
Tests trimmed and waiting — tidy little thing.
A quiet tidy swamp — code’s neat as a string. 🧅

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description covers main points but lacks detail on testing and backward compatibility. It references a related PR and explains the API change pattern but doesn't fully address template sections. Add explicit information about testing performed (unit tests, integration tests, compilation verification) and confirm backward compatibility impact of the API changes from the Solana patch.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating code to work with a new Solana patch. It directly relates to the primary objective of adapting the codebase to API changes in the jeff/encoded-tx-2 branch.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jeff/sealevel-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dee2a40 and 649df89.

⛔ Files ignored due to path filters (1)
  • rust/main/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • rust/main/Cargo.toml
  • rust/sealevel/libraries/account-utils/src/discriminator.rs
  • rust/sealevel/libraries/account-utils/src/lib.rs
  • rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs
  • rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs
  • rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs
  • rust/sealevel/libraries/message-recipient-interface/src/lib.rs
  • rust/sealevel/programs/helloworld/src/processor.rs
  • rust/sealevel/programs/hyperlane-sealevel-igp/src/instruction.rs
  • rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs
  • rust/sealevel/programs/ism/test-ism/src/program.rs
  • rust/sealevel/programs/mailbox/src/instruction.rs
  • rust/sealevel/programs/mailbox/src/processor.rs
  • rust/sealevel/programs/test-send-receiver/src/program.rs
  • rust/sealevel/programs/validator-announce/src/instruction.rs
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/mainnet_config.json in future code reviews as requested by paulbalaji.
📚 Learning: 2025-11-20T12:20:42.691Z
Learnt from: yjamin
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7414
File: rust/main/chains/hyperlane-aleo/src/provider/traits.rs:252-0
Timestamp: 2025-11-20T12:20:42.691Z
Learning: In rust/main/chains/hyperlane-aleo/src/provider/traits.rs, the `get_state_paths_for_commitments` and `get_state_paths_for_commitments_async` methods intentionally use `.unwrap_or_default()` to return an empty Vec on any error. This behavior matches SnarkVM's internal QueryTrait implementation and should not be changed to propagate errors.

Applied to files:

  • rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs
  • rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs
  • rust/sealevel/programs/helloworld/src/processor.rs
  • rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs
📚 Learning: 2025-11-26T16:06:32.569Z
Learnt from: yjamin
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7444
File: rust/main/chains/hyperlane-aleo/src/mailbox.rs:145-157
Timestamp: 2025-11-26T16:06:32.569Z
Learning: In rust/main/chains/hyperlane-aleo/src/mailbox.rs, the `delivered()` method intentionally treats all errors from `get_mapping_value("deliveries", &key)` as "not delivered" (returning `Ok(false)`), and the `recipient_ism()` method intentionally falls back to `default_ism()` on any error from the `app_metadata` lookup. This error-swallowing behavior is by design and should not be changed to propagate errors.

Applied to files:

  • rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs
  • rust/sealevel/programs/mailbox/src/processor.rs
  • rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs
  • rust/sealevel/programs/ism/test-ism/src/program.rs
  • rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs
  • rust/sealevel/programs/helloworld/src/processor.rs
  • rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs
  • rust/sealevel/libraries/message-recipient-interface/src/lib.rs
  • rust/sealevel/programs/mailbox/src/instruction.rs
  • rust/sealevel/programs/test-send-receiver/src/program.rs
📚 Learning: 2025-11-19T15:18:17.559Z
Learnt from: kamiyaa
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7372
File: rust/main/agents/relayer/src/server/evm/nonce/set_upper_nonce.rs:46-63
Timestamp: 2025-11-19T15:18:17.559Z
Learning: The `/evm/set_upper_nonce` endpoint in `rust/main/agents/relayer/src/server/evm/nonce/set_upper_nonce.rs` is used for internal purposes only, so detailed error messages in HTTP responses are acceptable.

Applied to files:

  • rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs
📚 Learning: 2025-11-05T22:31:24.038Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7319
File: typescript/infra/src/utils/sealevel.ts:788-791
Timestamp: 2025-11-05T22:31:24.038Z
Learning: In Hyperlane's Sealevel/Solana programs, the PROGRAM_INSTRUCTION_DISCRIMINATOR constant is intentionally defined as [1, 1, 1, 1, 1, 1, 1, 1] (eight bytes of 0x01) in rust/sealevel/libraries/account-utils/src/discriminator.rs. This is the actual discriminator value used by multisig-ism-message-id and other programs, not a placeholder. TypeScript code should use Buffer.from([1, 1, 1, 1, 1, 1, 1, 1]) to match this constant.

Applied to files:

  • rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs
  • rust/sealevel/libraries/message-recipient-interface/src/lib.rs
  • rust/sealevel/libraries/account-utils/src/discriminator.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (67)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (status)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: pnpm-test-run
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: Greptile Review
  • GitHub Check: e2e-matrix (starknet)
  • GitHub Check: e2e-matrix (cosmwasm)
  • GitHub Check: e2e-matrix (cosmosnative)
  • GitHub Check: e2e-matrix (sealevel)
  • GitHub Check: e2e-matrix (radix)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: lint-rs
  • GitHub Check: test-rs
  • GitHub Check: lander-coverage
🔇 Additional comments (18)
rust/sealevel/programs/helloworld/src/processor.rs (1)

462-466: Error handling updated to match upstream API change.

Both error mappings correctly drop the error string payload when constructing BorshIoError, aligning with the new Solana patch API.

Also applies to: 483-485

rust/sealevel/programs/hyperlane-sealevel-igp/src/instruction.rs (1)

51-53: Properly updated for upstream API.

The serialization error handling in into_instruction_data now matches the new BorshIoError signature.

rust/sealevel/programs/validator-announce/src/instruction.rs (1)

30-32: Instruction serialization updated correctly.

The error mapping follows the same pattern as other instruction modules, removing the error string from BorshIoError.

rust/sealevel/libraries/account-utils/src/discriminator.rs (1)

108-117: Discriminator encoding error handling updated.

The DiscriminatorEncode trait now properly maps serialization errors to the unit-like BorshIoError variant.

rust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rs (1)

20-27: Error mapping updated in trait method.

The set_interchain_security_module_return_data method now constructs BorshIoError without the error string. The subsequent .unwrap() behavior remains unchanged.

rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs (1)

613-616: Return data serialization error handling updated.

Both SimulationReturnData serialization paths now use the updated BorshIoError API without error string payloads.

Also applies to: 784-787

rust/sealevel/programs/mailbox/src/instruction.rs (1)

52-54: Mailbox instruction serialization updated.

The core mailbox instruction serialization now uses the new BorshIoError API.

rust/sealevel/libraries/interchain-security-module-interface/src/lib.rs (1)

51-76: ISM instruction encoding/decoding updated.

All serialization and deserialization paths in the InterchainSecurityModuleInstruction implementation now use the new BorshIoError API consistently.

Also applies to: 78-97

rust/sealevel/libraries/message-recipient-interface/src/lib.rs (2)

98-103: LGTM - Error handling updated for API compatibility.

The changes here remove the error string payload from BorshIoError construction. This aligns with the upstream Solana patch you're integrating. The error propagation still works fine, just without the extra detail.

Also applies to: 105-111


128-136: Decode paths updated consistently.

Same pattern applied to deserialization - error mapping simplified to match the new API. All good.

rust/sealevel/programs/mailbox/src/processor.rs (3)

382-385: Store operation updated for new error API.

The inbox store now propagates BorshIoError without attaching the error string. Works as expected.


462-466: ISM return data handling looks solid.

Both inbox_get_recipient_ism and get_recipient_ism updated consistently to use the simplified error construction.

Also applies to: 500-503


753-756: Getter functions updated uniformly.

All the outbox and owner getters now use the unit-like BorshIoError. The pattern's consistent throughout.

Also applies to: 789-792, 817-820, 839-842

rust/sealevel/programs/test-send-receiver/src/program.rs (1)

406-413: Test program updated to match the new API.

Both return data serialization points now use the simplified BorshIoError. Since this is test code, the loss of error detail strings won't impact production debugging.

Also applies to: 449-463

rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs (2)

86-92: ISM instruction handlers updated properly.

The Type, VerifyAccountMetas, and ValidatorsAndThresholdAccountMetas instructions all handle the new error API correctly.

Also applies to: 111-114, 146-149


300-303: Getter methods consistent with the rest.

Both get_validators_and_threshold and get_owner follow the same pattern - return data wrapped in SimulationReturnData with simplified error handling.

Also applies to: 471-474

rust/sealevel/libraries/account-utils/src/lib.rs (1)

99-139: Store method updated, but error detail is lost.

The AccountData::store method now constructs BorshIoError without the original error string. This is necessary for API compatibility, but it means when serialization fails (especially the WriteZero case), you won't see what went wrong.

Since this is a widely-used utility library, debugging serialization issues might be trickier. The control flow's still correct though - errors still propagate properly.

rust/sealevel/programs/ism/test-ism/src/program.rs (1)

82-89: Test ISM updated to match API changes.

Both return data paths now use the simplified error construction. Looks good for a test program.

Also applies to: 189-192

Comment on lines 302 to 348
[patch.crates-io.solana-account-decoder]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-clap-utils]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-cli-config]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-client]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-program]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-sdk]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-transaction-status]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-zk-token-sdk]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"
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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Verify the Solana fork branch exists
curl -s "https://api.github.com/repos/hyperlane-xyz/solana/branches/jeff/encoded-tx-2" | jq -r '.name, .commit.sha, .commit.commit.message' 2>/dev/null | head -20

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 193


🏁 Script executed:

# Search for BorshIoError in the rust codebase to understand the changes
rg "BorshIoError" rust/ -A 2 -B 2 | head -100

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 7768


🏁 Script executed:

# Look at Cargo.toml to understand the full context of Solana patches
cat -n rust/main/Cargo.toml | sed -n '295,355p'

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 2253


🏁 Script executed:

# Search for any references to upstream merge plans, PR discussions, or future plans
rg -i "upstream|merge.*branch|pr.*1\.14|solana.*upstream" rust/ --type md --type txt -B 2 -A 2

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 58


🏁 Script executed:

# Check if there are any comments or TODOs related to this branch or API change
rg -i "jeff/encoded|BorshError.*plan|TODO.*solana|FIXME.*upstream" rust/ -B 1 -A 1

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 2537


🏁 Script executed:

# Look at the main Cargo.toml comment section to see if there's any explanation
head -350 rust/main/Cargo.toml | tail -100

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 2895


The Solana branch check passes, but there's no documented plan for upstream.

Good news: the jeff/encoded-tx-2 branch exists (commit 88288713965aca854f6caa50136ed705f71f8660) and the commit message itself is "feat: remove deprecated field and remove BorshError string"—exactly what you'd expect.

The ProgramError::BorshIoError change is real too. Throughout the sealevel programs (validator-announce, mailbox, ism modules), it's consistently used as a unit variant without string arguments, matching the API change in the branch.

The gap: there's no documented upstream merge strategy anywhere in the codebase. No TODOs, no comments about when or if this gets upstreamed to Solana proper. The commented-out tag (# tag = "hyperlane-1.14.13-2025-05-21") suggests you had a release path once, but right now this is a custom fork dependency with layers of reliance. Before merging, your team should clarify the long-term plan—whether this stays as a branch dependency indefinitely, waits for Solana to adopt similar changes, or something else entirely.

🤖 Prompt for AI Agents
rust/main/Cargo.toml around lines 302-348: the patch entries point to a
fork/branch (jeff/encoded-tx-2) with no documented upstreaming plan; add a
short, explicit note in the repo (preferably in Cargo.toml near these patches
and in CONTRIBUTING or DEPENDENCIES.md) stating the intended strategy (stay
forked indefinitely, upstream to Solana and track a PR/merge timeline, or pin to
a release tag), include the commit hash and rationale, assign an owner and
target milestone or issue/PR link for tracking, and update the commented tag or
replace it with an explicit TODO and link so future maintainers know how and
when this will be reconciled with upstream.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
rust/sealevel/libraries/account-utils/src/discriminator.rs (1)

1-7: Verify the Solana branch dependency is stable.

This file looks fine, but the PR switches Solana dependencies from a pinned tag to the jeff/encoded-tx-2 branch. Branches can shift under your feet, so make sure that branch is stable before merging—or better yet, switch back to a tagged release once it's available.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 649df89 and 2a5dcdd.

⛔ Files ignored due to path filters (1)
  • rust/sealevel/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • rust/main/lander/src/adapter/chains/sealevel/adapter/tests/tests_common.rs
  • rust/main/lander/tests/integration_sealevel.rs
  • rust/sealevel/Cargo.toml
  • rust/sealevel/libraries/account-utils/src/discriminator.rs
  • rust/sealevel/programs/mailbox-test/src/functional.rs
💤 Files with no reviewable changes (2)
  • rust/main/lander/src/adapter/chains/sealevel/adapter/tests/tests_common.rs
  • rust/main/lander/tests/integration_sealevel.rs
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/mainnet_config.json in future code reviews as requested by paulbalaji.
📚 Learning: 2025-11-05T22:31:24.038Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7319
File: typescript/infra/src/utils/sealevel.ts:788-791
Timestamp: 2025-11-05T22:31:24.038Z
Learning: In Hyperlane's Sealevel/Solana programs, the PROGRAM_INSTRUCTION_DISCRIMINATOR constant is intentionally defined as [1, 1, 1, 1, 1, 1, 1, 1] (eight bytes of 0x01) in rust/sealevel/libraries/account-utils/src/discriminator.rs. This is the actual discriminator value used by multisig-ism-message-id and other programs, not a placeholder. TypeScript code should use Buffer.from([1, 1, 1, 1, 1, 1, 1, 1]) to match this constant.

Applied to files:

  • rust/sealevel/libraries/account-utils/src/discriminator.rs
📚 Learning: 2025-11-26T16:06:32.569Z
Learnt from: yjamin
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7444
File: rust/main/chains/hyperlane-aleo/src/mailbox.rs:145-157
Timestamp: 2025-11-26T16:06:32.569Z
Learning: In rust/main/chains/hyperlane-aleo/src/mailbox.rs, the `delivered()` method intentionally treats all errors from `get_mapping_value("deliveries", &key)` as "not delivered" (returning `Ok(false)`), and the `recipient_ism()` method intentionally falls back to `default_ism()` on any error from the `app_metadata` lookup. This error-swallowing behavior is by design and should not be changed to propagate errors.

Applied to files:

  • rust/sealevel/programs/mailbox-test/src/functional.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (65)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (status)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: pnpm-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: e2e-matrix (cosmwasm)
  • GitHub Check: e2e-matrix (radix)
  • GitHub Check: e2e-matrix (sealevel)
  • GitHub Check: e2e-matrix (starknet)
  • GitHub Check: e2e-matrix (cosmosnative)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: lint-rs
  • GitHub Check: lander-coverage
  • GitHub Check: test-rs
🔇 Additional comments (2)
rust/sealevel/programs/mailbox-test/src/functional.rs (1)

855-860: Error pattern updated correctly.

The change from BorshIoError(_) to BorshIoError matches the new API where this variant no longer carries a string payload. The test logic is solid—it still validates that malformatted recipient ISM data triggers the right error type.

rust/sealevel/libraries/account-utils/src/discriminator.rs (1)

108-118: Code change is sound—adapts correctly to the upstream API shift.

The error mapping now returns ProgramError::BorshIoError as a unit variant, which matches what Solana's got now. The _err naming follows the Rust convention for unused values, so that's tidy.

Fair point about losing the err.to_string() diagnostic bits—that's the price you pay when upstream changes the API shape. Can't get blood from a stone, as they say.

The tests at lines 137-167 exercise the serialization paths that feed into this, so they should catch anything amiss. Give 'em a run to make sure everything still works as expected.

Comment on lines 259 to 317
[patch.crates-io.solana-account-decoder]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-banks-client]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-clap-utils]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-cli-config]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-client]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-program]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-program-test]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-sdk]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-transaction-status]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"

[patch.crates-io.solana-zk-token-sdk]
git = "https://github.com/hyperlane-xyz/solana.git"
tag = "hyperlane-1.14.13-2025-05-21"
branch = "jeff/encoded-tx-2"
# tag = "hyperlane-1.14.13-2025-05-21"
version = "=1.14.13"
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's verify the Cargo.toml file and its patches
if [ -f "rust/sealevel/Cargo.toml" ]; then
  echo "=== Cargo.toml exists, checking patch section ==="
  sed -n '259,317p' rust/sealevel/Cargo.toml
else
  echo "File not found at expected path"
  find . -name "Cargo.toml" -path "*/sealevel/*" 2>/dev/null | head -5
fi

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 1909


🏁 Script executed:

#!/bin/bash
# Check if there's any git history or comments explaining these changes
cd rust/sealevel 2>/dev/null || cd . 
if [ -d ".git" ]; then
  echo "=== Recent commits touching Cargo.toml ==="
  git log --oneline -20 -- Cargo.toml 2>/dev/null | head -10
else
  echo "Not in git repo or no git history available"
fi

# Look for any documentation about this patch
echo ""
echo "=== Checking for docs/comments about solana patches ==="
rg "jeff/encoded-tx-2|hyperlane.*solana" --type toml --type md --type txt 2>/dev/null | head -20

Repository: hyperlane-xyz/hyperlane-monorepo

Length of output: 1206


🌐 Web query:

hyperlane-xyz solana fork jeff/encoded-tx-2 branch PR #6 status

💡 Result:

I couldn't find a PR #6 for a branch named jeff/encoded-tx-2 in the public hyperlane-xyz repositories. I searched the hyperlane monorepo and general GitHub results and found no matching branch or pull request. [1][2]

Please paste the repository URL (or the PR link) or confirm the exact GitHub repo name/user and I’ll check the PR status.

Sources:

  • hyperlane-xyz/hyperlane-monorepo (GitHub). [1]
  • General web/GitHub search (no results for "encoded-tx-2" / "jeff/encoded-tx-2"). [2]

Branch references in Cargo patches—this one's got layers, and not the good kind.

You've got all 10 of those Solana crates patched to a branch (jeff/encoded-tx-2) instead of a tag. Thing is, branches move around. What you lock in today won't be what you pull tomorrow, even with Cargo.lock sitting right there. That's a reproducibility problem—like trying to nail down fog.

The real issues:

  • Builds aren't reproducible: Branch HEADs float. Same manifest, potentially different code over time.
  • Supply chain risk: Branches are mutable in ways tags aren't. You're trusting a moving target.
  • Friction down the line: Harder to audit what actually got compiled when you need to know.

I get why you're doing this—you're working with patches on a fork while things stabilize. But this shouldn't hang around. Once that branch is stable and tested, you need a plan: either get a proper immutable tag created on the fork, or work with the upstream maintainers to get the changes merged and tagged there.

What you should do:

  1. Verify the branch is actually stable in your integration environment
  2. Coordinate a handoff: get a release tag created (e.g., hyperlane-1.14.13-tagged-release)
  3. Swap the patches back to tag-based references
  4. Clean up those commented-out old tags

What's the timeline on getting these changes locked down with a proper tag? Worth tracking so this doesn't become the permanent solution.

🤖 Prompt for AI Agents
In rust/sealevel/Cargo.toml around lines 259 to 317, the Cargo [patch.crates-io]
entries point all Solana crates at the mutable branch "jeff/encoded-tx-2" which
breaks reproducible builds and increases supply-chain risk; replace each
git+branch reference with an immutable git tag (or commit SHA) once the branch
is stabilized or a release tag is created, coordinate with the fork
owner/upstream to create a proper tag (e.g., hyperlane-1.14.13-<release>) and
then update each [patch.crates-io.*] entry to use that tag (or the specific
commit SHA) and remove the commented-out old tag lines so the manifest
references immutable sources only.

@hyper-gonk
Copy link
Copy Markdown
Contributor

hyper-gonk bot commented Jan 2, 2026

🦀 Rust Agent Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-agent:pr-7677
gcr.io/abacus-labs-dev/hyperlane-agent:2a5dcdd-20260102-165942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant