Skip to content

fix: paginate Helius stake account requests - #283

Open
zmaslerdev wants to merge 1 commit into
crypkit:masterfrom
zmaslerdev:fix/solana-program-accounts-v2
Open

fix: paginate Helius stake account requests#283
zmaslerdev wants to merge 1 commit into
crypkit:masterfrom
zmaslerdev:fix/solana-program-accounts-v2

Conversation

@zmaslerdev

Copy link
Copy Markdown

📝 Summary

Use paginated Helius stake-account queries while preserving legacy getProgramAccounts behavior for non-Helius Solana RPC providers.

🔍 Review

Recommendation: 🟡 Focused review — the change is localized, but stake balances depend on complete cursor traversal.

⚠️ Review carefully:

  • blockapi/v2/api/solana.py:_fetch_staked_sol — continue through empty filtered pages until paginationKey is null and preserve the flat internal result contract.

🔗 Compatibility

Helius RPC hosts use getProgramAccountsV2; other Solana RPC providers retain getProgramAccounts. Existing parsers still receive result as a flat account list.

✅ Verification

Confidence: 🟢 Fully verified — focused and full unit suites pass, and both production Helius and the default Solana RPC paths were exercised live.

@zmaslerdev

Copy link
Copy Markdown
Author

Hi @galvanizze, could you please review this change? GitHub does not allow the PR author to submit a formal review request without upstream write permission.

Comment thread blockapi/v2/api/solana.py
params=[self.STAKE_PROGRAM_ID, config],
)

config['limit'] = self.api_options.max_items_per_page

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recheck this setting for helius

@galvanizze galvanizze left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test on some addresses, with lots of balances/nfts, to check whether paginating works ok

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.

2 participants