Skip to content

Commit

Permalink
Merge branch 'develop' into feat/vote-priority-fee
Browse files Browse the repository at this point in the history
# Conflicts:
#	x/crosschain/keeper/msg_server_vote_gas_price.go
#	zetaclient/chains/bitcoin/observer/observer.go
#	zetaclient/chains/evm/observer/observer.go
#	zetaclient/chains/interfaces/interfaces.go
#	zetaclient/testutils/mocks/zetacore_client.go
#	zetaclient/zetacore/tx.go
#	zetaclient/zetacore/tx_test.go
  • Loading branch information
swift1337 committed Jul 15, 2024
2 parents c7be816 + 0d79cfb commit 073f977
Show file tree
Hide file tree
Showing 161 changed files with 5,179 additions and 3,199 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- uses: actions/setup-go@v5
if: ${{ inputs.skip_go == 'false' }}
with:
go-version: '1.20'
go-version: '1.22'
cache: false

- uses: actions/setup-python@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
if: ${{ github.event.inputs.skip_checks != 'true' }}
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'

- name: Run Gosec Security Scanner
if: ${{ github.event.inputs.skip_checks != 'true' }}
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
if: ${{ github.event.inputs.skip_checks != 'true' }}
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'

- name: Run Cosmos Gosec Security Scanner
if: ${{ github.event.inputs.skip_checks != 'true' }}
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
if: ${{ github.event.inputs.skip_checks != 'true' }}
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'

- name: Run golangci-lint
if: ${{ github.event.inputs.skip_checks != 'true' }}
Expand Down
29 changes: 3 additions & 26 deletions .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'

- name: Run Gosec Security Scanner
uses: securego/[email protected]
with:
args: ./...

gosec-cosmos:
runs-on: ubuntu-22.04
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v4
uses: zeta-chain/[email protected]
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'

- name: Run Cosmos Gosec Security Scanner
run: make lint-cosmos-gosec
args: -exclude-generated -exclude-dir testutil ./...

lint:
runs-on: ubuntu-22.04
Expand All @@ -67,7 +44,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-localnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.7-labs
FROM golang:1.20.14-bookworm AS base-build
FROM golang:1.22.5-bookworm AS base-build

ENV GOPATH /go
ENV GOOS=linux
Expand All @@ -22,10 +22,10 @@ COPY --exclude=*.sh --exclude=*.md --exclude=*.yml . .
RUN --mount=type=cache,target="/root/.cache/go-build" make install
RUN --mount=type=cache,target="/root/.cache/go-build" make install-zetae2e

FROM golang:1.20.14-bookworm AS cosmovisor-build
FROM golang:1.22.5-bookworm AS cosmovisor-build
RUN go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]

FROM golang:1.20.14-bookworm AS base-runtime
FROM golang:1.22.5-bookworm AS base-runtime

RUN apt update && \
apt install -yq jq yq curl tmux python3 openssh-server iputils-ping iproute2 bind9-host && \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ lint-pre:
lint: lint-pre
@golangci-lint run

lint-cosmos-gosec:
@bash ./scripts/cosmos-gosec.sh
lint-gosec:
@bash ./scripts/gosec.sh

gosec:
gosec -exclude-dir=localnet ./...
Expand Down
16 changes: 10 additions & 6 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Breaking Changes

* [List of the breaking changes can be found in this document](docs/releases/v17_breaking_changes.md)
* [2460](https://github.com/zeta-chain/node/pull/2460) - Upgrade to go 1.22. This required us to temporarily remove the QUIC backend from [go-libp2p](https://github.com/libp2p/go-libp2p). If you are a zetaclient operator and have configured quic peers, you need to switch to tcp peers.

### Features

Expand All @@ -30,7 +30,7 @@
* [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
* [2372](https://github.com/zeta-chain/node/pull/2372) - add queries for tss fund migration info
* [2416g](https://github.com/zeta-chain/node/pull/2416) - add Solana chain information
* [2416](https://github.com/zeta-chain/node/pull/2416) - add Solana chain information

### Refactor

Expand Down Expand Up @@ -58,6 +58,8 @@
* [2375](https://github.com/zeta-chain/node/pull/2375) - improve & speedup code formatting
* [2380](https://github.com/zeta-chain/node/pull/2380) - use `ChainInfo` in `authority` to allow dynamically support new chains
* [2395](https://github.com/zeta-chain/node/pull/2395) - converge AppContext with ZetaCoreContext in zetaclient
* [2428](https://github.com/zeta-chain/node/pull/2428) - propagate context across codebase & refactor zetacore client
* [2464](https://github.com/zeta-chain/node/pull/2464) - move common voting logic to voting.go and add new function VoteOnBallot

### Tests

Expand All @@ -76,9 +78,9 @@
* [2349](https://github.com/zeta-chain/node/pull/2349) - add TestBitcoinDepositRefund and WithdrawBitcoinMultipleTimes E2E tests
* [2368](https://github.com/zeta-chain/node/pull/2368) - eliminate panic usage across testing suite
* [2369](https://github.com/zeta-chain/node/pull/2369) - fix random cross-chain swap failure caused by using tiny UTXO
* [2549](https://github.com/zeta-chain/node/pull/2459) - add separate accounts for each policy in e2e tests
* [2415](https://github.com/zeta-chain/node/pull/2415) - add e2e test for upgrade and test admin functionalities


### Fixes

* [1484](https://github.com/zeta-chain/node/issues/1484) - replaced hard-coded `MaxLookaheadNonce` with a default lookback factor
Expand All @@ -94,6 +96,7 @@
* [2434](https://github.com/zeta-chain/node/pull/2434) - the default database when running `zetacored init` is now pebbledb

### CI

* [2388](https://github.com/zeta-chain/node/pull/2388) - added GitHub attestations of binaries produced in the release workflow.
* [2285](https://github.com/zeta-chain/node/pull/2285) - added nightly EVM performance testing pipeline, modified localnet testing docker image to utilitze debian:bookworm, removed build-jet runners where applicable, removed deprecated/removed upgrade path testing pipeline
* [2268](https://github.com/zeta-chain/node/pull/2268) - updated the publish-release pipeline to utilize the Github Actions Ubuntu 20.04 Runners
Expand Down Expand Up @@ -213,7 +216,7 @@
* [1861](https://github.com/zeta-chain/node/pull/1861) - fix `ObserverSlashAmount` invalid read
* [1880](https://github.com/zeta-chain/node/issues/1880) - lower the gas price multiplier for EVM chains
* [1883](https://github.com/zeta-chain/node/issues/1883) - zetaclient should check 'IsSupported' flag to pause/unpause a specific chain
* * [2076](https://github.com/zeta-chain/node/pull/2076) - automatically deposit native zeta to an address if it doesn't exist on ZEVM
* [2076](https://github.com/zeta-chain/node/pull/2076) - automatically deposit native zeta to an address if it doesn't exist on ZEVM
* [1633](https://github.com/zeta-chain/node/issues/1633) - zetaclient should be able to pick up new connector and erc20Custody addresses
* [1944](https://github.com/zeta-chain/node/pull/1944) - fix evm signer unit tests
* [1888](https://github.com/zeta-chain/node/issues/1888) - zetaclient should stop inbound/outbound txs according to cross-chain flags
Expand All @@ -236,11 +239,12 @@
## Version: v15.0.0

### Features

* [1912](https://github.com/zeta-chain/node/pull/1912) - add reset chain nonces msg

## Version: v14.0.1

- [1817](https://github.com/zeta-chain/node/pull/1817) - Add migration script to fix pending and chain nonces on testnet
* [1817](https://github.com/zeta-chain/node/pull/1817) - Add migration script to fix pending and chain nonces on testnet

## Version: v13.0.0

Expand Down Expand Up @@ -549,4 +553,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
22 changes: 12 additions & 10 deletions cmd/zetaclientd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
btcobserver "github.com/zeta-chain/zetacore/zetaclient/chains/bitcoin/observer"
evmobserver "github.com/zeta-chain/zetacore/zetaclient/chains/evm/observer"
"github.com/zeta-chain/zetacore/zetaclient/config"
clientcontext "github.com/zeta-chain/zetacore/zetaclient/context"
zctx "github.com/zeta-chain/zetacore/zetaclient/context"
"github.com/zeta-chain/zetacore/zetaclient/keys"
"github.com/zeta-chain/zetacore/zetaclient/zetacore"
)
Expand Down Expand Up @@ -57,7 +57,8 @@ func debugCmd(_ *cobra.Command, args []string) error {
return err
}

appContext := clientcontext.New(cfg, zerolog.Nop())
appContext := zctx.New(cfg, zerolog.Nop())
ctx := zctx.WithAppContext(context.Background(), appContext)

chainID, err := strconv.ParseInt(args[1], 10, 64)
if err != nil {
Expand All @@ -74,15 +75,16 @@ func debugCmd(_ *cobra.Command, args []string) error {
"",
debugArgs.zetaChainID,
false,
nil)
zerolog.Nop(),
)
if err != nil {
return err
}
chainParams, err := client.GetChainParams()
chainParams, err := client.GetChainParams(ctx)
if err != nil {
return err
}
tssEthAddress, err := client.GetEthTssAddress()
tssEthAddress, err := client.GetEVMTSSAddress(ctx)
if err != nil {
return err
}
Expand Down Expand Up @@ -148,19 +150,19 @@ func debugCmd(_ *cobra.Command, args []string) error {

switch coinType {
case coin.CoinType_Zeta:
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenZeta(tx, receipt, false)
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenZeta(ctx, tx, receipt, false)
if err != nil {
return err
}

case coin.CoinType_ERC20:
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenERC20(tx, receipt, false)
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenERC20(ctx, tx, receipt, false)
if err != nil {
return err
}

case coin.CoinType_Gas:
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenGas(tx, receipt, false)
ballotIdentifier, err = evmObserver.CheckAndVoteInboundTokenGas(ctx, tx, receipt, false)
if err != nil {
return err
}
Expand All @@ -186,15 +188,15 @@ func debugCmd(_ *cobra.Command, args []string) error {
return err
}
btcObserver.WithBtcClient(btcClient)
ballotIdentifier, err = btcObserver.CheckReceiptForBtcTxHash(inboundHash, false)
ballotIdentifier, err = btcObserver.CheckReceiptForBtcTxHash(ctx, inboundHash, false)
if err != nil {
return err
}
}
fmt.Println("BallotIdentifier : ", ballotIdentifier)

// query ballot
ballot, err := client.GetBallot(ballotIdentifier)
ballot, err := client.GetBallot(ctx, ballotIdentifier)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func Initialize(_ *cobra.Command, _ []string) error {
}

//Create new config struct
configData := config.New()
configData := config.New(true)

//Validate Peer eg. /ip4/172.0.2.1/tcp/6668/p2p/16Uiu2HAmACG5DtqmQsHtXg4G2sLS65ttv84e7MrL4kapkjfmhxAp
if len(initArgs.peer) != 0 {
Expand Down
Loading

0 comments on commit 073f977

Please sign in to comment.