Repository navigation
feat(dapi): add method to retrieve all non-banned endpoints - #3072
Conversation
## Issue being fixed or feature implemented Need ability to read all non-banned endpoints in DAPI client for monitoring, diagnostics, and custom load balancing strategies. ## What was done? Added public API to get all non-banned addresses from DAPI client: - `AddressList::get_live_addresses()` - returns `Vec<Address>` with all non-banned addresses - `DapiClient::get_live_addresses()` - convenience method at DapiClient level that delegates to AddressList - Uses same filtering logic as `get_live_address()` - checks if `banned_until < now` or ban has not been set - Added comprehensive documentation with usage examples ## How Has This Been Tested? Added 5 unit tests covering all scenarios: - Empty address list - All addresses unbanned - Some addresses banned - All addresses banned - Addresses unbanned after previous ban All tests pass. Verified with: - `cargo test -p rs-dapi-client` - `cargo check -p rs-dapi-client` - `cargo clippy -p rs-dapi-client` ## Breaking Changes None. This is a purely additive change that introduces new public methods without modifying existing behavior. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
📝 WalkthroughWalkthroughTwo new public methods added to retrieve all live (non-banned) addresses: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
|
CI errors are unrelated. |
Issue being fixed or feature implemented
Need ability to read all non-banned endpoints in DAPI client for monitoring, diagnostics, and custom load balancing strategies.
What was done?
Added public API to get all non-banned addresses from DAPI client:
AddressList::get_live_addresses()- returnsVec<Address>with allnon-banned addresses
DapiClient::get_live_addresses()- convenience method at DapiClientlevel that delegates to AddressList
get_live_address()- checks ifbanned_until < nowor ban has not been setHow Has This Been Tested?
Added 5 unit tests covering all scenarios:
All tests pass. Verified with:
cargo test -p rs-dapi-clientcargo check -p rs-dapi-clientcargo clippy -p rs-dapi-clientBreaking Changes
None. This is a purely additive change that introduces new public methods without modifying existing behavior.
Co-Authored-By: Claude Sonnet 4.5 [email protected]
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
get_live_addresses()method to retrieve all currently active addresses in batch, complementing the existing single-address lookup functionality.Tests