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(oft-solana/wire task): error when no solana secret key passed in #1133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nazreen
Copy link
Contributor

@nazreen nazreen commented Dec 16, 2024

  • In wire task, current behavior is to warn (easily overlooked) when no --solana-secret-key is passed in and generate a random keypair. This does not make sense and leads to confusion as the resulting error of Attempt to debit an account but found no record of a prior credit. is obscure.
  • updated behavior: throw error when no--solana-secret-key is provided

@St0rmBr3w
Copy link
Contributor

I beleive this is due to the fact that a lot of solana web3.js REQUIRES a keypair for logging and getting values.
The problem is that the getter function's shouldn't necessarily require a valid keypair.
In 90% of cases it doesn't matter since the team is using the project too, but I believe we needed to include this since the CLI will throw some errors otherwise.

Need to investigate where in the code this breaks down.

@nazreen
Copy link
Contributor Author

nazreen commented Dec 17, 2024

@St0rmBr3w the PR makes --solana-secret-key compulsory for the wire task, which is not a read-only function.

Maybe you are referring to tasks that inherit the wire task, likelz:oapp:init:solana? well that is also a write task.

The thing is, there's also inconsistency in terms of how the solana private key is retrieved

In lz:oft:solana:create, it just reads the SOLANA_PRIVATE_KEY env var, through deriveConnection

This is also just modifying the wire task in oft-solana, which of course would involve writing for Solana side.

If the concern is that this file might be used for other repos and therefor wrongly require a Solana private key when the project does not need Solana, then we can do a conditional early return, only require solanaSecretKey when programId is present (but note that currently in this task we early return when programId is not provided)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants