-
Notifications
You must be signed in to change notification settings - Fork 256
feat: support multiple JITO endpoints with round-robin retry #2664
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
base: main
Are you sure you want to change the base?
feat: support multiple JITO endpoints with round-robin retry #2664
Conversation
Co-Authored-By: Ali Behjati <ali@dourolabs.xyz>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
@@ -50,7 +50,7 @@ export default { | |||
default: 50000, | |||
} as Options, | |||
"jito-endpoint": { |
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.
Let's rename this param to jito-endpoints
for clarity
while (Date.now() - startTime < maxRetryTimeMs) { | ||
const currentClient = clients[clientIndex]; | ||
try { | ||
await currentClient.sendBundle(bundle); | ||
return firstTransactionSignature; | ||
} catch (err: any) { | ||
lastError = err; | ||
clientIndex = (clientIndex + 1) % clients.length; | ||
await new Promise((resolve) => setTimeout(resolve, 500)); | ||
} | ||
} |
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.
(aside) @guibescos do you know how many jito endpoints we can round robin against? the ratelimit retry logic is a little funky here if there are only 2 or 3.
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.
(aside) cc @ali-bahjati
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.
I have never experimented with multiple jito endpoints so I don't have a good take on this!
Co-Authored-By: Ali Behjati <ali@dourolabs.xyz>
Closing due to inactivity for more than 7 days. |
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.
Add a log line when attempting sendTransactionsJito
to indicate which jito endpoint is being used
(aside) okay devin is ignoring me -- will test this out manually and make any updates necessary |
…evin/1746706324-solana-jito-multiple-endpoints
} else { | ||
throw err; | ||
try { | ||
this.logger.info("Sending Jito transactions..."); |
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.
did you mean to leave these extra logs here?
} catch (err: any) { | ||
lastError = err; | ||
clientIndex = (clientIndex + 1) % clients.length; | ||
await new Promise((resolve) => setTimeout(resolve, 500)); |
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.
why do we need to wait between different endpoints
let lastError: Error | null = null; | ||
let clientIndex = 0; | ||
|
||
while (Date.now() - startTime < maxRetryTimeMs) { |
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.
since the pushing frequency is 5 seconds in the production deployment, the scheduler will try to push a fresher bundle 5 seconds after.
60 seconds retry time seems too much, after 5 seconds the current bundle is stale and the current task should terminate
{ maxRetryTimeMs: this.maxRetryTimeMs }, | ||
); | ||
} catch (err: any) { | ||
if (err.code === 8 && err.details?.includes("Rate limit exceeded")) { |
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.
tbh this "timeout" code path was added as an ducttape fix by ayaz so feel free to rework it into some more principled
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.
This will probably take some trial and error. Approving to not slow you down
Multiple JITO Endpoints Support
This PR adds support for multiple JITO endpoints in the Solana price pusher with a round-robin retry mechanism.
Changes:
sendTransactionsJito
to accept a list of SearcherClientsSolanaPricePusherJito
class to accept multiple endpointsImplementation details:
Link to Devin run: https://app.devin.ai/sessions/4b444e4e547842658001b352436f6970
Requested by: Ali Behjati (ali@dourolabs.xyz)