Skip to content

Commit

Permalink
Merge branch 'main' into prover_set2
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored May 20, 2024
2 parents a6fe78f + 2a42aac commit c7f3fed
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/repo--validate-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
protocol
relayer
taikoon
snaefell-nft
snaefell-ui
ui-lib
taiko-client
supplementary-contracts
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/snaefell-ui--ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Snaefell UI

on: workflow_call

jobs:
build:
runs-on: [taiko-runner]
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies
# This step is needed because the .env file is not committed to the repository
# and the Svelte check complains about not finding the exports from $env/static/public,
# which will be generated based on the .env file when running `svelte-kit sync`
- name: Copy .env.example to .env
working-directory: ./packages/snaefell-ui
run: cp .env.example .env

- name: Frontend build
working-directory: ./packages/snaefell-ui
run: pnpm build

- name: Svelte check
working-directory: ./packages/snaefell-ui
run: pnpm check

- name: Check formatting
working-directory: ./packages/snaefell-ui
run: pnpm lint

- name: Unit tests
env:
SKIP_ENV_VALIDATION: "true"
working-directory: ./packages/snaefell-ui
run: pnpm test:unit
40 changes: 40 additions & 0 deletions .github/workflows/snaefell-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Snaefell UI CI/CD

on:
push:
branches-ignore:
- release-please-*
paths:
- "packages/snaefell-ui/**"
pull_request:
paths:
- "packages/snaefell-ui/**"

jobs:
build-and-test:
uses: ./.github/workflows/snaefell-ui--ci.yml

# Deployment name follow the pattern: deploy_<appname(snaefell-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
deploy_snaefell-ui_mainnet_preview:
if: ${{ github.ref_name != 'main' }}
needs: build-and-test
uses: ./.github/workflows/repo--vercel-deploy.yml
with:
environment: "preview"
flags: ""
secrets:
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_TAIKOON_UI_MAINNET }}
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}

deploy_snaefell-ui_mainnet_production:
if: ${{ github.ref_name == 'main' && contains(github.ref, 'refs/tags/snaefell-ui-') }}
needs: build-and-test
uses: ./.github/workflows/repo--vercel-deploy.yml
with:
environment: "production"
flags: "--prod"
secrets:
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_TAIKOON_UI_MAINNET }}
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_token: ${{ secrets.VERCEL_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/taikoon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches: [main]
paths:
- "packages/taikoon/**"
pull_request:
paths:
- "packages/taikoon/**"

jobs:
build-taikoon:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ taiko-mono/
│ ├── <a href="./packages/relayer">relayer</a>: Bridge backend relayer.
│ ├── <a href="./packages/supplementary-contracts">supplementary-contracts</a>: Supplementary smart contracts that are not part of the Taiko rollup protocol.
│ ├── <a href="./packages/taiko-client">taiko-client</a>: Taiko client implementation in Go.
│ ├── <a href="./packages/taikoon">taikoon</a>: Taikoon NFT contracts.
│ ├── <a href="./packages/taikoon">taikoon</a>: Taikoon and other NFT contracts.
│ └── <a href="./packages/taikoon-ui">taikoon-ui</a>: Taikoon NFT UI.
...
</pre>
Expand Down
13 changes: 0 additions & 13 deletions packages/snaefell-nft/package.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/snaefell-ui/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BAR=FOO
15 changes: 15 additions & 0 deletions packages/snaefell-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "snaefell-ui",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "echo 'Unimplemented'",
"check": "echo 'Unimplemented'",
"lint": "echo 'Unimplemented'",
"test:unit": "echo 'Unimplemented'"
},
"author": "",
"license": "ISC"
}
17 changes: 14 additions & 3 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ type RISC0RequestProofBodyParam struct {

// RaikoRequestProofBodyResponse represents the JSON body of the response of the proof requests.
type RaikoRequestProofBodyResponse struct {
Proof string `json:"proof"` //nolint:revive,stylecheck
ErrorMessage string `json:"message"`
Data *RaikoProofData `json:"data"`
ErrorMessage string `json:"message"`
}

type RaikoProofData struct {
Proof string `json:"proof"` //nolint:revive,stylecheck
}

// RequestProof implements the ProofProducer interface.
Expand Down Expand Up @@ -135,7 +139,14 @@ func (s *SGXProofProducer) callProverDaemon(ctx context.Context, opts *ProofRequ

log.Debug("Proof generation output", "output", output)

proof = common.Hex2Bytes(output.Proof[2:])
// Raiko returns "" as proof when proof type is native,
// so we just convert "" to bytes
if s.ProofType == ProofTypeCPU {
proof = common.Hex2Bytes(output.Data.Proof)
} else {
proof = common.Hex2Bytes(output.Data.Proof[2:])
}

log.Info(
"Proof generated",
"height", opts.BlockID,
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"packages/taikoon-ui": {},
"packages/taiko-client": {},
"packages/supplementary-contracts": {},
"packages/snaefell-nft": {}
"packages/snaefell-ui": {}
},
"separate-pull-requests": true
}

0 comments on commit c7f3fed

Please sign in to comment.