Skip to content
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

Open
BrandtH22 opened this issue Dec 26, 2024 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@BrandtH22
Copy link
Contributor

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):

image

Here is the example offer:

offer1qqr83wcuu2ryhmwu0y7f2kglqpcdy9yd2cdy5k555ked67m33yfxtnm7pyghwh7a7kukkdtn9kje99y6epfdw4zz5224pdnkzjs4y22ts4g2rpqe60e45eaxvex8mh3h7d54arml4clha8mn0m8nnemeneemul5hjj2fftx5yalv4u5lhn69ma7njw2a7a3desh8rjqz2cvvv4f5yeht7y7l2ndm029jdyjquxhseuv8qyy5tz6x4j49lrg3yqqvhvek47kmyhwnzf0y6s9dgj5x39yak2cfy2hr7e8x0eueuq3a95ae859m9gjz79yhdsc2h37yw8clukww4nw70slxhwpdkey5pctewjcd7ef606c32u2hv5k0k4gwh3p7a50enjv2cl68yfeaeam5a27jvyvmnszwcd9c298fas8t08p7jhh76wrk904gmzw5lzws6t6yxzfc9m0favrjwrl7drau3lzphvmk3acxah02phgmk3alk7pagxamwlmw7um0suyhyreaup9umgdgfjzv7rmdjymcc48n4sc9n9cdyatrkm4uahxd4t95fsmpe7fnxkzt3guweyysmhzws5ldc7tf4huctw7wq47ds57jadx9n5nmwral9tl03qhm0uhvyxmvlp2gft5t0l8dd7p9pvekea94eh6haehwtnkmsr8rjc6lh3wwvwvj2trx0fz4f38v0dnxpp62ma3fl20drc3cqw7scpsthgpe9qq7uf70c53k28xz9cja93v3q4rkuynp97nmehen6ar6nguq7xvwl5sldqry44k3znmym2342whqgfklww87yavsjuayg803a3f6uldt0fx42309g9l3gq55034zxzvxeqd54qvl3cfh7ennut8kl678vkscmqnm9yvh45jae93phz530qrp4hnn0kneenau4pmqgca8psv29yw5h79ruxfh0jncryjaph6ultcu3wsker8x0p6fl09039a3096v03n9mcw5l2xmnu6e9a64qcnd8wjj6a0fxwe7hmuw68kaevn7vrtrttwe2yje58rytcc3j9d8agrgda80e8z2pe83c6cttvkd6uzagjgtwrdgh7hzl9dfzylf3sxarxspslw37mphvhm80a4fr5sz37w5rect3v70d89y8gmt3g724mpk8ksxk0767zfy0mttqksmq6u0jk4te656kz2m5xuxnvdp3p64f6qv34wuhzml3044prmh9vkc02t9l2fw0lccfu378rctawtu0cjz520zh677cegnqlrtkdjls4jn8tvmjjlrhxv4hq66s60ts4at83hps0ze7mju4zrx09zd942vxq747zq977gdelgd49hujq980nml0jn7ujvfmjjrxdgcn0wzkegpj90qvlj29v0xrx70d5lqcj4cv7dp7n3dm9cz668ncmnexvzfaeuc0638fjvl2mxag97yz4kd5t7tnykha4wr2wuhsqpvywcx8jk7378h9dt8z3x9u8550mey8ywm64dcxtjjlhh62rjapkpvqz58968lkaexsuxpfvjgap7h7ww9z36h4htvl7792y7gz8hkekwdgf9vg9agl04nnlxtag53lwpqk95sfqqvpe9v6rfu8gqfggxfarppuqqyxseusfz7wccqq69cqcq20qztgqgjg9spyqqrx2rvnfsmp8g4f8y33r8wtgz973qgpnx4y5esj8za8gq7qqqvx6dg34a9j854g0tjvrl678pagwvgrqfwjd8wenudys5hpkavxkxa83wg6tc2y397tlhhkdmz3d7fgc2wcjdpj808cqfltlwnzgwd38c5whxfyzkyqd5pcxjqp7j5tcfsar7hjrv4rvz886xp3t9q887qcq06e7eny9y6gdqvc5l5lls7w9grudenes4z0ak3cdrakh574ftrm8k4245p20rmuhygp07la8s2f72ngwk28704mvykagj8ckjnnxf83lkrz2enf5u5at4crllpwneh4zuwhq69ps2hwsw9tk0uspuy32anuau7l6v79t4pvl0a2yedc2x9g2g4j3n2mezxn9jnrsac9d2yt5rmkmygmvl2esf5mrdpkzg70kz85ap6sjq292f0465t5nq8l7q5ys5c7j5cdk9m06tf2xe7kr39nt6nu46uu04jg864rxg4pw36dqz5q8s2pwt8uw6zsr34qnrrcthe9frn9sf47c67nh0egxdfhl3n3t4fa0ypcwa9kknnvapmd8jcvm958ky80xzvk9gcshdn7hpwfgklch6gxrcsjnxvst5n24nru9xu2tkkj6zr4vlhfwdhp6s7daha70x880kfltdrzx4qunuwhkx6vj07d65clha3rtf689eh9x48l04t7vjp09tfcuwvjf97wrmxxeqypqcf0unv2p4arvyq0d6fsk7wu4jtl5k068zg7aenq406kvc8t7xkn9mu8n3w8rstt7hfuwvmr2rm6yeu9l0az4nrc0eak5ujlf2gcp9ytpeck06vjyumcwn3wp5pm8tua0eaqnxz0hmt9xezk4ph8udhcakzygy0ug8cqvslsxa87zt6lp26hul2zvt8kdmtuglkp4nkxankwz53drdadh9hwgwh9amdsm5puq8cy0cgl6ly978nl2pmz5we0qevrzxpvyfrs9pxslrqdkrypgrcmscj0y6t3yqrglf7pzzq96dcdcg3apkrexkwy9gajkyqd9z0ujmrzv85qhc7wry9h0wnj7523v2688p2xa2kh8fvjvmmh55fu47yknwujwcenhpapam3z2vyqggm9v3qzpp7xcgznssmw25rcqcxcpjshkvpxs0q6jazyrupsqvfcq3xryp5qst57erzl8pdrysg5m6h0c8awyrnsgcujezvqxs6vxzysqsacqclquq7nx86xccgrqfg8raxwyxvs0pjjd96fzjcgcvypq9yxfv87tvfufqnr9q773pwjgfd6jlx9dd0x3fuz0y2v706rwkzvcn2ded54t5jjw4m5rlwwmkt8yxejqeejyjghka0krpl8f4d7gk226ayse85m4rjd22kvdevpv4j7t34ndfakq5vesjkfz5s9x80uty8fsgn93dlr8vrrxp8eq2yrjq5guuc6s4x8pn2d7y9pevf95jzjazhz4g3k6d5752yq3jgad33n7m9hehjlypukhtn9d40du383lw99c6hz38k7t9ga0wl9esjgc0rkxmun7c70rrmdrfc4rkfh4cluk7tzkt4cfckf3xgunzlqgt8f065kyugqlh287az33k6lm7v567tce5r5fec3u2cp55h2jwm9pw98yswe25ww9ta70n44ql69jdqjh8mdxfl4yumudxew2aft4wdqumqn0h3pchr8dyh99a9mx8km797yxpf58u9pdk0nmyqxrl3m0n5mfgussslm5u4ruk6csmmmmwmguxrn0u4kkrmp77dnj59890wqahwkt6au4u6s34jgad0hxn47qxm7y2gp0fw4zzfgyzjggg99sn342zptal3wu0a3x98lwjsf2hatt7qdy25yyzkqkhxa5y8asnnmftt46cf5jzfqyjzftup223p0tzvllj5mhrjguzxetemq3scjggq85xcggse2cjqctqtz8qrgwqg7vzqufcjgysk3unrqrgs9s9yj6ygyy3zsqz4csy5f67pz8rv3qd6gzcvqcdq4h0chl075ltvgqlchry6xelawlrhwqdfp7787cjjnuvn0aq6h4pma8fmx7e9qehtltwwpyrp0nzgemd4p52p0qs9awldf30at64sse5vys8qqlpknmp7pv430z8wuszeyvxjm39nsuhgy3kxut5430pwyqvpp3v04yf9v5anhdwtu68tpera9nyhhean49ahch5ecrn9z9erxk5akk42wtcl5f994t5t5ls5mpmuaunu6tsdfjv7aemhkc930jj7uh4kq53wtmpycngmt9gpq42z2sul5zc95f9gs2hlvesvwcy7yz4qggd2rnj5srz3ukv9regh8tj5jakafc4j92jlhsquk0dqnxkd0n8kaml0t9mwax90wmtwnwpkeprul3g93v8ukdcce9dmavecmay0847zja0y0kxhd3fuvk8tnq24umk7kz7la4d0gmzj346fyhhak7vds78kfk8cs2jnh6ev95k3k9e2955z74k75ldp3mmnexedjjzjtk4fd70ua88ddf62ka4p2dtq4vsjjs5fu0t0zgzhvx83qgqft8k4n5dqjn7ra2dvp3c6k7xpfzj34zkr8ll27tr5kmxevdtew72gf7jfnmrsjrthdj62m0spxfhhurksya8675jvx8m6amzzev9dtdzkck5u4p7n4lryl6fev56fwgd3mf7e27we6chjhrk75fqgxcsaspppmqw20vxew8q2k2q7vu22lgf4pygxxawa29zc56fhwl9jj2ft99y56wek7ytssd3pmzzxpuets3x79z9pp5t0wpvjayqprnwxu85m5exxqllg0f3zqjqsy8y9snqa8p25r2xulfqcqy3p55tqgr36r725s9qygp3stsxgjjh87guze0q3cp32patqafc86twc2fws4ycgzcu862yqla4c8cspu978l66kn2w3g4l8ty6xuxt8l82ns8cku9g53qazg88uetkr22pgm9wrcfyl53ewwtgrn8dlu32haa94as87gvngyudwuu4un2gtl9879z7k775247c6e27ky2633t7z8r930hvd3drdvqnyj2gynrh796qycy3jexl3nkp3nqnusfzpeqjywwwdggnrje3xlxzsu6qjd93f5nmtvwec8x4k57dgslzlnau6dj09w3dwddtj2hhuuaxmgma6rv8qe8j78kpyy440hevyq9xa88wuzddfn5tnu0xfevu6g06ak8v5ze233ddpretfk3jh7vwaam56r9mn8hmuewwl49k3f5e899ayy7h06jqdwt64m46tm2y3ultmt322e2340528m46lsudlkeupz2repykc70lph2sw9gkznrm7mmgmuh9texhtp0gtmez3znwcaa6mdl2ldkfdgdxe40jtehze206slmp66g4aahdk52a7gnd235mdty3ms4wcc6nf4pe0x2jw0ecg0v6nhl4s06tefe9lem7lh2puqxdxh7ty3hdej92qlxfyvjfzqeyju02zg7lg38me0pxssvfr8d0ydc2w4mxwl2nyv7x87jgh0nzvf3uwmh0h5use8pzvzgevnt7synwnlcp6q2vcd3aq88udlvxwxhgd85u3uhxn8stpqptnw6e0cp9usayrhdv9hsp3yf8mudgka9jvjhr0qfgtjnhwrjq688sf7gmjat8v4ng0tf8dhpuhrteslhd7857ndlqy9w04d4t64k363whumnmwgv8hxg022077xmqfrq3d88w8xqepvwjeqsfwcpttt9tpgxqmalq9s2aycd7demwaupzvexjqstz44mnql7lawtqk4na4fcmcq20ylf9mtxuszkykp8du9jkjzrnxz8tgd4xy0yc37mtxe2sqa5pmsx40wyqddcreuglmkc9zg4hxykvy9wa9wdlafkkevuvcfeeu38yvtmvyymlqwf75lrxl7zt6ltlyhetu8el5nhwfrv4mylmk9ftfsg0zm3xn0tcm5ue4588h5lm3fcwejd2gpusn688a4yx7jgdysaln8vrrxp8eq85zjq0guuhwsn68pn857q93mffy0catdc4qjufkwnaycm4vddj2e9x27vaen8ma86ws2u93a3q89e08q7egd3707s785qyutvpg9h87utxdfz4ky6hsqc278x9vsvylwuc4umjwre7ujcckmde3tye7rdd3ltk4lelxwdf55cj86ap6cc78vm4ta4zk68jpxeytfc07eq5fg752e95jy5cldet56j7l9jaq53vw2uze5w7507jmf2z5jh87s0npvfanknut6tlyyghjk0dw03wpfua06mplt7cue6lhp69tkmjhdp52537frxa3gapl88djztm8v04t3vmycf92w9wu5ennx24y2skahxa34qejpu69halz0a2tl0jstc9k2gnlav62fpusr6pfq85w2v7lc7v75dmfc6wxz5fljx52ucp4hp327asm00jgptjhwzlcc4l083jnjq0yy7sga8s402y8cqytqydstq0yq96ja9vr5r78uj93qzzryvpgw2g2uj93sssjt2zyvglftsxfy3gjrqyfsfqun3928vn569kru8kdc04a9uvqn6pemfc0cpnnyqnpxca8q8qjd8q2zxl6vrt8zmpd4ytzuqxr6euzmsssvu5rpusq8nzq80yg9rq7jmp3zw6hd7wfuuhassamye08ny4uwey6tk0kr5tjl96htgk3lek9muf2gyz9fqkphntxqpxzayjrvkgr3h878spwju9jpps5qcws3qpqe9k05dccjs5xv8l42yqgygz04qcym5cjuq3hfd4hmp97hu7c5gnyrqdup805988r4ajcp6xy7p3uw94m6ufsjjdl2w46kauysplthmr3x6un2yf7ekhnu2lhn3elj0tc2kamghqh9xajlex564deqrval2sddyj2j076utyrcsq7ppu7p6x0v8yqxgg0ljdcz8vr0xprcyyy83cffyeyujqk8e5ptl58qfpe42np3frkmrdpy32c7frwtklq5vmechjydulpz7ay69zaa4ujfkxp5zsmmu0psahw56ma7akn7pn8x5tptmzktkz40ukv0jd4h2rukwn788s4pvujdhgc99m8av8h6a6gl4prc46nygam5pa7pqy5af8wjm85hvld2g54g2mgpfhndewd6x7gvj7789e3xhpzncyy5s5043l9htl4xc792dj3akan8h75t7754dkp24h0t0lqjre7ukamuc2l76s0e3ht70gdheqhze0pt2pd65ahdnzn4z6fagnfhjsrugqjnh34a0k8jjgp6ftk34205lytqvfjc2vw03fn738pfwr8d85gthskdnvhhakj42ew4g55l46fzlyycknfd42hkk29lsxt0gd7gduuhvlt2np4d29r3eel8a04qaszhc2qd

Version

2.5.0

What platform are you using?

macOS

What ui mode are you using?

GUI

Relevant log output

No response

@BrandtH22 BrandtH22 added the bug Something isn't working label Dec 26, 2024
@BrandtH22
Copy link
Contributor Author

Error that appears in the chia client:
image

@wjblanke wjblanke assigned Quexington and Rigidity and unassigned Quexington Jan 8, 2025
@wjblanke
Copy link
Contributor

wjblanke commented Jan 8, 2025

Brandon can u tell us what you did to Sage to fix acceptance

@BrandtH22
Copy link
Contributor Author

This is the commit that Rigidity made to sage to ensure these offers can be accepted:
xch-dev/sage@3736e3e

@wjblanke
Copy link
Contributor

wjblanke commented Jan 8, 2025

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?

@Quexington
Copy link
Contributor

Quexington commented Jan 8, 2025

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.

@Quexington
Copy link
Contributor

Error that appears in the chia client: image

Do you by chance have the corresponding backend stacktrace from the logs?

@Quexington
Copy link
Contributor

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?

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.

@Rigidity
Copy link
Contributor

Rigidity commented Jan 8, 2025

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?

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.

@Rigidity
Copy link
Contributor

Rigidity commented Jan 8, 2025

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.

If you create a Payment with an amount of 0 from the settlement_payments puzzle, it raises an error.

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.

@Rigidity
Copy link
Contributor

Rigidity commented Jan 8, 2025

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?

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.

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?

@Rigidity
Copy link
Contributor

Rigidity commented Jan 8, 2025

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.

@Quexington
Copy link
Contributor

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.

@Rigidity
Copy link
Contributor

Rigidity commented Jan 9, 2025

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 🤔

@Rigidity
Copy link
Contributor

Rigidity commented Jan 9, 2025

Btw, https://mixch.dev is the offer viewer in the original screenshot, it's very useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants