fix: add delegate to packed accounts in decompress, chunk proofs#2284
fix: add delegate to packed accounts in decompress, chunk proofs#2284SwenSchaeferjohann wants to merge 21 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughThe documentation file Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
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)
ctoken_for_payments.md (1)
268-311:⚠️ Potential issue | 🟡 MinorFix the misleading "parallel" comment and surface the new decimals requirement.
The example has three issues worth addressing:
Misleading parallel execution: The comment says "in parallel, if any" but the code uses sequential
for-loop withawaiton each iteration. Either execute truly in parallel usingPromise.all()or correct the comment to reflect sequential execution.New
decimalsparameter is required: ThecreateUnwrapInstructionnow requires the mint's decimals (fortransfer_checkedvalidation). The example correctly fetches this viagetMint, but this change should be called out since it differs from previous API versions.Missing error handling: In production, both the load batches loop and the unwrap transaction should be wrapped in try-catch blocks with appropriate failure handling (retries, user notifications, etc.).
Example: Fix parallel execution or comment
For truly parallel execution:
-// Send load batches first (in parallel, if any), then unwrap tx -for (const batch of loadBatches) { - await sendAndConfirmTransaction(rpc, new Transaction().add(...batch), [ - payer, - owner, - ]); -} +// Send load batches in parallel (if any), then unwrap tx +if (loadBatches.length > 0) { + await Promise.all( + loadBatches.map(batch => + sendAndConfirmTransaction(rpc, new Transaction().add(...batch), [payer, owner]) + ) + ); +}Or, for sequential (fix comment):
-// Send load batches first (in parallel, if any), then unwrap tx +// Send load batches first (if any), then unwrap tx for (const batch of loadBatches) {
🤖 Fix all issues with AI agents
In `@ctoken_for_payments.md`:
- Around line 144-159: Add a cross-reference to the official
js/compressed-token/docs/payment-integration.md and a brief note next to the
createTransferInterfaceInstructions example: mention the hot/cold sender pattern
and the rule "For a hot sender or <=8 cold inputs, the result is a
single-element array", and instruct readers to run loadBatches (the rest
returned by sliceLast) in parallel and then submit transferBatch sequentially;
reference the symbols createTransferInterfaceInstructions, sliceLast,
loadBatches, and transferBatch and add a link to the payment-integration.md
which contains the full usage example and the table describing contents of each
transaction.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@ctoken_for_payments.md`:
- Around line 312-318: The comment says "Send load batches first (in
parallel...)" but the for-loop over loadBatches runs sequentially; update to
actually send in parallel by mapping loadBatches to an array of
sendAndConfirmTransaction promises using sendAndConfirmTransaction(rpc, new
Transaction().add(...batch), [payer, owner]) and await Promise.all(...) (or,
alternatively, change the comment to remove "in parallel" if sequential behavior
is intended). Ensure you reference loadBatches, sendAndConfirmTransaction, rpc,
Transaction, payer, and owner when making the change so the behavior and intent
remain clear.
…on-aware proof chunking
03c7dc7 to
32849ea
Compare
Summary by CodeRabbit
Documentation
Chores