Skip to content

Conversation

isi8787
Copy link
Collaborator

@isi8787 isi8787 commented Oct 8, 2025

why?

Updating solana/cli to work with current version of solana programs on main

  • ...
  • Task: ?

how?

  • ...

testing

  • ...

Note

Modernizes Solana CLI, programs integration, and docs: switch to --chain, add decimal amount parsing and new authority/minter params, update gateway verification flow, refresh dependencies, and prune Solana devnet-5 config entries.

  • CLI/Config:
    • Rename chain_id to chain across config/CLI; update JSON writes/reads to use chains[chain].
    • Remove --chain-id from docs/commands; add --signer-keys for gas-service init.
    • Prune solana-5 entries from devnet-amplifier.json and related Axelar Solana contract mappings.
  • ITS Enhancements:
    • Support decimal string amounts via parse_decimal_string_to_raw_units (with tests) using mint decimals for SPL/Token-2022.
    • New optional authority params: authority, operator, minter, deployer; pass through to instructions.
    • Amount args for transfers/mints now strings; print human/raw details; allow setting flow limit as optional.
    • Add helpers to read mint decimals, token program IDs.
  • Gateway/GMP:
    • Add signing verifier set merkle root to initialize_payload_verification_session and verification PDA; adjust signature verification loop.
    • Use updated ITS GMP execute builder; update executable ix to include fee_payer.
    • Domain separator and multisig prover lookups now keyed by chain.
  • Governance/Gas Service:
    • Initialize/write config under chains[chain].
  • Docs:
    • ITS guides: set maxDecimalsWhenTruncating to 6; add instructions to find token source accounts.
  • Deps:
    • Add lazy_static, regex; update Cargo.lock with Solana 2.1.16 and related crate changes.

Written by Cursor Bugbot for commit 32b544a. This will update automatically on new commits. Configure here.

@isi8787 isi8787 marked this pull request as ready for review October 8, 2025 19:38
@isi8787 isi8787 requested a review from a team as a code owner October 8, 2025 19:38
Copy link
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.

Greptile Overview

Summary

This PR updates the Solana CLI to work with the current version of Solana programs. The changes involve several key areas:

Configuration and Naming Standardization: The most prominent change is renaming the chain_id field to chain throughout the codebase. This affects the Config struct, CLI parameters, and all references across multiple files including main.rs, config.rs, gateway.rs, deploy.rs, its.rs, governance.rs, gas_service.rs, and utils.rs. The CLI parameter description changes from 'Axelar chainId' to 'Axelar chain', indicating a shift from ID-based to name-based chain identification.

CLI Command Updates: The documentation files show significant changes to command syntax. The --chain-id parameter has been removed from most commands in the GMP deployment documentation, while the ITS documentation now requires --chain-id $CHAIN for initialization. A new --signer-keys parameter has been added to gas service initialization commands.

ITS Module Enhancements: The ITS module receives substantial updates including changing initial_supply from u64 to f64 for human-readable input, adding optional authority parameters for better role-based access control, implementing a new get_token_decimals function that handles both Token-2022 and standard SPL tokens, and adding amount conversion logic with overflow protection.

Gateway Module Updates: The gateway module is updated to work with newer program interfaces, including changes to payload hashing (removing the signer_set parameter), updating PDA generation to include both payload and verifier set merkle roots, changing the ITS instruction builder method name, and adding fee payer parameters.

Configuration Cleanup: The devnet-amplifier configuration removes the entire 'solana-5' chain configuration while keeping 'solana-2', consolidating on a single Solana environment setup.

These changes reflect API evolution in the underlying Solana programs, improved user experience through human-readable inputs, and better security through explicit authority specifications.

Important Files Changed

Changed Files
Filename Score Overview
solana/src/config.rs 5/5 Renames chain_id field to chain in Config struct for naming consistency
solana/src/main.rs 5/5 Updates CLI parameter from chain_id to chain with description changes
solana/src/governance.rs 5/5 Fixes field reference from config.chain_id to config.chain
solana/src/deploy.rs 5/5 Updates variable reference from config.chain_id to config.chain
solana/src/gas_service.rs 5/5 Corrects config field access from config.chain_id to config.chain
solana/src/utils.rs 5/5 Renames function parameters from chain_id to chain for consistency
solana/src/its.rs 4/5 Major updates including f64 amounts, authority params, token decimals handling
solana/src/gateway.rs 4/5 Updates for newer program interfaces with payload hashing and PDA changes
releases/solana/2025-09-GMP-vanilla.md 5/5 Removes --chain-id parameter from CLI commands and adds --signer-keys
releases/solana/2025-09-ITS-vanilla.md 5/5 Adds --chain-id $CHAIN requirement to ITS init commands
axelar-chains-config/info/devnet-amplifier.json 4/5 Removes solana-5 chain configuration, consolidates on solana-2

Confidence score: 4/5

  • This PR is generally safe to merge with careful attention to testing the updated CLI commands
  • Score reflects comprehensive but breaking changes to CLI interfaces that require validation
  • Pay close attention to ITS and gateway modules which have significant API changes

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant Config
    participant Gateway
    participant GasService
    participant ITS
    participant SolanaRPC
    participant AxelarNetwork

    User->>CLI: Execute command (send/generate/sign/broadcast)
    CLI->>Config: Initialize config from chains info
    Config->>Config: Load network configuration from JSON
    
    alt Send Command
        CLI->>CLI: Parse instruction subcommand
        alt Gateway Command
            CLI->>Gateway: Build gateway transaction
            Gateway->>AxelarNetwork: Query verifier set (if needed)
            Gateway->>Gateway: Construct execute data
            Gateway->>CLI: Return instructions
        else Gas Service Command
            CLI->>GasService: Build gas service transaction
            GasService->>CLI: Return instructions
        else ITS Command
            CLI->>ITS: Build ITS transaction
            ITS->>SolanaRPC: Query token manager/mint info
            ITS->>CLI: Return instructions
        end
        CLI->>SolanaRPC: Get latest blockhash
        CLI->>CLI: Create signed transaction
        CLI->>SolanaRPC: Broadcast transaction
        CLI->>User: Return transaction result
    
    else Generate Command
        CLI->>CLI: Build unsigned transaction
        CLI->>SolanaRPC: Fetch nonce account data
        CLI->>Config: Save unsigned transaction to output dir
        CLI->>User: Return unsigned transaction file
    
    else Sign Command
        CLI->>Config: Load unsigned transaction
        CLI->>CLI: Sign with local keypair/Ledger
        CLI->>Config: Save partial signature
        CLI->>User: Return signature file
    
    else Broadcast Command
        CLI->>Config: Load signed transaction
        CLI->>SolanaRPC: Broadcast to network
        CLI->>User: Return transaction result
    end
Loading

11 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

…ffchain_data function and default to payer if not passed
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@kulikthebird kulikthebird left a comment

Choose a reason for hiding this comment

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

I left some comments, where I focused mostly on the parse_decimal_string_to_raw_units method. Thanks!

@isi8787 isi8787 merged commit 0fe5266 into chore/solana-3 Oct 9, 2025
10 checks passed
@isi8787 isi8787 deleted the refactor/update-solana-cli branch October 9, 2025 18:49
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.

2 participants