Skip to content

feat(svm): remove enabled deposit route check #939

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

Merged
merged 4 commits into from
Apr 3, 2025

Conversation

Reinis-FRP
Copy link
Contributor

This implements removing enabled deposit route check in SVM, same as for EVM in #926

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
@nicholaspai
Copy link
Member

@Reinis-FRP can you target the march-evm-audit-universal-adapter branch pls?

@Reinis-FRP Reinis-FRP changed the base branch from master to march-evm-audit-universal-adapter March 27, 2025 12:33
#[account(
init_if_needed,
payer = payer,
payer = signer,
Copy link
Member

Choose a reason for hiding this comment

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

you did this to clean up as well? this file post PR still has some inconsistencies now, now?

#[account(constraint = is_local_or_remote_owner(&signer, &state) @ SvmError::NotOwner)]
pub signer: Signer<'info>,

pub struct CreateVault<'info> {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a bit confused by this change. Was the point of this PR not to just remove enable deposit route check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, alternative would be to remove SetEnableRoute altogether and let the operator create vault PDA manually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did end up deleting the instruction altogether in the last commit, since vault ATA can be created by anyone directly via associated token program.

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
@Reinis-FRP Reinis-FRP requested review from pxrl and bmzig as code owners March 28, 2025 09:31
@Reinis-FRP Reinis-FRP requested a review from chrismaree March 28, 2025 09:34
@mrice32 mrice32 changed the base branch from march-evm-audit-universal-adapter to solana-march-audit-2 April 1, 2025 03:08
@@ -0,0 +1,66 @@
// This script is used by a chain admin to create a vault for a token on the Solana Spoke Pool.
Copy link
Member

Choose a reason for hiding this comment

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

this can, in theory, be called by anyone other than just the admin, right? as we are simply creating a ATA for the spokepool PDA to store a given token?

Im thinking through the equivalent functionality we have on other chains now that we no longer have a deposit route check: in theory, someone else could call use this script (or otherwise) to create PDAs so that you can deposit and fill non-whitelisted tokens on behalf of the protocol, just like we can on other chains (by just depositing without using a verified token to a given spoke).

point being, this is not used by an admin, right? there is no special permissioning to create one of these vaults?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, anyone can create the vault. normally we expect admin to do this as that requires spending rent-exempt deposit on vault ATA creation. But any other user is free to do this if they want to deposit funds on a non-whitelisted token.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the comment to reflect that

Copy link
Member

@chrismaree chrismaree left a comment

Choose a reason for hiding this comment

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

this looks good to me! its simple and clean.

I have two open comments on naming but other than that this looks good!

Reinis-FRP and others added 2 commits April 1, 2025 11:39
Co-authored-by: Chris Maree <christopher.maree@gmail.com>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
@mrice32 mrice32 merged commit b7ddacc into solana-march-audit-2 Apr 3, 2025
9 checks passed
@mrice32 mrice32 deleted the reinis-frp/svm-no-route-check branch April 3, 2025 02:58
Reinis-FRP added a commit that referenced this pull request May 21, 2025
* feat(svm): remove enabled deposit route check (#939)

* feat(svm): remove enabled deposit route check

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: remove create_vault ix

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* Update scripts/svm/simpleDeposit.ts

Co-authored-by: Chris Maree <christopher.maree@gmail.com>

* fix: update comment

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Co-authored-by: Chris Maree <christopher.maree@gmail.com>

* feat(svm): test native sol deposits (#942)

* feat(svm): test native sol deposits

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: merge issues

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): pin rust toolchain for solana (#960) (#961)

* fix(svm): pin rust toolchain for solana



* fix: add local toolchain



* fix: add rustfmt to nightly



* fix: pin nightly in lint scripts



---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): M-01 Deposit Tokens Transferred from Depositor Token Account Instead of Signer (#971)

* fix(svm): M-01 Deposit Tokens Transfers

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* feat: use unchecked account

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* feat: remove system acc

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: deposit tests

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: fill tests

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* refactor: rename and comments

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: across plus

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix(svm): pin rust toolchain for solana (#960)

* fix(svm): pin rust toolchain for solana

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add local toolchain

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add rustfmt to nightly

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: pin nightly in lint scripts

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* refactor: rename and organize function

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* feat: update deposit delegate seed

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* feat: use relay_hash from function arguments

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: heap memory error

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* refactor: cleanup

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: deposit checks

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: fill tests

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: fill relay delagate

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>

* fix: fill

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: simplify

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: cleanup

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* test: update fill tests

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: comments

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: scripts

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: make seed structs private

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* feat: add missing params to deposit hashes

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: simplify

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: delegate utils

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: anchor serialize

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* refactor: reuse helper deriveSeedHash

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: move paused fills check in handler

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* feat: improvements

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: remove program_id from transfer_from params

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: fill import

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: tests

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

---------

Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com>
Co-authored-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): N-01 remove v3 from remaining functions and comments (#964)

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): L-01 create new vault on deposit if needed (#957)

* fix(svm): L-01 create new vault on deposit if needed

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: use stable toolchain in ci

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): pin rust toolchain for solana (#960)

* fix(svm): pin rust toolchain for solana

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add local toolchain

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add rustfmt to nightly

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: pin nightly in lint scripts

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): N-02 clarify documentation (#963)

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): N-03 use consistent variable names in the instruction constraint (#962)

* fix(svm): pin rust toolchain for solana (#960)

* fix(svm): pin rust toolchain for solana

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add local toolchain

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: add rustfmt to nightly

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: pin nightly in lint scripts

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix(svm): N-03 use consistent variable names in the instruction constraint

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* fix: restore relay_hash naming in FillRelay context

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

* feat: update toolchain

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* feat: update toolchain bis

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: delete old scripts

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: across plus codama test

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: fill test codama

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* feat: bump version

Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>

* fix: bump version

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>

---------

Signed-off-by: Reinis Martinsons <reinis@umaproject.org>
Signed-off-by: Pablo Maldonado <pablo@umaproject.org>
Signed-off-by: Pablo Maldonado <pablomaldonadoturci@gmail.com>
Co-authored-by: Reinis Martinsons <77973553+Reinis-FRP@users.noreply.github.com>
Co-authored-by: Chris Maree <christopher.maree@gmail.com>
Co-authored-by: Reinis Martinsons <reinis@umaproject.org>
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.

4 participants