feat: update code to work with new solana patch#7677
Conversation
|
| branch = "jeff/encoded-tx-2" | ||
| # tag = "hyperlane-1.14.13-2025-05-21" |
There was a problem hiding this 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.
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.|
Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthroughThis PR removes string payloads from Changes
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
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
rust/main/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (15)
rust/main/Cargo.tomlrust/sealevel/libraries/account-utils/src/discriminator.rsrust/sealevel/libraries/account-utils/src/lib.rsrust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rsrust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rsrust/sealevel/libraries/interchain-security-module-interface/src/lib.rsrust/sealevel/libraries/message-recipient-interface/src/lib.rsrust/sealevel/programs/helloworld/src/processor.rsrust/sealevel/programs/hyperlane-sealevel-igp/src/instruction.rsrust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rsrust/sealevel/programs/ism/test-ism/src/program.rsrust/sealevel/programs/mailbox/src/instruction.rsrust/sealevel/programs/mailbox/src/processor.rsrust/sealevel/programs/test-send-receiver/src/program.rsrust/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.rsrust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rsrust/sealevel/programs/helloworld/src/processor.rsrust/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.rsrust/sealevel/programs/mailbox/src/processor.rsrust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rsrust/sealevel/programs/ism/test-ism/src/program.rsrust/sealevel/libraries/hyperlane-sealevel-connection-client/src/lib.rsrust/sealevel/programs/helloworld/src/processor.rsrust/sealevel/libraries/interchain-security-module-interface/src/lib.rsrust/sealevel/libraries/message-recipient-interface/src/lib.rsrust/sealevel/programs/mailbox/src/instruction.rsrust/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.rsrust/sealevel/libraries/message-recipient-interface/src/lib.rsrust/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_datanow matches the newBorshIoErrorsignature.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
DiscriminatorEncodetrait now properly maps serialization errors to the unit-likeBorshIoErrorvariant.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_datamethod now constructsBorshIoErrorwithout 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
SimulationReturnDataserialization paths now use the updatedBorshIoErrorAPI 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
BorshIoErrorAPI.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
InterchainSecurityModuleInstructionimplementation now use the newBorshIoErrorAPI 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
BorshIoErrorconstruction. 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
BorshIoErrorwithout attaching the error string. Works as expected.
462-466: ISM return data handling looks solid.Both
inbox_get_recipient_ismandget_recipient_ismupdated 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_thresholdandget_ownerfollow 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::storemethod now constructsBorshIoErrorwithout the original error string. This is necessary for API compatibility, but it means when serialization fails (especially theWriteZerocase), 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
| [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" |
There was a problem hiding this comment.
🧩 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 -20Repository: 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 -100Repository: 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 2Repository: 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 1Repository: 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 -100Repository: 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.
There was a problem hiding this comment.
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-2branch. 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
⛔ Files ignored due to path filters (1)
rust/sealevel/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
rust/main/lander/src/adapter/chains/sealevel/adapter/tests/tests_common.rsrust/main/lander/tests/integration_sealevel.rsrust/sealevel/Cargo.tomlrust/sealevel/libraries/account-utils/src/discriminator.rsrust/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(_)toBorshIoErrormatches 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::BorshIoErroras a unit variant, which matches what Solana's got now. The_errnaming 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.
| [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" |
There was a problem hiding this comment.
🧩 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
fiRepository: 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 -20Repository: 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:
- Verify the branch is actually stable in your integration environment
- Coordinate a handoff: get a release tag created (e.g.,
hyperlane-1.14.13-tagged-release) - Swap the patches back to tag-based references
- 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.
🦀 Rust Agent Docker Image Built SuccessfullyImage Tags: |
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
Tests
✏️ 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-2branch. The primary change updatesProgramError::BorshIoErrorfrom accepting aStringparameter to being a unit variant.Key Changes:
tag = "hyperlane-1.14.13-2025-05-21"tobranch = "jeff/encoded-tx-2"inCargo.toml.map_err(|err| ProgramError::BorshIoError(err.to_string()))to.map_err(|_err| ProgramError::BorshIoError)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
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.jeff/encoded-tx-2branch is stable before merging, and consider creating a tagged release once changes are finalizedImportant Files Changed
jeff/encoded-tx-2branch (commented out previous tags)DiscriminatorEncodeto match newProgramError::BorshIoErrorsignature without string parameterAccountData::storeto match newProgramError::BorshIoErrorsignatureInterchainSecurityModuleInstructionencode/decode to match newProgramError::BorshIoErrorsignatureMessageRecipientInstructionencode/decode to match newProgramError::BorshIoErrorsignatureProgramError::BorshIoErrorsignatureSequence 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.)