Conversation
WalkthroughNew deployment automation framework added for the midprice_pino Solana program. Includes a Makefile orchestrating three shell scripts—build, deploy, and IDL update—plus a Cargo.toml manifest defining the program's dependencies. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
deploy-scripts/midprice_pino/build-devnet.sh (1)
27-27: Consider making--tools-versionconfigurable.The tools version
v1.52is hardcoded, which may become outdated as Solana SDK evolves. Consider making this configurable via an environment variable for easier maintenance.♻️ Proposed improvement
+SBF_TOOLS_VERSION="${SBF_TOOLS_VERSION:-v1.52}" + echo "Building midprice_pino in $MIDPRICE_DIR..." mkdir -p "$ROOT/target/deploy" -(cd "$MIDPRICE_DIR" && cargo build-sbf --tools-version v1.52) +(cd "$MIDPRICE_DIR" && cargo build-sbf --tools-version "$SBF_TOOLS_VERSION")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy-scripts/midprice_pino/build-devnet.sh` at line 27, The hardcoded tools version in the build command should be made configurable: introduce an environment variable (e.g., SBF_TOOLS_VERSION or MIDPRICE_SBF_TOOLS_VERSION) with a default of "v1.52" and replace the literal "--tools-version v1.52" in the build-devnet.sh invocation "(cd \"$MIDPRICE_DIR\" && cargo build-sbf --tools-version v1.52)" to use that variable so callers can override the tools version without editing the script.deploy-scripts/midprice_pino/update-devnet-idl.sh (2)
57-60: Pin@solana-program/program-metadatato a specific version instead of using@latest.Using
@latestin a deployment script creates non-reproducible builds and risks breaking changes. Pin to a specific version like@0.5.1(current latest, published Feb 2026) or document the required version.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy-scripts/midprice_pino/update-devnet-idl.sh` around lines 57 - 60, Replace the non-reproducible npx invocation that uses `@solana-program/program-metadata`@latest in the exec command with a specific pinned version (e.g., `@0.5.1`) so deployments are deterministic; update the exec line invoking npx `@solana-program/program-metadata` (used to write idl) to reference the chosen version and, if desired, add a short comment in the script documenting the pinned version and why it was chosen.
34-48: Consider adding an example or templateidl.jsonfile for clarity.The script requires an
idl.jsonfile which is not included in this PR. While the error handling (lines 44-48) clearly documents how to provide it viaIDL_JSONenvironment variable, users invokingmake update-devnet-idlwithout prior knowledge will encounter the error. Since midprice_pino is a Pinocchio program (not Anchor), the IDL must be manually created and provided. Adding a sample or templateidl.jsonindeploy-scripts/midprice_pino/would improve discoverability.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@deploy-scripts/midprice_pino/update-devnet-idl.sh` around lines 34 - 48, The script checks for IDL_JSON and will fail if the IDL file is missing (see IDL_JSON check and error block), so add a template/sample IDL at deploy-scripts/midprice_pino/idl.json and document its usage so users running make update-devnet-idl have something to start from; create a minimal idl.json example matching the midprice_pino program shape (instructions, accounts, types) and commit it next to the script, and optionally add a one-line note in the script or README referencing IDL_JSON and the sample file to make discovery explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@deploy-scripts/midprice_pino/Makefile`:
- Around line 34-48: The Makefile uses relative script paths which break when
invoked from another directory; add a top-level MIDPRICE_MK_DIR variable (e.g.
MIDPRICE_MK_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))) and update
the targets build-devnet, deploy-devnet, and update-devnet-idl to call scripts
via "$(MIDPRICE_MK_DIR)/build-devnet.sh", "$(MIDPRICE_MK_DIR)/deploy-devnet.sh",
and "$(MIDPRICE_MK_DIR)/update-devnet-idl.sh" respectively while preserving
exported environment variables.
In `@programs/midprice_pino/Cargo.toml`:
- Line 1: Remove the standalone [workspace] declaration from this crate's
Cargo.toml (the lone "[workspace]" header) so it doesn't define its own
workspace; delete that section/header entirely so the crate is only a member of
the root workspace which already includes programs/*.
---
Nitpick comments:
In `@deploy-scripts/midprice_pino/build-devnet.sh`:
- Line 27: The hardcoded tools version in the build command should be made
configurable: introduce an environment variable (e.g., SBF_TOOLS_VERSION or
MIDPRICE_SBF_TOOLS_VERSION) with a default of "v1.52" and replace the literal
"--tools-version v1.52" in the build-devnet.sh invocation "(cd \"$MIDPRICE_DIR\"
&& cargo build-sbf --tools-version v1.52)" to use that variable so callers can
override the tools version without editing the script.
In `@deploy-scripts/midprice_pino/update-devnet-idl.sh`:
- Around line 57-60: Replace the non-reproducible npx invocation that uses
`@solana-program/program-metadata`@latest in the exec command with a specific
pinned version (e.g., `@0.5.1`) so deployments are deterministic; update the exec
line invoking npx `@solana-program/program-metadata` (used to write idl) to
reference the chosen version and, if desired, add a short comment in the script
documenting the pinned version and why it was chosen.
- Around line 34-48: The script checks for IDL_JSON and will fail if the IDL
file is missing (see IDL_JSON check and error block), so add a template/sample
IDL at deploy-scripts/midprice_pino/idl.json and document its usage so users
running make update-devnet-idl have something to start from; create a minimal
idl.json example matching the midprice_pino program shape (instructions,
accounts, types) and commit it next to the script, and optionally add a one-line
note in the script or README referencing IDL_JSON and the sample file to make
discovery explicit.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 18ea7ee9-f859-46b3-a614-c59065a03718
⛔ Files ignored due to path filters (1)
programs/midprice_pino/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
deploy-scripts/midprice_pino/Makefiledeploy-scripts/midprice_pino/build-devnet.shdeploy-scripts/midprice_pino/deploy-devnet.shdeploy-scripts/midprice_pino/update-devnet-idl.shprograms/midprice_pino/Cargo.toml
| build-devnet: | ||
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" bash ./build-devnet.sh | ||
|
|
||
| deploy-devnet: | ||
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | ||
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | ||
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | ||
| bash ./deploy-devnet.sh | ||
|
|
||
| update-devnet-idl: | ||
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | ||
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | ||
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | ||
| IDL_JSON="$(IDL_JSON)" \ | ||
| bash ./update-devnet-idl.sh |
There was a problem hiding this comment.
Relative script paths break when Makefile is invoked from a different directory.
The targets use bash ./build-devnet.sh etc., which only works when the Makefile is invoked from its directory. When using make -f deploy-scripts/midprice_pino/Makefile build-devnet from the repo root (as shown in line 1's comment), the relative paths will fail.
🔧 Proposed fix — use absolute paths via MIDPRICE_MK_DIR
build-devnet:
- PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" bash ./build-devnet.sh
+ PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" bash "$(MIDPRICE_MK_DIR)build-devnet.sh"
deploy-devnet:
PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \
DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \
SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \
- bash ./deploy-devnet.sh
+ bash "$(MIDPRICE_MK_DIR)deploy-devnet.sh"
update-devnet-idl:
PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \
DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \
SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \
IDL_JSON="$(IDL_JSON)" \
- bash ./update-devnet-idl.sh
+ bash "$(MIDPRICE_MK_DIR)update-devnet-idl.sh"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| build-devnet: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" bash ./build-devnet.sh | |
| deploy-devnet: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | |
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | |
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | |
| bash ./deploy-devnet.sh | |
| update-devnet-idl: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | |
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | |
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | |
| IDL_JSON="$(IDL_JSON)" \ | |
| bash ./update-devnet-idl.sh | |
| build-devnet: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" bash "$(MIDPRICE_MK_DIR)build-devnet.sh" | |
| deploy-devnet: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | |
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | |
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | |
| bash "$(MIDPRICE_MK_DIR)deploy-devnet.sh" | |
| update-devnet-idl: | |
| PROTOCOL_V2_ROOT="$(PROTOCOL_V2_ROOT)" SOLANA_URL="$(SOLANA_URL)" \ | |
| DEPLOYER_KEYPAIR="$(DEPLOYER_KEYPAIR)" PROGRAM_KEYPAIR="$(PROGRAM_KEYPAIR)" \ | |
| SOLANA_PATH="$(SOLANA_PATH)" DEVNET_ADMIN="$(DEVNET_ADMIN)" \ | |
| IDL_JSON="$(IDL_JSON)" \ | |
| bash "$(MIDPRICE_MK_DIR)update-devnet-idl.sh" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@deploy-scripts/midprice_pino/Makefile` around lines 34 - 48, The Makefile
uses relative script paths which break when invoked from another directory; add
a top-level MIDPRICE_MK_DIR variable (e.g. MIDPRICE_MK_DIR := $(dir $(abspath
$(lastword $(MAKEFILE_LIST))))) and update the targets build-devnet,
deploy-devnet, and update-devnet-idl to call scripts via
"$(MIDPRICE_MK_DIR)/build-devnet.sh", "$(MIDPRICE_MK_DIR)/deploy-devnet.sh", and
"$(MIDPRICE_MK_DIR)/update-devnet-idl.sh" respectively while preserving exported
environment variables.
| @@ -0,0 +1,26 @@ | |||
| [workspace] | |||
There was a problem hiding this comment.
Remove standalone [workspace] declaration — this crate is already a workspace member.
The root Cargo.toml uses the glob pattern programs/* to register all program directories as workspace members. Having an empty [workspace] declaration here creates a conflicting standalone workspace, which can cause cargo resolution issues and break cargo build from the repository root.
🔧 Proposed fix
-[workspace]
-
[package]📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [workspace] | |
| [package] |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@programs/midprice_pino/Cargo.toml` at line 1, Remove the standalone
[workspace] declaration from this crate's Cargo.toml (the lone "[workspace]"
header) so it doesn't define its own workspace; delete that section/header
entirely so the crate is only a member of the root workspace which already
includes programs/*.
Summary by CodeRabbit