Skip to content

Commit

Permalink
rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Feb 13, 2024
2 parents bf41f4f + 62f9849 commit 16620fe
Show file tree
Hide file tree
Showing 121 changed files with 46,477 additions and 1,990 deletions.
71 changes: 71 additions & 0 deletions .github/actions/build-docker-images-generic/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 'Build Docker Images'
description: 'Builds Docker images and pushes them to any repository.'
inputs:
DOCKER_FILENAME:
description: 'Name of the docker file to use for the build'
required: true
REPOSITORY_NAME:
description: 'Name of the Repository'
required: true
IMAGE_TAG:
description: 'Image Tag'
required: true
REGISTRY:
description: 'Docker or ORG you want to push to.'
required: true
DOCKER_ORG:
description: 'Docker ORG you want to push to.'
required: false
USERNAME:
description: 'Username for GitHub Container Registry'
required: true
TOKEN:
description: 'Token for GitHub Container Registry'
required: true
DOCKER_FILE_DIRECTORY:
description: 'Directory for your Dockerfile'
required: true
DOCKER_BUILD_KIT:
description: "whether or not to use docker build kit."
required: true
TAG_LATEST:
description: "should the pipeline tag latest"
required: true
runs:
using: "composite"

steps:
- name: Set Environment Variables"
run: |
echo "DOCKER_BUILDKIT=${{ inputs.DOCKER_BUILD_KIT }}" >> $GITHUB_ENV
shell: bash

- name: Log in to the Docker Registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.REGISTRY }}
username: ${{ inputs.USERNAME }}
password: ${{ inputs.TOKEN }}

- name: Build, tag, and push images
shell: bash
working-directory: ${{ inputs.DOCKER_FILE_DIRECTORY }}
run: |
if [ ! -z "${{ inputs.DOCKER_ORG }}" ]; then
echo "DOCKER ORG SPECIFIED SO USE DOCKER HUB"
docker build -f ${{ inputs.DOCKER_FILENAME }} -t ${{ inputs.DOCKER_ORG }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }} .
docker push ${{ inputs.DOCKER_ORG }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }}
if [ "${{ inputs.TAG_LATEST }}" == "true" ]; then
docker tag ${{ inputs.DOCKER_ORG }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }} ${{ inputs.DOCKER_ORG }}/${{ inputs.REPOSITORY_NAME }}:latest
docker push ${{ inputs.DOCKER_ORG }}/${{ inputs.REPOSITORY_NAME }}:latest
fi
else
echo "DOCKER REGISTRY SPECIFIED WITH NO DOCKER_ORG USE NON ORG REGISTRIES"
docker build -f ${{ inputs.DOCKER_FILENAME }} -t ${{ inputs.REGISTRY }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }} .
docker push ${{ inputs.REGISTRY }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }}
if [ "${{ inputs.TAG_LATEST }}" == "true" ]; then
docker tag ${{ inputs.REGISTRY }}/${{ inputs.REPOSITORY_NAME }}:${{ inputs.IMAGE_TAG }} ${{ inputs.REGISTRY }}/${{ inputs.REPOSITORY_NAME }}:latest
docker push ${{ inputs.REGISTRY }}/${{ inputs.REPOSITORY_NAME }}:latest
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,6 @@ jobs:
- name: Clean Up Workspace
if: always()
shell: bash
run: rm -rf *
run: sudo rm -rf *


120 changes: 120 additions & 0 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Zetacored-Docker-Build

on:
pull_request:
types:
- closed
branches:
- 'main'
workflow_dispatch:
inputs:
version:
description: 'Docker Tag Version For Manual Execution'
required: false
default: ''

concurrency:
group: Zetacored-Docker-Build
cancel-in-progress: false

env:
DOCKER_REPO: "zeatcored"
DOCKER_ORG: "zetachain"
DOCKER_REGISTRY: "https://index.docker.io/v1/"

jobs:
docker_build_ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Version from the PR title.
if: github.event_name == 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV}
- name: Set Version for Hotfix Release from Input.
if: github.event_name != 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV}
- name: "BUILD:PUSH:MONITORING:DOCKER:IMAGE"
uses: ./.github/actions/build-docker-images-generic
with:
DOCKER_FILENAME: "Dockerfile"
REPOSITORY_NAME: "${{ env.DOCKER_REPO }}"
IMAGE_TAG: "ubuntu-${{ env.GITHUB_TAG_MAJOR_VERSION }}"
REGISTRY: "${{ env.DOCKER_REGISTRY }}"
DOCKER_ORG: "${{ env.DOCKER_ORG }}"
USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}"
TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
DOCKER_FILE_DIRECTORY: "./"
DOCKER_BUILD_KIT: "0"
TAG_LATEST: "true"

docker_build_mac:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Version from the PR title.
if: github.event_name == 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV}
- name: Set Version for Hotfix Release from Input.
if: github.event_name != 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV}
- name: "BUILD:PUSH:MONITORING:DOCKER:IMAGE"
uses: ./.github/actions/build-docker-images-generic
with:
DOCKER_FILENAME: "Dockerfile"
REPOSITORY_NAME: "${{ env.DOCKER_REPO }}"
IMAGE_TAG: "mac-${{ env.GITHUB_TAG_MAJOR_VERSION }}"
REGISTRY: "${{ env.DOCKER_REGISTRY }}"
DOCKER_ORG: "${{ env.DOCKER_ORG }}"
USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}"
TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
DOCKER_FILE_DIRECTORY: "./"
DOCKER_BUILD_KIT: "0"
TAG_LATEST: "false"

docker_build_arm:
runs-on: buildjet-4vcpu-ubuntu-2204-arm
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set Version from the PR title.
if: github.event_name == 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV}
- name: Set Version for Hotfix Release from Input.
if: github.event_name != 'pull_request'
run: |
echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV}
- name: "BUILD:PUSH:MONITORING:DOCKER:IMAGE"
uses: ./.github/actions/build-docker-images-generic
with:
DOCKER_FILENAME: "Dockerfile"
REPOSITORY_NAME: "${{ env.DOCKER_REPO }}"
IMAGE_TAG: "arm-${{ env.GITHUB_TAG_MAJOR_VERSION }}"
REGISTRY: "${{ env.DOCKER_REGISTRY }}"
DOCKER_ORG: "${{ env.DOCKER_ORG }}"
USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}"
TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
DOCKER_FILE_DIRECTORY: "./"
DOCKER_BUILD_KIT: "0"
TAG_LATEST: "false"
2 changes: 1 addition & 1 deletion Dockerfile-versioned-source
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /go/delivery/zeta-node
RUN mkdir -p $GOPATH/bin/old
RUN mkdir -p $GOPATH/bin/new

ENV NEW_VERSION=v12.1.0
ENV NEW_VERSION=v12.3.0

# Build new release from the current source
COPY go.mod /go/delivery/zeta-node/
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ stateful-upgrade:

stateful-upgrade-source:
@echo "--> Starting stateful smoketest"
$(DOCKER) build --build-arg old_version=v12.0.0 -t zetanode -f ./Dockerfile-versioned-source .
$(DOCKER) build --build-arg old_version=v12.2.1 -t zetanode -f ./Dockerfile-versioned-source .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile-upgrade.fastbuild .
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-stateful.yml up -d

Expand Down Expand Up @@ -293,4 +293,14 @@ release:
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean --skip-validate
release --clean --skip-validate

###############################################################################
### Local Mainnet Development ###
###############################################################################

mainnet-zetarpc-node:
cd contrib/local-mainnet/zetacored && docker-compose up

mainnet-bitcoind-node:
cd contrib/local-mainnet/bitcoind && docker-compose up
4 changes: 3 additions & 1 deletion app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
)

const releaseVersion = "v12.2.0"
const releaseVersion = "v12.3.0"

func SetupHandlers(app *App) {
app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) {
Expand All @@ -16,6 +17,7 @@ func SetupHandlers(app *App) {
for m, mb := range app.mm.Modules {
vm[m] = mb.ConsensusVersion()
}
VersionMigrator{v: vm}.TriggerMigration(crosschaintypes.ModuleName)

return app.mm.RunMigrations(ctx, app.configurator, vm)
})
Expand Down
20 changes: 19 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,45 @@

* `zetaclientd start` : 2 inputs required from stdin

### Features

* [1698](https://github.com/zeta-chain/node/issues/1698) - bitcoin dynamic depositor fee

### Docs

* [1731](https://github.com/zeta-chain/node/pull/1731) added doc for hotkey and tss key-share password prompts.

### Features

*[1728] (https://github.com/zeta-chain/node/pull/1728) - allow aborted transactions to be refunded by minting tokens to zEvm.

### Refactor

* [1630](https://github.com/zeta-chain/node/pull/1630) added password prompts for hotkey and tss keyshare in zetaclient
Starting zetaclient now requires two passwords to be input; one for the hotkey and another for the tss key-share.

### Fixes

* [1678](https://github.com/zeta-chain/node/issues/1678) - clean cached stale block to fix evm outtx hash mismatch
* [1690](https://github.com/zeta-chain/node/issues/1690) - double watched gas prices and fix btc scheduler
* [1687](https://github.com/zeta-chain/node/pull/1687) - only use EVM supported chains for gas stability pool
* [1692](https://github.com/zeta-chain/node/pull/1692) - fix get params query for emissions module
* [1706](https://github.com/zeta-chain/node/pull/1706) - fix CLI crosschain show-out-tx-tracker
* [1707](https://github.com/zeta-chain/node/issues/1707) - fix bitcoin fee rate estimation
* [1712](https://github.com/zeta-chain/node/issues/1712) - increase EVM outtx inclusion timeout to 20 minutes
* [1733](https://github.com/zeta-chain/node/pull/1733)) - remove the unnecessary 2x multiplier in the convertGasToZeta RPC
* [1733](https://github.com/zeta-chain/node/pull/1733) - remove the unnecessary 2x multiplier in the convertGasToZeta RPC
* [1721](https://github.com/zeta-chain/node/issues/1721) - zetaclient should provide bitcoin_chain_id when querying TSS address
* [1744](https://github.com/zeta-chain/node/pull/1744) - added cmd to encrypt tss keyshare file, allowing empty tss password for backward compatibility.

### Tests

* [1584](https://github.com/zeta-chain/node/pull/1584) - allow to run E2E tests on any networks
* [1753](https://github.com/zeta-chain/node/pull/1753) - fix gosec errors on usage of rand package

### CI

* CI: adding pipeline to build and push docker images into dockerhub on release for ubuntu and macos.
* Added docker-compose and make commands for launching full nodes. `make mainnet-zetarpc-node` `make mainnet-bitcoind-node`
* [1736](https://github.com/zeta-chain/node/pull/1736) - chore: add Ethermint endpoints to OpenAPI

### Chores
Expand Down Expand Up @@ -85,6 +102,7 @@
### Refactoring

* [1628](https://github.com/zeta-chain/node/pull/1628) optimize return and simplify code
* [1640](https://github.com/zeta-chain/node/pull/1640) reorganize zetaclient into subpackages

### Refactoring
* [1619](https://github.com/zeta-chain/node/pull/1619) - Add evm fee calculation to tss migration of evm chains
Expand Down
17 changes: 11 additions & 6 deletions cmd/zetaclientd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import (
"strings"
"sync"

"github.com/zeta-chain/zetacore/zetaclient/bitcoin"
"github.com/zeta-chain/zetacore/zetaclient/evm"
"github.com/zeta-chain/zetacore/zetaclient/keys"
"github.com/zeta-chain/zetacore/zetaclient/metrics"
"github.com/zeta-chain/zetacore/zetaclient/zetabridge"

"github.com/btcsuite/btcd/rpcclient"
sdk "github.com/cosmos/cosmos-sdk/types"
ethcommon "github.com/ethereum/go-ethereum/common"
Expand All @@ -17,7 +23,6 @@ import (
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/testutil/sample"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/zetaclient"
"github.com/zeta-chain/zetacore/zetaclient/config"
)

Expand Down Expand Up @@ -54,16 +59,16 @@ func DebugCmd() *cobra.Command {
var ballotIdentifier string
chainLogger := zerolog.New(io.Discard).Level(zerolog.Disabled)

telemetryServer := zetaclient.NewTelemetryServer()
telemetryServer := metrics.NewTelemetryServer()
go func() {
err := telemetryServer.Start()
if err != nil {
panic("telemetryServer error")
}
}()

bridge, err := zetaclient.NewZetaCoreBridge(
&zetaclient.Keys{OperatorAddress: sdk.MustAccAddressFromBech32(sample.AccAddress())},
bridge, err := zetabridge.NewZetaCoreBridge(
&keys.Keys{OperatorAddress: sdk.MustAccAddressFromBech32(sample.AccAddress())},
debugArgs.zetaNode,
"",
debugArgs.zetaChainID,
Expand All @@ -89,7 +94,7 @@ func DebugCmd() *cobra.Command {

if common.IsEVMChain(chain.ChainId) {

ob := zetaclient.EVMChainClient{
ob := evm.ChainClient{
Mu: &sync.Mutex{},
}
ob.WithZetaClient(bridge)
Expand Down Expand Up @@ -159,7 +164,7 @@ func DebugCmd() *cobra.Command {
}
fmt.Println("CoinType : ", coinType)
} else if common.IsBitcoinChain(chain.ChainId) {
obBtc := zetaclient.BitcoinChainClient{
obBtc := bitcoin.BTCChainClient{
Mu: &sync.Mutex{},
}
obBtc.WithZetaClient(bridge)
Expand Down
Loading

0 comments on commit 16620fe

Please sign in to comment.