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

Merge 1.12.0-rc1 #984

Merged
merged 9 commits into from
Feb 14, 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
29 changes: 24 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ jobs:
gwos-evm-filehash: ${{ steps.prepare.outputs.gwos-evm-filehash }}

build-godwoken:
strategy:
matrix:
# optional SMT trie feature
# see https://github.com/godwokenrises/godwoken/pull/859
features: ['', 'smt-trie']
runs-on: ${{ inputs.runner_type || 'ubuntu-20.04' }}
# matrix: [with or without builtin consensus]
# TODO: build-godwoken-without-builtin-consensus:
Expand Down Expand Up @@ -190,7 +195,7 @@ jobs:
path: |
target/release/godwoken
target/release/gw-tools
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.runner_type || 'ubuntu-20.04' }}-godwoken-${{ hashFiles('crates/**') }}
key: ${{ runner.os }}-${{ runner.arch }}-${{ inputs.runner_type || 'ubuntu-20.04' }}-godwoken-${{ matrix.features || 'default' }}-${{ hashFiles('crates/**') }}
- name: Cache Godwoken target directory
if: steps.godwoken-cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
Expand All @@ -203,22 +208,24 @@ jobs:
- name: Build godwoken
id: build
if: steps.godwoken-cache.outputs.cache-hit != 'true'
env:
FEATURE_ARG: ${{ matrix.features && format('--features={0}', matrix.features) || '' }}
# Use SSE4.2, POPCNT, etc. These are available on almost all x86 CPUs in use today, including rosetta 2.
run: |
echo "install libclang required by autorocks-sys"
sudo apt update && sudo apt install -y libclang-dev
RUSTFLAGS="-C target-cpu=x86-64-v2" CARGO_PROFILE_RELEASE_LTO=true cargo build --release
RUSTFLAGS="-C target-cpu=x86-64-v2" CARGO_PROFILE_RELEASE_LTO=true cargo build --release ${{ env.FEATURE_ARG }}
- name: Archive godwoken binaries
# TODO: upload only once
# if: steps.godwoken-cache.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v3
with:
name: component.godwoken-${{ hashFiles('crates/**') }}
name: component.godwoken-${{ matrix.features || 'default' }}-${{ hashFiles('crates/**') }}
path: |
target/release/godwoken
target/release/gw-tools


# https://github.com/docker/build-push-action has a warning:
# > Subdirectory for Git context is available from BuildKit v0.9.0. If you're using the docker
# > builder (default if setup-buildx-action not used), then BuildKit in Docker Engine will be
Expand All @@ -230,6 +237,11 @@ jobs:
#
# So the `docker-build-push` step was simply moved to a separate job.
docker-build-push:
strategy:
matrix:
# optional SMT trie feature
# see https://github.com/godwokenrises/godwoken/pull/859
features: ['', 'smt-trie']
needs: [build-scripts, build-godwoken]
runs-on: 'ubuntu-20.04'
# If you specify the access for any of these scopes, all of those that are not specified are set to none.
Expand Down Expand Up @@ -263,7 +275,7 @@ jobs:
- name: Download component.godwoken
uses: actions/download-artifact@v3
with:
name: component.godwoken-${{ hashFiles('crates/**') }}
name: component.godwoken-${{ matrix.features || 'default' }}-${{ hashFiles('crates/**') }}
path: target/release/
- name: Add executable permission to Godwoken binaries
run: chmod +x godwoken gw-tools
Expand All @@ -274,8 +286,13 @@ jobs:
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
env:
FEATURE_TAG: ${{ matrix.features && format('-{0}', matrix.features) || '' }}
with:
images: ${{ env.REGISTRY }}${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
suffix=${{ env.FEATURE_TAG }},onlatest=true
# dynamically set date as a suffix
tags: |
type=ref,event=tag
Expand All @@ -288,6 +305,8 @@ jobs:
source.component.gwos=https://github.com/godwokenrises/godwoken/tree/${{ github.sha }}/gwos
source.component.gwos-evm=https://github.com/godwokenrises/godwoken/tree/${{ github.sha }}/gwos-evm
source.component.omni_lock=https://github.com/nervosnetwork/ckb-production-scripts/tree/rc_lock
- name: Echo steps.meta.outputs.bake-file
run: cat ${{ steps.meta.outputs.bake-file }}

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/godwoken-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
POLYJUICE_GIT_URL=https://github.com/${{ github.repository }}
POLYJUICE_GIT_CHECKOUT=${{ github.ref }}
GODWOKEN_KICKER_REPO=godwokenrises/godwoken-kicker
GODWOKEN_KICKER_REF=refs/pull/341/merge
GODWOKEN_KICKER_REF=refs/pull/343/merge
55 changes: 23 additions & 32 deletions .github/workflows/web3-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ name: Web3 Docker Build Push

on:
push:
branches: ["develop", '*-rc*']
paths:
- 'web3/**'
# todo: how to release tag under monorepo?
tags: ["web3@v*.*.*"]
branches: [ 'main', 'dev*', 'v1*', '1.*' ]
# Publish semver tags as releases.
tags: [ 'v*.*.*', '1.*' ]
# This event occurs when a GitHub Actions workflow is manually triggered.
# For more information, see
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# Note: Write access to the repository is required to perform these steps.
workflow_dispatch:
inputs:
runner_type:
description: 'Choose an appropriate runner'
required: true
default: ubuntu-20.04
type: choice
options:
- ubuntu-20.04
- self-hosted

env:
# Use ghcr.io only
Expand Down Expand Up @@ -35,7 +46,6 @@ jobs:
# https://github.com/docker/login-action
# GitHub automatically creates a unique GITHUB_TOKEN secret to use in this workflow.
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -49,37 +59,18 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}

- name: Get Current Commit Id
id: commit
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
tags: |
type=ref,event=tag
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}}
type=ref,event=branch

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: New Commit Build => Build and push commit image to ${{ env.REGISTRY }}
if: ${{ github.ref_type != 'tag' }}
uses: docker/build-push-action@v2
with:
file: ./web3/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}-${{ steps.commit.outputs.sha_short }}
labels: ${{ steps.meta.outputs.labels }}

# extract web3 tags from the special format: web3@v*.*.*
- name: Split web3 tags
if: ${{ startsWith(github.ref, 'refs/tags') }}
env:
metatags: ${{ steps.meta.outputs.tags }}
id: split
run: echo "::set-output name=tags::${metatags/web3@/}"

# Build and push Docker image with Buildx (don't push on PR)
# only for new tag
- name: Official Release Build => Build and push tag image to ${{ env.REGISTRY }}
if: ${{ startsWith(github.ref, 'refs/tags') }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: ./web3/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.split.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

56 changes: 23 additions & 33 deletions .github/workflows/web3-indexer-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ name: Web3 Indexer Docker Build Push

on:
push:
branches: ["develop", '*-rc*']
paths:
- 'web3/**'
# todo: how do we release tag under monorepo?
tags: ["web3@v*.*.*"]
branches: [ 'main', 'dev*', 'v1*', '1.*' ]
# Publish semver tags as releases.
tags: [ 'v*.*.*', '1.*' ]
# This event occurs when a GitHub Actions workflow is manually triggered.
# For more information, see
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow
# Note: Write access to the repository is required to perform these steps.
workflow_dispatch:
inputs:
runner_type:
description: 'Choose an appropriate runner'
required: true
default: ubuntu-20.04
type: choice
options:
- ubuntu-20.04
- self-hosted

env:
# Use ghcr.io only
Expand Down Expand Up @@ -35,7 +46,6 @@ jobs:
# https://github.com/docker/login-action
# GitHub automatically creates a unique GITHUB_TOKEN secret to use in this workflow.
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
Expand All @@ -49,38 +59,18 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}

- name: Get Current Commit Id
id: commit
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
tags: |
type=ref,event=tag
type=ref,event=branch,suffix=-{{date 'YYYYMMDDHHmm'}}
type=ref,event=branch

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: New Commit Build => Build and push commit image to ${{ env.REGISTRY }}
if: ${{ github.ref_type != 'tag' }}
uses: docker/build-push-action@v2
with:
file: web3/docker/indexer/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}-${{ steps.commit.outputs.sha_short }}
labels: ${{ steps.meta.outputs.labels }}

# extract web3 tags from the special format: web3@v*.*.*
- name: Split web3 tags
if: ${{ startsWith(github.ref, 'refs/tags') }}
env:
metatags: ${{ steps.meta.outputs.tags }}
id: split
run: echo "::set-output name=tags::${metatags/web3@/}"

# Build and push Docker image with Buildx (don't push on PR)
# only for new tag
- name: Official Release Build => Build and push tag image to ${{ env.REGISTRY }}
if: ${{ startsWith(github.ref, 'refs/tags') }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
file: web3/docker/indexer/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.split.outputs.tags }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

46 changes: 32 additions & 14 deletions .github/workflows/web3-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@ name: Web3 Unit Tests
on:
push:
paths:
- 'web3/**'
- 'web3/**'
pull_request:
paths:
- 'web3/**'

env:
# Environment variables propagated to godwoken-kicker
MANUAL_BUILD_GODWOKEN: "true"
GODWOKEN_GIT_URL: "https://github.com/${{ github.repository }}"
GODWOKEN_GIT_CHECKOUT: "${{ github.ref }}""
MANUAL_BUILD_SCRIPTS: "true"
SCRIPTS_GIT_URL: "https://github.com/${{ github.repository }}"
SCRIPTS_GIT_CHECKOUT: "${{ github.ref }}"
MANUAL_BUILD_POLYJUICE: "true"
POLYJUICE_GIT_URL: "https://github.com/${{ github.repository }}"
POLYJUICE_GIT_CHECKOUT: "${{ github.ref }}"
MANUAL_BUILD_WEB3: "true"
MANUAL_BUILD_WEB3_INDEXER: "true"
WEB3_GIT_URL: "https://github.com/${{ github.repository }}"
WEB3_GIT_CHECKOUT: "${{ github.sha }}"
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: "godwokenrises/godwoken-kicker"
GODWOKEN_KICKER_REF: "0fe565409eff7a3bd3323b5d3411f2d6186ed478"


jobs:
unit-tests:
web3-unit-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web3

steps:

Expand All @@ -38,9 +48,7 @@ jobs:
(echo " == kicker start attempt: 2 == " && ./kicker stop && ./kicker start) || \
(echo " == kicker start failed == " && docker-compose --file docker/docker-compose.yml logs --tail 6 && exit 1)
docker-compose --file docker/docker-compose.yml logs --tail 6
# FIXME: Sometimes, Godwoken service is not running
# https://github.com/Flouse/godwoken/runs/3639382192?check_suite_focus=true#step:8:667
- name: Kicker ps
- name: Kicker ps and logs
run: sleep 60 && ./kicker ps && ./kicker logs web3
- name: Store kicker network information as environment variables
run: |
Expand All @@ -51,9 +59,19 @@ jobs:
# Godwoken-Web3
- uses: actions/checkout@v3
with:
path: godwoken-web3
- name: Yarn run test
working-directory: godwoken-web3
path: godwoken-monorepo
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('godwoken-monorepo/**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Godwoken Web3 | yarn run test
working-directory: godwoken-monorepo/web3
run: yarn && yarn run build && yarn run test

- name: Kicker logs if failure
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com).

## [Unreleased]

## [v1.12.0-rc1] - 2023-02-08

The `web3` and `web3-indexer` components have been added to the monorepo since this release, and we bumped the version from `v1.8.x` to `v1.12.x` to unify the version.

We introduced a breaking change of the config file in [#946](https://github.com/godwokenrises/godwoken/pull/946). The consensus-related options are moved into option `consensus`, and we put the builtin `testnet` and `mainnet` consensus into the godwoken program. This change reduces the operation works of node maintainers.

Highlights:

- Builtin mainnet and testnet consensus config [#946](https://github.com/godwokenrises/godwoken/pull/946)
- Add web3 and web3-indexer into the monorepo [#910](https://github.com/godwokenrises/godwoken/pull/910)

Bug fixes:

- gwos-evm: fix big mod exp [#932](https://github.com/godwokenrises/godwoken/pull/932)
- fix(web3): eth_getFilterLogs should return all matched logs [#947](https://github.com/godwokenrises/godwoken/pull/947)

Enhenchment:

- chore: use TransactionDB and refactor store [#903](https://github.com/godwokenrises/godwoken/pull/903)
- chore: refactor rpc server [#927](https://github.com/godwokenrises/godwoken/pull/927)
- Improve the error code of API when executing transactions [#930](https://github.com/godwokenrises/godwoken/pull/930)

## [v1.8.0-rc2] - 2022-12-19

A major change in this release is re-interpreting the meaning of the `xxx_timepoint` field to `finalized timestamp`.
Expand Down
Loading