-
Notifications
You must be signed in to change notification settings - Fork 8
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
[Qanet] Ensure compatibility with TFChain 2.9 release #3340
Comments
@AhmedHanafy725 A last-minute change that is worth highlighting. |
Will start with the balance changes and running the node, and will apply the contract lock changes tomorrow: |
Issue update: |
Issue Update: Question: in dashboard, should we go with time estimate update: will add 2h for playground edits |
For the first case, For the second case, On the other hand, the |
Issue update: |
moved to blocked on chain deployment |
Any reason for keeping old names? I understand the need for consistency to avoid confusing users, but this should not prevent us from correcting or improving some UI terms. Referring to the amount needed to be settled as a locked amount is not correct. It's the other way around; the locked amount is the amount already settled/reserved. |
Just a friendly reminder, we should conduct tests locally whenever possible. Here are the steps to follow:
I understand the temptation to wait for the devnet deployment, but I want to highlight your options here. |
I'm leaving it as is until we talk to @AhmedHanafy725 . I will check with him as soon as possible and apply the changes. |
grid client is using graphql to generate the consumption rate, and it is used to get the overdue amount. already tested creating name contract and getting the payment state but I couldn't calculate the overdue amount to test resuming graceperiod contracts. |
@0oM4R You could run a local Graphql instance that listens to the local TFChain. |
As discussed with Thabet will wait for the chain deployment |
Runtime was updated on devnet |
Issue update: |
Issue update: cost calculation is almost done, need to handle todo: |
Issue update: |
Issue update: |
Issue update: dashboard now calling the new methods, need to implement the new flow of node contracts on the rent contract only; |
unique name calculation looks fine.
will update the time estimation to more 8 hours; for UI changes, test, clean up the code, and prepare the pr |
Issue update : |
Issue update: while testing faced a edge case, when rent contract got billed and the node contract got crated after that, and got billed before the next billling cycle of the rent contract; in this case we have node contract on grace period, and its rent contract is on created state.
todo: handle the mentioned case in UI, and test it. will take about 3h |
For rephrasing will do in separate issue #3400 |
need to include two things:
|
You mean on certified nodes, not dedicated ones, right?
Isn't this handled by the calc module? |
no it is not
|
Issue update: while testing with Sameh we found that there is some fractions is messing, I did some refactor to increase the accuracy
still can't find the fractions gap, all calculation should be fine! |
Todo dashboard: on reload contracts, the rented node ref should be cleared |
for name contract the calculation seems to be correct and the contract moved to created state only if i used the polkadot ui and bill the contract using another account, this mean the issue might be in the extrinsic fees |
issue update : added some ui enhancements by resetting values as mentioned above |
issue update:
|
verified on qanet ran the billing test suite billing is made after the first hour in the first billing cycle, determining the billing rate for each contract and deployment when the contract is in a grace period, you can now click on the grace period and learn more about the contracts and tfts to unlock the machine on the rented went to a grace period when the node went to a grace period tried to deploy on the node after it went grace period (was possible before) |
Which package/s are you suggesting this feature for?
No response
Is your feature request related to a problem? Please describe
Ensure compatibility with TFChain 2.9 release / TFChain runtime v152
Describe the solution you'd like
For better context
PR: threefoldtech/tfchain#992
Relevant SDK Adjustments Needed:
Fund Reservations: The system now employs a more reliable reservation method, replacing the previous use of locks/freezes.
Balance Handling: Payments on hold are no longer considered part of the free balance. The total balance should now reflect both the reserved and free portions. Previously, the free balance was considered the total balance, with amounts reserved for future payments subtracted from it. The new approach aligns with the balances pallet terminology:
Contract Payment Tracking: The ContractLock has been replaced with ContractPaymentState to better track and manage the states of contract payments, particularly during grace periods and when dealing with overdue payments.
https://github.com/threefoldtech/tfchain/blob/622e7d255b9c76203fba8a316b84b280b59fbba7/substrate-node/pallets/pallet-smart-contract/src/types.rs#L219-L224
https://github.com/threefoldtech/tfchain/blob/83ccaa45d86076f6730d3611ce0c826c69dce649/substrate-node/pallets/pallet-smart-contract/src/types.rs#L236-L243
Dashboard Restore Contracts Feature: After the update to the new runtime, the dashboard's "restore contracts" feature will no longer be usable. To correctly reinstate this functionality, the following steps are needed:
Update:
Possibly less relevant changes::
Event Emission Changes: The events emitted from the billing process have been updated, and several changes have been made:
New Events:
ContractPaymentOverdrawn
: This event is closely related to theContractBilled
event. Both events provide information about the amount due for the previous billing period. TheContractBilled
event indicates that the due amount was successfully charged to the user's account. In contrast, theContractPaymentOverdrawn
event signifies that the due amount was not fully covered and has been added to the contract's overdraft. This distinction helps in accurately tracking the financial state of contracts.RewardDistributed
: This event signifies the successful distribution of rewards after the billing cycle, providing transparency and traceability for reward payouts.ContractGracePeriodElapsed
: This event is triggered when a contract has exceeded its grace period without sufficient funds, leading to its transition to a deleted state.No longer emitted as part of the
billContract
callLocked
: It have been replaced with Reserved eventTokenBurned
: The TokenBurned event is no longer emitted, reflecting the removal of TFT burning from TFChain.Unlocked
andTransfer
Events: Both the Unlocked and Transfer events have been replaced with theReserveRepatriated
event.New Errors:
RewardDistributionError
ContractPaymentStateNotExists
The text was updated successfully, but these errors were encountered: