-
Notifications
You must be signed in to change notification settings - Fork 134
feat: add provider shuffle option to HTTPGatewayRouter #772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Friendly ping @SgtPooki @achingbrain 🧁 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks fine to me.. i think the option could have a better name
@@ -17,6 +17,7 @@ export const DEFAULT_TRUSTLESS_GATEWAYS = [ | |||
|
|||
export interface HTTPGatewayRouterInit { | |||
gateways?: Array<URL | string> | |||
skipProviderShuffle?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something more explicit like keepOrder
would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we should probably add a jsdoc with @default
tag..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even more concise - ‘shuffle’ (default: true)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SgtPooki @achingbrain Thanks for the review!
Just pushed a commit changing it to shuffle
, flipped the corresponding logic, and added a jsdoc comment with a @default
tag ✔️
feat: allow opting out of provider shuffle in HTTPGatewayRouter
See #771 for motivation.
Description
For use cases where gateway lookup order is important, this PR allows passing a new config param to
HTTPGatewayRouter
which opts out of the shuffling which happens on each call tofindProviders
.Notes & open questions
I.e., the feature is backward-compatible.
Change checklist