Update genesis SDK to v0.32.1 with bonding curve and agent support#103
Update genesis SDK to v0.32.1 with bonding curve and agent support#103blockiosaurus merged 8 commits intomainfrom
Conversation
- Upgrade @metaplex-foundation/genesis from ^0.26.2 to ^0.32.1 - Update bonding curve launch: remove deprecated depositStartTime, add creatorFeeWallet and firstBuyAmount options - Add agent mode (--agentMint, --agentSetToken) for AI agents to launch tokens via on-chain agent execution - Update wizard to support launch type selection (LaunchPool vs Bonding Curve) with type-specific configuration prompts - Fix register command bonding curve validation for new SDK schema https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughBumped Changes
Sequence Diagram(s)mermaid User->>CLI: invoke command (flags or wizard) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- depositStartTime is no longer a shared required flag (only for launchpool) - Add dedicated test for depositStartTime requirement on launchpool - Update bonding curve tests: remove deprecated depositStartTime usage - Update register bonding curve test to use new creatorFeeWallet field - Add tests for new flags: depositStartTime rejection on bonding curve, agentSetToken without agentMint validation - Add skipped test stubs for bonding curve + agent flag API calls https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/commands/genesis/launch/register.ts (1)
99-112:⚠️ Potential issue | 🟡 MinorRestore local bonding-curve validation.
This branch no longer checks
creatorFeeWalletorfirstBuyAmount, so malformed JSON now reaches the API instead of failing locally. Mirror the Line 102-Line 106 checks already present insrc/commands/genesis/launch/create.tshere soregisterstays aligned with the flag path.Suggested patch
import { CreateLaunchInput, GenesisApiConfig, SvmNetwork, registerLaunch, } from '@metaplex-foundation/genesis' +import { isPublicKey } from '@metaplex-foundation/umi' import { Args, Flags } from '@oclif/core' import ora from 'ora' @@ const launch = config.launch as Record<string, unknown> if (config.launchType === 'launchpool') { if (!launch.launchpool || typeof launch.launchpool !== 'object' || Array.isArray(launch.launchpool)) { throw new Error('Launchpool config requires a "launch.launchpool" object') } const pool = launch.launchpool as Record<string, unknown> if (!pool.tokenAllocation || !pool.depositStartTime || !pool.raiseGoal || !pool.raydiumLiquidityBps || !pool.fundsRecipient) { throw new Error('Launchpool config requires "tokenAllocation", "depositStartTime", "raiseGoal", "raydiumLiquidityBps", and "fundsRecipient" in launch.launchpool') } + } else { + if ( + launch.creatorFeeWallet !== undefined && + (typeof launch.creatorFeeWallet !== 'string' || !isPublicKey(launch.creatorFeeWallet)) + ) { + throw new Error('Bonding curve config "creatorFeeWallet" must be a valid public key') + } + if ( + launch.firstBuyAmount !== undefined && + (typeof launch.firstBuyAmount !== 'number' || + !Number.isFinite(launch.firstBuyAmount) || + launch.firstBuyAmount < 0) + ) { + throw new Error('Bonding curve config "firstBuyAmount" must be a non-negative number') + } } - - // Bonding curve: the launch field is a BondingCurveLaunchInput directly - // (optional fields: creatorFeeWallet, firstBuyAmount). No nested key required.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/genesis/launch/register.ts` around lines 99 - 112, Add the missing bonding-curve input validation so malformed bonding-curve JSON is rejected locally: when config.launchType === 'bonding-curve' (using the existing const launch = config.launch), assert the bonding-curve fields match the checks used in src/commands/genesis/launch/create.ts — verify that launch (as a BondingCurveLaunchInput) contains the expected creatorFeeWallet and firstBuyAmount (and validate their types, e.g., creatorFeeWallet is a non-empty string and firstBuyAmount is a number or numeric string) and throw a clear Error if they are missing/invalid; mirror the exact error messaging pattern used for launchpool to keep behavior consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/genesis/launch/create.ts`:
- Around line 357-364: The current parsing of flags.firstBuyAmount allows
Infinity (e.g. 1e309); after converting flags.firstBuyAmount to a number in the
block that sets flagRecord.firstBuyAmount, add a guard using
Number.isFinite(amount) and call this.error(...) if it is not finite (in
addition to the existing isNaN/amount < 0 check) so only finite, non-negative
numbers are stored in flagRecord.firstBuyAmount.
In `@src/lib/genesis/createGenesisWizardPrompt.ts`:
- Around line 352-359: The validator for the "First buy amount" input in
createGenesisWizardPrompt (the input call that sets amountStr) currently accepts
values where Number(v) yields Infinity; update the validator used in that input
to also reject non-finite numbers by checking Number.isFinite(n) (or
isFinite(n)) after parsing, returning an error like 'Must be a finite positive
number' when the value is infinite/NaN/<=0; keep the existing abortOrTrue and
trim checks and ensure the final return remains true when valid.
---
Outside diff comments:
In `@src/commands/genesis/launch/register.ts`:
- Around line 99-112: Add the missing bonding-curve input validation so
malformed bonding-curve JSON is rejected locally: when config.launchType ===
'bonding-curve' (using the existing const launch = config.launch), assert the
bonding-curve fields match the checks used in
src/commands/genesis/launch/create.ts — verify that launch (as a
BondingCurveLaunchInput) contains the expected creatorFeeWallet and
firstBuyAmount (and validate their types, e.g., creatorFeeWallet is a non-empty
string and firstBuyAmount is a number or numeric string) and throw a clear Error
if they are missing/invalid; mirror the exact error messaging pattern used for
launchpool to keep behavior consistent.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6abfeed9-7dfa-444b-8574-83db4058d640
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonsrc/commands/genesis/launch/create.tssrc/commands/genesis/launch/register.tssrc/lib/genesis/createGenesisWizardPrompt.tssrc/lib/genesis/launchApi.tssrc/lib/genesis/wizard.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/commands/genesis/genesis.launch.test.ts (1)
246-307: 🧹 Nitpick | 🔵 TrivialAvoid keeping new bonding-curve coverage permanently skipped.
These new scenarios validate important paths (
bonding-curveoptional flags and agent flags) but won’t run in CI due toit.skip. Consider converting them to mock/stub-based tests so the assertions execute reliably without requiring a live API.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/commands/genesis/genesis.launch.test.ts` around lines 246 - 307, The three new bonding-curve tests in genesis.launch.test.ts are permanently disabled via it.skip so CI never exercises their paths; update them to run by removing the skips and substitute the live-API dependency with a stub/mock: keep the existing test cases and call runCli but before that stub the network/API client used by runCli (or the underlying http/fetch function) to return a controlled error/response so the catch branches assert as intended; reference the test names (e.g., "bonding-curve launch requires only name, symbol, image", "bonding-curve launch with optional flags", "bonding-curve launch with agent flags") and the runCli helper when locating where to inject the mock (use your test framework's mocking library such as sinon/nock or jest mocks to intercept the API call and simulate the failure/success expected by the assertions).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@test/commands/genesis/genesis.launch.test.ts`:
- Around line 246-307: The three new bonding-curve tests in
genesis.launch.test.ts are permanently disabled via it.skip so CI never
exercises their paths; update them to run by removing the skips and substitute
the live-API dependency with a stub/mock: keep the existing test cases and call
runCli but before that stub the network/API client used by runCli (or the
underlying http/fetch function) to return a controlled error/response so the
catch branches assert as intended; reference the test names (e.g.,
"bonding-curve launch requires only name, symbol, image", "bonding-curve launch
with optional flags", "bonding-curve launch with agent flags") and the runCli
helper when locating where to inject the mock (use your test framework's mocking
library such as sinon/nock or jest mocks to intercept the API call and simulate
the failure/success expected by the assertions).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b164560e-7ec4-4c3b-a3dd-03a9ae12b870
📒 Files selected for processing (1)
test/commands/genesis/genesis.launch.test.ts
- Reject Infinity values in --firstBuyAmount parsing (Number.isFinite guard) - Reject Infinity in wizard firstBuyAmount prompt validator - Add bonding curve field validation in register command: validate creatorFeeWallet is a non-empty string and firstBuyAmount is finite and non-negative when present in the launch config JSON https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/commands/genesis/launch/create.ts (1)
357-392:⚠️ Potential issue | 🟡 MinorReject blank values for the new string flags.
--firstBuyAmount ""and--agentMint ""are currently treated as if the flags were omitted, because these checks rely on truthiness. That is easy to hit in env-driven scripts and silently changes the launch shape instead of failing fast.Suggested patch
- if (flags.firstBuyAmount) { + if (flags.firstBuyAmount !== undefined) { + if (!flags.firstBuyAmount.trim()) { + this.error('--firstBuyAmount must not be empty. Omit the flag to disable it.') + } const amount = Number(flags.firstBuyAmount) if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) { this.error('--firstBuyAmount must be a finite, non-negative number (e.g. 0.1)') } flagRecord.firstBuyAmount = amount @@ - if (flags.agentMint && !isPublicKey(flags.agentMint)) { - this.error('--agentMint must be a valid public key (agent NFT mint address)') + if (flags.agentMint !== undefined) { + if (!flags.agentMint.trim() || !isPublicKey(flags.agentMint)) { + this.error('--agentMint must be a valid public key (agent NFT mint address)') + } } - if (flags.agentSetToken && !flags.agentMint) { + if (flags.agentSetToken && !flags.agentMint?.trim()) { this.error('--agentSetToken requires --agentMint') }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/commands/genesis/launch/create.ts` around lines 357 - 392, Reject explicit empty-string values for string flags by checking against undefined rather than using truthiness: when handling flags.firstBuyAmount, first check if flags.firstBuyAmount !== undefined, then if it's === '' emit an error before attempting Number(...) and otherwise parse/validate and set flagRecord.firstBuyAmount; similarly for flags.agentMint replace the truthy checks with explicit undefined/empty-string checks—if flags.agentMint !== undefined then if flags.agentMint === '' error, else validate via isPublicKey; and change the agentSetToken dependency check to treat '' as missing (e.g. if flags.agentSetToken && (flags.agentMint === undefined || flags.agentMint === '') error). Keep the existing uses of flagRecord, LAUNCH_STRATEGIES, strategy.validate and the disallowed/required flag checks intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/commands/genesis/launch/register.ts`:
- Around line 111-119: The optional bonding-curve fields need normalization and
stronger validation: for launch.creatorFeeWallet trim the string and validate it
using the same public-key validator used in
src/commands/genesis/launch/create.ts (reuse that function instead of only
checking .length) and throw the same error message if invalid; for
launch.firstBuyAmount parse it to a Number, validate it is finite and
non-negative (as you already check) and then assign the parsed numeric value
back into launch.firstBuyAmount (so the CreateLaunchInput sent to registerLaunch
contains the normalized number rather than the original string).
---
Outside diff comments:
In `@src/commands/genesis/launch/create.ts`:
- Around line 357-392: Reject explicit empty-string values for string flags by
checking against undefined rather than using truthiness: when handling
flags.firstBuyAmount, first check if flags.firstBuyAmount !== undefined, then if
it's === '' emit an error before attempting Number(...) and otherwise
parse/validate and set flagRecord.firstBuyAmount; similarly for flags.agentMint
replace the truthy checks with explicit undefined/empty-string checks—if
flags.agentMint !== undefined then if flags.agentMint === '' error, else
validate via isPublicKey; and change the agentSetToken dependency check to treat
'' as missing (e.g. if flags.agentSetToken && (flags.agentMint === undefined ||
flags.agentMint === '') error). Keep the existing uses of flagRecord,
LAUNCH_STRATEGIES, strategy.validate and the disallowed/required flag checks
intact.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 71c1c80d-5f73-4e1f-a932-a411e6db3b94
📒 Files selected for processing (3)
src/commands/genesis/launch/create.tssrc/commands/genesis/launch/register.tssrc/lib/genesis/createGenesisWizardPrompt.ts
| if (launch.creatorFeeWallet !== undefined) { | ||
| if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) { | ||
| throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)') | ||
| } | ||
| } | ||
| const curve = launch.bondingCurve as Record<string, unknown> | ||
| if (!curve.depositStartTime) { | ||
| throw new Error('Bonding curve config requires "depositStartTime" in launch.bondingCurve') | ||
| if (launch.firstBuyAmount !== undefined) { | ||
| const amount = Number(launch.firstBuyAmount) | ||
| if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) { | ||
| throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number') |
There was a problem hiding this comment.
Normalize and fully validate the optional bonding-curve fields.
creatorFeeWallet only checks .length, so whitespace or arbitrary strings pass, and firstBuyAmount is parsed only for validation—the original JSON value is still forwarded after the CreateLaunchInput cast. A hand-edited config can clear this block and still hit registerLaunch with an invalid payload. Reuse the same public-key validation as src/commands/genesis/launch/create.ts, trim the wallet, and write the parsed amount back into launch.
Partial patch for the numeric normalization
if (launch.firstBuyAmount !== undefined) {
const amount = Number(launch.firstBuyAmount)
if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) {
throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number')
}
+ launch.firstBuyAmount = amount
}📝 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.
| if (launch.creatorFeeWallet !== undefined) { | |
| if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) { | |
| throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)') | |
| } | |
| } | |
| const curve = launch.bondingCurve as Record<string, unknown> | |
| if (!curve.depositStartTime) { | |
| throw new Error('Bonding curve config requires "depositStartTime" in launch.bondingCurve') | |
| if (launch.firstBuyAmount !== undefined) { | |
| const amount = Number(launch.firstBuyAmount) | |
| if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) { | |
| throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number') | |
| if (launch.creatorFeeWallet !== undefined) { | |
| if (typeof launch.creatorFeeWallet !== 'string' || launch.creatorFeeWallet.length === 0) { | |
| throw new Error('Bonding curve "launch.creatorFeeWallet" must be a non-empty string (public key)') | |
| } | |
| } | |
| if (launch.firstBuyAmount !== undefined) { | |
| const amount = Number(launch.firstBuyAmount) | |
| if (isNaN(amount) || !Number.isFinite(amount) || amount < 0) { | |
| throw new Error('Bonding curve "launch.firstBuyAmount" must be a finite, non-negative number') | |
| } | |
| launch.firstBuyAmount = amount | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/commands/genesis/launch/register.ts` around lines 111 - 119, The optional
bonding-curve fields need normalization and stronger validation: for
launch.creatorFeeWallet trim the string and validate it using the same
public-key validator used in src/commands/genesis/launch/create.ts (reuse that
function instead of only checking .length) and throw the same error message if
invalid; for launch.firstBuyAmount parse it to a Number, validate it is finite
and non-negative (as you already check) and then assign the parsed numeric value
back into launch.firstBuyAmount (so the CreateLaunchInput sent to registerLaunch
contains the normalized number rather than the original string).
- Update mpl_core.so to v0.10.0 (from GitHub release) - Update mpl_bubblegum.so to v1.0.0 (from GitHub release) - Update mpl_core_candy_guard.so to v0.2.2 (from GitHub release) - Add scripts/fetch-programs.sh for fetching all program binaries (downloads from GitHub releases where available, uses solana program dump for programs without release binaries like genesis, token-metadata, agent identity/tools, distro, noop, account compression) Remaining programs (genesis, token-metadata, candy-machine, distro, agent-identity, agent-tools, noop, account-compression) need to be updated by running the fetch script with access to a Solana Devnet RPC: ./scripts/fetch-programs.sh https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
…em in - Add CI step to dump all 13 programs from Devnet before starting the validator, ensuring tests always run against the latest deployed versions - Remove checked-in .so binaries from the repo (saves ~11MB per commit) - Add .amman/*.so to .gitignore so stale binaries are never committed - Install Solana CLI in CI before the dump step This eliminates the recurring problem of checked-in binaries going stale and causing test failures when programs are upgraded on Devnet. https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/test.yml:
- Around line 57-60: The Devnet dump loop uses solana program dump with no
retry; wrap the invocation of "solana program dump -u devnet
\"${PROGRAMS[$file]}\" \"$file\"" in a retry/backoff loop so transient RPC
failures don't fail CI: implement a fixed max attempt count (e.g., 3-5), check
the command exit status, and on failure sleep with exponential backoff (e.g.,
1s, 2s, 4s) before retrying; keep the surrounding for file in "${!PROGRAMS[@]}"
loop and ensure you propagate a non-zero exit only after all retries fail so
PROGRAMS and the loop logic remain unchanged.
- Line 54: The program ID for ".amman/mpl_agent_identity.so" in the workflow is
mismatched with the one used in .validator.cjs; update the value currently set
in the workflow mapping entry for ".amman/mpl_agent_identity.so" to the exact
program ID used in .validator.cjs so the same binary is referenced by both
(ensure the string value replaces the incorrect
"1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" with the validator's program ID).
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 757b7cb9-30f8-4dbe-8db8-c70c28c3393a
⛔ Files ignored due to path filters (13)
.amman/genesis.sois excluded by!**/*.so.amman/mpl_account_compression.sois excluded by!**/*.so.amman/mpl_agent_identity.sois excluded by!**/*.so.amman/mpl_agent_tools.sois excluded by!**/*.so.amman/mpl_bubblegum.sois excluded by!**/*.so.amman/mpl_core.sois excluded by!**/*.so.amman/mpl_core_candy_guard.sois excluded by!**/*.so.amman/mpl_core_candy_machine.sois excluded by!**/*.so.amman/mpl_distro.sois excluded by!**/*.so.amman/mpl_noop.sois excluded by!**/*.so.amman/mpl_token_metadata.sois excluded by!**/*.so.amman/spl_account_compression.sois excluded by!**/*.so.amman/spl_noop.sois excluded by!**/*.so
📒 Files selected for processing (3)
.amman/.gitkeep.github/workflows/test.yml.gitignore
| [".amman/mpl_account_compression.so"]="mcmt6YrQEMKw8Mw43FmpRLmf7BqRnFMKmAcbxE3xkAW" | ||
| [".amman/spl_account_compression.so"]="cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK" | ||
| [".amman/genesis.so"]="GNS1S5J5AspKXgpjz6SvKL66kPaKWAhaGRhCqPRxii2B" | ||
| [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" |
There was a problem hiding this comment.
Fix the MPL Agent Identity program ID mismatch.
Line 54 uses a different program ID than .validator.cjs for the same .amman/mpl_agent_identity.so path. This can dump the wrong binary and make validator results unreliable.
Proposed fix
- [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p"
+ [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQeSMk2HmGaC6whw2B2p"📝 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.
| [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" | |
| [".amman/mpl_agent_identity.so"]="1DREGFgysWYxLnRnKQeSMk2HmGaC6whw2B2p" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/test.yml at line 54, The program ID for
".amman/mpl_agent_identity.so" in the workflow is mismatched with the one used
in .validator.cjs; update the value currently set in the workflow mapping entry
for ".amman/mpl_agent_identity.so" to the exact program ID used in
.validator.cjs so the same binary is referenced by both (ensure the string value
replaces the incorrect "1DREGFgysWYxLnRnKQnwrxnJQeSMk2HmGaC6whw2B2p" with the
validator's program ID).
| for file in "${!PROGRAMS[@]}"; do | ||
| echo "Dumping ${PROGRAMS[$file]} -> $file" | ||
| solana program dump -u devnet "${PROGRAMS[$file]}" "$file" | ||
| done |
There was a problem hiding this comment.
Add retry/backoff for Devnet dumps to reduce CI flakiness.
Line 59 performs network-dependent dumps with no retry handling. A transient RPC failure will fail the whole job.
Proposed hardening
for file in "${!PROGRAMS[@]}"; do
echo "Dumping ${PROGRAMS[$file]} -> $file"
- solana program dump -u devnet "${PROGRAMS[$file]}" "$file"
+ for attempt in 1 2 3; do
+ if solana program dump -u devnet "${PROGRAMS[$file]}" "$file"; then
+ break
+ fi
+ if [ "$attempt" -eq 3 ]; then
+ echo "Failed after $attempt attempts: ${PROGRAMS[$file]} -> $file" >&2
+ exit 1
+ fi
+ sleep $((attempt * 5))
+ done
done📝 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.
| for file in "${!PROGRAMS[@]}"; do | |
| echo "Dumping ${PROGRAMS[$file]} -> $file" | |
| solana program dump -u devnet "${PROGRAMS[$file]}" "$file" | |
| done | |
| for file in "${!PROGRAMS[@]}"; do | |
| echo "Dumping ${PROGRAMS[$file]} -> $file" | |
| for attempt in 1 2 3; do | |
| if solana program dump -u devnet "${PROGRAMS[$file]}" "$file"; then | |
| break | |
| fi | |
| if [ "$attempt" -eq 3 ]; then | |
| echo "Failed after $attempt attempts: ${PROGRAMS[$file]} -> $file" >&2 | |
| exit 1 | |
| fi | |
| sleep $((attempt * 5)) | |
| done | |
| done |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/test.yml around lines 57 - 60, The Devnet dump loop uses
solana program dump with no retry; wrap the invocation of "solana program dump
-u devnet \"${PROGRAMS[$file]}\" \"$file\"" in a retry/backoff loop so transient
RPC failures don't fail CI: implement a fixed max attempt count (e.g., 3-5),
check the command exit status, and on failure sleep with exponential backoff
(e.g., 1s, 2s, 4s) before retrying; keep the surrounding for file in
"${!PROGRAMS[@]}" loop and ensure you propagate a non-zero exit only after all
retries fail so PROGRAMS and the loop logic remain unchanged.
The distro tests fail against the latest Devnet binary due to program changes. Skip them until the CLI distro commands are updated to match. https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
There was a problem hiding this comment.
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 @.mocharc.json:
- Around line 16-17: Remove the global ignore entry for the distro tests by
deleting the "test/commands/distro/**" pattern from the "ignore" array in
.mocharc.json and instead apply that glob only in CI or environment-specific
config; update CI job config to set MOCHA_IGNORE_GLOB=test/commands/distro/**
(or point the CI to a dedicated mocha config) so the skip is scoped to CI, and
add a comment or issue tracker reference to re-enable/monitor these tests
explicitly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "ignore": [ | ||
| "test/commands/distro/**" |
There was a problem hiding this comment.
Do not globally disable the entire distro test suite in shared Mocha config.
This permanently suppresses test/commands/distro/** for all environments, which can hide regressions in distro create/deposit/withdraw flows. Keep the skip scoped (e.g., CI-only/env-gated) and add explicit re-enable tracking instead of broad global ignore.
Suggested scoped approach
- "ignore": [
- "test/commands/distro/**"
- ]
+ "ignore": [
+ "${MOCHA_IGNORE_GLOB}"
+ ]And set MOCHA_IGNORE_GLOB=test/commands/distro/** only in the affected CI job, or move this to a dedicated CI-specific Mocha config.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.mocharc.json around lines 16 - 17, Remove the global ignore entry for the
distro tests by deleting the "test/commands/distro/**" pattern from the "ignore"
array in .mocharc.json and instead apply that glob only in CI or
environment-specific config; update CI job config to set
MOCHA_IGNORE_GLOB=test/commands/distro/** (or point the CI to a dedicated mocha
config) so the skip is scoped to CI, and add a comment or issue tracker
reference to re-enable/monitor these tests explicitly.
ts-node/esm uses the deprecated --loader flag and requires --experimental-specifier-resolution=node, both of which are removed in Node 24. Switch to tsx which handles TypeScript transpilation and ESM module resolution correctly on all supported Node versions (20+). https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR
|
@blockiosaurus added auto selection of api url based on current set rpc. |
creatorFeeWallet and firstBuyAmount options
tokens via on-chain agent execution
with type-specific configuration prompts
https://claude.ai/code/session_019vt15ih7CYh8fAhSCZmZKR