Skip to content
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

feat: use Solana versioned transaction to build api calls #5633

Open
wants to merge 7 commits into
base: feat/solana-versioned-transaction-base-branch
Choose a base branch
from

Conversation

syan095
Copy link
Contributor

@syan095 syan095 commented Feb 13, 2025

Pull Request

Closes: PRO-1962, PRO-1967

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have written sufficient tests.
  • I have written and tested required migrations.
  • I have updated documentation where appropriate.

Summary

Solana API and transaction builder use Versioned Transaction.
All uses of legacy transactions are replaced with versioned transactions.
Put in placeholders and TODOs to interface with other parts of the Versioned transaction work.

@albert-llimos albert-llimos force-pushed the feat/solana-versioned-transaction branch from ec95f58 to 56a6108 Compare February 13, 2025 10:18
@syan095 syan095 marked this pull request as ready for review February 14, 2025 07:32
@syan095 syan095 changed the title WIP: Solana Api and transaction builder use versioned transaction feat: Use Solana versioned transaction to build api calls Feb 14, 2025
Copy link
Contributor

@albert-llimos albert-llimos left a comment

Choose a reason for hiding this comment

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

I think it looks great overall, pending on how exactly we implement the rest of the logic. Few comments:

  • I see you have removed some of the legacy transaction logic. I guess that's fine and we don't plan on using it anywhere.
  • As I mentioned to you, in feat: add image with ALT Manager, additional nonces and ALT witnessing.  #5638 I have simplified a bit the Chainflip ALT logic to include it in the Solana Environment.
  • That other PR is now ready for review. We can merge this onto the base branch or wait to merge the other one on top of this and then merge it into the main branch.
  • Do we need any migration? It feels like we might need one since the transacion and messages have changed 🤔 (I haven't had the time to check)

I just added some minor comments.

state-chain/chains/src/ccm_checker.rs Show resolved Hide resolved
Comment on lines +172 to +183
fn decode_unchecked(
ccm: &CcmChannelMetadata,
chain: ForeignChain,
) -> Result<DecodedCcmAdditionalData, CcmValidityError> {
if chain == ForeignChain::Solana {
VersionedSolanaCcmAdditionalData::decode(&mut &ccm.ccm_additional_data.clone()[..])
.map(DecodedCcmAdditionalData::Solana)
.map_err(|_| CcmValidityError::CannotDecodeCcmAdditionalData)
} else {
Ok(DecodedCcmAdditionalData::NotRequired)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this being called anywhere except tests. Am I missing something?

@@ -129,6 +129,7 @@ where
_gas_budget: GasAmount,
_message: Vec<u8>,
_ccm_additional_data: Vec<u8>,
_swap_request_id: SwapRequestId,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just fyi, @ramizhasan111 is looking into whether there is a smarter way that doesn't require the swap request id to be passed. TBD.

@albert-llimos albert-llimos changed the title feat: Use Solana versioned transaction to build api calls feat: use Solana versioned transaction to build api calls Feb 14, 2025
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