Skip to content

feat: add solana #1

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

Open
wants to merge 72 commits into
base: main
Choose a base branch
from
Open

feat: add solana #1

wants to merge 72 commits into from

Conversation

frenzox
Copy link
Collaborator

@frenzox frenzox commented Apr 29, 2025

No description provided.

@frenzox frenzox self-assigned this Apr 29, 2025
@frenzox frenzox added the enhancement New feature or request label Apr 29, 2025
@frenzox frenzox moved this to In Progress in solana-axelar Apr 29, 2025
@frenzox frenzox force-pushed the feat/solana branch 8 times, most recently from 9cacb83 to 2db0eec Compare May 2, 2025 14:37
@frenzox frenzox force-pushed the feat/solana branch 9 times, most recently from 922d5ba to bf12f5c Compare May 14, 2025 14:41
@frenzox frenzox marked this pull request as ready for review May 15, 2025 10:06
@frenzox frenzox requested review from eloylp and ICavlek May 15, 2025 10:34
"rpc": "https://api.devnet.solana.com",
"chainType": "svm",
"decimals": 9,
"finality": TBD,
Copy link
Collaborator Author

@frenzox frenzox May 15, 2025

Choose a reason for hiding this comment

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

Do you guys have any idea what are we supposed to put here? I see for evm it's just "finalized", for stellar it has a "1" 🤷‍♂️

Copy link

Choose a reason for hiding this comment

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

This value is used to determine when a hard finalized block can be retrieved to verify and relay a message. In EVMs we use the finality tag as part of their standard JSON-RPC methods if its supported by the chain. For solana the value should be minimum number of blocks until a transaction can be considered fully finalized (hard finality)

Choose a reason for hiding this comment

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

@frenzox I believe this value should be "31" to be consistent with what would be considered a "finalized" commitment level on Solana, as there is no concept of a "finalized" tag

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated in b499966

Comment on lines 169 to 171
| **Devnet-amplifier** | TBD | TBD |
| **Testnet** | TBD | TBD |
| **Mainnet** | TBD | TBD |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Other chains seem to have some predefined numbers for these parameters. Do we have as well? Where does it come from?

Choose a reason for hiding this comment

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

The minimumRotationDelay is the minimum frequency at which we expect the signer set is updated on Axelar itself (for example on mainnet it would be at most once per day or 86,400 seconds). The previousSignerRetention refers to how many epochs a signer set is valid for signature verification. We want the proof to be valid for up to 2 weeks, so we set previous SingerRetention to 15.

You can use the values from Stellar: https://github.com/axelarnetwork/axelar-contract-deployments/blob/c572991f28224e81f44ee64e50034778ee352f87/releases/stellar/2025-01-GMP-v1.0.0.md?plain=1#L103

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Awesome, thanks for the explanation @AttissNgo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated in b499966

frenzox and others added 20 commits July 2, 2025 12:55
This is, atm, merely a copy of the Steller counterpart with updated
chain name.

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Address some review comments that pointed out there's no direct map
between solana clusters and axelar env. Solana devnet should likely be
used for everything other than mainnet. Solana mainnet-beta should be
used with axelar mainnet. This will be emphasized in the docs as well.

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
On solana, transactions are not used to query the ledger, instead we use
get_account RPC method to fetch account information.

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
@eloylp
Copy link
Member

eloylp commented Jul 2, 2025

fixed conflicts

\"$CHAIN\" : {
"governanceAddress": "[governance address]",
"serviceName": "[service name]",
"sourceGatewayAddress": "[external gateway address]",
Copy link

Choose a reason for hiding this comment

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

this document should provide reference of how to get the external gateway address

| **Devnet-amplifier** | `100` | `[\"7\", \"10\"]` | `100` |
| **Stagenet** | `600` | `[\"7\", \"10\"]` | `100` |
| **Testnet** | `14845` | `[\"7\", \"10\"]` | `100` |
| **Mainnet** | `14845` | `[\"8\", \"10\"]` | `920000000` |
Copy link

Choose a reason for hiding this comment

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

how was the reward per epoch calculated for Solana, was this value approved by BD?

| **Testnet** | `https://api.devnet.solana.com` |
| **Mainnet** | `https://api.mainnet-beta.solana.com` |

```bash
Copy link

Choose a reason for hiding this comment

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

i dont see any ampd configuration for the Multisig Prover verifiers will interact with ?

| **Testnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` |
| **Mainnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` |

| Network | `serviceName` | `votingThreshold` | `signingThreshold` | `confirmationHeight` |
Copy link

Choose a reason for hiding this comment

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

if confirmation height is always 31 then we can remove the column, i see its hardcoded in the below config

| **Testnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` |
| **Mainnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` |

| Network | `serviceName` | `votingThreshold` | `signingThreshold` | `confirmationHeight` |
Copy link

Choose a reason for hiding this comment

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

remove confirmation height column since its not accurate and there is no difference between stages since its just 31 below


```sh
solana/solana-axelar-cli send gas-service init \
--upgrade-authority <CONFIG_AUTHORITY_BASE58_PUBKEY> \
Copy link

Choose a reason for hiding this comment

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

in the wallet step we only create a single wallet, do we need to create multiple wallets for the different programs?

--governance-chain <GOVERNANCE_CHAIN> \
--governance-address <GOVERNANCE_ADDRESS> \
--minimum-proposal-eta-delay <MINIMUM_PROPOSAL_ETA_DELAY_IN_SECONDS> \
--operator <GOVERNANCE_PROGRAM_OPERATOR_BASE58_PUBKEY>
Copy link

Choose a reason for hiding this comment

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

Similar question, do we need to create multiple wallets

1. Send a GMP call:

```sh
node evm/gateway.js -n <SOURCE_CHAIN> --action callContract --destinationChain <solana|solana-testnet|solana-devnet> --destination <DESTINATION_ADDRESS> --payload <PAYLOAD_HEX>
Copy link

Choose a reason for hiding this comment

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

for destination chain why does it need to be a solana option? will this work with other chains in the amplifier protocol?

CLUSTER=<devnet|mainnet-beta>
```

#### Devnet-amplifier / Stagenet / Testnet
Copy link

Choose a reason for hiding this comment

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

do we need seperate set of keys for ITS deployment?

"axelar": {
"contracts": {
"InterchainTokenService": {
"solana-devnet": {
Copy link

Choose a reason for hiding this comment

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

this is the only place we are calling it solana-devnet . should it just be "solana" and if so we can condense into the same config for all environments

# Set PRIVATE_KEY in .env
PRIVATE_KEY=<EVM_DEPLOYER_KEY>

node evm/its.js -n all --action setTrustedAddress --trustedChain <solana|solana-devnet> --trustedAddress hub

Choose a reason for hiding this comment

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

this command is updated. please check its script

4. Interchain Token Transfer for Canonical Token:

```sh
node evm/its.js --action interchainTransfer -n <SOURCE_CHAIN> --destinationChain <solana|solana-devnet> --destinationAddress <ENCODED_RECIPIENT> --tokenId <TOKEN_ID> --amount <AMOUNT> --gasValue <GAS_VALUE>

Choose a reason for hiding this comment

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

update this with new command.

2. Interchain Token Transfer for Native Interchain Token:

```sh
node evm/its.js --action interchainTransfer -n <SOURCE_CHAIN> --destinationChain <solana|solana-devnet> --destinationAddress <ENCODED_RECIPIENT> --tokenId <TOKEN_ID> --amount <AMOUNT>

Choose a reason for hiding this comment

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

same here

RUN_AS_ACCOUNT=[wasm deployer/governance address]
```

- `--runAs $RUN_AS_ACCOUNT` is only required for devnet-amplifier. Do not use `--runAs` for stagenet, testnet, or mainnet.

Choose a reason for hiding this comment

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

runAs & deposit value are now picked up from configs. Please check release doc template.


- Gov proposal environment variables. Update these for each network

| Network | `PROVER_ADMIN` | `DEPOSIT_VALUE` | `REWARD_AMOUNT` |

Choose a reason for hiding this comment

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

remove DEPOSIT_VALUE from table

-c Coordinator \
-t "Register Multisig Prover for Solana" \
-d "Register Multisig Prover address for Solana at Coordinator contract" \
--runAs $RUN_AS_ACCOUNT \

Choose a reason for hiding this comment

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

remove runAs & deposit

cd ../gateway
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --lib
cd ../multisig-prover
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown --lib
Copy link
Member

Choose a reason for hiding this comment

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

Hey @blockchainguyy , shouldn't this be using the cosmwasm optimizer (the docker image) for building contracts as per the docs state ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

Incorporate deployment scripts to Axelar deployments repo
5 participants