feat(rpc): expose remote account claim counts - #1500
Conversation
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughThe change adds shared atomic remote-account claim tracking to Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@magicblock-aperture/src/requests/http/mod.rs`:
- Around line 239-245: Remove the redundant
read_accounts_with_ensure_with_context method and update its sole caller in
get_multiple_accounts.rs to invoke read_accounts_with_ensure directly, passing
the existing fetch_context unchanged.
In `@magicblock-aperture/src/requests/http/send_transaction.rs`:
- Around line 49-55: Extract the duplicated SendTransaction AccountFetchContext
construction into a shared helper such as send_transaction_context alongside
rpc_get_account_context and rpc_get_multiple_accounts_context in mod.rs. Update
magicblock-aperture/src/requests/http/send_transaction.rs:49-55 and
magicblock-aperture/src/requests/http/simulate_transaction.rs:58-66 to call the
helper with signature and remote_account_claims, preserving the existing
entrypoint and requested-account values.
In `@magicblock-aperture/tests/accounts.rs`:
- Around line 10-21: The remote account claims header helper is duplicated
across three integration test files. Add or reuse the shared
`REMOTE_ACCOUNT_CLAIMS_HEADER` and `remote_account_claims_header()` definitions
in `tests/setup.rs`, remove the local copies, and import the shared helper in
`magicblock-aperture/tests/accounts.rs` lines 10-21,
`magicblock-aperture/tests/batches.rs` lines 4-15, and
`magicblock-aperture/tests/transactions.rs` lines 19-30.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 17da7a60-87c2-4d60-a763-498db8521f37
📒 Files selected for processing (22)
magicblock-aperture/src/requests/http/get_account_info.rsmagicblock-aperture/src/requests/http/get_balance.rsmagicblock-aperture/src/requests/http/get_delegation_status.rsmagicblock-aperture/src/requests/http/get_multiple_accounts.rsmagicblock-aperture/src/requests/http/get_token_account_balance.rsmagicblock-aperture/src/requests/http/mod.rsmagicblock-aperture/src/requests/http/send_transaction.rsmagicblock-aperture/src/requests/http/simulate_transaction.rsmagicblock-aperture/src/server/http/dispatch.rsmagicblock-aperture/tests/accounts.rsmagicblock-aperture/tests/batches.rsmagicblock-aperture/tests/transactions.rsmagicblock-chainlink/src/chainlink/fetch_cloner/ata_projection.rsmagicblock-chainlink/src/chainlink/fetch_cloner/mod.rsmagicblock-chainlink/src/chainlink/fetch_cloner/pending_operation.rsmagicblock-chainlink/src/chainlink/fetch_cloner/pipeline.rsmagicblock-chainlink/src/chainlink/fetch_cloner/program_loader.rsmagicblock-chainlink/src/chainlink/fetch_cloner/tests.rsmagicblock-chainlink/src/chainlink/mod.rsmagicblock-chainlink/src/remote_account_provider/mod.rsmagicblock-chainlink/src/remote_account_provider/tests.rsmagicblock-metrics/src/metrics/types.rs
2ea1ad1 to
7708b73
Compare
Summary
Add
X-MB-Remote-Account-Claimsto JSON-RPC responses, reporting the number of unique remoteaccounts claimed while serving a request.
Details
paths.
duplicates, waiters, companion fetches, and internal/background fetches.
claims report
0.positive coverage in
test_remote_account_claims_count_owned_unique_requested_pubkeys.AccountFetchContextcloneable rather thanCopy: it owns anArc<AtomicU64>, and the remaining clones are required for async ownership and shared request accounting.Summary by CodeRabbit
New Features
X-MB-Remote-Account-Claimsresponse header to account-related RPC requests, including batch responses.Bug Fixes
Tests