Skip to content

Commit

Permalink
conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis committed Jan 29, 2024
2 parents 2d3d818 + 64ed9b1 commit ae6a54d
Show file tree
Hide file tree
Showing 50 changed files with 1,944 additions and 564 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-versioned-source
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WORKDIR /go/delivery/zeta-node
RUN mkdir -p $GOPATH/bin/old
RUN mkdir -p $GOPATH/bin/new

ENV NEW_VERSION=v12.0.0
ENV NEW_VERSION=v12.1.0

# Build new release from the current source
COPY go.mod /go/delivery/zeta-node/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ stateful-upgrade:

stateful-upgrade-source:
@echo "--> Starting stateful smoketest"
$(DOCKER) build --build-arg old_version=v11.0.0-patch-core-params -t zetanode -f ./Dockerfile-versioned-source .
$(DOCKER) build --build-arg old_version=v12.0.0 -t zetanode -f ./Dockerfile-versioned-source .
$(DOCKER) build -t orchestrator -f contrib/localnet/orchestrator/Dockerfile-upgrade.fastbuild .
cd contrib/localnet/ && $(DOCKER) compose -f docker-compose-stateful.yml up -d

Expand Down
18 changes: 13 additions & 5 deletions app/setup_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/upgrade/types"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
observertypes "github.com/zeta-chain/zetacore/x/observer/types"
observerTypes "github.com/zeta-chain/zetacore/x/observer/types"
)

const releaseVersion = "v12.0.0"
const releaseVersion = "v12.1.0"

func SetupHandlers(app *App) {
app.UpgradeKeeper.SetUpgradeHandler(releaseVersion, func(ctx sdk.Context, plan types.Plan, vm module.VersionMap) (module.VersionMap, error) {
Expand All @@ -18,8 +17,8 @@ func SetupHandlers(app *App) {
for m, mb := range app.mm.Modules {
vm[m] = mb.ConsensusVersion()
}
vm[crosschaintypes.ModuleName] = 3
vm[observertypes.ModuleName] = 4
vm = VersionMigrator{vm}.TriggerMigration(observerTypes.ModuleName)

return app.mm.RunMigrations(ctx, app.configurator, vm)
})

Expand All @@ -38,3 +37,12 @@ func SetupHandlers(app *App) {
app.SetStoreLoader(types.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
}

type VersionMigrator struct {
v module.VersionMap
}

func (v VersionMigrator) TriggerMigration(moduleName string) module.VersionMap {
v.v[moduleName] = v.v[moduleName] - 1
return v.v
}
33 changes: 24 additions & 9 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@

## Unreleased

### Fixes
* [1610](https://github.com/zeta-chain/node/issues/1610) - add pending outtx hash to tracker after monitoring for 10 minutes

### Tests

* [1584](https://github.com/zeta-chain/node/pull/1584) - allow to run E2E tests on any networks

## Version: v12.1.0

### Tests

* [1577](https://github.com/zeta-chain/node/pull/1577) - add chain header tests in E2E tests and fix admin tests

### Features

### Fixes

* [1535](https://github.com/zeta-chain/node/issues/1535) - Avoid voting on wrong ballots due to false blockNumber in EVM tx receipt
* [1588](https://github.com/zeta-chain/node/pull/1588) - fix chain params comparison logic
* [1650](https://github.com/zeta-chain/node/pull/1605) - exempt (discounted) *system txs* from min gas price check and gas fee deduction
* [1632](https://github.com/zeta-chain/node/pull/1632) - set keygen to `KeygenStatus_KeyGenSuccess` if its in `KeygenStatus_PendingKeygen`.
* [1576](https://github.com/zeta-chain/node/pull/1576) - Fix zetaclient crash due to out of bound integer conversion and log prints.
* [1575](https://github.com/zeta-chain/node/issues/1575) - Skip unsupported chain parameters by IsSupported flag

### CI

Expand All @@ -22,6 +32,19 @@
### Chores

* [1585](https://github.com/zeta-chain/node/pull/1585) - Updated release instructions
* [1615](https://github.com/zeta-chain/node/pull/1615) - Add upgrade handler for version v12.1.0

### Features

* [1591](https://github.com/zeta-chain/node/pull/1591) - support lower gas limit for voting on inbound and outbound transactions
* [1592](https://github.com/zeta-chain/node/issues/1592) - check inbound tracker tx hash against Tss address and some refactor on inTx observation

### Refactoring

* [1628](https://github.com/zeta-chain/node/pull/1628) optimize return and simplify code

### Refactoring
* [1619](https://github.com/zeta-chain/node/pull/1619) - Add evm fee calculation to tss migration of evm chains

## Version: v12.0.0

Expand All @@ -45,8 +68,6 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c
* `GetTssAddress` : Changed from `/zeta-chain/observer/get_tss_address/` to `/zeta-chain/observer/getTssAddress/{bitcoin_chain_id}` . Optional bitcoin chain id can now be passed as a parameter to fetch the correct tss for required BTC chain. This parameter only affects the BTC tss address in the response.

### Features

* [1549](https://github.com/zeta-chain/node/pull/1549) - add monitoring for vote tx results in ZetaClient
* [1498](https://github.com/zeta-chain/node/pull/1498) - Add monitoring(grafana, prometheus, ethbalance) for localnet testing
* [1395](https://github.com/zeta-chain/node/pull/1395) - Add state variable to track aborted zeta amount
* [1410](https://github.com/zeta-chain/node/pull/1410) - `snapshots` commands
Expand All @@ -56,8 +77,6 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c

### Fixes

* [1576](https://github.com/zeta-chain/node/pull/1576) - Fix zetaclient crash due to out of bound integer conversion and log prints.
* [1575](https://github.com/zeta-chain/node/issues/1575) - Skip unsupported chain parameters by IsSupported flag
* [1554](https://github.com/zeta-chain/node/pull/1554) - Screen out unconfirmed UTXOs that are not created by TSS itself
* [1560](https://github.com/zeta-chain/node/issues/1560) - Zetaclient post evm-chain outtx hashes only when receipt is available
* [1516](https://github.com/zeta-chain/node/issues/1516) - Unprivileged outtx tracker removal
Expand All @@ -76,7 +95,6 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c
* [1525](https://github.com/zeta-chain/node/pull/1525) - relax EVM chain block header length check 1024->4096
* [1522](https://github.com/zeta-chain/node/pull/1522/files) - block `distribution` module account from receiving zeta
* [1528](https://github.com/zeta-chain/node/pull/1528) - fix panic caused on decoding malformed BTC addresses
* [1557](https://github.com/zeta-chain/node/pull/1557) - remove decreaseAllowance and increaseAllowance checks
* [1536](https://github.com/zeta-chain/node/pull/1536) - add index to check previously finalized inbounds
* [1556](https://github.com/zeta-chain/node/pull/1556) - add emptiness check for topic array in event parsing
* [1546](https://github.com/zeta-chain/node/pull/1546) - fix reset of pending nonces on genesis import
Expand Down Expand Up @@ -105,7 +123,6 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c
* Update --ledger flag hint

### Chores

* [1446](https://github.com/zeta-chain/node/pull/1446) - renamed file `zetaclientd/aux.go` to `zetaclientd/utils.go` to avoid complaints from go package resolver.
* [1499](https://github.com/zeta-chain/node/pull/1499) - Add scripts to localnet to help test gov proposals
* [1442](https://github.com/zeta-chain/node/pull/1442) - remove build types in `.goreleaser.yaml`
Expand All @@ -117,9 +134,7 @@ Getting the correct TSS address for Bitcoin now requires proviidng the Bitcoin c
* [1538](https://github.com/zeta-chain/node/pull/1538) - improve stateful e2e testing

### CI

* Removed private runners and unused GitHub Action
* Adding typescript publishing pipeline.

## Version: v11.0.0

Expand Down
1 change: 0 additions & 1 deletion cmd/zetae2e/local/erc20.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func erc20TestRoutine(
// run erc20 test
if err := erc20Runner.RunSmokeTestsFromNames(
smoketests.AllSmokeTests,
smoketests.TestMultipleERC20DepositName,
smoketests.TestERC20WithdrawName,
smoketests.TestMultipleWithdrawsName,
smoketests.TestERC20DepositAndCallRefundName,
Expand Down
5 changes: 1 addition & 4 deletions common/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ type Chains []Chain

// IsEqual compare two chain to see whether they represent the same chain
func (chain Chain) IsEqual(c Chain) bool {
if chain.ChainId == c.ChainId {
return true
}
return false
return chain.ChainId == c.ChainId
}

func (chain Chain) IsZetaChain() bool {
Expand Down
26 changes: 26 additions & 0 deletions common/gas_limits.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package common

import (
sdkmath "cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"
)

const (
// EVMSend is the gas limit required to transfer tokens on an EVM based chain
EVMSend = 21000
// TODO: Move gas limits from zeta-client to this file
// https://github.com/zeta-chain/node/issues/1606
)

// MultiplyGasPrice multiplies the median gas price by the given multiplier and returns the truncated value
func MultiplyGasPrice(medianGasPrice sdkmath.Uint, multiplierString string) (sdkmath.Uint, error) {
multiplier, err := sdk.NewDecFromStr(multiplierString)
if err != nil {
return sdkmath.ZeroUint(), err
}
gasPrice, err := sdk.NewDecFromStr(medianGasPrice.String())
if err != nil {
return sdkmath.ZeroUint(), err
}
return sdkmath.NewUintFromString(gasPrice.Mul(multiplier).TruncateInt().String()), nil
}
2 changes: 1 addition & 1 deletion contrib/localnet/scripts/start-zetaclientd-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ else
SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p)
done
rm ~/.tss/*
zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 0 --keyring-backend "$BACKEND"
zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 1 --keyring-backend "$BACKEND"
zetaclientd start
fi
2 changes: 1 addition & 1 deletion contrib/localnet/scripts/start-zetaclientd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ else
zetaclientd init \
--peer /ip4/172.20.0.21/tcp/6668/p2p/$SEED \
--pre-params ~/preParams.json --zetacore-url $node \
--chain-id athens_101-1 --operator zeta1lz2fqwzjnk6qy48fgj753h48444fxtt7hekp52 --log-level 0 --hotkey=val_grantee_observer
--chain-id athens_101-1 --operator zeta1lz2fqwzjnk6qy48fgj753h48444fxtt7hekp52 --log-level 1 --hotkey=val_grantee_observer
zetaclientd start
fi
1 change: 1 addition & 0 deletions docs/cli/zetacored/zetacored_tx_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ zetacored tx crosschain [flags]
### SEE ALSO

* [zetacored tx](zetacored_tx.md) - Transactions subcommands
* [zetacored tx crosschain abort-stuck-cctx](zetacored_tx_crosschain_abort-stuck-cctx.md) - abort a stuck CCTX
* [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
Expand Down
52 changes: 52 additions & 0 deletions docs/cli/zetacored/zetacored_tx_crosschain_abort-stuck-cctx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# tx crosschain abort-stuck-cctx

abort a stuck CCTX

```
zetacored tx crosschain abort-stuck-cctx [index] [flags]
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async|block)
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
--fees string Fees to pay along with transaction; eg: 10uatom
--from string Name or address of private key with which to sign
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
--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 abort-stuck-cctx
--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
--node string [host]:[port] to tendermint rpc interface for this chain
--note string Note to add a description to the transaction (previously --memo)
--offline Offline mode (does not allow any online functionality)
-o, --output string Output format (text|json)
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
-y, --yes Skip tx broadcasting prompt confirmation
```

### Options inherited from parent commands

```
--chain-id string The network chain ID
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

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

2 changes: 2 additions & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50830,6 +50830,8 @@ definitions:
lastReceiveHeight:
type: string
format: uint64
crosschainMsgAbortStuckCCTXResponse:
type: object
crosschainMsgAddToInTxTrackerResponse:
type: object
crosschainMsgAddToOutTxTrackerResponse:
Expand Down
12 changes: 12 additions & 0 deletions docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,15 @@ message MsgCreateTSSVoter {
}
```

## MsgAbortStuckCCTX

AbortStuckCCTX aborts a stuck CCTX
Authorized: admin policy group 2

```proto
message MsgAbortStuckCCTX {
string creator = 1;
string cctx_index = 2;
}
```

9 changes: 9 additions & 0 deletions proto/crosschain/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ service Msg {
rpc UpdateTssAddress(MsgUpdateTssAddress) returns (MsgUpdateTssAddressResponse);
rpc MigrateTssFunds(MsgMigrateTssFunds) returns (MsgMigrateTssFundsResponse);
rpc CreateTSSVoter(MsgCreateTSSVoter) returns (MsgCreateTSSVoterResponse);

rpc AbortStuckCCTX(MsgAbortStuckCCTX) returns (MsgAbortStuckCCTXResponse);
}

message MsgCreateTSSVoter {
Expand Down Expand Up @@ -153,3 +155,10 @@ message MsgVoteOnObservedInboundTx {
}

message MsgVoteOnObservedInboundTxResponse {}

message MsgAbortStuckCCTX {
string creator = 1;
string cctx_index = 2;
}

message MsgAbortStuckCCTXResponse {}
6 changes: 1 addition & 5 deletions rpc/namespaces/ethereum/debug/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ import (
func isCPUProfileConfigurationActivated(ctx *server.Context) bool {
// TODO: use same constants as server/start.go
// constant declared in start.go cannot be imported (cyclical dependency)
const flagCPUProfile = "cpu-profile"
if cpuProfile := ctx.Viper.GetString(flagCPUProfile); cpuProfile != "" {
return true
}
return false
return ctx.Viper.GetString("cpu-profile") != ""
}

// ExpandHome expands home directory in file paths.
Expand Down
48 changes: 48 additions & 0 deletions typescript/crosschain/tx_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,51 @@ export declare class MsgVoteOnObservedInboundTxResponse extends Message<MsgVoteO
static equals(a: MsgVoteOnObservedInboundTxResponse | PlainMessage<MsgVoteOnObservedInboundTxResponse> | undefined, b: MsgVoteOnObservedInboundTxResponse | PlainMessage<MsgVoteOnObservedInboundTxResponse> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.crosschain.MsgAbortStuckCCTX
*/
export declare class MsgAbortStuckCCTX extends Message<MsgAbortStuckCCTX> {
/**
* @generated from field: string creator = 1;
*/
creator: string;

/**
* @generated from field: string cctx_index = 2;
*/
cctxIndex: string;

constructor(data?: PartialMessage<MsgAbortStuckCCTX>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.crosschain.MsgAbortStuckCCTX";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MsgAbortStuckCCTX;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MsgAbortStuckCCTX;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MsgAbortStuckCCTX;

static equals(a: MsgAbortStuckCCTX | PlainMessage<MsgAbortStuckCCTX> | undefined, b: MsgAbortStuckCCTX | PlainMessage<MsgAbortStuckCCTX> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.crosschain.MsgAbortStuckCCTXResponse
*/
export declare class MsgAbortStuckCCTXResponse extends Message<MsgAbortStuckCCTXResponse> {
constructor(data?: PartialMessage<MsgAbortStuckCCTXResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.crosschain.MsgAbortStuckCCTXResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MsgAbortStuckCCTXResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MsgAbortStuckCCTXResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MsgAbortStuckCCTXResponse;

static equals(a: MsgAbortStuckCCTXResponse | PlainMessage<MsgAbortStuckCCTXResponse> | undefined, b: MsgAbortStuckCCTXResponse | PlainMessage<MsgAbortStuckCCTXResponse> | undefined): boolean;
}

Loading

0 comments on commit ae6a54d

Please sign in to comment.