Skip to content

Conversation

@drozdziak1
Copy link
Contributor

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-builder and prepare_multisig.py

Stan Drozd added 6 commits December 8, 2022 15:54
- 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(
Copy link
Collaborator

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

Copy link
Contributor Author

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
Copy link
Collaborator

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, ...)

Copy link
Collaborator

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.

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 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.

Copy link
Collaborator

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

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

Nice!

@drozdziak1
Copy link
Contributor Author

Note: Would love Guillermo's review before we merge this

ledgerDerivationChange: number | undefined,
walletPath: string
walletPath: string,
solRpcUrl?: string,
Copy link
Contributor

@guibescos guibescos Dec 12, 2022

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

Copy link
Contributor Author

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

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'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
@drozdziak1 drozdziak1 merged commit f69a91d into main Dec 13, 2022
@drozdziak1 drozdziak1 deleted the drozdziak1/squads-in-tilt branch December 13, 2022 13:05
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