improve rent - #31
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The rent-query commitment mismatch can cause account initialization failures.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Improves Solana rent handling and makes cleanup behavior deterministic.
Changes:
- Uses live rent values for account funding.
- Adds a fixed SOL cleanup threshold.
- Improves rent-query error context.
File summaries
| File | Review |
|---|---|
solana/solana.go |
Separates account funding from cleanup selection. Add boundary and non-SOL tests for the new threshold. |
apps/solana/rpc.go |
Changes rent-query commitment and error handling. The query should use processed to match transaction execution and avoid underfunding during rent increases. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func (c *Client) RPCGetMinimumBalanceForRentExemption(ctx context.Context, dataSize uint64) (uint64, error) { | ||
| for { | ||
| r, err := c.rpcClient.GetMinimumBalanceForRentExemption(ctx, dataSize, rpc.CommitmentProcessed) | ||
| r, err := c.rpcClient.GetMinimumBalanceForRentExemption(ctx, dataSize, rpc.CommitmentConfirmed) |
Comment on lines
+45
to
+47
| func isSOLCleanupDust(assetID string, lamports decimal.Decimal) bool { | ||
| return assetID == solanaApp.SolanaChainBase && | ||
| lamports.Cmp(decimal.NewFromUint64(solanaCleanupDustLamports)) <= 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.