Skip to content

Commit 5edd452

Browse files
committed
Merge branch 'develop' of https://github.com/zeta-chain/node into refactor-integrate-base-signer-observer-into-existing-structs
2 parents b51ab8a + 3c4ea97 commit 5edd452

File tree

90 files changed

+945
-3716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+945
-3716
lines changed

.github/ISSUE_TEMPLATE/syncing.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Having difficulties setting up or syncing a node
22
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.
3+
labels: ["infra"]
34
body:
45
- type: dropdown
56
attributes:
@@ -10,14 +11,14 @@ body:
1011
- type: dropdown
1112
attributes:
1213
label: Does your machine match the technical requirements?
13-
description: See https://www.zetachain.com/docs/validators/requirements/
14+
description: See https://www.zetachain.com/docs/nodes/start-here/requirements/
1415
options:
1516
- "Yes"
1617
- "No"
1718
- type: dropdown
1819
attributes:
1920
label: Have you completed the setup?
20-
description: See https://www.zetachain.com/docs/validators/setup/
21+
description: See https://www.zetachain.com/docs/nodes/start-here/setup/
2122
options:
2223
- "Yes"
2324
- "No"
@@ -30,10 +31,10 @@ body:
3031
- KSYNC
3132
- type: dropdown
3233
attributes:
33-
label: Did you build your binary from source or download it from the Releases[https://github.com/zeta-chain/node/releases] page?
34-
description: We recommend using binaries from our releases page.
34+
label: Did you build your binary from source or download it from the Releases page?
35+
description: "We recommend using binaries from our Releases page: https://github.com/zeta-chain/node/releases"
3536
options:
36-
- "Downloaded from releases page"
37+
- "Downloaded from Releases page"
3738
- "Built locally"
3839
- type: textarea
3940
attributes:

Dockerfile-localnet

-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ RUN mkdir -p /root/.zetacored/cosmovisor/genesis/bin && \
4444
ENV PATH /root/.zetacored/cosmovisor/current/bin/:/root/.zetaclientd/upgrades/current/:${PATH}
4545

4646
COPY contrib/localnet/scripts /root
47-
COPY contrib/localnet/preparams /root/preparams
4847
COPY contrib/localnet/ssh_config /root/.ssh/config
4948
COPY contrib/localnet/zetacored /root/zetacored
50-
COPY contrib/localnet/tss /root/tss
5149

5250
RUN chmod 755 /root/*.sh
5351

changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* [2306](https://github.com/zeta-chain/node/pull/2306) - refactor zetaclient outbound transaction signing logic
4848
* [2296](https://github.com/zeta-chain/node/pull/2296) - move `testdata` package to `testutil` to organize test-related utilities
4949
* [2344](https://github.com/zeta-chain/node/pull/2344) - group common data of EVM/Bitcoin signer and observer using base structs
50+
* [2317](https://github.com/zeta-chain/node/pull/2317) - add ValidateOutbound method for cctx orchestrator
5051

5152
### Tests
5253

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

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

7175
### CI
7276

cmd/zetaclientd/start.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func start(_ *cobra.Command, _ []string) error {
268268
}
269269

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

284284
// Creates a map of all chain observers for each chain. Each chain observer is responsible for observing events on the chain and processing them.
285-
observerMap, err := CreateChainObserverMap(appContext, zetacoreClient, tss, dbpath, telemetryServer, logger)
285+
observerMap, err := CreateChainObserverMap(appContext, zetacoreClient, tss, dbpath, logger, telemetryServer)
286286
if err != nil {
287287
startLogger.Err(err).Msg("CreateChainObserverMap")
288288
return err

cmd/zetaclientd/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func CreateZetacoreClient(
6262
func CreateSignerMap(
6363
appContext *context.AppContext,
6464
tss interfaces.TSSSigner,
65-
ts *metrics.TelemetryServer,
6665
logger base.Logger,
66+
ts *metrics.TelemetryServer,
6767
) (map[int64]interfaces.ChainSigner, error) {
6868
zetacoreContext := appContext.ZetacoreContext()
6969
signerMap := make(map[int64]interfaces.ChainSigner)
@@ -117,8 +117,8 @@ func CreateChainObserverMap(
117117
zetacoreClient *zetacore.Client,
118118
tss interfaces.TSSSigner,
119119
dbpath string,
120-
ts *metrics.TelemetryServer,
121120
logger base.Logger,
121+
ts *metrics.TelemetryServer,
122122
) (map[int64]interfaces.ChainObserver, error) {
123123
zetacoreContext := appContext.ZetacoreContext()
124124
observerMap := make(map[int64]interfaces.ChainObserver)

cmd/zetae2e/balances.go

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010

1111
"github.com/zeta-chain/zetacore/app"
1212
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
13-
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
1413
"github.com/zeta-chain/zetacore/e2e/config"
1514
"github.com/zeta-chain/zetacore/e2e/runner"
16-
"github.com/zeta-chain/zetacore/e2e/utils"
1715
)
1816

1917
const flagSkipBTC = "skip-btc"
@@ -71,8 +69,6 @@ func runBalances(cmd *cobra.Command, args []string) error {
7169
conf,
7270
ethcommon.HexToAddress(evmAddr),
7371
conf.Accounts.EVMPrivKey,
74-
utils.FungibleAdminName, // placeholder value, not used
75-
local.FungibleAdminMnemonic, // placeholder value, not used
7672
logger,
7773
)
7874
if err != nil {

cmd/zetae2e/bitcoin_address.go

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010

1111
"github.com/zeta-chain/zetacore/app"
1212
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
13-
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
1413
"github.com/zeta-chain/zetacore/e2e/config"
1514
"github.com/zeta-chain/zetacore/e2e/runner"
16-
"github.com/zeta-chain/zetacore/e2e/utils"
1715
)
1816

1917
const flagPrivKey = "privkey"
@@ -71,8 +69,6 @@ func runBitcoinAddress(cmd *cobra.Command, args []string) error {
7169
conf,
7270
ethcommon.HexToAddress(evmAddr),
7371
conf.Accounts.EVMPrivKey,
74-
utils.FungibleAdminName, // placeholder value, not used
75-
local.FungibleAdminMnemonic, // placeholder value, not used
7672
logger,
7773
)
7874
if err != nil {

cmd/zetae2e/config/config.go

+2-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88

99
"github.com/zeta-chain/zetacore/e2e/config"
1010
"github.com/zeta-chain/zetacore/e2e/runner"
11-
"github.com/zeta-chain/zetacore/e2e/txserver"
1211
)
1312

1413
// RunnerFromConfig create test runner from config
@@ -19,9 +18,8 @@ func RunnerFromConfig(
1918
conf config.Config,
2019
evmUserAddr ethcommon.Address,
2120
evmUserPrivKey string,
22-
zetaUserName string,
23-
zetaUserMnemonic string,
2421
logger *runner.Logger,
22+
opts ...runner.E2ERunnerOption,
2523
) (*runner.E2ERunner, error) {
2624
// initialize clients
2725
btcRPCClient,
@@ -39,16 +37,6 @@ func RunnerFromConfig(
3937
if err != nil {
4038
return nil, fmt.Errorf("failed to get clients from config: %w", err)
4139
}
42-
// initialize client to send messages to ZetaChain
43-
zetaTxServer, err := txserver.NewZetaTxServer(
44-
conf.RPCs.ZetaCoreRPC,
45-
[]string{zetaUserName},
46-
[]string{zetaUserMnemonic},
47-
conf.ZetaChainID,
48-
)
49-
if err != nil {
50-
return nil, fmt.Errorf("failed to initialize ZetaChain tx server: %w", err)
51-
}
5240

5341
// initialize E2E test runner
5442
newRunner := runner.NewE2ERunner(
@@ -57,11 +45,9 @@ func RunnerFromConfig(
5745
ctxCancel,
5846
evmUserAddr,
5947
evmUserPrivKey,
60-
zetaUserMnemonic,
6148
evmClient,
6249
zevmClient,
6350
cctxClient,
64-
zetaTxServer,
6551
fungibleClient,
6652
authClient,
6753
bankClient,
@@ -71,6 +57,7 @@ func RunnerFromConfig(
7157
zevmAuth,
7258
btcRPCClient,
7359
logger,
60+
opts...,
7461
)
7562

7663
// set contracts

cmd/zetae2e/local/accounts.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,7 @@ var (
3838
UserAdminAddress = ethcommon.HexToAddress("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
3939
UserAdminPrivateKey = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" // #nosec G101 - used for testing
4040

41-
FungibleAdminMnemonic = "snow grace federal cupboard arrive fancy gym lady uniform rotate exercise either leave alien grass" // #nosec G101 - used for testing
41+
// FungibleAdminAddress is the address of the account for testing the fungible admin functions
42+
UserFungibleAdminAddress = ethcommon.HexToAddress("0x8305C114Ea73cAc4A88f39A173803F94741b9055")
43+
UserFungibleAdminPrivateKey = "d88d09a7d6849c15a36eb6931f9dd616091a63e9849a2cc86f309ba11fb8fec5" // #nosec G101 - used for testing
4244
)

cmd/zetae2e/local/admin.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func adminTestRoutine(
3939
UserAdminAddress,
4040
UserAdminPrivateKey,
4141
runner.NewLogger(verbose, color.FgHiGreen, "admin"),
42+
runner.WithZetaTxServer(deployerRunner.ZetaTxServer),
4243
)
4344
if err != nil {
4445
return err

cmd/zetae2e/local/erc20.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func erc20TestRoutine(
4040
UserERC20Address,
4141
UserERC20PrivateKey,
4242
runner.NewLogger(verbose, color.FgGreen, "erc20"),
43+
runner.WithZetaTxServer(deployerRunner.ZetaTxServer),
4344
)
4445
if err != nil {
4546
return err

cmd/zetae2e/local/local.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package local
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"path/filepath"
78
"time"
@@ -14,6 +15,7 @@ import (
1415
"github.com/zeta-chain/zetacore/e2e/config"
1516
"github.com/zeta-chain/zetacore/e2e/e2etests"
1617
"github.com/zeta-chain/zetacore/e2e/runner"
18+
"github.com/zeta-chain/zetacore/e2e/txserver"
1719
"github.com/zeta-chain/zetacore/e2e/utils"
1820
"github.com/zeta-chain/zetacore/pkg/chains"
1921
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
@@ -166,6 +168,16 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
166168
time.Sleep(70 * time.Second)
167169
}
168170

171+
zetaTxServer, err := txserver.NewZetaTxServer(
172+
conf.RPCs.ZetaCoreRPC,
173+
[]string{utils.FungibleAdminName},
174+
[]string{UserFungibleAdminPrivateKey},
175+
conf.ZetaChainID,
176+
)
177+
if err != nil {
178+
panic(fmt.Errorf("failed to initialize ZetaChain tx server: %w", err))
179+
}
180+
169181
// initialize deployer runner with config
170182
deployerRunner, err := zetae2econfig.RunnerFromConfig(
171183
ctx,
@@ -174,9 +186,8 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
174186
conf,
175187
DeployerAddress,
176188
DeployerPrivateKey,
177-
utils.FungibleAdminName,
178-
FungibleAdminMnemonic,
179189
logger,
190+
runner.WithZetaTxServer(zetaTxServer),
180191
)
181192
if err != nil {
182193
panic(err)

cmd/zetae2e/local/test_runner.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
77
"github.com/zeta-chain/zetacore/e2e/config"
88
"github.com/zeta-chain/zetacore/e2e/runner"
9-
"github.com/zeta-chain/zetacore/e2e/utils"
109
)
1110

1211
// initTestRunner initializes a runner form tests
@@ -18,6 +17,7 @@ func initTestRunner(
1817
userAddress ethcommon.Address,
1918
userPrivKey string,
2019
logger *runner.Logger,
20+
opts ...runner.E2ERunnerOption,
2121
) (*runner.E2ERunner, error) {
2222
// initialize runner for test
2323
testRunner, err := zetae2econfig.RunnerFromConfig(
@@ -27,9 +27,8 @@ func initTestRunner(
2727
conf,
2828
userAddress,
2929
userPrivKey,
30-
utils.FungibleAdminName,
31-
FungibleAdminMnemonic,
3230
logger,
31+
opts...,
3332
)
3433
if err != nil {
3534
return nil, err

cmd/zetae2e/run.go

-4
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ import (
1212

1313
"github.com/zeta-chain/zetacore/app"
1414
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
15-
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
1615
"github.com/zeta-chain/zetacore/e2e/config"
1716
"github.com/zeta-chain/zetacore/e2e/e2etests"
1817
"github.com/zeta-chain/zetacore/e2e/runner"
19-
"github.com/zeta-chain/zetacore/e2e/utils"
2018
)
2119

2220
const flagVerbose = "verbose"
@@ -93,8 +91,6 @@ func runE2ETest(cmd *cobra.Command, args []string) error {
9391
conf,
9492
ethcommon.HexToAddress(evmAddr),
9593
conf.Accounts.EVMPrivKey,
96-
utils.FungibleAdminName, // placeholder value, not used
97-
local.FungibleAdminMnemonic, // placeholder value, not used
9894
logger,
9995
)
10096
if err != nil {

cmd/zetae2e/setup_bitcoin.go

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010

1111
"github.com/zeta-chain/zetacore/app"
1212
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
13-
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
1413
"github.com/zeta-chain/zetacore/e2e/config"
1514
"github.com/zeta-chain/zetacore/e2e/runner"
16-
"github.com/zeta-chain/zetacore/e2e/utils"
1715
)
1816

1917
// NewSetupBitcoinCmd sets up bitcoin wallet for e2e tests
@@ -58,8 +56,6 @@ func runSetupBitcoin(_ *cobra.Command, args []string) error {
5856
conf,
5957
ethcommon.HexToAddress(evmAddr),
6058
conf.Accounts.EVMPrivKey,
61-
utils.FungibleAdminName, // placeholder value, not used
62-
local.FungibleAdminMnemonic, // placeholder value, not used
6359
logger,
6460
)
6561
if err != nil {

cmd/zetae2e/show_tss.go

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import (
1010

1111
"github.com/zeta-chain/zetacore/app"
1212
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
13-
"github.com/zeta-chain/zetacore/cmd/zetae2e/local"
1413
"github.com/zeta-chain/zetacore/e2e/config"
1514
"github.com/zeta-chain/zetacore/e2e/runner"
16-
"github.com/zeta-chain/zetacore/e2e/utils"
1715
)
1816

1917
// NewShowTSSCmd returns the show TSS command
@@ -59,8 +57,6 @@ func runShowTSS(_ *cobra.Command, args []string) error {
5957
conf,
6058
ethcommon.HexToAddress(evmAddr),
6159
conf.Accounts.EVMPrivKey,
62-
utils.FungibleAdminName, // placeholder value, not used
63-
local.FungibleAdminMnemonic, // placeholder value, not used
6460
logger,
6561
)
6662
if err != nil {

cmd/zetae2e/stress.go

-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ func StressTest(cmd *cobra.Command, _ []string) {
149149
conf,
150150
local.DeployerAddress,
151151
local.DeployerPrivateKey,
152-
utils.FungibleAdminName,
153-
local.FungibleAdminMnemonic,
154152
logger,
155153
)
156154
if err != nil {

contrib/localnet/docker-compose-admin.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ services:
1313
context: ./anvil
1414
container_name: eth2
1515
hostname: eth2
16+
platform: linux/amd64
1617
ports:
1718
- "8546:8545"
1819
networks:
@@ -23,4 +24,4 @@ services:
2324
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
2425

2526
zetaclient1:
26-
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]
27+
entrypoint: [ "/root/start-zetaclientd.sh", "additional-evm" ]

contrib/localnet/preparams/PreParams_zetaclient0.json

-1
This file was deleted.

0 commit comments

Comments
 (0)