-
Notifications
You must be signed in to change notification settings - Fork 308
Add the Squads Mesh program to Tilt and initialize a Vault for it #421
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
Conversation
- Move cheap Python script additions after the expensive rust build - Cache Cargo's package cache to shorten the "updating crates.io registry" build steps
This contains most of the work on Tilt/testing harness side.
This new subcommand enables the runtime Python script to create a multisig vault on the fly on the mock Solana devnet.
| ); | ||
|
|
||
| // The vault key is a PDA and the create key is only an ingredient for it | ||
| let [vaultAddr, bump] = await PublicKey.findProgramAddress( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this I think you can use getMsPDA method from squads (in the lib, not in the class). They have some PDA methods here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing, thank you!
| try { | ||
| let _multisig = await mesh.getMultisig(vaultAddr); | ||
|
|
||
| // NOTE(2022-12-08): If this check prevents you from iterating dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we add an cli option for this? like --ignore-if-exists. Restarting solana needs restarting everything after that (pyth, attester, ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, so in the script interacting with it you don't exit if this fails. Then feel free to keep it as is. But maybe worth modifying the comment that this should not affect tilt testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also not perfectly happy about this, but it probably depends on the kinds of testing scenarios we want. To avoid devnet restarts, I think we could come up with a good initial state for the mock multisig. Then, we can just bring an existing vault back to this initial state if previous run of integration tests changed it. That sounds like one of the next steps after this change.
ali-behjati
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
Note: Would love Guillermo's review before we merge this |
| ledgerDerivationChange: number | undefined, | ||
| walletPath: string | ||
| walletPath: string, | ||
| solRpcUrl?: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also feel like solRpcUrl should default to http://localhost:8899 for localdevnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Tilt you usually refer to the solana node by solana-devnet, I generally wanted to make interactions with arbitrary Solana deployments possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make it default to the localhost:8899 thing and change it for tilt in the surrounding Python script
- Use default mesh program address - remove unused program.json - remove redundant null checks - hardcode vault address (it is deterministic against the constant mesh program pubkey) - Start depending on solana-devnet in Tilt - Add carol to vault and set threshold to 2
With this change, we'll be able to test various multisig testing/usage scenarios. NOTE: many of the files are just keypairs for the new functionality. Most important changes live in
multisig-wh-message-builderandprepare_multisig.py