-
Notifications
You must be signed in to change notification settings - Fork 305
feat(solana): prepare MCM deploy task on Solana mainnet #480
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
4 commits
Select commit
Hold shift + click to select a range
075095d
feat(solana): prepare mainnet MCM deployment
xenoliss abf0d96
chore(solana): use chain_id 1 for mainnet
xenoliss b93e1e8
chore(solana): add funding step to fund MCM authorities
xenoliss 3d97af3
chore(solana): simplify deployment to same address
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| SOLANA_VERSION=1.17.25 | ||
| ANCHOR_VERSION=0.29.0 | ||
|
|
||
| # Variables for cloning the MCM repo | ||
| MCM_REPO=https://github.com/base/chainlink-ccip/ | ||
| MCM_COMMIT=efe0405f3e2fa6789a57ec510e101828040a384b | ||
|
|
||
| # Variables for deploying and sending transactions | ||
| CLUSTER=mainnet | ||
| AUTHORITY=~/.config/solana/id.json | ||
| MCM_KEYPAIR=./mcm-keypair.json | ||
|
|
||
| # Signature of the deployWithMaxDataLen tx (used to generate the deployment artifacts) | ||
| MCM_DEPLOY_SIGNATURE= | ||
|
|
||
| # General variables for MCM | ||
| MCM_PROGRAM_ID=Ea5qsVs2kwQXi7LMAh3Qg5YKpuPQbW7oqvYaPXUwBwoX # Same as devnet | ||
| MCM_MULTISIG_ID_0=0x0000000000000000000000000000000000000000000000000000000000000000 | ||
| MCM_MULTISIG_ID_1=0x0000000000000000000000000000000000000000000000000000000000000001 | ||
| MCM_CHAIN_ID=1 | ||
| MCM_AUTHORITY_0= | ||
| MCM_AUTHORITY_1= | ||
| MCM_MULTISIG_INIT_ARTIFACT_0=artifacts/mcm-multisig-init-0.json | ||
| MCM_MULTISIG_INIT_ARTIFACT_1=artifacts/mcm-multisig-init-1.json | ||
|
|
||
| # Variables for configuring signers for multisig 0 and 1. | ||
| # Note: Both multisigs are deployed with the same signers configuration to ease deployment. | ||
| # After deployment, the signers configuration for both multisigs MUST be updated to the correct configuration. | ||
| MCM_SIGNER_COUNT=1 | ||
| MCM_SIGNERS=0xb2d9a52e76841279EF0372c534C539a4f68f8C0B | ||
| MCM_SIGNER_GROUPS=0 | ||
| MCM_GROUP_QUORUMS=1 | ||
| MCM_GROUP_PARENTS=0 | ||
| MCM_SIGNERS_INIT_ARTIFACT_0=artifacts/mcm-signers-init-0.json | ||
| MCM_SIGNERS_INIT_ARTIFACT_1=artifacts/mcm-signers-init-1.json | ||
| MCM_SIGNERS_APPEND_ARTIFACT_0=artifacts/mcm-signers-append-0.json | ||
| MCM_SIGNERS_APPEND_ARTIFACT_1=artifacts/mcm-signers-append-1.json | ||
| MCM_SIGNERS_FINALIZE_ARTIFACT_0=artifacts/mcm-signers-finalize-0.json | ||
| MCM_SIGNERS_FINALIZE_ARTIFACT_1=artifacts/mcm-signers-finalize-1.json | ||
| MCM_SIGNERS_SET_CONFIG_ARTIFACT_0=artifacts/mcm-signers-set-config-0.json | ||
| MCM_SIGNERS_SET_CONFIG_ARTIFACT_1=artifacts/mcm-signers-set-config-1.json | ||
|
|
||
| # Variables for transfering multisig 0 ownership to its own authority | ||
| MCM_VALID_UNTIL= | ||
| MCM_OVERRIDE_PREVIOUS_ROOT=false | ||
| MCM_SIGNATURES_COUNT=1 | ||
| MCM_SIGNATURES_0= | ||
| MCM_SIGNATURES_1= | ||
| MCM_PROPOSAL_OUTPUT_0=accept_ownership_proposal_0.json | ||
| MCM_PROPOSAL_OUTPUT_1=accept_ownership_proposal_1.json | ||
| MCM_OWNERSHIP_TRANSFER_ARTIFACT_0=artifacts/mcm-ownership-transfer-0.json | ||
| MCM_OWNERSHIP_TRANSFER_ARTIFACT_1=artifacts/mcm-ownership-transfer-1.json | ||
| MCM_SIGNATURES_INIT_ARTIFACT_0=artifacts/mcm-signatures-init-0.json | ||
| MCM_SIGNATURES_INIT_ARTIFACT_1=artifacts/mcm-signatures-init-1.json | ||
| MCM_SIGNATURES_APPEND_ARTIFACT_0=artifacts/mcm-signatures-append-0.json | ||
| MCM_SIGNATURES_APPEND_ARTIFACT_1=artifacts/mcm-signatures-append-1.json | ||
| MCM_SIGNATURES_FINALIZE_ARTIFACT_0=artifacts/mcm-signatures-finalize-0.json | ||
| MCM_SIGNATURES_FINALIZE_ARTIFACT_1=artifacts/mcm-signatures-finalize-1.json | ||
| MCM_PROPOSAL_SET_ROOT_ARTIFACT_0=artifacts/mcm-proposal-set-root-0.json | ||
| MCM_PROPOSAL_SET_ROOT_ARTIFACT_1=artifacts/mcm-proposal-set-root-1.json | ||
| MCM_PROPOSAL_EXECUTE_ARTIFACT_0=artifacts/mcm-proposal-execute-0.json | ||
| MCM_PROPOSAL_EXECUTE_ARTIFACT_1=artifacts/mcm-proposal-execute-1.json | ||
|
|
||
| # Variables for transferring MCM upgrade authority | ||
| SOL_PROGRAM_ID=$(MCM_PROGRAM_ID) | ||
| NEW_UPGRADE_AUTHORITY=$(MCM_AUTHORITY_0) | ||
|
|
||
| # Signature of the set-upgrade-authority tx (used to generate the set-upgrade-authority artifacts) | ||
| SET_UPGRADE_AUTHORITY_SIGNATURE= | ||
|
|
||
| # Variables for funding MCM authorities | ||
| SOL_AMOUNT=0.5 | ||
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,2 @@ | ||
| chainlink-ccip/ | ||
| *keypair.json |
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 @@ | ||
| include ../.env | ||
| include .env | ||
|
|
||
| include ../../Makefile | ||
|
|
||
| ## | ||
| # Project Setup | ||
| ## | ||
|
|
||
| .PHONY: install-rust | ||
| install-rust: | ||
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
|
||
| .PHONY: install-solana-cli | ||
| install-solana-cli: | ||
| curl -sSfL https://release.anza.xyz/v$(SOLANA_VERSION)/install | sh | ||
|
|
||
| .PHONY: install-anchor | ||
| install-anchor: | ||
| cargo install --git https://github.com/coral-xyz/anchor --tag v$(ANCHOR_VERSION) anchor-cli --force | ||
|
|
||
| .PHONY: setup-deps | ||
| setup-deps: install-rust install-solana-cli install-anchor | ||
|
|
||
| ## | ||
| # Deployment Workflow | ||
| ## | ||
|
|
||
| # Step 1: Clone and patch the MCM program | ||
| .PHONY: step1-clone-and-patch | ||
| step1-clone-and-patch: | ||
| @echo "==> Step 1: Cloning and patching the MCM program..." | ||
| rm -rf chainlink-ccip | ||
| git clone --filter=blob:none $(MCM_REPO) chainlink-ccip | ||
| cd chainlink-ccip && \ | ||
| git checkout $(MCM_COMMIT) | ||
|
|
||
| # Step 2: Build and deploy the MCM program | ||
| .PHONY: step2-build-and-deploy | ||
| step2-build-and-deploy: | ||
| @echo "==> Step 2: Building and deploying the MCM program..." | ||
| mkdir -p chainlink-ccip/chains/solana/contracts/target/deploy/ && \ | ||
| cp $(MCM_KEYPAIR) chainlink-ccip/chains/solana/contracts/target/deploy/mcm-keypair.json | ||
| cd chainlink-ccip/chains/solana/contracts && \ | ||
| anchor keys sync && \ | ||
| anchor build -p mcm && \ | ||
| anchor deploy --provider.cluster $(CLUSTER) --provider.wallet $(AUTHORITY) -p mcm | ||
|
|
||
| # Step 3: Generate deploy artifacts (use solana explorer to get the signature of the deployWithMaxDataLen tx) | ||
| .PHONY: step3-generate-deploy-artifacts | ||
| step3-generate-deploy-artifacts: | ||
| @echo "==> Step 3: Generating MCM deploy artifacts..." | ||
| make sol-confirm SIG=$(MCM_DEPLOY_SIGNATURE) output=artifacts/mcm-deploy-artifacts.json | ||
|
|
||
| # Step 4: Initialize the multisigs(inherited from parent) | ||
| .PHONY: step4-init-multisigs | ||
| step4-init-multisigs: | ||
| @echo "==> Step 4: Initializing MCM multisigs..." | ||
| make mcm-multisig-init \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_0) \ | ||
| MCM_MULTISIG_INIT_ARTIFACT=$(MCM_MULTISIG_INIT_ARTIFACT_0) | ||
| make mcm-multisig-init \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_1) \ | ||
| MCM_MULTISIG_INIT_ARTIFACT=$(MCM_MULTISIG_INIT_ARTIFACT_1) | ||
| @echo "==> MCM multisig authority for multisig 0..." | ||
| make mcm-multisig-print-authority \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_0) | ||
| @echo "==> MCM multisig authority for multisig 1..." | ||
| make mcm-multisig-print-authority \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_1) | ||
|
|
||
| # Step 5: Initialize the signers for multisigs(inherited from parent) | ||
| .PHONY: step5-init-signers | ||
| step5-init-signers: | ||
| @echo "==> Step 5: Initializing MCM signers for multisigs..." | ||
| make mcm-signers-all \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_0) \ | ||
| MCM_SIGNERS_INIT_ARTIFACT=$(MCM_SIGNERS_INIT_ARTIFACT_0) \ | ||
| MCM_SIGNERS_APPEND_ARTIFACT=$(MCM_SIGNERS_APPEND_ARTIFACT_0) \ | ||
| MCM_SIGNERS_FINALIZE_ARTIFACT=$(MCM_SIGNERS_FINALIZE_ARTIFACT_0) \ | ||
| MCM_SIGNERS_SET_CONFIG_ARTIFACT=$(MCM_SIGNERS_SET_CONFIG_ARTIFACT_0) | ||
| make mcm-signers-all \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_1) \ | ||
| MCM_SIGNERS_INIT_ARTIFACT=$(MCM_SIGNERS_INIT_ARTIFACT_1) \ | ||
| MCM_SIGNERS_APPEND_ARTIFACT=$(MCM_SIGNERS_APPEND_ARTIFACT_1) \ | ||
| MCM_SIGNERS_FINALIZE_ARTIFACT=$(MCM_SIGNERS_FINALIZE_ARTIFACT_1) \ | ||
| MCM_SIGNERS_SET_CONFIG_ARTIFACT=$(MCM_SIGNERS_SET_CONFIG_ARTIFACT_1) | ||
|
|
||
| # Step 6: Create accept-ownership proposals (inherited from parent) | ||
| .PHONY: step6-create-accept-ownership-proposals | ||
| step6-create-accept-ownership-proposals: | ||
| @echo "==> Step 6: Creating MCM accept-ownership proposals..." | ||
| make mcm-proposal-accept-ownership \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_0) \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_0) | ||
| make mcm-proposal-accept-ownership \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_1) \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_1) | ||
|
|
||
| # Step 7: Sign the proposals (inherited from parent) | ||
| .PHONY: step7-sign-proposals | ||
| step7-sign-proposals: | ||
| @echo "==> Step 7: Signing MCM proposals..." | ||
| make mcm-sign \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_0) | ||
| make mcm-sign \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_1) | ||
|
|
||
| # Step 8: Execute ownership transfers (inherited from parent) | ||
| .PHONY: step8-execute-ownership-transfers | ||
| step8-execute-ownership-transfers: | ||
| @echo "==> Step 8: Executing MCM ownership transfers..." | ||
| make mcm-ownership-transfer \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_0) \ | ||
| MCM_PROPOSED_OWNER=$(MCM_AUTHORITY_0) \ | ||
| MCM_OWNERSHIP_TRANSFER_ARTIFACT=$(MCM_OWNERSHIP_TRANSFER_ARTIFACT_0) | ||
| make mcm-all \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_0) \ | ||
| MCM_SIGNATURES=$(MCM_SIGNATURES_0) \ | ||
| MCM_SIGNATURES_INIT_ARTIFACT=$(MCM_SIGNATURES_INIT_ARTIFACT_0) \ | ||
| MCM_SIGNATURES_APPEND_ARTIFACT=$(MCM_SIGNATURES_APPEND_ARTIFACT_0) \ | ||
| MCM_SIGNATURES_FINALIZE_ARTIFACT=$(MCM_SIGNATURES_FINALIZE_ARTIFACT_0) \ | ||
| MCM_PROPOSAL_SET_ROOT_ARTIFACT=$(MCM_PROPOSAL_SET_ROOT_ARTIFACT_0) \ | ||
| MCM_PROPOSAL_EXECUTE_ARTIFACT=$(MCM_PROPOSAL_EXECUTE_ARTIFACT_0) | ||
| make mcm-ownership-transfer \ | ||
| MCM_MULTISIG_ID=$(MCM_MULTISIG_ID_1) \ | ||
| MCM_PROPOSED_OWNER=$(MCM_AUTHORITY_1) \ | ||
| MCM_OWNERSHIP_TRANSFER_ARTIFACT=$(MCM_OWNERSHIP_TRANSFER_ARTIFACT_1) | ||
| make mcm-all \ | ||
| MCM_PROPOSAL_OUTPUT=$(MCM_PROPOSAL_OUTPUT_1) \ | ||
| MCM_SIGNATURES=$(MCM_SIGNATURES_1) \ | ||
| MCM_SIGNATURES_INIT_ARTIFACT=$(MCM_SIGNATURES_INIT_ARTIFACT_1) \ | ||
| MCM_SIGNATURES_APPEND_ARTIFACT=$(MCM_SIGNATURES_APPEND_ARTIFACT_1) \ | ||
| MCM_SIGNATURES_FINALIZE_ARTIFACT=$(MCM_SIGNATURES_FINALIZE_ARTIFACT_1) \ | ||
| MCM_PROPOSAL_SET_ROOT_ARTIFACT=$(MCM_PROPOSAL_SET_ROOT_ARTIFACT_1) \ | ||
| MCM_PROPOSAL_EXECUTE_ARTIFACT=$(MCM_PROPOSAL_EXECUTE_ARTIFACT_1) | ||
|
|
||
| # Step 9: Transfer upgrade authority (inherited from parent) | ||
| .PHONY: step9-transfer-upgrade-authority | ||
| step9-transfer-upgrade-authority: | ||
| @echo "==> Step 9: Transferring MCM upgrade authority..." | ||
| make sol-program-set-upgrade-authority | ||
| make sol-program-show | ||
|
|
||
| # Step 10: Generate set-upgrade-authority artifacts (use solana explorer to get the signature of the set-upgrade-authority tx) | ||
| .PHONY: step10-generate-set-upgrade-authority-artifacts | ||
| step10-generate-set-upgrade-authority-artifacts: | ||
| @echo "==> Step 10: Generating MCM set-upgrade-authority artifacts..." | ||
| make sol-confirm SIG=$(SET_UPGRADE_AUTHORITY_SIGNATURE) output=artifacts/set-upgrade-authority-artifacts.json | ||
|
|
||
| # Step 11: Fund MCM authorities (inherited from parent) | ||
| .PHONY: step11-fund-mcm-authorities | ||
| step11-fund-mcm-authorities: | ||
| @echo "==> Step 11: Funding MCM authorities..." | ||
| make sol-transfer SOL_RECIPIENT=$(MCM_AUTHORITY_0) output=artifacts/fund-mcm-authority-0.json | ||
| make sol-transfer SOL_RECIPIENT=$(MCM_AUTHORITY_1) output=artifacts/fund-mcm-authority-1.json |
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
This keypair will match the devnet address
Ea5qsVs2kwQXi7LMAh3Qg5YKpuPQbW7oqvYaPXUwBwoX