-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Bug] Offers are Creating an Extra CreateCoin for CATs in the Amount of 0 Preventing offer Acceptance #19092
Comments
Brandon can u tell us what you did to Sage to fix acceptance |
This is the commit that Rigidity made to sage to ensure these offers can be accepted: |
Quex can u verify only looking at index 0 is OK? Also why do we create a zero value CAT in our offer creation code? |
I'm not familiar with the sage code so I can't exactly sure what the fix is doing, it seems like maybe it's combining multiple payments into one and I'm not sure why that would work so it would be good to have @Rigidity comment on what the motivation for the change was. |
My reading of the knapsack coin algorithm is that 0 is a valid coin amount for it to select and may therefore do that. Not 100% that's why this would be the case, but that's my best guess. |
That's not what the Sage code is doing, it's combining all of the coins into one output which is created by the first coin. The total amount remains the same, just reduces the amount of dust in the taker's wallet when accepting the offer. |
If you create a By combining the coins it avoids this issue. Technically I could probably just skip the zero coins instead, but the reference wallet shouldn't be creating zero amount settlement CATs to begin with. |
I think the wallet should be combining the inputs into one settlement coin unless it needs to create intermediate ones for duplicate royalty payments, for example. Maybe there's a bug in that payment dedupe logic that creates a zero amount coin? |
I'm guessing the fix for the Chia wallet would be the same - don't include notarized payments with an amount of 0 when taking offers as a workaround. But also don't create settlement coins with an amount of 0 when making offers, ideally. |
I think the initial description might be misleading, although, I could be wrong as I have not used that particular explorer before. @BrandtH22 said "create coin" but the image shows that the coin is offered, not created. Like I said, I think knapsack will select those zero coins and this might be tripping the reference wallet up in some way but again, a stack trace would be helpful to know where to look. |
It's a settlement coin that was created by the input(s) with an amount of 0, and wasn't included in an intermediate spend, so it's being picked up as a coin to make payments by the taker. Would be good to just filter 0 amount coins out of the coin selection function if it's doing that, but it's also strange that a 0 amount coin would have been created by the wallet in the first place 🤔 |
Btw, https://mixch.dev is the offer viewer in the original screenshot, it's very useful |
What happened?
A number of users are reporting issues with accepting some offers created in versions 2.1.4+ (might also effect earlier versions). The issue only arises when a CAT is involved in the offer and upon inspecting the offers there is an extra create coin condition for the CAT in the amount of 0.
This is how it appears in mixch for the below example offer (which has since been cancelled):
Here is the example offer:
Version
2.5.0
What platform are you using?
macOS
What ui mode are you using?
GUI
Relevant log output
No response
The text was updated successfully, but these errors were encountered: