-
Notifications
You must be signed in to change notification settings - Fork 270
fix(audit): scope provider attribute queries to provider keys#2076
fix(audit): scope provider attribute queries to provider keys #2076modernzju wants to merge 1 commit into
Conversation
Signed-off-by: modernzju <modernzju@outlook.com>
WalkthroughTwo gRPC query handlers ( ChangesAudit Provider Query Prefix Scoping
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Uh oh!
There was an error while loading. Please reload this page.
Description
Closes: akash-network/support#619
Scopes the
AllProvidersAttributesandAuditorAttributesquery pagination to the audit provider key prefix.Previously both query handlers paginated over the full audit KV store and called
ParseIDFromKeyfor every key. That works while the store only contains provider keys, but it is fragile: any future non-provider key under the same store key could be parsed as a provider ID and cause incorrect results or a panic.This change wraps the audit store with
prefix.NewStore(..., types.PrefixProviderID())before paginating, so only provider attribute records are scanned. The tests add a non-provider key to the audit store and verify both query paths ignore it.Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.md