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

Marinade common CLI artifacts #1

Merged
merged 11 commits into from
Jul 4, 2023
Merged

Conversation

ochaloup
Copy link
Collaborator

I consider this repository to be common to any liquid staking program CLI in Rust.

The idea is to work solely with Anchor Client and the RequestBuilder.
Unfortunately, I fight a bit with the builder and I haven't fight a way through to append other transactions than the one the builder crates.
Maybe it would be option to use Transaction instead of the builder but I haven't found a fine way how to merge transactions either. To use a single "thing" I decided to work with the RequestBuilder. But there could be something nicer that I haven't been able to find.

I decided to work with the RpcMarinade as it seems to an easy wrapper around client and anchor stuff that can be used within the CLI program. The methods like validator_list,... are listed as functions but wrapped inside of the rpc marinade for an easier use.

@ochaloup ochaloup requested a review from aankor June 26, 2023 16:07
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from 16f301d to 07f3330 Compare June 27, 2023 10:24
@ochaloup
Copy link
Collaborator Author

ochaloup commented Jun 27, 2023

@aankor I moved a part of CLI arguments, those that seems to be common to other CLI, here. My intention is to not copy&paste declaration.

(I use workspace intentionally here while it could be you have some better idea on module split.)

@ochaloup
Copy link
Collaborator Author

ochaloup commented Jun 27, 2023

From discussions with @aankor, the following should be adjusted:

  • DynSigner should be in a separate crate (+ PR to Anchor [code should be created](DynSigner struct: for Solana CLI usage to wrap Box<dyn Signer> to align with Client<C> coral-xyz/anchor#2550 to check possibility to have that there)
  • remove all the rpc client helper stuff retrying is wrong (cron job rerun will manage it), remove checks for mint/token
  • place execution log handling to separate method like log_execution
    • use error! on error, debug! for log messages on success
  • consider not using specialized method for execution and move that logic under the particular CLI repo, having the call looks like txes.map(|tx| log_execution(tx.execute())) (need to be considered, not clear about this now)
    • when specialized method is used then not working with vec but use iterable
  • simulate can properly works only with one transaction

@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from f085414 to b6e26dd Compare June 27, 2023 21:22
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from f7ba6a6 to 6de2969 Compare June 28, 2023 08:11
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from 6da847e to b337857 Compare June 28, 2023 09:07
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from 7b188fa to 429b238 Compare June 28, 2023 09:38
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch 8 times, most recently from 78bf8b4 to 3f6455c Compare June 29, 2023 09:23
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from 3f6455c to 71db03b Compare June 29, 2023 09:26
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch 2 times, most recently from e2ca208 to a76c030 Compare June 30, 2023 08:36
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch 3 times, most recently from 7789cab to aac04d1 Compare June 30, 2023 09:19
@ochaloup ochaloup force-pushed the validator-manager-refactoring branch from aac04d1 to f8f24b7 Compare June 30, 2023 09:19
@ochaloup ochaloup merged commit 970b192 into main Jul 4, 2023
@ochaloup ochaloup deleted the validator-manager-refactoring branch August 11, 2023 12:31
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.

2 participants