Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: builtin consensus config and binaries #946

Merged
merged 15 commits into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
docker run --rm ${{ env.IMAGE }} gw-tools --version
docker run --rm ${{ env.IMAGE }} ckb --version
docker run --rm ${{ env.IMAGE }} ckb-cli --version
docker run --rm ${{ env.IMAGE }} find /scripts -type f -exec sha1sum {} \;
docker run --rm ${{ env.IMAGE }} find /scripts -type f -exec sha256sum {} \;

- name: Record image info to the outputs of this jobs
id: result
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/godwoken-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches: [develop, master, ci, 'v1*']
tags: ["v*.*.*"]
paths:
- 'gwos-evm/**'
jjyr marked this conversation as resolved.
Show resolved Hide resolved
pull_request:

jobs:
Expand All @@ -24,3 +26,8 @@ jobs:
MANUAL_BUILD_WEB3_INDEXER=true
WEB3_GIT_URL="https://github.com/${{ github.repository }}"
WEB3_GIT_CHECKOUT=${{ github.ref }}
MANUAL_BUILD_POLYJUICE=true
POLYJUICE_GIT_URL=https://github.com/${{ github.repository }}
POLYJUICE_GIT_CHECKOUT=${{ github.ref }}
GODWOKEN_KICKER_REPO=jjyr/godwoken-kicker
GODWOKEN_KICKER_REF=build-web3-indexer-in-monorepo
11 changes: 0 additions & 11 deletions .github/workflows/gwos-evm-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,3 @@ jobs:
run: |
ls -lh build
sha256sum build/generator build/generator_log build/validator build/validator_log

integration-test:
uses: nervosnetwork/godwoken-tests/.github/workflows/reusable-integration-test-v1.yml@develop
with:
extra_github_env: |
MANUAL_BUILD_GODWOKEN=true
GODWOKEN_GIT_URL=https://github.com/${{ github.repository }}
GODWOKEN_GIT_CHECKOUT=${{ github.ref }}
MANUAL_BUILD_POLYJUICE=true
POLYJUICE_GIT_URL=https://github.com/${{ github.repository }}
POLYJUICE_GIT_CHECKOUT=${{ github.ref }}
94 changes: 94 additions & 0 deletions .github/workflows/prepare-builtin-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Prepare gw-builtin-binaries

on:
push:
paths:
- 'crates/builtin-binaries/build.rs'

jobs:
publish:
runs-on: ubuntu-20.04
if: github.event.pull_request.merged == true
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
token: ${{ secrets.PAT }}

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust components
run: rustup component add rustfmt && rustup component add clippy
- name: Install moleculec
run: |
test "$(moleculec --version)" = "Moleculec 0.7.2" \
|| cargo install moleculec --version 0.7.2 --force
- name: Install capsule
env:
CAPSULE_VERSION: v0.7.0
run: |
(which capsule && test "$(capsule --version)" = "Capsule 0.7.0") \
|| curl -OL https://github.com/nervosnetwork/capsule/releases/download/${CAPSULE_VERSION}/capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& tar xf capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& mv capsule_${CAPSULE_VERSION}_x86_64-linux/capsule ~/.cargo/bin/ \
&& rm capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& rm -rf capsule_${CAPSULE_VERSION}_x86_64-linux/
capsule --version

# - name: Cache of component.gwos
# id: gwos-cache
# uses: actions/cache@v3
# with:
# path: |
# gwos/build/release/*
# gwos/c/build/*-generator
# gwos/c/build/*-validator
# gwos/c/build/account_locks/*
# key: component.gwos-${{ hashFiles('gwos/**') }}
# - name: Build gwos binaries
# if: steps.gwos-cache.outputs.cache-hit != 'true'
# working-directory: gwos
# run: cd c && make && cd .. && capsule build --release --debug-output

- name: Cache of component.gwos-evm
id: godwoken-polyjuice-cache
uses: actions/cache@v3
with:
path: |
gwos-evm/build/*generator*
gwos-evm/build/*validator*
key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }}

- name: Build godwoken-polyjuice
if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
working-directory: gwos-evm
run: |
git submodule update --init --recursive --depth=1
make all-via-docker
- name: Copy contracts from prebuild docker images
run: devtools/fetch-binaries.sh

- name: Run build script of gw-builtin-binaries
run: |
cargo build -p gw-builtin-binaries

- name: Checksum
working-directory: crates/builtin-binaries/builtin
run: bash -c 'sha256sum `find . -not -path checksum.txt -type f | sort` > checksum.txt'

# commit to submodule repo
- name: Push to godwoken-builtin-binaries repo
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: crates/builtin-binaries/builtin
branch: master
commit_message: Commit from CI ${{ github.sha }}
16 changes: 16 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,22 @@ jobs:
env:
RUSTFLAGS: -D warnings
run: cargo clippy --tests --all-features --all-targets

- name: Cache of component.gwos-evm
id: godwoken-polyjuice-cache
uses: actions/cache@v3
with:
path: |
gwos-evm/build/*generator*
gwos-evm/build/*validator*
key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }}
- name: Build godwoken-polyjuice
if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
working-directory: gwos-evm
run: |
git submodule update --init --recursive --depth=1
make all-via-docker

- name: Copy contracts from prebuild docker images
run: devtools/fetch-binaries.sh
- name: Tests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ jobs:
- name: Test C Uint256
run: cargo test -p c-uint256-tests
- name: Script tests
run: cargo test --features scripts script_tests
run: cargo test --features scripts --features gw-config/no-builtin script_tests
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@
path = crates/autorocks/autorocks-sys/snappy
url = https://github.com/google/snappy.git
shadow = true
[submodule "crates/builtin-binaries/builtin"]
path = crates/builtin-binaries/builtin
url = https://github.com/godwokenrises/godwoken-builtin-binaries.git
67 changes: 28 additions & 39 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ members = [
"crates/utils",
"crates/tx-filter",
"crates/replay-chain",
"crates/dynamic-config",
"crates/p2p-network",
"crates/polyjuice-sender-recover",
"crates/godwoken-bin",
"crates/telemetry",
"crates/metrics",
"crates/builtin-binaries"
]

exclude = [
Expand Down
1 change: 1 addition & 0 deletions crates/benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gw-types = { path = "../../gwos/crates/types" }
gw-traits = { path = "../traits" }
gw-config = { path = "../config" }
gw-utils = { path = "../utils" }
gw-builtin-binaries = { path = "../builtin-binaries" }

[[bench]]
name = "bench_main"
Expand Down
Loading