Skip to content

Solana CCTP miscellanous fixes #1102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 28, 2025
Merged

Solana CCTP miscellanous fixes #1102

merged 14 commits into from
Jul 28, 2025

Conversation

toblich
Copy link
Contributor

@toblich toblich commented Jul 23, 2025

Suggestion for reviewers: Look at the diff commit-by-commit, as they are all fairly atomic

@toblich toblich requested a review from PabloMansanet July 23, 2025 16:20
@toblich toblich requested a review from a team as a code owner July 23, 2025 16:20
Copy link

👋 toblich, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@toblich toblich requested a review from Copilot July 23, 2025 16:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR contains miscellaneous fixes for Solana CCTP implementation, focusing on improving clarity, correctness, and consistency across the codebase. The changes include documentation improvements, spelling corrections, error message fixes, code simplification, and parameter adjustments.

  • Documentation and comment clarity improvements for CCTP message transmission relationships
  • Spelling and grammatical corrections in error messages and comments
  • Code simplification and API consistency improvements for function parameters and return types
  • Removal of unused code and better validation of ownership transfer operations

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
chains/solana/gobindings/latest/cctp_token_pool/LockOrBurnTokens.go Updated documentation to clarify CCTP invocation relationships
chains/solana/gobindings/latest/ccip_offramp/types.go Renamed interface and types for better naming consistency
chains/solana/contracts/target/types/cctp_token_pool.ts Updated TypeScript type definitions to match Go binding changes
chains/solana/contracts/target/types/ccip_offramp.ts Updated TypeScript type definitions for renamed types
chains/solana/contracts/target/types/base_token_pool.ts Fixed spelling error in error message
chains/solana/contracts/target/idl/*.json Updated IDL files to reflect type and message changes
chains/solana/contracts/programs/rmn-remote/src/instructions/v1/admin.rs Added validation to prevent setting owner to default public key
chains/solana/contracts/programs/fee-quoter/src/instructions/v1/admin.rs Added validation to prevent setting owner to default public key
chains/solana/contracts/programs/example-ccip-sender/src/lib.rs Removed unnecessary cfg attribute
chains/solana/contracts/programs/example-ccip-sender/Cargo.toml Added proper lint configuration for cfg warnings
chains/solana/contracts/programs/cctp-token-pool/src/lib.rs Fixed typo in comment
chains/solana/contracts/programs/cctp-token-pool/src/context.rs Updated documentation and reorganized validation order
chains/solana/contracts/programs/ccip-router/src/state.rs Removed unused method from DeriveAccountsResponse
chains/solana/contracts/programs/ccip-router/src/instructions/v1/admin.rs Added validation to prevent setting owner to default public key
chains/solana/contracts/programs/ccip-offramp/src/state.rs Removed unused method from DeriveAccountsResponse
chains/solana/contracts/programs/ccip-offramp/src/instructions/v1/execute/derive.rs Renamed enum and updated all references
chains/solana/contracts/programs/ccip-offramp/src/instructions/v1/execute.rs Updated to use renamed enum and simplified iterator usage
chains/solana/contracts/programs/ccip-offramp/src/instructions/v1/admin.rs Added validation to prevent setting owner to default public key
chains/solana/contracts/programs/ccip-offramp/src/context.rs Removed unused parameters from instruction contexts
chains/solana/contracts/programs/ccip-common/src/v1.rs Refactored token admin registry loading for better maintainability
chains/solana/contracts/programs/ccip-common/src/lib.rs Added new struct and conversion for token admin registry v1
chains/solana/contracts/programs/base-token-pool/src/common.rs Fixed spelling errors in error messages and comments

@@ -272,29 +275,15 @@ fn load_v1_token_admin_registry(
);

require!(
TokenAdminRegistry::DISCRIMINATOR == data[..8],
TokenAdminRegistry::DISCRIMINATOR == data[..ANCHOR_DISCRIMINATOR_SIZE],
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a nit, and one that there's no need to act on now as it's pervasive on the codebase, but for situations like this in the future I think it's a bit cleaner to use split_at rather than using slice ranges.

mint: Pubkey::new_from_array(data[137..169].try_into().unwrap()),
supports_auto_derivation: false, // this is the field that is missing in v1, and it defaults to false
})
Ok(TokenAdminRegistry::try_from(token_admin_registry_v1)?)
Copy link
Contributor

Choose a reason for hiding this comment

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

Much much cleaner 👍

require_keys_neq!(
proposed_owner,
Pubkey::default(),
CcipRouterError::RedundantOwnerProposal
Copy link
Contributor

Choose a reason for hiding this comment

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

This error message is incorrect now. It doesn't seem like a big deal here, but the error string reads "Proposed owner is the current owner", which could be confusing in this context.

Copy link
Contributor

@PabloMansanet PabloMansanet left a comment

Choose a reason for hiding this comment

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

LGTM, just one error message change that I think needs to happen, but my other comments are minor thoughts.

@toblich toblich requested a review from PabloMansanet July 27, 2025 22:35
Copy link

Metric fix/solana-cctp-miscellaneous main
Coverage 70.1% 69.6%

@toblich toblich enabled auto-merge July 28, 2025 00:43
@toblich toblich added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit f398970 Jul 28, 2025
48 checks passed
@mateusz-sekara mateusz-sekara deleted the fix/solana-cctp-miscellaneous branch July 28, 2025 11:00
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.

3 participants