livepeer / go-livepeer

Official Go implementation of the Livepeer protocol
http://livepeer.org
MIT License
546 stars 169 forks source link

fix(ai): improve AI selection algorithm #3030

Closed rickstaa closed 5 months ago

rickstaa commented 5 months ago

What does this pull request do? Explain your changes. (required)

This pull request modifies the selection algorithm to continue retrying for a duration of one second instead of stopping after four attempts. This change addresses issues encountered with the current algorithm's performance in environments with 15 nodes on the network, ensuring more robust and reliable operation until further optimizations can be implemented.

Specific updates (required)

How did you test each of these updates (required)

I tested it offchain/onchain on my development Gateway.

Does this pull request close any open issues?

Checklist:

rickstaa commented 5 months ago

Here's @yondonfu; this straightforward solution might help ease the situation. I have several other PRs lined up to fix the double selection, but this one is ready for merging if there are no objections. I also am finishing a tech spec explaining all the improvements that can be made. The only downside I see is the increased cost because we pay orch's for returning an insufficient capacity error. To address this, I've created a new pull request, which you can review here: PR #3035.