Skip to content

Commit

Permalink
Merge branch 'develop' into refactor-integrate-base-observer
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie authored Jun 25, 2024
2 parents a96898d + 852897f commit 956f681
Show file tree
Hide file tree
Showing 31 changed files with 217 additions and 180 deletions.
20 changes: 20 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
reviews:
path_filters:
- "**/*.pb.go"
- "**/*.pb.gw.go"
path_instructions:
- path: '**/*.go'
instructions: >-
Review the Go code, point out issues relative to principles of clean
code, expressiveness, and performance.
- path: '**/*.proto'
instructions: >-
Review the Protobuf definitions, point out issues relative to
compatibility, and expressiveness.
- path: '**/*.sh'
instructions: >-
Review the shell scripts, point out issues relative to security,
performance, and maintainability.
auto_review:
base_branches:
- develop
6 changes: 2 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ jobs:
- name: Full Log Dump On Failure
if: failure()
run: |
cd contrib/localnet
docker compose logs
make stop-localnet
- name: Notify Slack on Failure
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/develop'
Expand All @@ -167,8 +166,7 @@ jobs:
- name: Stop Private Network
if: always()
run: |
cd contrib/localnet/
docker compose down
make stop-localnet
- name: Clean Up Workspace
if: always()
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/execute_advanced_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
- name: Full Log Dump On Failure
if: failure()
run: |
cd contrib/localnet
docker compose logs
make stop-localnet
- name: Notify Slack on Failure
if: failure() && github.event_name == 'schedule'
Expand Down Expand Up @@ -82,8 +81,7 @@ jobs:
- name: Full Log Dump On Failure
if: failure()
run: |
cd contrib/localnet
docker compose logs
make stop-localnet
- name: Notify Slack on Failure
if: failure() && github.event_name == 'schedule'
Expand Down Expand Up @@ -114,8 +112,7 @@ jobs:
- name: Full Log Dump On Failure
if: failure()
run: |
cd contrib/localnet
docker compose logs
make stop-localnet
e2e-performance-test:
if: ${{ github.event.inputs.e2e-performance-test == 'true' }}
Expand All @@ -137,5 +134,4 @@ jobs:
- name: Full Log Dump On Failure
if: failure()
run: |
cd contrib/localnet
docker compose logs
make stop-localnet
3 changes: 1 addition & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ jobs:
- name: Stop Private Network
if: ${{ always() && github.event.inputs.skip_checks != 'true' }}
run: |
cd contrib/localnet/
docker compose down
make stop-localnet
- name: Clean Up Workspace
if: always()
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ jobs:
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if git diff ${{ github.event.pull_request.base.sha }} $file | grep -q nosec; then
# Skip this workflow file
if [ "$file" == ".github/workflows/sast-linters.yml" ] || [ "$file" == "changelog.md" ]; then
echo "Skipping nosec check for $file"
continue
fi
# Only consider additions of "nosec", marked by '+'
if git diff ${{ github.event.pull_request.base.sha }} $file | grep -q '^+.*nosec'; then
echo "nosec detected in $file"
nosec_list+=("$file,")
nosec_detected=1
Expand All @@ -118,6 +125,7 @@ jobs:
echo "nosec_files=$nosec_list_string" >> $GITHUB_ENV
echo "nosec_detected=$nosec_detected" >> $GITHUB_ENV
- name: Report nosec uses
uses: mshick/add-pr-comment@v2
if: env.nosec_detected == 1
Expand Down Expand Up @@ -149,6 +157,3 @@ jobs:
run: |
DIFF=$(git diff ${{ github.event.pull_request.base.sha }})
echo "$DIFF" | grep -P '#nosec(?!(\sG\d{3}))(?![^\s\t])([\s\t]*|$)' && echo "nosec without specified rule found!" && exit 1 || exit 0
34 changes: 25 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ HSM_BUILD_FLAGS := -tags pebbledb,ledger,hsm_test

export DOCKER_BUILDKIT := 1

# parameters for localnet docker compose files
# set defaults to empty to prevent docker warning
export LOCALNET_MODE
export E2E_ARGS := $(E2E_ARGS)
export UPGRADE_HEIGHT
export ZETACORED_IMPORT_GENESIS_DATA
export ZETACORED_START_PERIOD := 30s

clean: clean-binaries clean-dir clean-test-dir clean-coverage

clean-binaries:
Expand Down Expand Up @@ -217,43 +225,51 @@ start-e2e-test: zetanode

start-e2e-admin-test: zetanode
@echo "--> Starting e2e admin test"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-admin.yml up -d
export E2E_ARGS="--skip-regular --test-admin" && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-additionalevm.yml up -d

start-e2e-performance-test: zetanode
@echo "--> Starting e2e performance test"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-performance.yml up -d
export E2E_ARGS="--test-performance" && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d

start-stress-test: zetanode
@echo "--> Starting stress test"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-stresstest.yml up -d
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-stress.yml up -d

#TODO: replace OLD_VERSION with v16 tag once its available
zetanode-upgrade: zetanode
@echo "Building zetanode-upgrade"
$(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime --build-arg OLD_VERSION='release/v16' .
$(DOCKER) build -t zetanode:old -f Dockerfile-localnet --target old-runtime --build-arg OLD_VERSION='release/v17' .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile.fastbuild .
.PHONY: zetanode-upgrade

start-upgrade-test: zetanode-upgrade
@echo "--> Starting upgrade test"
export LOCALNET_MODE=upgrade && \
export UPGRADE_HEIGHT=225 && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-upgrade.yml up -d

start-upgrade-test-light: zetanode-upgrade
@echo "--> Starting light upgrade test (no ZetaChain state populating before upgrade)"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-upgrade.yml -f docker-compose-upgrade-light.yml up -d
export LOCALNET_MODE=upgrade && \
export UPGRADE_HEIGHT=90 && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-upgrade.yml up -d

start-localnet: zetanode start-localnet-skip-build

start-localnet-skip-build:
@echo "--> Starting localnet"
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml -f docker-compose-setup-only.yml up -d
export LOCALNET_MODE=setup-only && \
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose.yml up -d

stop-localnet:
start-e2e-import-mainnet-test: zetanode
@echo "--> Starting e2e import-data test"
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml -f docker-compose-import-data.yml up -d
export ZETACORED_IMPORT_GENESIS_DATA=true && \
export ZETACORED_START_PERIOD=10m && \
cd contrib/localnet/ && ./scripts/import-data.sh mainnet && $(DOCKER) compose -f docker-compose.yml up -d

stop-test:
stop-localnet:
cd contrib/localnet/ && $(DOCKER) compose down --remove-orphans

###############################################################################
Expand Down
2 changes: 2 additions & 0 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"golang.org/x/exp/slices"

"github.com/zeta-chain/zetacore/pkg/constant"
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types"
emissionstypes "github.com/zeta-chain/zetacore/x/emissions/types"
ibccrosschaintypes "github.com/zeta-chain/zetacore/x/ibccrosschain/types"
)
Expand Down Expand Up @@ -66,6 +67,7 @@ func SetupHandlers(app *App) {
govtypes.ModuleName,
crisistypes.ModuleName,
emissionstypes.ModuleName,
authoritytypes.ModuleName,
}
allUpgrades := upgradeTracker{
upgrades: []upgradeTrackerItem{
Expand Down
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* [2319](https://github.com/zeta-chain/node/pull/2319) - use `CheckAuthorization` function in all messages
* [2325](https://github.com/zeta-chain/node/pull/2325) - revert telemetry server changes
* [2339](https://github.com/zeta-chain/node/pull/2339) - add binaries related question to syncing issue form
* [2366](https://github.com/zeta-chain/node/pull/2366) - add migration script for adding authorizations table

### Refactor

Expand Down Expand Up @@ -93,6 +94,7 @@
* [2191](https://github.com/zeta-chain/node/pull/2191) - Fixed conditional logic for the docker build step for non release builds to not overwrite the github tag
* [2192](https://github.com/zeta-chain/node/pull/2192) - Added release status checker and updater pipeline that will update release statuses when they go live on network
* [2335](https://github.com/zeta-chain/node/pull/2335) - ci: updated the artillery report to publish to artillery cloud
* [2377](https://github.com/zeta-chain/node/pull/2377) - ci: adjusted sast-linters.yml to not scan itself, nor alert on removal of nosec.

## v17.0.0

Expand Down Expand Up @@ -532,4 +534,4 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c
### CI

* [1218](https://github.com/zeta-chain/node/pull/1218) - cross-compile release binaries and simplify PR testings
* [1302](https://github.com/zeta-chain/node/pull/1302) - add mainnet builds to goreleaser
* [1302](https://github.com/zeta-chain/node/pull/1302) - add mainnet builds to goreleaser
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
version: "3"

# This docker-compose file overrides the orchestrator service to specify the flag to test the admin functions
# and skip the regular tests
# it also adds another local Ethereum network to test EVM chain migration and use the additional-evm flag

services:
orchestrator:
entrypoint: ["/work/start-zetae2e.sh", "local --skip-regular --test-admin"]

eth2:
build:
context: ./anvil
Expand All @@ -21,7 +16,9 @@ services:
ipv4_address: 172.20.0.102

zetaclient0:
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
environment:
- ADDITIONAL_EVM=true

zetaclient1:
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
environment:
- ADDITIONAL_EVM=true
30 changes: 0 additions & 30 deletions contrib/localnet/docker-compose-import-data.yml

This file was deleted.

2 changes: 0 additions & 2 deletions contrib/localnet/docker-compose-monitoring.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
grafana:
image: grafana/grafana:latest
Expand Down
9 changes: 0 additions & 9 deletions contrib/localnet/docker-compose-performance.yml

This file was deleted.

9 changes: 0 additions & 9 deletions contrib/localnet/docker-compose-setup-only.yml

This file was deleted.

Loading

0 comments on commit 956f681

Please sign in to comment.