threefoldtech / tfchain

Threefold Chain.
Apache License 2.0
15 stars 11 forks source link

Misuse of balance lock #969

Open sameh-farouk opened 1 month ago

sameh-farouk commented 1 month ago

Describe the bug

By reviewing the billing code, it seems that the balance lock feature (from the balances pallet) may have been used incorrectly in our smart-contract pallet (at least it wasn't intended for such a use case).

Here are some side effects that I can think of:

I can provide more details later (issue to be updated)

To Reproduce

Expected

Screenshots

Additional context

0oM4R commented 1 month ago

I'm working on https://github.com/threefoldtech/tfgrid-sdk-ts/issues/2489 , and while testing the flow, i had total locked amount with less than 19 tft, Screenshot from 2024-05-13 19-16-21 balance details : Screenshot from 2024-05-13 19-16-40

i have funded my wallet with 19 tft, i was expecting to bill all of them, but after call billContractForBlock for all contracts, all contracts moved back to created state, I my balance details : Screenshot from 2024-05-13 19-21-47 Screenshot from 2024-05-13 19-21-17

locks like there is somthing wrong with rent contract billing Screenshot from 2024-05-13 19-23-33 Screenshot from 2024-05-13 19-22-55