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

Does the banks client verify signatures? #23

Open
the-fool opened this issue Jun 1, 2024 · 2 comments
Open

Does the banks client verify signatures? #23

the-fool opened this issue Jun 1, 2024 · 2 comments

Comments

@the-fool
Copy link

the-fool commented Jun 1, 2024

It seems like processTransaction works when an account is supposed to be a signer, but there is no signature in the transaction. Is this the expected behavior? And is there any way to enforce signature checks?

For example, say there is an Anchor accounts declaration:

#[derive(Accounts)]
pub struct Example<'info> {
    #[account(mut)]
    payer: Signer<'info>,

    other_signer: Signer<'info>,
}

If I submit a transaction with these two accounts, but no signature for the other_signer account, the transaction still executes successfully.

@kevinheavey
Copy link
Owner

The underlying solana-banks-server code doesn't check the signatures. But how are you serializing the transaction without the signatures being checked on the client side? Related: #15

@the-fool
Copy link
Author

the-fool commented Jun 1, 2024

That answers that :)

I am just using @solana/web3.js, like so:

const msg = new web3.TransactionMessage({
      payerKey,
      recentBlockhash,
      instructions,
 }).compileToV0Message()

const tx = new web3.VersionedTransaction(msg)

banksClient.processTransaction(tx)

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

No branches or pull requests

2 participants