-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fix inaccurate fee estimations #5303
Conversation
75746d8
to
2015df6
Compare
2015df6
to
aab07ae
Compare
cc @314159265359879 to help QA here? |
src/app/common/transactions/bitcoin/coinselect/local-coin-selection.spec.ts
Show resolved
Hide resolved
src/app/pages/send/send-crypto-asset-form/form/btc/btc-send-form-confirmation.tsx
Show resolved
Hide resolved
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 good here, and I'm not running into any bugs testing it. 👍
@kyranjamie I believe we need to fix calc in |
checked btc send with 3ns inputs and 2ns outputs and it worked for me 👍 |
Eurgh, this needs refactoring. Though I think it doesn't have same problem, as the other with the for loop. |
// From the address of the recipient, we infer the output type | ||
[outputAddressTypeWithFallback + '_output_count']: outputLength, | ||
[outputAddressTypeWithFallback + '_output_count']: outputCount, |
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.
as I understand we can skip adding _outputs_counts
for different output types? 🤔
like it is now in getSizeInfoMultipleRecipients
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.
Not entirely sure what you mean by this @alter-eggo ?
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.
You do this as well in the multiple recipients code acc[type + '_output_count'] = count;
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.
Open for changes if needed here, but merging to not hold up fixes
This PR fixes the issues relating to fee estimations describe in Notion.
The previously calculation lead to a situation whereby some estimations would be counting one fewer input than actually used, thus vastly decreasing the fee rate.
Open to feedback how we can extend the tests of the coin selection.
@fbwoolf can you please QA this to double check
2024-04-25-000182.mp4