-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
9cacb83
to
2db0eec
Compare
93ae4ff
to
f4adef4
Compare
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
These keys will be used in other modules as well. Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Since we're here, fix the visibility of the functions. Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Not sure how this is supposed to be populated yet. I believe this is filled by Axelar since we need a chainId. Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
"rpc": "https://api.devnet.solana.com", | ||
"chainType": "svm", | ||
"decimals": 9, | ||
"finality": TBD, |
There was a problem hiding this comment.
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" 🤷♂️
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
| **Devnet-amplifier** | TBD | TBD | | ||
| **Testnet** | TBD | TBD | | ||
| **Mainnet** | TBD | TBD | |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
@@ -0,0 +1 @@ | |||
../axelar-chains-config/info/devnet-amplifier.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I don't need these simlinks anymore.
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
|
||
2. Clone the solana-axelar repository. | ||
|
||
3. Build the Solana programs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a checksum value to ensure correct version is the one built and deployed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I should update the instructions to use the solana-verify
tool. Does that align with what you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the instruction in order to add verifiable build. This will also ensure the on-chain program corresponds to the git commit hash and flag it as verified in the explorer.
#### Devnet-amplifier: | ||
|
||
```json | ||
"solana-devnet": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we organize the configs into separate files the ending "devnet", "stagenet" is not needed, and we can just use "solana" as the identifiers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in b499966
1. Deploy Gateway program: | ||
|
||
```sh | ||
solana program-v4 deploy \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to avoid to much copying of values in terminal when preparing to run commands we recommend that we set an ENV values all the parameters that are needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
"rpc": "https://api.devnet.solana.com", | ||
"chainType": "svm", | ||
"decimals": 9, | ||
"finality": TBD, |
There was a problem hiding this comment.
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
"chainType": "svm", | ||
"decimals": 9, | ||
"finality": TBD, | ||
"approxFinalityWaitTime": 13, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"approxFinalityWaitTime": 13, | |
"approxFinalityWaitTime": 1, |
This value is in minutes (not seconds)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
"finality": TBD, | ||
"approxFinalityWaitTime": 13, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above for "finality"
and "approxFinalityWaitTime"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
"finality": TBD, | ||
"approxFinalityWaitTime": 13, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
| **Devnet-amplifier** | TBD | TBD | | ||
| **Testnet** | TBD | TBD | | ||
| **Mainnet** | TBD | TBD | |
There was a problem hiding this comment.
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
|
||
2. Route GMP call via Amplifier: | ||
|
||
- <https://docs.axelar.dev/dev/amplifier/chain-integration/relay-messages> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TX_EVENT
, which represents the index of the ContractCall event, is needed for manual relaying. How does this work in Solana since the tx emits logs rather than events? Could you provide a brief instruction of how to get this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The event id will be the line number in the tx logs where the event data is located. I'll add a command to retrieve the gateway events and their respective ids from a transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
```sh | ||
solana/solana-axelar-cli send gateway submit-proof \ | ||
--multisig-session-id <MULTISIG_SESSION_ID> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add step to confirm that message is received on Solana
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
```sh | ||
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also specify the Solana CLI version used for deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated on b499966
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in b499966
|
||
```sh | ||
# Set default cluster | ||
solana config set --url testnet # Use appropriate network: testnet, devnet, mainnet-beta, or localhost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be different for mainnet, let's add environment-specific instructions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in b499966
#### Devnet-amplifier: | ||
|
||
```json | ||
"solana-devnet": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add devnet in the config name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in b499966
"solana-devnet": { | ||
"name": "Solana Devnet", | ||
"axelarId": "solana-devnet", | ||
"rpc": "https://api.devnet.solana.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually connect test networks on our devnet, lets discuss if a devnet connection is preferred here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure I understand, you mean solana testnet should be used for both axelar's devnet-amplifier and testnet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frenzox correct, unless there is some need to use the Solana devnet instead. What was the reasoning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK all our devnet-amplifier tests so far were performed using solana devnet, that's why I assumed it was the case here. I'll update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blockchainguyy @AttissNgo Here are the solana docs explaining the difference between the environments. Could you take a look and tell me what you think? The solana-devnet
is an official public network used for testing smart contracts, it's not a local network normally seen in EVM world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading it, it seems to me that we should actually use only Solana devnet
for both Axelar's devnet-amplifier
and testnet
and not uset Solana testnet
at all. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted to to use only solana mainnet-beta for axelar mainnet and solana devnet for the other axeler environments. Please let me know if you think it should be done otherwise. I did like so since according to the docs:
Testnet is where the Solana core contributors stress test recent release features on a live cluster, particularly focused on network performance, stability and validator behavior.
Testnet may be subject to ledger resets. Testnet typically runs a newer software release branch than both Devnet and Mainnet Beta
and
Devnet serves as a playground for anyone who wants to take Solana for a test drive, as a user, token holder, app developer, or validator.
Application developers should target Devnet. Potential validators should first target Devnet.
#### Testnet: | ||
|
||
```json | ||
"solana-testnet": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here.
This is, atm, merely a copy of the Steller counterpart with updated chain name. Signed-off-by: Guilherme Felipe da Silva <[email protected]>
|
||
## Deployment | ||
|
||
- Create an `.env` config. `CHAIN` should be set to `Solana`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Create an `.env` config. `CHAIN` should be set to `Solana`. | |
- Create an `.env` config. `CHAIN` should be set to `solana`. |
Chain names stored in config are lowercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in 216fc06
"sourceGatewayAddress": "[external gateway address]", | ||
"votingThreshold": "[voting threshold]", | ||
"blockExpiry": 10, | ||
"confirmationHeight": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"confirmationHeight": 1, | |
"confirmationHeight": 31, |
to reflect "finalized" commitment level on Solana
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in 216fc06
"msgIdFormat": "hex_tx_hash_and_event_index", | ||
"addressFormat": "stellar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"msgIdFormat": "hex_tx_hash_and_event_index", | |
"addressFormat": "stellar" | |
"msgIdFormat": "base58_tx_signature_and_log_index", | |
"addressFormat": "solana" |
"signingThreshold": "[signing threshold]", | ||
"serviceName": "[service name]", | ||
"verifierSetDiffThreshold": 0, | ||
"encoder": "stellar_xdr", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"encoder": "stellar_xdr", | |
"encoder": "borsh", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated in 216fc06
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
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 <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
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 <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
Signed-off-by: Guilherme Felipe da Silva <[email protected]>
No description provided.