Skip to content

feat: add squads proposal flow - #177

Merged
GabrielePicco merged 11 commits into
mainfrom
feat/squads-proposal-workflows
Apr 29, 2026
Merged

GabrielePicco merged 11 commits into
mainfrom
feat/squads-proposal-workflows

Conversation

@GabrielePicco

@GabrielePicco GabrielePicco commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Added a manual workflow to verify deployed Solana programs that produces verification artifacts, a processed verification transaction, and human-readable run instructions.
    • Added a workflow to build, validate, upload, and propose Solana program upgrades, including artifact uploads and a summary of proposal/buffer/program details.
    • Added a helper script to create and submit upgrade proposals and emit proposal, transaction, and run metadata.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b0d0b4750d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@GabrielePicco has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 54 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 85565c50-50f4-477a-8834-f77842ed5588

📥 Commits

Reviewing files that changed from the base of the PR and between 157d6d0 and 8459773.

📒 Files selected for processing (2)
  • .github/scripts/create-squads-upgrade-proposal.mjs
  • .github/workflows/propose-program-upgrade.yml
📝 Walkthrough

Walkthrough

Adds two manual GitHub Actions workflows and a helper script. The prepare-program-verification workflow installs Solana CLI v3.1.5 and solana-verify v0.4.15, validates RPC/secrets, derives the Squads vault PDA from on-chain program state, exports a base64 verification PDA transaction, post-processes it, optionally submits a remote verification job, and uploads artifacts and a run summary. The propose-program-upgrade workflow builds a verifiable shared library, checks the on-chain upgrade authority equals the derived Squads vault PDA and that binary size fits ProgramData, uploads the program to a buffer, transfers buffer authority to the vault PDA, and invokes a script to create a Squads v4 upgrade proposal. A new create-squads-upgrade-proposal.mjs script constructs, signs, and submits the vault transaction and proposal and exposes the transaction index.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/squads-proposal-workflows

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 40 minutes and 54 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/propose-program-upgrade.yml:
- Around line 149-161: The Squads action's keypair input must be the raw keypair
data in Uint8Array/JSON byte-array form (e.g., [1,2,...,32]) not a file path or
other secret string; ensure the env secret SQUADS_PROPOSER_KEYPAIR is stored as
that JSON byte array and is passed directly to the action's keypair input, or
add a preceding step (e.g., the "Write proposer keypair" step) that reads the
keyfile and converts/outputs the JSON byte-array string and then feed that
output into the Create Squads upgrade proposal action's keypair input; reference
the Create Squads upgrade proposal action's keypair input and the
SQUADS_PROPOSER_KEYPAIR secret to locate where to validate/convert the format.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4b33c1c7-6cca-4566-9a98-d330c231e1fb

📥 Commits

Reviewing files that changed from the base of the PR and between ef1dedb and b0d0b47.

📒 Files selected for processing (2)
  • .github/workflows/prepare-program-verification.yml
  • .github/workflows/propose-program-upgrade.yml

@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 17:06 — with GitHub Actions Failure

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c5b43446e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 17:16 — with GitHub Actions Failure

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 19cb3eeef5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 18:18 — with GitHub Actions Failure

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/scripts/create-squads-upgrade-proposal.mjs:
- Around line 84-93: The confirmation results from connection.confirmTransaction
are ignored for both the vault transaction (vaultTransactionSignature) and the
proposal creation (proposalSignature); capture each call's returned
RpcResponseAndContext<SignatureResult>, check result.value.err for non-null
on-chain failures, and if an error exists log the signature and error details
(reference connection.confirmTransaction, vaultTransactionSignature,
proposalSignature, multisig.rpc.proposalCreate, SQUADS_TRANSACTION_INDEX) and
abort (throw or process.exit(1)) so the script does not continue exporting
SQUADS_TRANSACTION_INDEX after a failed on‑chain transaction.

In @.github/workflows/prepare-program-verification.yml:
- Around line 47-48: The workflow step "Install cargo-binstall" currently uses
the mutable ref cargo-bins/cargo-binstall@main; replace that with an immutable
commit SHA by updating the uses field (cargo-bins/cargo-binstall@<commit-sha>)
so the action is pinned to a specific commit; locate the step with the name
"Install cargo-binstall" and change the uses value from
cargo-bins/cargo-binstall@main to cargo-bins/cargo-binstall@<exact-commit-sha>.

In @.github/workflows/propose-program-upgrade.yml:
- Around line 3-10: The workflow currently triggers on pull_request which is
unsafe and causes PROPOSAL_NAME to be undefined because the job reads
inputs.proposal_name; remove the pull_request trigger from the on: block so the
workflow only runs via workflow_dispatch (and keep the existing inputs like
proposal_name), then ensure the job step that sets PROPOSAL_NAME (the
environment/step referencing inputs.proposal_name) continues to read from
github.event.inputs.proposal_name (workflow_dispatch) rather than expecting
pull_request data; verify that any usage of inputs.proposal_name or
github.event.inputs.proposal_name is only executed when the event is
workflow_dispatch.
- Around line 52-59: The workflow uses mutable refs for third-party actions
(dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2,
cargo-bins/cargo-binstall@main); replace each mutable tag with the corresponding
immutable commit SHA (e.g., dtolnay/rust-toolchain@<SHA>,
Swatinem/rust-cache@<SHA>, cargo-bins/cargo-binstall@<SHA>) so the actions are
pinned, verify the SHAs by checking each action repository’s commit you intend
to use, and update the workflow entries for those action uses accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4f6a591d-da98-482f-bd56-b7ab28b6f7a5

📥 Commits

Reviewing files that changed from the base of the PR and between b0d0b47 and 6b542ac.

📒 Files selected for processing (3)
  • .github/scripts/create-squads-upgrade-proposal.mjs
  • .github/workflows/prepare-program-verification.yml
  • .github/workflows/propose-program-upgrade.yml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b542acd44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 18:26 — with GitHub Actions Failure

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e6a488d40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 18:33 — with GitHub Actions Failure
@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 18:53 — with GitHub Actions Failure
@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 18:58 — with GitHub Actions Failure
@GabrielePicco
GabrielePicco had a problem deploying to mainnet-program-upgrade April 29, 2026 19:11 — with GitHub Actions Failure
@GabrielePicco
GabrielePicco deployed to mainnet-program-upgrade April 29, 2026 19:37 — with GitHub Actions Active

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

♻️ Duplicate comments (2)
.github/workflows/propose-program-upgrade.yml (2)

57-61: ⚠️ Potential issue | 🟠 Major

Pin third-party actions to immutable commit SHAs.

dtolnay/rust-toolchain@stable and Swatinem/rust-cache@v2 are mutable references. Since this workflow handles mainnet secrets and signing authority, a retagged action could silently compromise the build. Pin these to specific commit SHAs.

Example pinning (verify SHAs before use)
      - name: Install Rust
-       uses: dtolnay/rust-toolchain@stable
+       uses: dtolnay/rust-toolchain@d8352f6b1d2e870bc5716f41d5a4a7e495b85ead  # stable

      - name: Cache Rust
-       uses: Swatinem/rust-cache@v2
+       uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6  # v2.7.8
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/propose-program-upgrade.yml around lines 57 - 61, Replace
the mutable action refs with immutable commit SHAs: change uses:
dtolnay/rust-toolchain@stable to uses: dtolnay/rust-toolchain@<commit-sha> and
uses: Swatinem/rust-cache@v2 to uses: Swatinem/rust-cache@<commit-sha> (locate
these by the uses lines for dtolnay/rust-toolchain and Swatinem/rust-cache in
the workflow), verify and paste the exact commit SHAs from each action repo
before committing so no mutable tag remains.

3-10: ⚠️ Potential issue | 🔴 Critical

Critical: Remove the pull_request trigger — mainnet writes on every PR.

The pull_request trigger is still present despite being flagged in a previous review. This workflow performs real mainnet operations (buffer upload, authority transfer, proposal creation) and should only run via workflow_dispatch. Additionally, inputs.proposal_name is undefined for pull_request events, causing the proposal step to fail or use the fallback.

Suggested fix
 on:
-  pull_request:
   workflow_dispatch:
     inputs:
       proposal_name:
         description: "Squads proposal"
         required: true
         default: "Upgrade delegation program"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/propose-program-upgrade.yml around lines 3 - 10, The
workflow incorrectly includes the pull_request trigger which causes unsafe
mainnet writes and breaks the inputs contract (inputs.proposal_name isn't
defined for PR events); remove the "pull_request:" key from the on: block so
only "workflow_dispatch:" remains, and ensure the workflow references
inputs.proposal_name only when run via workflow_dispatch (no additional
PR-specific handling needed once pull_request is removed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/prepare-program-verification.yml:
- Around line 101-114: The file is missing a trailing newline; update the "Write
summary" step (the block that appends to "$GITHUB_STEP_SUMMARY" using the echo
{...} >> "$GITHUB_STEP_SUMMARY") so the file ends with a single newline
character—ensure the final line after the closing brace or the last echo is
terminated with '\n' (add a newline at EOF) to comply with POSIX conventions.
- Around line 18-28: Remove MAINNET_RPC_URL from the job-level env block so it
is not exposed globally (currently declared alongside SOLANA_VERSION and
PROGRAM_ID), and instead add MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
only to the env of the specific steps that require it (mirroring the approach
used in propose-program-upgrade.yml); update any step definitions that need RPC
access to include the variable in their env and verify no other steps rely on
the top-level MAINNET_RPC_URL.

In @.github/workflows/propose-program-upgrade.yml:
- Around line 207-220: The file's workflow step that appends the program upgrade
summary (the shell block that echoes values like $PROGRAM_ID,
$PROGRAM_BUFFER_ADDRESS, $GITHUB_STEP_SUMMARY, etc., under the "Write summary"
step) is missing a trailing newline at EOF; open that workflow file and ensure
the final line ends with a newline character (i.e., add an empty newline after
the closing brace/redirect >> "$GITHUB_STEP_SUMMARY") so the file conforms to
POSIX newline conventions.

---

Duplicate comments:
In @.github/workflows/propose-program-upgrade.yml:
- Around line 57-61: Replace the mutable action refs with immutable commit SHAs:
change uses: dtolnay/rust-toolchain@stable to uses:
dtolnay/rust-toolchain@<commit-sha> and uses: Swatinem/rust-cache@v2 to uses:
Swatinem/rust-cache@<commit-sha> (locate these by the uses lines for
dtolnay/rust-toolchain and Swatinem/rust-cache in the workflow), verify and
paste the exact commit SHAs from each action repo before committing so no
mutable tag remains.
- Around line 3-10: The workflow incorrectly includes the pull_request trigger
which causes unsafe mainnet writes and breaks the inputs contract
(inputs.proposal_name isn't defined for PR events); remove the "pull_request:"
key from the on: block so only "workflow_dispatch:" remains, and ensure the
workflow references inputs.proposal_name only when run via workflow_dispatch (no
additional PR-specific handling needed once pull_request is removed).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ee7d27a7-ea38-458d-893b-d152ea42ea7d

📥 Commits

Reviewing files that changed from the base of the PR and between 6b542ac and 157d6d0.

📒 Files selected for processing (2)
  • .github/workflows/prepare-program-verification.yml
  • .github/workflows/propose-program-upgrade.yml

@GabrielePicco
GabrielePicco merged commit ccdf031 into main Apr 29, 2026
3 checks passed
@GabrielePicco
GabrielePicco deleted the feat/squads-proposal-workflows branch April 29, 2026 20:13
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.

1 participant