diff --git a/solana/mainnet/2025-10-27-deploy-mcm/.env b/solana/mainnet/2025-10-27-deploy-mcm/.env new file mode 100644 index 00000000..80296c83 --- /dev/null +++ b/solana/mainnet/2025-10-27-deploy-mcm/.env @@ -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 diff --git a/solana/mainnet/2025-10-27-deploy-mcm/.gitignore b/solana/mainnet/2025-10-27-deploy-mcm/.gitignore new file mode 100644 index 00000000..2edeed2d --- /dev/null +++ b/solana/mainnet/2025-10-27-deploy-mcm/.gitignore @@ -0,0 +1,2 @@ +chainlink-ccip/ +*keypair.json diff --git a/solana/mainnet/2025-10-27-deploy-mcm/Makefile b/solana/mainnet/2025-10-27-deploy-mcm/Makefile new file mode 100644 index 00000000..93658d95 --- /dev/null +++ b/solana/mainnet/2025-10-27-deploy-mcm/Makefile @@ -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