You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The migration algorithm is an iterative algorithm, which attempts to construct several coin selections in order to deplete a wallet. An initial "ideal batch size" is calculated beforehand, and then, the algorithm proceed to construct selections from batch of inputs of that ideal size (modulo the last batch).
Constructing a selection also means balancing it. Here, the algorithm will depletes change outputs until reaching an equilibrium and will take care of filtering out dust coins that are below a certain threshold.
There are cases where a given selection could not produce any value (all change output are below the threshold).
Expected Behavior
The algorithm should discard such "no-value" selections, and continue processing next batches until it has traversed all batches.
Current Behavior
The algorithm stops at the first "no-value" selections and returns, with whatever selections has been accumulated this far, possibly leaving many inputs behind.
The issue is the handling of the Nothing branch ☝️ which should not be pure [] (terminal case of the recursion) but simply migrate, discarding the ongoing selection, but continuing migrating others.
The text was updated successfully, but these errors were encountered:
Context
The migration algorithm is an iterative algorithm, which attempts to construct several coin selections in order to deplete a wallet. An initial "ideal batch size" is calculated beforehand, and then, the algorithm proceed to construct selections from batch of inputs of that ideal size (modulo the last batch).
Constructing a selection also means balancing it. Here, the algorithm will depletes change outputs until reaching an equilibrium and will take care of filtering out dust coins that are below a certain threshold.
There are cases where a given selection could not produce any value (all change output are below the threshold).
Expected Behavior
The algorithm should discard such "no-value" selections, and continue processing next batches until it has traversed all batches.
Current Behavior
The algorithm stops at the first "no-value" selections and returns, with whatever selections has been accumulated this far, possibly leaving many inputs behind.
Resolution
https://github.com/input-output-hk/cardano-coin-selection/blob/cff368d674fe58bc1a12e6564a26ccea21eb5aac/src/library/Cardano/CoinSelection/Algorithm/Migration.hs#L108-L112
The issue is the handling of the
Nothing
branch ☝️ which should not bepure []
(terminal case of the recursion) but simplymigrate
, discarding the ongoing selection, but continuing migrating others.The text was updated successfully, but these errors were encountered: