Skip to content

Commit

Permalink
Sapling kernel (#32)
Browse files Browse the repository at this point in the history
* WIP: sapling kernel

* Rename Michelson VM crate

* Rename Tezos proto crate

* Rename tezos kernel crate

* Switch to installer client

* wip: massive refactoring

* Finish migration

* Linter fixes

* Fix docker images

* Fix docker build

* Introduce cargo bin path car

* Sapling store

* Fix deps

* Add missing clang to docker image

* Use smart rollup core instead of runtime

* Linter fixups

* LayeredStore refactored

* Update readme files

* Add license header

* Add kernel_io crate

* Sapling kernel

* Switch to mockall, add readme

* Update makefile and readme

* Sapling tutorial

* Fix gha script

* gha: do not deploy draft PRs

* Fix sapling proto, add test suite replaying ghostnet txs

* Split gha build workflow

* Sapling kernel: update tutorial

* SPDX headers

* Lock zcash deps

* Update zcash deps
  • Loading branch information
m-kus authored Jul 12, 2023
1 parent 55a6746 commit 185fe51
Show file tree
Hide file tree
Showing 1,106 changed files with 5,725 additions and 2,473 deletions.
2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
.github
.gitignore
.tezos-client
.logs
target
test
*.env
56 changes: 56 additions & 0 deletions .github/workflows/build_sapling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Sapling operator

on:
push:
branches:
- 'master'
tags:
- '*.*.*'
pull_request:
branches:
- 'master'

jobs:
build:
name: Build and push docker images
runs-on: ubuntu-latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository_owner }}
outputs:
operator: ${{ steps.meta-tezos-operator.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

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

- name: Sapling operator tags & labels
id: meta-sapling-operator
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/sapling-operator

- name: Sapling operator build & push
uses: docker/build-push-action@v2
with:
context: .
file: build/operator/Dockerfile
build-args: |
OCTEZ_TAG=v17.1
OCTEZ_PROTO=PtNairob
PACKAGE=sapling_kernel
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-sapling-operator.outputs.tags }}
labels: ${{ steps.meta-sapling-operator.outputs.labels }}
48 changes: 26 additions & 22 deletions .github/workflows/build.yml → .github/workflows/build_tezos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build & deploy Tezos operator

on:
push:
Expand All @@ -19,7 +19,7 @@ jobs:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_BASE: ${{ github.repository_owner }}
outputs:
operator: ${{ steps.meta-operator.outputs.tags }}
operator: ${{ steps.meta-tezos-operator.outputs.tags }}
steps:
- name: Check out the repo
uses: actions/checkout@v2
Expand All @@ -34,32 +34,34 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Operator tags & labels
id: meta-operator
- name: Tezos operator tags & labels
id: meta-tezos-operator
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tz-rollup-operator
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tezos-operator

- name: Operator build & push
if: ${{ !contains(github.event.head_commit.message, '[skip-build-operator]') }}
- name: Tezos operator build & push
uses: docker/build-push-action@v2
with:
context: .
file: build/operator/Dockerfile
# file: build/operator/Dockerfile.debug
build-args: |
NETWORK=mumbainet
OCTEZ_TAG=v17.1
OCTEZ_PROTO=PtNairob
PACKAGE=tezos_kernel
# TEZOS_BRANCH=ole@wasmer-instance-leak
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-operator.outputs.tags }}
labels: ${{ steps.meta-operator.outputs.labels }}
tags: ${{ steps.meta-tezos-operator.outputs.tags }}
labels: ${{ steps.meta-tezos-operator.outputs.labels }}

- name: Facade tags & labels
id: meta-facade
- name: Tezos facade tags & labels
id: meta-tezos-facade
uses: docker/metadata-action@v3
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tz-rollup-facade
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}/tezos-facade

- name: Facade build & push
if: ${{ !contains(github.event.head_commit.message, '[skip-build-facade]') }}
Expand All @@ -70,17 +72,19 @@ jobs:
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-facade.outputs.tags }}
labels: ${{ steps.meta-facade.outputs.labels }}
tags: ${{ steps.meta-tezos-facade.outputs.tags }}
labels: ${{ steps.meta-tezos-facade.outputs.labels }}

deploy:
if: ${{ !contains(github.event.head_commit.message, '[skip-deploy]') }}
name: Deploy rollup to testnet
if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
name: Deploy Tezos rollup to testnet
needs: build
runs-on: ubuntu-latest
env:
NETWORK: nairobinet
steps:
- name: Deploy rollup
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e OPERATOR_KEY=${{ secrets.OPERATOR_KEY }} ${{ needs.build.outputs.operator }} originate-rollup | tee originate.out
run: docker run -v "/var/run/docker.sock":"/var/run/docker.sock" -e NETWORK=${{ env.NETWORK }} -e OPERATOR_KEY=${{ secrets.OPERATOR_KEY }} ${{ needs.build.outputs.operator }} deploy_rollup | tee originate.out

- name: Extract rollup address
run: |
Expand All @@ -96,7 +100,7 @@ jobs:
comment-author: 'github-actions[bot]'
body: |
<!-- pr-rollup-deployment -->
Deployed at [${{ env.ROLLUP_ADDRESS }}](https://mumbainet.tzkt.io/${{ env.ROLLUP_ADDRESS }})
Deployed at [${{ env.ROLLUP_ADDRESS }}](https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }})
edit-mode: replace
reactions: rocket

Expand All @@ -106,13 +110,13 @@ jobs:
id: deployment
with:
token: "${{ github.token }}"
environment: mumbainet
environment: ${{ env.NETWORK }}

- name: Update deployment status
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: altinukshini/deployment-status@releases/v1
with:
token: "${{ github.token }}"
state: "success"
environment_url: https://mumbainet.tzkt.io/${{ env.ROLLUP_ADDRESS }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
environment_url: https://${{ env.NETWORK }}.tzkt.io/${{ env.ROLLUP_ADDRESS }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.bin
.tezos-client
.ipynb_checkpoints
.python-version
.logs
bin
target
tez_kernel/target
tezos_kernel/target
boot_kernel/target
*.env
.env
Loading

0 comments on commit 185fe51

Please sign in to comment.