-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: feat/solana-versioned-transaction-base-branch
Are you sure you want to change the base?
feat: use Solana versioned transaction to build api calls #5633
Conversation
Moved ALT related stuff to its own file.
ec95f58
to
56a6108
Compare
Removed all uses of Legacy message and Transaction.
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
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 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.
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) | ||
} | ||
} |
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 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, |
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 fyi, @ramizhasan111 is looking into whether there is a smarter way that doesn't require the swap request id to be passed. TBD.
Pull Request
Closes: PRO-1962, PRO-1967
Checklist
Please conduct a thorough self-review before opening the PR.
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.