Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie committed Apr 4, 2024
2 parents c5dfb42 + ae29968 commit ddc4d4a
Show file tree
Hide file tree
Showing 223 changed files with 10,991 additions and 5,048 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* @brewmaster012 @kingpinXD @kevinssgh @fadeev @lumtis @ws4charlie @skosito
* @brewmaster012 @kingpinXD @kevinssgh @lumtis @ws4charlie @skosito

.github/** @zeta-chain/devops
2 changes: 1 addition & 1 deletion .github/workflows/change-log-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Changelog Check

on:
pull_request:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
check-changelog:
Expand Down
2 changes: 1 addition & 1 deletion app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func IsSystemTx(tx sdk.Tx, isAuthorizedSigner func(string) bool) bool {
*cctxtypes.MsgVoteOnObservedInboundTx,
*cctxtypes.MsgVoteOnObservedOutboundTx,
*cctxtypes.MsgAddToOutTxTracker,
*cctxtypes.MsgCreateTSSVoter,
*observertypes.MsgVoteTSS,
*observertypes.MsgAddBlockHeader,
*observertypes.MsgAddBlameVote:
signers := innerMsg.GetSigners()
Expand Down
22 changes: 11 additions & 11 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestIsSystemTx(t *testing.T) {
// *cctxtypes.MsgVoteOnObservedInboundTx,
// *cctxtypes.MsgVoteOnObservedOutboundTx,
// *cctxtypes.MsgAddToOutTxTracker,
// *cctxtypes.MsgCreateTSSVoter,
// *observertypes.MsgVoteTSS,
// *observertypes.MsgAddBlockHeader,
// *observertypes.MsgAddBlameVote:
buildTxFromMsg := func(msg sdk.Msg) sdk.Tx {
Expand Down Expand Up @@ -64,26 +64,26 @@ func TestIsSystemTx(t *testing.T) {
wantIs bool
}{
{
"MsgCreateTSSVoter",
buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{
"MsgVoteTSS",
buildTxFromMsg(&observertypes.MsgVoteTSS{
Creator: sample.AccAddress(),
TssPubkey: "pubkey1234",
}),
isAuthorizedFalse,
false,
},
{
"MsgCreateTSSVoter",
buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{
"MsgVoteTSS",
buildTxFromMsg(&observertypes.MsgVoteTSS{
Creator: sample.AccAddress(),
TssPubkey: "pubkey1234",
}),
isAuthorized,
true,
},
{
"MsgExec{MsgCreateTSSVoter}",
buildAuthzTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{
"MsgExec{MsgVoteTSS}",
buildAuthzTxFromMsg(&observertypes.MsgVoteTSS{
Creator: sample.AccAddress(),
TssPubkey: "pubkey1234",
}),
Expand Down Expand Up @@ -169,17 +169,17 @@ func TestIsSystemTx(t *testing.T) {
true,
},
{
"MsgCreateTSSVoter",
buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{
"MsgVoteTSS",
buildTxFromMsg(&observertypes.MsgVoteTSS{
Creator: sample.AccAddress(),
}),
isAuthorized,

true,
},
{
"MsgExec{MsgCreateTSSVoter}",
buildAuthzTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{
"MsgExec{MsgVoteTSS}",
buildAuthzTxFromMsg(&observertypes.MsgVoteTSS{
Creator: sample.AccAddress(),
}),
isAuthorized,
Expand Down
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# CHANGELOG

## Unreleased

### Breaking Changes

* Admin policies have been moved from `observer` to a new module `authority`.
* Updating admin policies now requires to send a governance proposal executing the `UpdatePolicies` message in the `authority` module.
* The `Policies` query of the `authority` module must be used to get the current admin policies.
* `PolicyType_group1` has been renamed into `PolicyType_groupEmergency` and `PolicyType_group2` has been renamed into `PolicyType_groupAdmin`.

* `MsgCreateTSSVoter` message in the `crosschain` module has been moved to the `observer` module and renamed to `MsgVoteTSS`.
* The structure of the message remains the same.

### Refactor

* [1511](https://github.com/zeta-chain/node/pull/1511) - move ballot voting logic from `crosschain` to `observer`
Expand All @@ -22,6 +24,8 @@
* [1914](https://github.com/zeta-chain/node/pull/1914) - move crosschain flags to core context in zetaclient
* [1948](https://github.com/zeta-chain/node/pull/1948) - remove deprecated GetTSSAddress query in crosschain module
* [1936](https://github.com/zeta-chain/node/pull/1936) - refactor common package into subpackages and rename to pkg
* [1966](https://github.com/zeta-chain/node/pull/1966) - move TSS vote message from crosschain to observer
* [1853](https://github.com/zeta-chain/node/pull/1853) - refactor vote inbound tx and vote outbound tx

### Features

Expand All @@ -47,11 +51,15 @@
* [1879](https://github.com/zeta-chain/node/pull/1879) - full coverage for messages in types packages
* [1899](https://github.com/zeta-chain/node/pull/1899) - add empty test files so packages are included in coverage
* [1903](https://github.com/zeta-chain/node/pull/1903) - common package tests
* [1961](https://github.com/zeta-chain/node/pull/1961) - improve observer module coverage
* [1967](https://github.com/zeta-chain/node/pull/1967) - improve crosschain module coverage
* [1955](https://github.com/zeta-chain/node/pull/1955) - improve emissions module coverage

### Fixes

* [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
* [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 Down
17 changes: 8 additions & 9 deletions cmd/zetaclientd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,24 @@ import (
"strings"
"sync"

"github.com/btcsuite/btcd/rpcclient"
sdk "github.com/cosmos/cosmos-sdk/types"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/onrik/ethrpc"
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"github.com/zeta-chain/zetacore/pkg/chains"
"github.com/zeta-chain/zetacore/pkg/coin"
"github.com/zeta-chain/zetacore/testutil/sample"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/zetaclient/bitcoin"
"github.com/zeta-chain/zetacore/zetaclient/config"
corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context"
"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"
"github.com/rs/zerolog"
"github.com/spf13/cobra"
"github.com/zeta-chain/zetacore/testutil/sample"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
"github.com/zeta-chain/zetacore/zetaclient/config"
)

var debugArgs = debugArguments{}
Expand Down
8 changes: 1 addition & 7 deletions cmd/zetaclientd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ func CreateSignerMap(
loggers.Std.Error().Msgf("ChainParam not found for chain %s", evmConfig.Chain.String())
continue
}
if !evmChainParams.IsSupported {
continue
}
mpiAddress := ethcommon.HexToAddress(evmChainParams.ConnectorContractAddress)
erc20CustodyAddress := ethcommon.HexToAddress(evmChainParams.Erc20CustodyContractAddress)
signer, err := evm.NewEVMSigner(
Expand Down Expand Up @@ -117,14 +114,11 @@ func CreateChainClientMap(
if evmConfig.Chain.IsZetaChain() {
continue
}
evmChainParams, found := appContext.ZetaCoreContext().GetEVMChainParams(evmConfig.Chain.ChainId)
_, found := appContext.ZetaCoreContext().GetEVMChainParams(evmConfig.Chain.ChainId)
if !found {
loggers.Std.Error().Msgf("ChainParam not found for chain %s", evmConfig.Chain.String())
continue
}
if !evmChainParams.IsSupported {
continue
}
co, err := evm.NewEVMChainClient(appContext, bridge, tss, dbpath, loggers, evmConfig, ts)
if err != nil {
loggers.Std.Error().Err(err).Msgf("NewEVMChainClient error for chain %s", evmConfig.Chain.String())
Expand Down
32 changes: 17 additions & 15 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ flags:
- "common/"

ignore:
- "x/**/client/"
- "x/**/client/**/*"
- "x/**/keeper/keeper.go"
- "x/**/keeper/msg_server.go"
- "x/**/keeper/grpc_query_params.go"
Expand All @@ -49,25 +49,27 @@ ignore:
- "x/**/types/types.go"
- "x/**/types/expected_keepers.go"
- "x/**/module.go"
- "x/**/events.go"
- "x/**/migrator.go"
- "x/**/module_simulation.go"
- "x/**/simulation/"
- "x/**/simulation/**/*"
- "**/*.proto"
- "**/*.md"
- "**/*.yml"
- "**/*.yaml"
- "**/*.pb.go"
- "**/*.pb.gw.go"
- "**/*.json"
- ".github/"
- "app/"
- "cmd/"
- "contrib/"
- "docs/"
- "rpc/"
- "proto/"
- "scripts/"
- "server/"
- "testutil/"
- "testutils/"
- "errors/"
- "typescript/"
- ".github/**/*"
- "app/**/*"
- "cmd/**/*"
- "contrib/**/*"
- "docs/**/*"
- "rpc/**/*"
- "proto/**/*"
- "scripts/**/*"
- "server/**/*"
- "testutil/**/*"
- "testutils/**/*"
- "errors/**/*"
- "typescript/**/*"
1 change: 0 additions & 1 deletion docs/cli/zetacored/zetacored_query_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ zetacored query crosschain [flags]
* [zetacored query crosschain list-in-tx-tracker](zetacored_query_crosschain_list-in-tx-tracker.md) - shows a list of in tx tracker by chainId
* [zetacored query crosschain list-out-tx-tracker](zetacored_query_crosschain_list-out-tx-tracker.md) - list all OutTxTracker
* [zetacored query crosschain list-pending-cctx](zetacored_query_crosschain_list-pending-cctx.md) - shows pending CCTX
* [zetacored query crosschain params](zetacored_query_crosschain_params.md) - shows the parameters of the module
* [zetacored query crosschain show-cctx](zetacored_query_crosschain_show-cctx.md) - shows a CCTX
* [zetacored query crosschain show-gas-price](zetacored_query_crosschain_show-gas-price.md) - shows a gasPrice
* [zetacored query crosschain show-in-tx-hash-to-cctx](zetacored_query_crosschain_show-in-tx-hash-to-cctx.md) - shows a inTxHashToCctx
Expand Down
33 changes: 0 additions & 33 deletions docs/cli/zetacored/zetacored_query_crosschain_params.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/cli/zetacored/zetacored_tx_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ zetacored tx crosschain [flags]
* [zetacored tx crosschain add-to-in-tx-tracker](zetacored_tx_crosschain_add-to-in-tx-tracker.md) - Add a in-tx-tracker
Use 0:Zeta,1:Gas,2:ERC20
* [zetacored tx crosschain add-to-out-tx-tracker](zetacored_tx_crosschain_add-to-out-tx-tracker.md) - Add a out-tx-tracker
* [zetacored tx crosschain create-tss-voter](zetacored_tx_crosschain_create-tss-voter.md) - Create a new TSSVoter
* [zetacored tx crosschain gas-price-voter](zetacored_tx_crosschain_gas-price-voter.md) - Broadcast message gasPriceVoter
* [zetacored tx crosschain inbound-voter](zetacored_tx_crosschain_inbound-voter.md) - Broadcast message sendVoter
* [zetacored tx crosschain migrate-tss-funds](zetacored_tx_crosschain_migrate-tss-funds.md) - Migrate TSS funds to the latest TSS address
Expand Down
1 change: 1 addition & 0 deletions docs/cli/zetacored/zetacored_tx_observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ zetacored tx observer [flags]
* [zetacored tx observer update-crosschain-flags](zetacored_tx_observer_update-crosschain-flags.md) - Update crosschain flags
* [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal
* [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer
* [zetacored tx observer vote-tss](zetacored_tx_observer_vote-tss.md) - Vote for a new TSS creation

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# tx crosschain create-tss-voter
# tx observer vote-tss

Create a new TSSVoter
Vote for a new TSS creation

```
zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags]
zetacored tx observer vote-tss [pubkey] [keygen-block] [status] [flags]
```

### Options
Expand All @@ -21,7 +21,7 @@ zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags]
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for create-tss-voter
-h, --help help for vote-tss
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
Expand All @@ -48,5 +48,5 @@ zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags]

### SEE ALSO

* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands
* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands

39 changes: 9 additions & 30 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27173,21 +27173,6 @@ paths:
type: boolean
tags:
- Query
/zeta-chain/crosschain/params:
get:
summary: Parameters queries the parameters of the module.
operationId: Query_Params
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/zetacorecrosschainQueryParamsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/crosschain/protocolFee:
get:
operationId: Query_ProtocolFee
Expand Down Expand Up @@ -53701,8 +53686,6 @@ definitions:
is_removed:
type: boolean
title: if the tx was removed from the tracker due to no pending cctx
crosschainMsgCreateTSSVoterResponse:
type: object
crosschainMsgGasPriceVoterResponse:
type: object
crosschainMsgMigrateTssFundsResponse:
Expand Down Expand Up @@ -54324,6 +54307,15 @@ definitions:
type: object
observerMsgUpdateObserverResponse:
type: object
observerMsgVoteTSSResponse:
type: object
properties:
ballot_created:
type: boolean
vote_finalized:
type: boolean
keygen_success:
type: boolean
observerNode:
type: object
properties:
Expand Down Expand Up @@ -54731,19 +54723,6 @@ definitions:
repeated Bar results = 1;
PageResponse page = 2;
}
zetacorecrosschainParams:
type: object
properties:
enabled:
type: boolean
description: Params defines the parameters for the module.
zetacorecrosschainQueryParamsResponse:
type: object
properties:
params:
$ref: '#/definitions/zetacorecrosschainParams'
description: params holds all the parameters of this module.
description: QueryParamsResponse is response type for the Query/Params RPC method.
zetacorecrosschainStatus:
type: object
properties:
Expand Down
Loading

0 comments on commit ddc4d4a

Please sign in to comment.