Skip to content

Commit

Permalink
Parachain support (#130)
Browse files Browse the repository at this point in the history
* copy in parachain template, and sort out cargo.toml

* Stub in collect collation info api

* Copy in key parts of pallet parachain system

* kick can down road on inherent scraping

* scribble idea about calling existing runtime apis from validate block

* change default paraid to 2000

* Install proper inherent data providers in collator client-side.

* Install parachain piece in the runtime

* Add zombienet config

* feature gate parachain aspects of runtime and restore working standalone node.

* Testing Validate block is tricky because the `validate_block` function is only built to wasm. I think it has to be that way because overwriting host functions... Maybe there is more to be explored here, but I found it not that rewarding of a direction. Feel free to explore more especially if we get desperate.

* Unit tests for parachain piece

* Proper hrmp watermark. Achieve working POC 🤵‍♂️🤱🍆🪂⛓️👶❗️

* Use TuxedoGenesisBlockBuilder in parachain service

* Use modified `ExportGenesisState` aka `ExportGenesisHead` command.

* Parachain docker image

* Switch branch to 1.3.0 fork
    Pick paritytech/polkadot-sdk#1897 into our target branch

* Bring in dev service and enable it exactly when using --dev

---------

Co-authored-by: Matteo Muraca <56828990+muraca@users.noreply.github.com>
  • Loading branch information
JoshOrndorff and muraca authored Nov 28, 2023
1 parent b4f8cf0 commit 0653fbe
Show file tree
Hide file tree
Showing 42 changed files with 11,561 additions and 2,230 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: Off-Narrative-Labs/toml_sort@v1
with:
all: true
match: "Cargo.toml"

test:
name: Test and code coverage
Expand All @@ -49,8 +50,10 @@ jobs:
cache-targets: true
cache-on-failure: true
- name: Run tests and print coverage data
run: cargo llvm-cov nextest --json --output-path lcov.json
--ignore-filename-regex "node/" --summary-only &&
run: cargo llvm-cov nextest --workspace
--exclude node-template --exclude parachain-template-node
--exclude derive-no-bound
--json --output-path lcov.json --summary-only &&
echo "Lines coverage " && jq ".data[0].totals.lines.percent" lcov.json
# if the PR is on the same repo, the coverage data can be reported as a comment
- if: github.event_name == 'pull_request' &&
Expand Down Expand Up @@ -101,6 +104,9 @@ jobs:
cache-targets: true
cache-on-failure: true
- name: Build
run: cargo build
# We do not need the parachain node for the wallet test.
# However, this is more than merely an optimization.
# If we just `cargo build` the runtime will be incorrectly built with the parachain feature.
run: cargo build -p node-template -p tuxedo-template-wallet
- name: Run wallet test
run: ./wallet/test.sh
38 changes: 36 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# 1. It feels less official and these containers are not yet ready for production
# 2. It doesn't require setting up a docker hub account or encrypting secrets.

name: Create and publish a Docker image
name: Create and publish Docker images

on:
push:
Expand All @@ -18,7 +18,7 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-node-image:
build-and-push-sovereign-node-image:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -44,6 +44,40 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
# Consider adding an explicit file path here so it matches the others.
# Also consider moving the node's dockerfile into the node directory.
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-and-push-parachain-node-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-parachain

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
file: ./parachain-node/Dockerfile
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
Loading

0 comments on commit 0653fbe

Please sign in to comment.