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: add fetch SOL for Solana Vault swaps #5541

Merged
merged 17 commits into from
Jan 18, 2025

Conversation

albert-llimos
Copy link
Contributor

@albert-llimos albert-llimos commented Jan 10, 2025

Pull Request

Closes: PRO-1942

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

  • Modify Solana Vault swaps logic such that native sol vault swaps are immediately fetch-and-closed account while for other sol assets, old functionality remains where we wait for the batch to fill or wait for timeout before we initate account closures.
  • Update to new Swap Endpoint program from PR: https://github.com/chainflip-io/chainflip-sol-contracts/pull/81
  • Add the fetching native Solana Vault swaps instruction as part of the close_accounts transaction.
  • Use the same number of nonces requirement for Vault swap fetches and deposit channel fetches.

@albert-llimos albert-llimos changed the title Feat/fetch sol vault swaps Feat: add fetch SOL native vault swaps Jan 10, 2025
@albert-llimos albert-llimos changed the title Feat: add fetch SOL native vault swaps feat: add fetch SOL native vault swaps Jan 10, 2025
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 79.56204% with 28 lines in your changes missing coverage. Please review.

Project coverage is 71%. Comparing base (1ae265a) to head (1493883).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...te-chain/runtime/src/chainflip/solana_elections.rs 22% 7 Missing ⚠️
...rc/electoral_systems/solana_vault_swap_accounts.rs 87% 2 Missing and 4 partials ⚠️
state-chain/runtime/src/chainflip/vault_swaps.rs 0% 6 Missing ⚠️
state-chain/chains/src/sol/api.rs 0% 3 Missing ⚠️
...n/chains/src/sol/sol_tx_core/address_derivation.rs 90% 0 Missing and 2 partials ⚠️
engine/src/witness/sol.rs 0% 1 Missing ⚠️
state-chain/chains/src/sol/transaction_builder.rs 97% 0 Missing and 1 partial ⚠️
state-chain/pallets/cf-environment/src/lib.rs 80% 1 Missing ⚠️
state-chain/runtime/src/chainflip.rs 89% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #5541   +/-   ##
=====================================
- Coverage     71%     71%   -0%     
=====================================
  Files        511     511           
  Lines      90349   90320   -29     
  Branches   90349   90320   -29     
=====================================
- Hits       64121   64078   -43     
- Misses     23582   23589    +7     
- Partials    2646    2653    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

albert-llimos and others added 3 commits January 14, 2025 09:14
* feat: proactively fetch sol vault swaps

* chore: rename close_accounts

* fix: edge case

* fix: clippy

* chore: minor

* feat: use const

* fix: minor

* chore: run bouncer and upgrade test

* chore: improve bouncer check

* chore: update force_sol_nonces for upgrade test

* chore: restore ci

* chore: renames and comments

---------

Co-authored-by: albert <allimos3@gmail.com>
@albert-llimos albert-llimos marked this pull request as ready for review January 14, 2025 15:09
@albert-llimos albert-llimos requested review from kylezs, dandanlen and a team as code owners January 14, 2025 15:09
@albert-llimos albert-llimos requested review from ahasna and removed request for a team, martin-chainflip and ahasna January 14, 2025 15:09
@albert-llimos albert-llimos changed the title feat: add fetch SOL native vault swaps feat: add fetch SOL for Solana Vault swaps Jan 14, 2025
@albert-llimos albert-llimos added this pull request to the merge queue Jan 17, 2025
@albert-llimos albert-llimos removed this pull request from the merge queue due to a manual request Jan 17, 2025
@albert-llimos albert-llimos added this pull request to the merge queue Jan 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 17, 2025
@albert-llimos albert-llimos added this pull request to the merge queue Jan 18, 2025
Merged via the queue into main with commit 21b6840 Jan 18, 2025
49 checks passed
@albert-llimos albert-llimos deleted the feat/fetch-sol-vault-swaps branch January 18, 2025 07:21
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