Skip to content

improve rent - #31

Merged
cedricfung merged 1 commit into
mainfrom
improves/changing-solana-rent
Sep 7, 2026
Merged

improve rent#31
cedricfung merged 1 commit into
mainfrom
improves/changing-solana-rent

Conversation

@hundredark

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI 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.

🟡 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.

Comment thread apps/solana/rpc.go
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 thread solana/solana.go
Comment on lines +45 to +47
func isSOLCleanupDust(assetID string, lamports decimal.Decimal) bool {
return assetID == solanaApp.SolanaChainBase &&
lamports.Cmp(decimal.NewFromUint64(solanaCleanupDustLamports)) <= 0
@cedricfung
cedricfung merged commit 5e9f637 into main Sep 7, 2026
4 checks passed
@cedricfung
cedricfung deleted the improves/changing-solana-rent branch September 7, 2026 16:45
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.

3 participants