-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The amount of returned dust coins is limited by factor relative to th…
…e amount of selected big coins (#2610) ## Description This PR implements a slight change to the coins to spend algorithm w.r.t how many dust coins can be selected. Each coins query can result in "free slots." For example, if max is set to 10 and the query is satisfied with 3 coins, 7 slots remain unused. The previous algorithm randomly added up to 7 dust coins to fill these slots. The new algorithm limits dust coins to at most 5 times the number of large coins, while still respecting the max limit on total coins. This will prevent the "dust coin flood", ie. responses that contain a single big coin and 200 dust coins. ## Checklist - [X] New behavior is reflected in tests ### Before requesting review - [X] I have reviewed the code myself ### After merging, notify other teams - [X] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- Loading branch information
Showing
1 changed file
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters