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

Chore: refactor Solana program idls #5381

Merged

Conversation

albert-llimos
Copy link
Contributor

@albert-llimos albert-llimos commented Nov 4, 2024

Address comments: #5355 (comment)
Refactor types into the State Chain and include those accounts checks as part of the macro.

@albert-llimos albert-llimos changed the title Chore: refactor program idls Chore: refactor Solana program idls Nov 5, 2024
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

Attention: Patch coverage is 51.80723% with 40 lines in your changes missing coverage. Please review.

Please upload report for BASE (feat/solana-vault-swaps-election@93da2e2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...chains/src/sol/sol_tx_core/program_instructions.rs 66% 21 Missing and 1 partial ⚠️
engine/src/witness/sol/program_swaps_witnessing.rs 0% 12 Missing ⚠️
engine/src/witness/sol/sol_deposits.rs 0% 5 Missing ⚠️
state-chain/chains/src/sol/sol_tx_core.rs 0% 1 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##             feat/solana-vault-swaps-election   #5381   +/-   ##
==================================================================
  Coverage                                    ?     71%           
==================================================================
  Files                                       ?     500           
  Lines                                       ?   87154           
  Branches                                    ?   87154           
==================================================================
  Hits                                        ?   61746           
  Misses                                      ?   22616           
  Partials                                    ?    2792           

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

@albert-llimos albert-llimos marked this pull request as ready for review November 5, 2024 13:20
@albert-llimos albert-llimos requested a review from kylezs as a code owner November 5, 2024 13:20
@albert-llimos albert-llimos merged commit 94d0c29 into feat/solana-vault-swaps-election Nov 5, 2024
@albert-llimos albert-llimos deleted the chore/refactor-program-idls branch November 5, 2024 13:42
ramizhasan111 pushed a commit that referenced this pull request Nov 14, 2024
* chore: refactor ANCHOR_PROGRAM_DISCRIMINATOR_LENGTH

* chore: expand macro

* wip: move accounts in to idl macro

* chore: also update fetch account info

* feat: sol idl types and checked account decoding

* chore: nit and run ci

* chore: revert ci

---------

Co-authored-by: Daniel <daniel@chainflip.io>
github-merge-queue bot pushed a commit that referenced this pull request Nov 27, 2024
* feat: solana vault swaps elections

* feat: account closing tracking in elections

* chore: clippy

* chore: minor

* fix: consensus

* chore: minor

* chore: minor rename

* Feat: engine logic to witness solana program swaps (#5313)

* chore: add get_event_accounts

* feat: add get_program_swaps

* chore: add get_program_swaps

* chore: improvements

* chore: also update persa.rs

* chore: cleanup

* feat: return swap account along with swap details

* refactor: use election properties

* feat: engine

* feat: vault swap details

* chore: bouncer solana program swaps (#5318)

* chore: first iteration adding anchor

* chore: small cleanup

* chore: syntax improvement

* chore: add comment

* chore: update compute units

* Fixed bouncer

* chore: fix issues and renamings

* chore: get block number from runtime

* chore: vault_swap_request remove origin

* fix: add is_vote_desired()

* fix: clippy, tests, benchmarks

* Feat: Expand Solana Vault Swap functionality and fix bouncer (#5375)

* feat: add creation slot and update image

* chore: fix anchor import

* chore: add ccm metadata

* chore: update with creation slot and prints

* chore: bouncer fixes

* chore: prevent rpc call if empty list

* chore: fix issues all around

* chore: fix lint

* chore: remove prints

* chore: address comment

* fix: BenchmarkValue shit, clippy and election order

* feat: is_vote_needed

* Test: bouncer solana event closure (#5378)

* chore: add check

* chore: remove logging

* chore: nit

* Chore: refactor Solana program idls (#5381)

* chore: refactor ANCHOR_PROGRAM_DISCRIMINATOR_LENGTH

* chore: expand macro

* wip: move accounts in to idl macro

* chore: also update fetch account info

* feat: sol idl types and checked account decoding

* chore: nit and run ci

* chore: revert ci

---------

Co-authored-by: Daniel <daniel@chainflip.io>

* chore: address comments

* chore: improve comment

* chore: nit

* chore: nit CcmCfParameters

* chore: remove unnecessary comment

* chore: return hashshet in get_swap_endpoint_data

* chore: reduce duplication of data removing unnecessary hashet

* fix: filter out errored rpc calls

* chore: workaround for bouncer lint

* chore: address comments

* chore: address comments

* chore: rename file

* chore: make src_token  safer, add unwrap()

* chore: pull out common code

* fix: chore: address comments

* chore: address comments

* chore: rebase related fixes, integrating latest features from main

* chore: fixes after merge

* feat: update engine broker and affiliate fees

* chore: update dummy hardcoded test cf_parameters

* chore: refactor bouncer vault swaps

* chore: fix versioned decoding

* chore: fix bouncer lint

* feat: close accounts even for invalid swaps (#5405)

* feat: close accounts even for invalid swaps

* chore: remove unnecessary TODO

* fix:

- don't exit early if a single account is missing
- handle missing accounts in rpc request method
- more consistent error handling
- tidy up imports
- rpc error is error, not warning

* fix: clippy

* feat: rebase fix

---------

Co-authored-by: albert <allimos3@gmail.com>
Co-authored-by: Daniel <daniel@chainflip.io>

* test: solana vault swap electoral system tests (#5382)

* feat: tests

* feat: refactor tests and new tests

* feat: more test cases

* chore: format

* chore: comments

* feat: more tests, addressed comments

* chore: address comments

* chore: address comment

* fix: merge fixes

* feat: additional test for invalid swap case

* chore: minor

* fix: remove expects

* chore: clearer error message

* feat: migration

* chore: test upgrade

* chore: update migration versions

* chore: update version

* fix: print pre and post upgrade logs in upgrade-test

* Feat: Use TransactionInId for Solana Vault Swaps (#5442)

* chore: update transcationInId and bouncer

* chore: run CI

* chore: add logging and decrease timeout

* chore: not try runtime

* chore: add more prints

* chore: run only one Solana Vault swap

* chore: use processed commitment

* chore: use confirmed

* chore: revert sendAndConfirmTransaction

* chore: fix

* chore: add print and extra swap

* chore: remove unnecessary context transition

* chore: log electoral settings

* chore: readd missing line

* chore: improve logging

* chore: add fix to upgrade-test

* chore: add missing SOLANA_PROGRAMS_VERSION

* chore: replace nonces manually

* chore: manually skip solana vault swaps

* chore: revert logs

* chore: run upgrade

* chore: fix path

* chore: refactor env

* chore: restore files

* chore: force initial sol nonces

* chore: run upgrade ci

* chore: fix reset --hard

* chore: small refactor

* chore: remove unnecessary reset

* chore: revert files

* chore: refactor

* chore: update affiliate_fee type

* chore: restore upgrade flag

---------

Co-authored-by: Albert Llimos <53186777+albert-llimos@users.noreply.github.com>
Co-authored-by: Roy Yang <roy@chainflip.io>
Co-authored-by: albert <allimos3@gmail.com>
Co-authored-by: Daniel <daniel@chainflip.io>
Co-authored-by: dandanlen <3168260+dandanlen@users.noreply.github.com>
Co-authored-by: kylezs <zsembery.kyle@gmail.com>
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.

2 participants