plasma-contracts icon indicating copy to clipboard operation
plasma-contracts copied to clipboard

Integration docs: explain how outputs are marked as non spendable when exit / piggybacked

Open kevsul opened this issue 5 years ago • 4 comments

kevsul avatar Jan 08 '20 09:01 kevsul

From Slack:

jarindr 5:14 PM okay I have a super weird scenario either it is a bug or i don't understand something Alice create tx in the air not included to Bob Bob start IFE on that tx Bob Piggyback the output the tx that Alice sent to Bob finally get included ( now bob has 1 UTXO to use ) Bob now try to use that utxo from above ( alice sent to bob ), watcher throw utxo_not_found (edited) this utxo_not_found problem happen ONLY when piggyback happened nothing make sense to me XD so if Bob didn't call piggybackInFlightExitOnOutput that utxo is usable as usual but once he called, then Alice send to Bob then Bob try to send back to Alice

...

piotr 20 hours ago ok, sorry it took so long, yestarday was a holiday here. so following the scenario you posted, if Bob piggybacks on an included tx's output, Bob won't be allowed to spend that output on the child chain. On a PiggybackOutput (or whatever it's called) event, child chain will remove the piggybacked utxos from the spendable set. Sounds like all is behaving correctly. You can think of output piggybacking in this scenario as something resembling a standard exit (since the tx got eventually included). In a SE case, the output is also blocked from spending on the chch.

kevsul avatar Jan 08 '20 09:01 kevsul

@kevin @pdobacz was referring to not allowing of spending an included, piggybacked tx output on ch-ch. On contracts side output is marked as spent only on exit finalization. So a user may call PlasmaFramework.isOutputSpent for a piggybacked output and it returns false while this output may be not spendable in a ch-ch. Is it ok to just briefly explain this difference in the integration-docs or should I go more into details how it works on contract and on elixir side?

Maybe we should rename this mapping in ExitGameController to isOutputWithdrawn, as isOutputSpent name may be a bit confusing.

pgebal avatar Jan 09 '20 15:01 pgebal

I think the doc should have enough detail to address the original question of why a utxo is unavailable on the child chain once it has been piggybacked. I realise that this doc is in plasma-contracts, but it shouldn't be limited to just the contracts side of things - users, integrators, etc. need to understand how it all works together.

Maybe we should rename this mapping in ExitGameController to isOutputWithdrawn, as isOutputSpent name may be a bit confusing.

I agree that this would be a better name

kevsul avatar Jan 10 '20 08:01 kevsul

hmm, isOutputWithdrawn might be a bit confusing on the case of IFE input is flagged. probably isFinalized?

boolafish avatar Jan 10 '20 08:01 boolafish