-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #604 from threefoldtech/v2.2.0
V2.2.0
- Loading branch information
Showing
96 changed files
with
10,204 additions
and
5,987 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @DylanVerstraete @brandonpille @renauter @robvanmieghem @leesmet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 2. Changed smart contract billing workflow | ||
|
||
Date: 2022-10-12 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
TFchain bills contract using an internal feature of susbtrate called `on_finalize`. This function / hook is executed after every block, in this function the time to compute is limited since this runs before the block production is finished. We are worried that if the usage of the grid grows, this on finalize method would need to do too much computations and that the block time would be impacted. | ||
|
||
## Decision | ||
|
||
We searched for an alternative to this `on_finalize` method within the substrate framework. We found a hook that fires after a block is produced, but in that hook the result of some computation must be submitted onchain with an extrinsic. This offchain worker cannot modify chain storage directly, rather it can only do that through an extrinsic. | ||
|
||
## Consequences | ||
|
||
### the good | ||
|
||
- The billing for a contract is now executed after a block is produced and not within that same block. | ||
- Atleast one offchain worker must run with the `smct` keytype in order to bill contracts. | ||
- Contracts billing cycles do not rely anymore on a previously successful bill. | ||
- External users can call `bill_contract` but don't need to. | ||
|
||
### the worrying | ||
|
||
- If no validators run an offchain worker with the `smct` keytype, no contracts will be billed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 3. Third party service contract | ||
|
||
Date: 2022-10-17 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
See [here](https://github.com/threefoldtech/tfchain/issues/445) for more details. | ||
|
||
## Decision | ||
|
||
The third party service contract flow is described [here](../../substrate-node/pallets/pallet-smart-contract/third-party_service_contract.md#flow). | ||
|
||
## Consequences | ||
|
||
### the good | ||
|
||
- It is now possible to create generic contract between two `TFChain` users (without restriction of account type) for some service and bill for it. | ||
|
||
### the worrying | ||
|
||
- Keep eyes on potential abuses and be prepared to handle all the malicious cases that can show up. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.