Skip to content

Commit 8335325

Browse files
Merge pull request #604 from threefoldtech/v2.2.0
V2.2.0
2 parents c706be7 + 08c4396 commit 8335325

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+10204
-5987
lines changed

.github/workflows/build_test.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ RUN apt update && \
1313
lldb \
1414
software-properties-common \
1515
tar \
16-
zstd && \
16+
zstd \
17+
protobuf-compiler && \
1718
add-apt-repository ppa:deadsnakes/ppa && \
1819
apt install -y python3.10 && \
1920
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py && \

.github/workflows/build_test.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
build-and-test:
99
runs-on: [self-hosted, poc]
1010
container:
11-
image: threefolddev/tfchain:1
11+
image: threefolddev/tfchain:2
1212
env:
1313
DEBIAN_FRONTEND: noninteractive
1414
steps:
@@ -25,8 +25,8 @@ jobs:
2525
~/.cargo/registry/cache/
2626
~/.cargo/git/db/
2727
substrate-node/target/
28-
key: ${{ runner.os }}-tfchain-cargo-${{ hashFiles('**/Cargo.lock') }}
29-
restore-keys: ${{ runner.os }}-tfchain-cargo-
28+
key: ${{ runner.os }}-tfchain-build-cache-${{ hashFiles('**/Cargo.lock') }}
29+
restore-keys: ${{ runner.os }}-tfchain-build-cache
3030

3131
- name: Build
3232
run: |
@@ -47,3 +47,9 @@ jobs:
4747
cd substrate-node/tests
4848
robot -d _output_tests/ .
4949
50+
- uses: actions/upload-artifact@v3
51+
if: always()
52+
with:
53+
name: integration test output
54+
path: substrate-node/tests/_output_tests/
55+

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @DylanVerstraete @brandonpille @renauter @robvanmieghem @leesmet
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 2. Changed smart contract billing workflow
2+
3+
Date: 2022-10-12
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
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.
12+
13+
## Decision
14+
15+
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.
16+
17+
## Consequences
18+
19+
### the good
20+
21+
- The billing for a contract is now executed after a block is produced and not within that same block.
22+
- Atleast one offchain worker must run with the `smct` keytype in order to bill contracts.
23+
- Contracts billing cycles do not rely anymore on a previously successful bill.
24+
- External users can call `bill_contract` but don't need to.
25+
26+
### the worrying
27+
28+
- If no validators run an offchain worker with the `smct` keytype, no contracts will be billed.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 3. Third party service contract
2+
3+
Date: 2022-10-17
4+
5+
## Status
6+
7+
Accepted
8+
9+
## Context
10+
11+
See [here](https://github.com/threefoldtech/tfchain/issues/445) for more details.
12+
13+
## Decision
14+
15+
The third party service contract flow is described [here](../../substrate-node/pallets/pallet-smart-contract/third-party_service_contract.md#flow).
16+
17+
## Consequences
18+
19+
### the good
20+
21+
- It is now possible to create generic contract between two `TFChain` users (without restriction of account type) for some service and bill for it.
22+
23+
### the worrying
24+
25+
- Keep eyes on potential abuses and be prepared to handle all the malicious cases that can show up.

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Ensure you have the following installed first:
1010
- libclang-dev
1111
- clang lldb lld
1212
- build-essential
13+
- protoc
1314

1415
You will also need rust and nightly installed.
1516

0 commit comments

Comments
 (0)