-
Notifications
You must be signed in to change notification settings - Fork 320
chore(solana): split patches, fix make command and generate mcm upgrade proposal #459
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
acc51c6
chore(solana): split patches, fix make command and generate mcm upgra…
xenoliss c8bebf3
chore(solana): remove unrelated deploy bridge task
xenoliss 15ec722
fix(solana): fix path in README
xenoliss 45988b8
chore(solana): standardize commits in .env files
xenoliss a90152e
chore(solana): rename deps to setup-deps
xenoliss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
solana/devnet/2025-10-20-deploy-mcm/patches/invoke_signed.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| diff --git a/chains/solana/contracts/programs/mcm/src/instructions/execute.rs b/chains/solana/contracts/programs/mcm/src/instructions/execute.rs | ||
| index 155b1a71..b550e7fe 100644 | ||
| --- a/chains/solana/contracts/programs/mcm/src/instructions/execute.rs | ||
| +++ b/chains/solana/contracts/programs/mcm/src/instructions/execute.rs | ||
| @@ -93,6 +93,13 @@ pub fn execute<'info>( | ||
|
|
||
| invoke_signed(&instruction, acc_infos, signer)?; | ||
|
|
||
| + // If the CPI modified any typed accounts present in this outer context | ||
| + // (e.g., calling `accept_ownership` which updates `multisig_config`), | ||
| + // reload them to avoid Anchor writing back the stale outer copy on exit. | ||
| + ctx.accounts.multisig_config.reload()?; | ||
| + ctx.accounts.root_metadata.reload()?; | ||
| + ctx.accounts.expiring_root_and_op_count.reload()?; | ||
| + | ||
| emit!(OpExecuted { | ||
| nonce, | ||
| to: instruction.program_id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| SOLANA_VERSION=1.17.25 | ||
| ANCHOR_VERSION=0.29.0 | ||
|
|
||
| # Variables for cloning the MCM repo | ||
| MCM_REPO=https://github.com/smartcontractkit/chainlink-ccip.git | ||
| MCM_AUDITED_COMMIT=0ee732e80586c2e9df5e9b0c3b5e9a19ee66b3a1 | ||
| INVOKE_SIGNED_PATCH=patches/invoke_signed.patch | ||
| EIP712_PATCH=patches/eip712.patch | ||
| SIMPLIFY_EIP712_PATCH=patches/simplify_eip712.patch | ||
| ID_PATCH=patches/id.patch | ||
|
|
||
| ## | ||
| # Common MCM Proposal Variables | ||
| ## | ||
|
|
||
| # MCM program ID (base58 encoded) | ||
| MCM_PROGRAM_ID=Ea5qsVs2kwQXi7LMAh3Qg5YKpuPQbW7oqvYaPXUwBwoX | ||
|
|
||
| # MCM multisig ID (32 bytes hex with 0x prefix) | ||
| MCM_MULTISIG_ID=0x0000000000000000000000000000000000000000000000000000000000000000 | ||
|
|
||
| # MCM authority address (derived PDA, base58 encoded) | ||
| MCM_AUTHORITY=2N9nKVFPHsBVazniiYNxECB2nPLcwjk3dHAJH9tkr2xQ | ||
|
|
||
| # Timestamp until which the proposal is valid and can be executed | ||
| MCM_VALID_UNTIL=1761205094 # Thu Oct 23 2025 07:38:14 GMT+0000 | ||
|
|
||
| # Set to true if you want to override the previous root when registering the proposal | ||
| # If set to true, it allows to override the (proposal) root even if there are outstanding operations left to execute in the previous proposal | ||
| MCM_OVERRIDE_PREVIOUS_ROOT=false | ||
|
|
||
| # Total number of signatures required to execute the proposal | ||
| MCM_SIGNATURES_COUNT=3 | ||
|
|
||
| # MCM proposal signatures | ||
| MCM_SIGNATURES= | ||
|
|
||
| # Output file for the MCM proposal | ||
| MCM_PROPOSAL_OUTPUT=proposal.json | ||
|
|
||
| # Authority account that will sign and submit MCM transactions | ||
| AUTHORITY=~/.config/solana/id.json | ||
|
|
||
| ## | ||
| # MCM Proposal Variables Specific to Program Upgrade | ||
| ## | ||
|
|
||
| # Program address to upgrade | ||
| PROGRAM=$(MCM_PROGRAM_ID) | ||
|
|
||
| # Buffer address containing the new program data (obtained from 'make write-buffer') | ||
| BUFFER=C4XSxK5zGw2ANbWQSURn6Cx4HaFiCxpmD6Nbb4T6szNu | ||
|
|
||
| # Spill account address to receive refunded lamports | ||
| SPILL=2aWsUTRfJu2hPNUYHaYJjm6C3SVPqXjtoxu2VgBXsd72 # Payer address | ||
|
|
||
| ## | ||
| # Variables for managing the temporary buffer | ||
| ## | ||
|
|
||
| # Path to the compiled program binary (.so file) | ||
| PROGRAM_BINARY=./chainlink-ccip/chains/solana/contracts/target/deploy/mcm.so | ||
|
|
||
| # New buffer authority (MCM authority) | ||
| NEW_BUFFER_AUTHORITY=$(MCM_AUTHORITY) | ||
|
|
||
| # Signature of the set-buffer-authority transaction | ||
| SET_BUFFER_AUTHORITY_SIGNATURE=5MH2pXrEmvoUepzVNfqWzJ5mVXyJn4T9b81yqFaK8T8QzW8quRAXoaATWqtaaaVXJ7hzmywaHFDwcAHj7EQ5EFEs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| chainlink-ccip/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,156 @@ | ||||||
| # Facilitator Instructions: MCM Program Upgrade | ||||||
|
|
||||||
| ## Overview | ||||||
|
|
||||||
| As a Facilitator, you are responsible for: | ||||||
| 1. Preparing the program buffer | ||||||
| 2. Creating the MCM proposal | ||||||
| 3. Committing and pushing the proposal to the repo | ||||||
| 4. Coordinating with Signers | ||||||
| 5. Collecting signatures | ||||||
| 6. Executing the proposal on-chain | ||||||
|
|
||||||
| ## Prerequisites | ||||||
|
|
||||||
| ```bash | ||||||
| cd contract-deployments | ||||||
| git pull | ||||||
| cd solana/devnet/2025-10-22-mcm-upgrade | ||||||
| make deps | ||||||
| ``` | ||||||
|
|
||||||
| Ensure you have: | ||||||
| - Solana CLI installed and configured | ||||||
| - `mcmctl` installed (via `make deps`) | ||||||
| - `eip712sign` installed (via `make deps`) | ||||||
| - A funded Solana wallet configured | ||||||
| - The compiled program binary (`.so` file) ready | ||||||
|
|
||||||
| ## Phase 1: Prepare the Program Buffer | ||||||
|
|
||||||
| ### 1.1. Obtain the compiled program | ||||||
|
|
||||||
| Get the compiled program binary (`.so` file) that contains the new version of the program. | ||||||
|
|
||||||
| ### 1.2. Update .env for buffer upload | ||||||
|
|
||||||
| Set the following in `.env`: | ||||||
|
|
||||||
| ```bash | ||||||
| PROGRAM=<program-address> | ||||||
| PROGRAM_BINARY=<path-to-.so-file> | ||||||
| ``` | ||||||
|
|
||||||
| ### 1.3. Write buffer | ||||||
|
|
||||||
| ```bash | ||||||
| make write-buffer | ||||||
| ``` | ||||||
|
|
||||||
| This will output a buffer address. Copy it. | ||||||
|
|
||||||
| ### 1.4. Update .env and transfer buffer authority | ||||||
|
|
||||||
| Set the following in `.env`: | ||||||
|
|
||||||
| ```bash | ||||||
| BUFFER=<buffer-address-from-write-buffer> | ||||||
| MCM_AUTHORITY=<mcm-authority-pda> | ||||||
| SPILL=<your-wallet-address> | ||||||
| ``` | ||||||
|
|
||||||
| Then transfer buffer authority to MCM: | ||||||
|
|
||||||
| ```bash | ||||||
| make transfer-buffer | ||||||
| ``` | ||||||
|
|
||||||
| The buffer is now controlled by the MCM authority. | ||||||
|
|
||||||
| ## Phase 2: Create and Commit MCM Proposal | ||||||
|
|
||||||
| ### 2.1. Update .env for proposal generation | ||||||
|
|
||||||
| Set the following in `.env`: | ||||||
|
|
||||||
| ```bash | ||||||
| MCM_PROGRAM_ID=<mcm-program-id> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't many of these already exist? (I mean from the |
||||||
| MCM_MULTISIG_ID=<multisig-id> | ||||||
| MCM_VALID_UNTIL=<unix-timestamp> | ||||||
| MCM_OVERRIDE_PREVIOUS_ROOT=false # or true if needed | ||||||
| MCM_PROPOSAL_OUTPUT=proposal.json | ||||||
| ``` | ||||||
|
|
||||||
| ### 2.2. Generate proposal | ||||||
|
|
||||||
| ```bash | ||||||
| make mcm-proposal | ||||||
| ``` | ||||||
|
|
||||||
| This creates the proposal file (default `proposal.json` or whatever is set in `MCM_PROPOSAL_OUTPUT`). | ||||||
|
|
||||||
| ### 2.3. Review proposal | ||||||
|
|
||||||
| Open and review the generated proposal file to verify: | ||||||
| - Program address matches `PROGRAM` | ||||||
| - Buffer address matches `BUFFER` | ||||||
| - Spill address is correct | ||||||
| - Valid until timestamp is appropriate | ||||||
| - All instructions are correct | ||||||
|
|
||||||
| ### 2.4. Commit and push | ||||||
|
|
||||||
| ```bash | ||||||
| git add . | ||||||
| git commit -m "Add MCM program upgrade proposal for <program-name>" | ||||||
| git push | ||||||
| ``` | ||||||
|
|
||||||
| ## Phase 3: Coordinate with Signers and Collect Signatures | ||||||
|
|
||||||
| Coordinate with Signers to collect their signatures. Each Signer will run `make mcm-sign` and provide their signature. | ||||||
|
|
||||||
| Concatenate all signatures in the format: `0xSIG1,0xSIG2,0xSIG3` | ||||||
|
|
||||||
| Once you have all required signatures, update `.env`: | ||||||
|
|
||||||
| ```bash | ||||||
| MCM_SIGNATURES_COUNT=<number-of-signatures> | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| MCM_SIGNATURES=0xSIG1,0xSIG2,0xSIG3 | ||||||
| ``` | ||||||
|
|
||||||
| ## Phase 4: Execute Proposal | ||||||
|
|
||||||
| ```bash | ||||||
| make mcm-all | ||||||
| ``` | ||||||
|
|
||||||
| This command executes all the necessary steps: | ||||||
| - Initialize signatures account | ||||||
| - Append signatures | ||||||
| - Finalize signatures | ||||||
| - Set root | ||||||
| - Execute proposal | ||||||
|
|
||||||
| ## Phase 5: Verification | ||||||
|
|
||||||
| ### 5.1. Verify program on Solana Explorer | ||||||
|
|
||||||
| Visit the Solana Explorer for your network: | ||||||
| - Mainnet: https://explorer.solana.com/ | ||||||
| - Devnet: https://explorer.solana.com/?cluster=devnet | ||||||
|
|
||||||
| Search for the program address (`$PROGRAM`) and verify: | ||||||
| - The "Last Deployed Slot" is recent | ||||||
| - The upgrade authority is still `MCM_AUTHORITY` | ||||||
| - The execution transaction is visible in history | ||||||
|
|
||||||
| ### 5.2. Update README | ||||||
|
|
||||||
| Update the Status line in README.md to: | ||||||
|
|
||||||
| ```markdown | ||||||
| Status: [EXECUTED](https://explorer.solana.com/tx/<transaction-signature>?cluster=<network>) | ||||||
| ``` | ||||||
|
|
||||||
| Replace `<transaction-signature>` with the execution transaction signature and `<network>` with the appropriate cluster (devnet, mainnet-beta, etc.). | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we pre-set these also?