Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/zeta-chain/node into ref…
Browse files Browse the repository at this point in the history
…actor-integrate-base-signer-observer-into-existing-structs
  • Loading branch information
ws4charlie committed Jun 20, 2024
2 parents b51ab8a + 3c4ea97 commit 5edd452
Show file tree
Hide file tree
Showing 90 changed files with 945 additions and 3,716 deletions.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/syncing.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Having difficulties setting up or syncing a node
description: Please fill out the following form to help us understand and resolve your issue with setting up or syncing a node. Provide as much detail as possible to ensure a quick and accurate resolution.
labels: ["infra"]
body:
- type: dropdown
attributes:
Expand All @@ -10,14 +11,14 @@ body:
- type: dropdown
attributes:
label: Does your machine match the technical requirements?
description: See https://www.zetachain.com/docs/validators/requirements/
description: See https://www.zetachain.com/docs/nodes/start-here/requirements/
options:
- "Yes"
- "No"
- type: dropdown
attributes:
label: Have you completed the setup?
description: See https://www.zetachain.com/docs/validators/setup/
description: See https://www.zetachain.com/docs/nodes/start-here/setup/
options:
- "Yes"
- "No"
Expand All @@ -30,10 +31,10 @@ body:
- KSYNC
- type: dropdown
attributes:
label: Did you build your binary from source or download it from the Releases[https://github.com/zeta-chain/node/releases] page?
description: We recommend using binaries from our releases page.
label: Did you build your binary from source or download it from the Releases page?
description: "We recommend using binaries from our Releases page: https://github.com/zeta-chain/node/releases"
options:
- "Downloaded from releases page"
- "Downloaded from Releases page"
- "Built locally"
- type: textarea
attributes:
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile-localnet
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ RUN mkdir -p /root/.zetacored/cosmovisor/genesis/bin && \
ENV PATH /root/.zetacored/cosmovisor/current/bin/:/root/.zetaclientd/upgrades/current/:${PATH}

COPY contrib/localnet/scripts /root
COPY contrib/localnet/preparams /root/preparams
COPY contrib/localnet/ssh_config /root/.ssh/config
COPY contrib/localnet/zetacored /root/zetacored
COPY contrib/localnet/tss /root/tss

RUN chmod 755 /root/*.sh

Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* [2306](https://github.com/zeta-chain/node/pull/2306) - refactor zetaclient outbound transaction signing logic
* [2296](https://github.com/zeta-chain/node/pull/2296) - move `testdata` package to `testutil` to organize test-related utilities
* [2344](https://github.com/zeta-chain/node/pull/2344) - group common data of EVM/Bitcoin signer and observer using base structs
* [2317](https://github.com/zeta-chain/node/pull/2317) - add ValidateOutbound method for cctx orchestrator

### Tests

Expand All @@ -57,6 +58,8 @@
* [2240](https://github.com/zeta-chain/node/pull/2240) - removed hard-coded Bitcoin regnet chainID in E2E withdraw tests
* [2266](https://github.com/zeta-chain/node/pull/2266) - try fixing E2E test `crosschain_swap` failure `btc transaction not signed`
* [2294](https://github.com/zeta-chain/node/pull/2294) - add and fix existing ethermint rpc unit test
* [2329](https://github.com/zeta-chain/node/pull/2329) - fix TODOs in rpc unit tests
* [2342](https://github.com/zeta-chain/node/pull/2342) - extend rpc unit tests with testing extension to include synthetic ethereum txs
* [2299](https://github.com/zeta-chain/node/pull/2299) - add `zetae2e` command to deploy test contracts

### Fixes
Expand All @@ -67,6 +70,7 @@
* [2233](https://github.com/zeta-chain/node/pull/2233) - fix `IsSupported` flag not properly updated in zetaclient's context
* [2243](https://github.com/zeta-chain/node/pull/2243) - fix incorrect bitcoin outbound height in the CCTX outbound parameter
* [2256](https://github.com/zeta-chain/node/pull/2256) - fix rate limiter falsely included reverted non-withdraw cctxs
* [2327](https://github.com/zeta-chain/node/pull/2327) - partially cherry picked the fix to Bitcoin outbound dust amount

### CI

Expand Down
4 changes: 2 additions & 2 deletions cmd/zetaclientd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func start(_ *cobra.Command, _ []string) error {
}

// CreateSignerMap: This creates a map of all signers for each chain . Each signer is responsible for signing transactions for a particular chain
signerMap, err := CreateSignerMap(appContext, tss, telemetryServer, logger)
signerMap, err := CreateSignerMap(appContext, tss, logger, telemetryServer)
if err != nil {
log.Error().Err(err).Msg("CreateSignerMap")
return err
Expand All @@ -282,7 +282,7 @@ func start(_ *cobra.Command, _ []string) error {
dbpath := filepath.Join(userDir, ".zetaclient/chainobserver")

// Creates a map of all chain observers for each chain. Each chain observer is responsible for observing events on the chain and processing them.
observerMap, err := CreateChainObserverMap(appContext, zetacoreClient, tss, dbpath, telemetryServer, logger)
observerMap, err := CreateChainObserverMap(appContext, zetacoreClient, tss, dbpath, logger, telemetryServer)
if err != nil {
startLogger.Err(err).Msg("CreateChainObserverMap")
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetaclientd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ func CreateZetacoreClient(
func CreateSignerMap(
appContext *context.AppContext,
tss interfaces.TSSSigner,
ts *metrics.TelemetryServer,
logger base.Logger,
ts *metrics.TelemetryServer,
) (map[int64]interfaces.ChainSigner, error) {
zetacoreContext := appContext.ZetacoreContext()
signerMap := make(map[int64]interfaces.ChainSigner)
Expand Down Expand Up @@ -117,8 +117,8 @@ func CreateChainObserverMap(
zetacoreClient *zetacore.Client,
tss interfaces.TSSSigner,
dbpath string,
ts *metrics.TelemetryServer,
logger base.Logger,
ts *metrics.TelemetryServer,
) (map[int64]interfaces.ChainObserver, error) {
zetacoreContext := appContext.ZetacoreContext()
observerMap := make(map[int64]interfaces.ChainObserver)
Expand Down
4 changes: 0 additions & 4 deletions cmd/zetae2e/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import (

"github.com/zeta-chain/zetacore/app"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

const flagSkipBTC = "skip-btc"
Expand Down Expand Up @@ -71,8 +69,6 @@ func runBalances(cmd *cobra.Command, args []string) error {
conf,
ethcommon.HexToAddress(evmAddr),
conf.Accounts.EVMPrivKey,
utils.FungibleAdminName, // placeholder value, not used
local.FungibleAdminMnemonic, // placeholder value, not used
logger,
)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions cmd/zetae2e/bitcoin_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import (

"github.com/zeta-chain/zetacore/app"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

const flagPrivKey = "privkey"
Expand Down Expand Up @@ -71,8 +69,6 @@ func runBitcoinAddress(cmd *cobra.Command, args []string) error {
conf,
ethcommon.HexToAddress(evmAddr),
conf.Accounts.EVMPrivKey,
utils.FungibleAdminName, // placeholder value, not used
local.FungibleAdminMnemonic, // placeholder value, not used
logger,
)
if err != nil {
Expand Down
17 changes: 2 additions & 15 deletions cmd/zetae2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/txserver"
)

// RunnerFromConfig create test runner from config
Expand All @@ -19,9 +18,8 @@ func RunnerFromConfig(
conf config.Config,
evmUserAddr ethcommon.Address,
evmUserPrivKey string,
zetaUserName string,
zetaUserMnemonic string,
logger *runner.Logger,
opts ...runner.E2ERunnerOption,
) (*runner.E2ERunner, error) {
// initialize clients
btcRPCClient,
Expand All @@ -39,16 +37,6 @@ func RunnerFromConfig(
if err != nil {
return nil, fmt.Errorf("failed to get clients from config: %w", err)
}
// initialize client to send messages to ZetaChain
zetaTxServer, err := txserver.NewZetaTxServer(
conf.RPCs.ZetaCoreRPC,
[]string{zetaUserName},
[]string{zetaUserMnemonic},
conf.ZetaChainID,
)
if err != nil {
return nil, fmt.Errorf("failed to initialize ZetaChain tx server: %w", err)
}

// initialize E2E test runner
newRunner := runner.NewE2ERunner(
Expand All @@ -57,11 +45,9 @@ func RunnerFromConfig(
ctxCancel,
evmUserAddr,
evmUserPrivKey,
zetaUserMnemonic,
evmClient,
zevmClient,
cctxClient,
zetaTxServer,
fungibleClient,
authClient,
bankClient,
Expand All @@ -71,6 +57,7 @@ func RunnerFromConfig(
zevmAuth,
btcRPCClient,
logger,
opts...,
)

// set contracts
Expand Down
4 changes: 3 additions & 1 deletion cmd/zetae2e/local/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ var (
UserAdminAddress = ethcommon.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
UserAdminPrivateKey = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" // #nosec G101 - used for testing

FungibleAdminMnemonic = "snow grace federal cupboard arrive fancy gym lady uniform rotate exercise either leave alien grass" // #nosec G101 - used for testing
// FungibleAdminAddress is the address of the account for testing the fungible admin functions
UserFungibleAdminAddress = ethcommon.HexToAddress("0x8305C114Ea73cAc4A88f39A173803F94741b9055")
UserFungibleAdminPrivateKey = "d88d09a7d6849c15a36eb6931f9dd616091a63e9849a2cc86f309ba11fb8fec5" // #nosec G101 - used for testing
)
1 change: 1 addition & 0 deletions cmd/zetae2e/local/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func adminTestRoutine(
UserAdminAddress,
UserAdminPrivateKey,
runner.NewLogger(verbose, color.FgHiGreen, "admin"),
runner.WithZetaTxServer(deployerRunner.ZetaTxServer),
)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions cmd/zetae2e/local/erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func erc20TestRoutine(
UserERC20Address,
UserERC20PrivateKey,
runner.NewLogger(verbose, color.FgGreen, "erc20"),
runner.WithZetaTxServer(deployerRunner.ZetaTxServer),
)
if err != nil {
return err
Expand Down
15 changes: 13 additions & 2 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package local

import (
"context"
"fmt"
"os"
"path/filepath"
"time"
Expand All @@ -14,6 +15,7 @@ import (
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/e2etests"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/txserver"
"github.com/zeta-chain/zetacore/e2e/utils"
"github.com/zeta-chain/zetacore/pkg/chains"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
Expand Down Expand Up @@ -166,6 +168,16 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
time.Sleep(70 * time.Second)
}

zetaTxServer, err := txserver.NewZetaTxServer(
conf.RPCs.ZetaCoreRPC,
[]string{utils.FungibleAdminName},
[]string{UserFungibleAdminPrivateKey},
conf.ZetaChainID,
)
if err != nil {
panic(fmt.Errorf("failed to initialize ZetaChain tx server: %w", err))
}

// initialize deployer runner with config
deployerRunner, err := zetae2econfig.RunnerFromConfig(
ctx,
Expand All @@ -174,9 +186,8 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
conf,
DeployerAddress,
DeployerPrivateKey,
utils.FungibleAdminName,
FungibleAdminMnemonic,
logger,
runner.WithZetaTxServer(zetaTxServer),
)
if err != nil {
panic(err)
Expand Down
5 changes: 2 additions & 3 deletions cmd/zetae2e/local/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

// initTestRunner initializes a runner form tests
Expand All @@ -18,6 +17,7 @@ func initTestRunner(
userAddress ethcommon.Address,
userPrivKey string,
logger *runner.Logger,
opts ...runner.E2ERunnerOption,
) (*runner.E2ERunner, error) {
// initialize runner for test
testRunner, err := zetae2econfig.RunnerFromConfig(
Expand All @@ -27,9 +27,8 @@ func initTestRunner(
conf,
userAddress,
userPrivKey,
utils.FungibleAdminName,
FungibleAdminMnemonic,
logger,
opts...,
)
if err != nil {
return nil, err
Expand Down
4 changes: 0 additions & 4 deletions cmd/zetae2e/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ import (

"github.com/zeta-chain/zetacore/app"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/e2etests"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

const flagVerbose = "verbose"
Expand Down Expand Up @@ -93,8 +91,6 @@ func runE2ETest(cmd *cobra.Command, args []string) error {
conf,
ethcommon.HexToAddress(evmAddr),
conf.Accounts.EVMPrivKey,
utils.FungibleAdminName, // placeholder value, not used
local.FungibleAdminMnemonic, // placeholder value, not used
logger,
)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions cmd/zetae2e/setup_bitcoin.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import (

"github.com/zeta-chain/zetacore/app"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

// NewSetupBitcoinCmd sets up bitcoin wallet for e2e tests
Expand Down Expand Up @@ -58,8 +56,6 @@ func runSetupBitcoin(_ *cobra.Command, args []string) error {
conf,
ethcommon.HexToAddress(evmAddr),
conf.Accounts.EVMPrivKey,
utils.FungibleAdminName, // placeholder value, not used
local.FungibleAdminMnemonic, // placeholder value, not used
logger,
)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions cmd/zetae2e/show_tss.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import (

"github.com/zeta-chain/zetacore/app"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
"github.com/zeta-chain/zetacore/e2e/config"
"github.com/zeta-chain/zetacore/e2e/runner"
"github.com/zeta-chain/zetacore/e2e/utils"
)

// NewShowTSSCmd returns the show TSS command
Expand Down Expand Up @@ -59,8 +57,6 @@ func runShowTSS(_ *cobra.Command, args []string) error {
conf,
ethcommon.HexToAddress(evmAddr),
conf.Accounts.EVMPrivKey,
utils.FungibleAdminName, // placeholder value, not used
local.FungibleAdminMnemonic, // placeholder value, not used
logger,
)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions cmd/zetae2e/stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,6 @@ func StressTest(cmd *cobra.Command, _ []string) {
conf,
local.DeployerAddress,
local.DeployerPrivateKey,
utils.FungibleAdminName,
local.FungibleAdminMnemonic,
logger,
)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion contrib/localnet/docker-compose-admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
context: ./anvil
container_name: eth2
hostname: eth2
platform: linux/amd64
ports:
- "8546:8545"
networks:
Expand All @@ -23,4 +24,4 @@ services:
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]

zetaclient1:
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
1 change: 0 additions & 1 deletion contrib/localnet/preparams/PreParams_zetaclient0.json

This file was deleted.

Loading

0 comments on commit 5edd452

Please sign in to comment.