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: add example changeset to transfer from timelock signer account #16476

Merged
merged 5 commits into from
Feb 24, 2025

Conversation

ecPablo
Copy link
Contributor

@ecPablo ecPablo commented Feb 19, 2025

Adds an example changeset to be used on example guides that will transfer some fund from the timelock signer to the provided account via mcms.

AI Summary

This pull request introduces a new changeset for transferring funds from a timelock signer PDA to a specified address within the Solana blockchain environment. It includes the implementation of the changeset and its corresponding tests, as well as modifications to existing helper functions to support the new functionality.

New Changeset Implementation:

Testing:

Helper Function Modifications:

  • deployment/common/changeset/solana/helpers.go: Modified the FundFromDeployerKey function to use a new helper function FundFromAddressIxs which creates transfer instructions from a specified address. This change supports the new changeset by enabling fund transfers from the timelock signer PDA.

Copy link
Contributor

github-actions bot commented Feb 19, 2025

AER Report: CI Core ran successfully ✅

aer_workflow , commit

AER Report: Operator UI CI ran successfully ✅

aer_workflow , commit

@ecPablo ecPablo marked this pull request as ready for review February 19, 2025 17:58
@ecPablo ecPablo requested review from a team as code owners February 19, 2025 17:58

config := proposalutils.SingleGroupTimelockConfigV2(t)
testhelpers.SavePreloadedSolAddresses(t, env, chainSelector)
// Initialize the address book with a dummy address to avoid deploy precondition errors.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure it's the same error I had, but if it is, I think we should avoid it by incorporating this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes it's the same error, I'll keep it here in the meantime while we merge your PR. Just re approved!

Copy link
Contributor

@gustavogama-cll gustavogama-cll left a comment

Choose a reason for hiding this comment

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

Left a few comments, but nothing critical.

I must say, though, that I don't quite get the point of this example. Is there a use case for transferring funds from the timelock signer pda?

@ecPablo
Copy link
Contributor Author

ecPablo commented Feb 19, 2025

Left a few comments, but nothing critical.

I must say, though, that I don't quite get the point of this example. Is there a use case for transferring funds from the timelock signer pda?

Not really, this example will be used more in the context of using the chainlink deployments framework so a user can have a instructions to sign and then call set root / execute via CLD and then easily check their balance to confirm the fund arrived to their account. It's more for "didactic" purposes

@gustavogama-cll
Copy link
Contributor

Not really, this example will be used more in the context of using the chainlink deployments framework so a user can have a instructions to sign and then call set root / execute via CLD and then easily check their balance to confirm the fund arrived to their account. It's more for "didactic" purposes

I see, thanks for the context.

I'll just throw my $0.02c -- just fyi, no action needed. I find that the external_program_cpi_stub program is great for this type of didactic test/example. I was able to experiment and validate quite a bit of logic in the mcms e2e tests thanks to its API, that is tailored for automated tests.

@ecPablo
Copy link
Contributor Author

ecPablo commented Feb 19, 2025

Not really, this example will be used more in the context of using the chainlink deployments framework so a user can have a instructions to sign and then call set root / execute via CLD and then easily check their balance to confirm the fund arrived to their account. It's more for "didactic" purposes

I see, thanks for the context.

I'll just throw my $0.02c -- just fyi, no action needed. I find that the external_program_cpi_stub program is great for this type of didactic test/example. I was able to experiment and validate quite a bit of logic in the mcms e2e tests thanks to its API, that is tailored for automated tests.

Thanks Gustavo, yeah I did check on that program, I ended up doing this because using the stub program would mean adding another changeset for deploying it and another migration on the tutorial, making it a bit longer.

@gustavogama-cll
Copy link
Contributor

gustavogama-cll commented Feb 19, 2025

Thanks Gustavo, yeah I did check on that program, I ended up doing this because using the stub program would mean adding another changeset for deploying it and another migration on the tutorial, making it a bit longer.

You don't actually need to worry about deploying it. The cpi stub program is predeployed by CTF.

Anyways, just something to consider next time.

@gustavogama-cll gustavogama-cll added this pull request to the merge queue Feb 24, 2025
Merged via the queue into develop with commit 456f822 Feb 24, 2025
162 checks passed
@gustavogama-cll gustavogama-cll deleted the ecpablo/solana-transfer-mcm-example branch February 24, 2025 18:14
krehermann pushed a commit that referenced this pull request Feb 27, 2025
…16476)

* feat: add changeset to transfer from timelock signer account

* fix: linting errors

* fix: code cleanup

* fix: use NewTransactionFromInstruction

* fix: cleanup accounts signer set
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.

3 participants