Skip to content

Commit

Permalink
Merge branch 'develop' into docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Aug 3, 2023
2 parents cabd78e + 55e440e commit 410a0fe
Show file tree
Hide file tree
Showing 98 changed files with 1,405 additions and 1,648 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @brewmaster012 @kingpinXD @kevinssgh @fadeev @lumtis
* @brewmaster012 @kingpinXD @kevinssgh @fadeev @lumtis @ws4charlie
12 changes: 9 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
build-alpine-and-test:
runs-on: ["ubuntu-latest"]
timeout-minutes: 30
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/develop')
concurrency:
group: "alpine-build-test"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -159,13 +162,15 @@ jobs:
g++
libusb-dev
linux-headers
git
shell-name: alpine.sh

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}


- name: Build zetacored and zetaclientd
env:
CGO_ENABLED: 1
Expand All @@ -174,6 +179,7 @@ jobs:
shell: alpine.sh --root {0}
run: |
apk add --no-cache --update
make clean
go mod tidy
make clean
make install-testnet
Expand Down Expand Up @@ -203,6 +209,7 @@ jobs:
path: |
zetacored-alpine-*
zetaclientd-alpine-*
- name: Clean Up Alpine Workspace
if: always()
shell: alpine.sh --root {0}
Expand Down Expand Up @@ -499,9 +506,8 @@ jobs:
Hey <@&1122981184255840306>! A new version of the zetachain node has been released.
Major Version Upgrade (e.g. v5.x.x to V6.x.x) must be completed through a governance proposal.
We will raise a governance proposal on Monday at 15:00 UTC with a 12-hour voting period.
The upgrade will be scheduled for Tuesday at approximately 15:00 UTC.
More specific information including block height will be shared on Monday as part of the governance proposal.
We will submit a governance proposal in the next few days with a 12-hour voting period.
More specific information including block height will be shared as part of the governance proposal.
See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }}
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ proto:
@echo "--> Generating OpenAPI specs"
@bash ./scripts/protoc-gen-openapi.sh

proto-format:
@bash ./scripts/proto-format.sh

.PHONY: proto

specs:
Expand Down
33 changes: 0 additions & 33 deletions config.yml

This file was deleted.

23 changes: 17 additions & 6 deletions contrib/localnet/orchestrator/smoketest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"context"
"fmt"
"github.com/btcsuite/btcutil"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/spf13/cobra"
"github.com/zeta-chain/zetacore/contrib/localnet/orchestrator/smoketest/contracts/zevmswap"
"github.com/zeta-chain/zetacore/zetaclient/config"
Expand Down Expand Up @@ -52,11 +54,15 @@ var (
)

type SmokeTest struct {
zevmClient *ethclient.Client
goerliClient *ethclient.Client
cctxClient types.QueryClient
btcRPCClient *rpcclient.Client
fungibleClient fungibletypes.QueryClient
zevmClient *ethclient.Client
goerliClient *ethclient.Client
btcRPCClient *rpcclient.Client

cctxClient types.QueryClient
fungibleClient fungibletypes.QueryClient
authClient authtypes.QueryClient
bankClient banktypes.QueryClient

wg sync.WaitGroup
ZetaEth *zetaeth.ZetaEth
ZetaEthAddr ethcommon.Address
Expand Down Expand Up @@ -104,6 +110,7 @@ func init() {

func NewSmokeTest(goerliClient *ethclient.Client, zevmClient *ethclient.Client,
cctxClient types.QueryClient, fungibleClient fungibletypes.QueryClient,
authClient authtypes.QueryClient, bankClient banktypes.QueryClient,
goerliAuth *bind.TransactOpts, zevmAuth *bind.TransactOpts,
btcRPCClient *rpcclient.Client) *SmokeTest {
// query system contract address
Expand Down Expand Up @@ -140,6 +147,8 @@ func NewSmokeTest(goerliClient *ethclient.Client, zevmClient *ethclient.Client,
goerliClient: goerliClient,
cctxClient: cctxClient,
fungibleClient: fungibleClient,
authClient: authClient,
bankClient: bankClient,
wg: sync.WaitGroup{},
goerliAuth: goerliAuth,
zevmAuth: zevmAuth,
Expand Down Expand Up @@ -204,6 +213,8 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) {

cctxClient := types.NewQueryClient(grpcConn)
fungibleClient := fungibletypes.NewQueryClient(grpcConn)
authClient := authtypes.NewQueryClient(grpcConn)
bankClient := banktypes.NewQueryClient(grpcConn)

// Wait for Genesis and keygen to be completed. ~ height 30
time.Sleep(20 * time.Second)
Expand Down Expand Up @@ -240,7 +251,7 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) {
panic(err)
}

smokeTest := NewSmokeTest(goerliClient, zevmClient, cctxClient, fungibleClient, goerliAuth, zevmAuth, btcRPCClient)
smokeTest := NewSmokeTest(goerliClient, zevmClient, cctxClient, fungibleClient, authClient, bankClient, goerliAuth, zevmAuth, btcRPCClient)

// The following deployment must happen here and in this order, please do not change
// ==================== Deploying contracts ====================
Expand Down
18 changes: 18 additions & 0 deletions contrib/localnet/orchestrator/smoketest/test_message_passing.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package main
import (
"context"
"fmt"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"math/big"
"time"

Expand Down Expand Up @@ -171,6 +172,15 @@ func (sm *SmokeTest) TestMessagePassingRevertSuccess() {
if err != nil {
panic(err)
}

res2, err := sm.bankClient.SupplyOf(context.Background(), &banktypes.QuerySupplyOfRequest{
Denom: "azeta",
})
if err != nil {
panic(err)
}
fmt.Printf("$$$ Before: SUPPLY OF AZETA: %d\n", res2.Amount.Amount)

tx, err = testDApp.SendHelloWorld(auth, sm.TestDAppAddr, big.NewInt(1337), amount, true)
if err != nil {
panic(err)
Expand Down Expand Up @@ -198,4 +208,12 @@ func (sm *SmokeTest) TestMessagePassingRevertSuccess() {
fmt.Printf(" Message: %x\n", event.Message)
}
}
res3, err := sm.bankClient.SupplyOf(context.Background(), &banktypes.QuerySupplyOfRequest{
Denom: "azeta",
})
if err != nil {
panic(err)
}
fmt.Printf("$$$ After: SUPPLY OF AZETA: %d\n", res3.Amount.Amount.BigInt())
fmt.Printf("$$$ Diff: SUPPLY OF AZETA: %d\n", res3.Amount.Amount.Sub(res2.Amount.Amount).BigInt())
}
6 changes: 5 additions & 1 deletion contrib/localnet/orchestrator/smoketest/test_stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package main
import (
"context"
"fmt"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -100,6 +102,8 @@ func StressTest(_ *cobra.Command, _ []string) {

cctxClient := types.NewQueryClient(grpcConn)
fungibleClient := fungibletypes.NewQueryClient(grpcConn)
bankClient := banktypes.NewQueryClient(grpcConn)
authClient := authtypes.NewQueryClient(grpcConn)

// Wait for Genesis and keygen to be completed. ~ height 30
time.Sleep(20 * time.Second)
Expand Down Expand Up @@ -136,7 +140,7 @@ func StressTest(_ *cobra.Command, _ []string) {
panic(err)
}

smokeTest := NewSmokeTest(goerliClient, zevmClient, cctxClient, fungibleClient, goerliAuth, zevmAuth, nil)
smokeTest := NewSmokeTest(goerliClient, zevmClient, cctxClient, fungibleClient, authClient, bankClient, goerliAuth, zevmAuth, nil)

// If stress test is running on local docker environment
if stressTestArgs.local {
Expand Down
29 changes: 14 additions & 15 deletions proto/common/common.proto
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
syntax = "proto3";
package common;

option go_package = "github.com/zeta-chain/zetacore/common";

//option (gogoproto.goproto_stringer_all) = false;
//option (gogoproto.stringer_all) = false;
//option (gogoproto.goproto_getters_all) = false;

import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/common";

// PubKeySet contains two pub keys , secp256k1 and ed25519
message PubKeySet {
string secp256k1 = 1 [(gogoproto.casttype) = "PubKey", (gogoproto.customname) = "Secp256k1"];
string ed25519 = 2 [(gogoproto.casttype) = "PubKey"];
string secp256k1 = 1 [
(gogoproto.casttype) = "PubKey",
(gogoproto.customname) = "Secp256k1"
];
string ed25519 = 2 [(gogoproto.casttype) = "PubKey"];
}

enum ReceiveStatus {
Expand All @@ -30,7 +32,6 @@ enum CoinType {
ERC20 = 2; // ERC20 token
}


enum ChainName {
option (gogoproto.goproto_enum_stringer) = true;
empty = 0;
Expand All @@ -39,26 +40,24 @@ enum ChainName {
zeta_mainnet = 2;
btc_mainnet = 3;
polygon_mainnet = 4;
bsc_mainnet = 5 ;
// Testnet
bsc_mainnet = 5;
// Testnet
goerli_testnet = 6;
mumbai_testnet = 7;
ganache_testnet = 8;
baobab_testnet = 9;
bsc_testnet = 10 ;
bsc_testnet = 10;
zeta_testnet = 11;
btc_testnet = 12 ;
// LocalNet
// zeta_localnet = 13;
btc_testnet = 12;
// LocalNet
// zeta_localnet = 13;
goerli_localnet = 14;
btc_regtest = 15;
// Athens
// zeta_athensnet=15;
// Athens
// zeta_athensnet=15;
}

message Chain {
ChainName chain_name = 1;
int64 chain_id = 2;
}


4 changes: 2 additions & 2 deletions proto/crosschain/chain_nonces.proto
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
syntax = "proto3";
package zetachain.zetacore.crosschain;

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types";

import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types";

message ChainNonces {
string creator = 1;
string index = 2;
Expand Down
18 changes: 10 additions & 8 deletions proto/crosschain/cross_chain_tx.proto
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
syntax = "proto3";
package zetachain.zetacore.crosschain;
import "gogoproto/gogo.proto";

import "common/common.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types";

enum CctxStatus {
option (gogoproto.goproto_enum_stringer) = true;
PendingInbound = 0; // some observer sees inbound tx
PendingOutbound = 1; // super majority observer see inbound tx
OutboundMined = 3; // the corresponding outbound tx is mined
OutboundMined = 3; // the corresponding outbound tx is mined
PendingRevert = 4; // outbound cannot succeed; should revert inbound
Reverted = 5; // inbound reverted.
Aborted = 6; // inbound tx error or invalid paramters and cannot revert; just abort
}

message InboundTxParams{
message InboundTxParams {
string sender = 1; // this address is the immediate contract/EOA that calls the Connector.send()
int64 sender_chain_id = 2;
int64 sender_chain_id = 2;
string tx_origin = 3; // this address is the EOA that signs the inbound tx
common.CoinType coin_type = 4;
string asset = 5; // for ERC20 coin type, the asset is an address of the ERC20 contract
Expand All @@ -27,7 +29,7 @@ message InboundTxParams{
string inbound_tx_observed_hash = 7;
uint64 inbound_tx_observed_external_height = 8;
string inbound_tx_ballot_index = 9;
uint64 inbound_tx_finalized_zeta_height = 10;
uint64 inbound_tx_finalized_zeta_height = 10;
}

message OutboundTxParams {
Expand All @@ -51,7 +53,7 @@ message OutboundTxParams {
message Status {
CctxStatus status = 1;
string status_message = 2;
int64 lastUpdate_timestamp = 3;
int64 lastUpdate_timestamp = 3;
}

message CrossChainTx {
Expand All @@ -64,6 +66,6 @@ message CrossChainTx {
];
string relayed_message = 6; // Not used by protocol , just relayed across
Status cctx_status = 8;
InboundTxParams inbound_tx_params = 9;
InboundTxParams inbound_tx_params = 9;
repeated OutboundTxParams outbound_tx_params = 10;
}
}
Loading

0 comments on commit 410a0fe

Please sign in to comment.