-
Notifications
You must be signed in to change notification settings - Fork 62
Feat/lw 12753 add retry mechanism for inputselection errors #1623
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
Feat/lw 12753 add retry mechanism for inputselection errors #1623
Conversation
|
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.
LGTM!
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.
Great work! 💪
throw error; | ||
} | ||
|
||
dependencies.inputSelector = new LargeFirstSelector({ |
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.
Ideally fallback inputSelector would be a separate dependency, but this is just a minor nit
InputSelectionFailure.UtxoNotFragmentedEnough | ||
] as const; | ||
|
||
it.each(fallbackFailures)('falls back to large first when random improve throws', async (failure) => { |
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.
Nice tests ❤️
Context
Some users with complex wallets that have hundreds (or even thousand) of UTxOs with small amounts can make our current input selection strategy fail due to selecting more inputs than max allowed, we need alternative input selection strategies for such wallets
Proposed Solution
Add a retry mechanism that fallback to large first when random improve fails to select