Skip to content

Commit

Permalink
rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed May 29, 2024
2 parents 3f09a65 + 42fe69c commit 100491f
Show file tree
Hide file tree
Showing 129 changed files with 3,813 additions and 1,767 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
build-test:
needs:
- check_branch
runs-on: buildjet-4vcpu-ubuntu-2004
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 15
concurrency:
group: "build-test"
Expand Down Expand Up @@ -411,7 +411,7 @@ jobs:
- e2e-admin-tests
- e2e-upgrade-test
- check_branch
runs-on: buildjet-4vcpu-ubuntu-2004
runs-on: ubuntu-20.04
timeout-minutes: 60
environment: release
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rc-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!"
publish-release:
runs-on: buildjet-4vcpu-ubuntu-2004
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 60
needs:
- pre-release-checks
Expand Down
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* [2152](https://github.com/zeta-chain/node/pull/2152) - custom priority nonce mempool
* [2113](https://github.com/zeta-chain/node/pull/2113) - add zetaclientd-supervisor process
* [2154](https://github.com/zeta-chain/node/pull/2154) - add `ibccrosschain` module
* [2258](https://github.com/zeta-chain/node/pull/2258) - add Optimism and Base in static chain information
* [2275](https://github.com/zeta-chain/node/pull/2275) - add ChainInfo singleton state variable in authority

### Refactor

Expand All @@ -29,6 +31,7 @@
* [2210](https://github.com/zeta-chain/node/pull/2210) - removed uncessary panics in the zetaclientd process
* [2205](https://github.com/zeta-chain/node/pull/2205) - remove deprecated variables pre-v17
* [2226](https://github.com/zeta-chain/node/pull/2226) - improve Go formatting with imports standardization and max line length to 120
* [2262](https://github.com/zeta-chain/node/pull/2262) - refactor MsgUpdateZRC20 into MsgPauseZrc20 and MsgUnPauseZRC20
* [2269](https://github.com/zeta-chain/node/pull/2269) - refactor MsgUpdateCrosschainFlags into MsgEnableCCTX, MsgDisableCCTX and MsgUpdateGasPriceIncreaseFlags


Expand All @@ -47,9 +50,10 @@
* [2222](https://github.com/zeta-chain/node/pull/2222) - removed `maxHeightDiff` to let observer scan from Bitcoin height where it left off
* [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

### CI

* [2268](https://github.com/zeta-chain/node/pull/2268) - CI: updated the publish-release pipeline to utilize the Github Actions Ubuntu 20.04 Runners.
* [2070](https://github.com/zeta-chain/node/pull/2070) - Added commands to build binaries from the working branch as a live full node rpc to test non-governance changes.
* [2119](https://github.com/zeta-chain/node/pull/2119) - Updated the release pipeline to only run on hotfix/ and release/ branches. Added option to only run pre-checks and not cut release as well. Switched approval steps to use environments.
* [2189](https://github.com/zeta-chain/node/pull/2189) - Updated the docker tag when a release trigger runs to be the github event for the release name which should be the version. Removed mac specific build as the arm build should handle that.
Expand Down
2 changes: 1 addition & 1 deletion cmd/zetaclientd/keygen_tss.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func GenerateTss(
// Bitcoin chain ID is currently used for using the correct signature format
// TODO: remove this once we have a better way to determine the signature format
// https://github.com/zeta-chain/node/issues/1397
bitcoinChainID := chains.BtcRegtestChain.ChainId
bitcoinChainID := chains.BitcoinRegtest.ChainId
btcChain, _, btcEnabled := appContext.GetBTCChainAndConfig()
if btcEnabled {
bitcoinChainID = btcChain.ChainId
Expand Down
3 changes: 2 additions & 1 deletion cmd/zetae2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func ExportContractsFromRunner(r *runner.E2ERunner, conf config.Config) config.C
conf.Contracts.EVM.ConnectorEthAddr = r.ConnectorEthAddr.Hex()
conf.Contracts.EVM.CustodyAddr = r.ERC20CustodyAddr.Hex()
conf.Contracts.EVM.ERC20 = r.ERC20Addr.Hex()
conf.Contracts.EVM.TestDappAddr = r.EvmTestDAppAddr.Hex()

conf.Contracts.ZEVM.SystemContractAddr = r.SystemContractAddr.Hex()
conf.Contracts.ZEVM.ETHZRC20Addr = r.ETHZRC20Addr.Hex()
Expand All @@ -107,7 +108,7 @@ func ExportContractsFromRunner(r *runner.E2ERunner, conf config.Config) config.C
conf.Contracts.ZEVM.WZetaAddr = r.WZetaAddr.Hex()
conf.Contracts.ZEVM.ZEVMSwapAppAddr = r.ZEVMSwapAppAddr.Hex()
conf.Contracts.ZEVM.ContextAppAddr = r.ContextAppAddr.Hex()
conf.Contracts.ZEVM.TestDappAddr = r.EvmTestDAppAddr.Hex()
conf.Contracts.ZEVM.TestDappAddr = r.ZevmTestDAppAddr.Hex()

return conf
}
8 changes: 7 additions & 1 deletion cmd/zetae2e/config/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,13 @@ func setContractsFromConfig(r *runner.E2ERunner, conf config.Config) error {
}
if c := conf.Contracts.ZEVM.TestDappAddr; c != "" {
if !ethcommon.IsHexAddress(c) {
return fmt.Errorf("invalid TestDappAddr: %s", c)
return fmt.Errorf("invalid ZevmTestDappAddr: %s", c)
}
r.ZevmTestDAppAddr = ethcommon.HexToAddress(c)
}
if c := conf.Contracts.EVM.TestDappAddr; c != "" {
if !ethcommon.IsHexAddress(c) {
return fmt.Errorf("invalid EvmTestDappAddr: %s", c)
}
r.EvmTestDAppAddr = ethcommon.HexToAddress(c)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ func localE2ETest(cmd *cobra.Command, _ []string) {

if !skipHeaderProof {
if err := deployerRunner.EnableHeaderVerification([]int64{
chains.GoerliLocalnetChain.ChainId,
chains.BtcRegtestChain.ChainId}); err != nil {
chains.GoerliLocalnet.ChainId,
chains.BitcoinRegtest.ChainId}); err != nil {
panic(err)
}
}
Expand Down
44 changes: 30 additions & 14 deletions contrib/localnet/orchestrator/start-zetae2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,29 @@ if [ "$OPTION" == "upgrade" ]; then
# Fetch the height of the upgrade, default is 225, if arg3 is passed, use that value
UPGRADE_HEIGHT=${3:-225}

# Run zetae2e, if the upgrade height is lower than 100, we use the setup-only flag
if [ "$UPGRADE_HEIGHT" -lt 100 ]; then
echo "running E2E command to setup the networks..."
if [[ ! -f deployed.yml ]]; then
zetae2e "$ZETAE2E_CMD" --setup-only --config-out deployed.yml --skip-header-proof
if [ $? -ne 0 ]; then
echo "e2e setup failed"
exit 1
fi
else
echo "skipping e2e setup because it has already been completed"
fi

# Run zetae2e, if the upgrade height is greater than 100 to populate the state
if [ "$UPGRADE_HEIGHT" -gt 100 ]; then
echo "running E2E command to setup the networks and populate the state..."

# Use light flag to ensure tests can complete before the upgrade height
zetae2e "$ZETAE2E_CMD" --config-out deployed.yml --light --skip-header-proof
fi
ZETAE2E_EXIT_CODE=$?

if [ $ZETAE2E_EXIT_CODE -ne 0 ]; then
echo "E2E setup failed"
exit 1
zetae2e "$ZETAE2E_CMD" --skip-setup --config deployed.yml --light --skip-header-proof
if [ $? -ne 0 ]; then
echo "first e2e failed"
exit 1
fi
fi

echo "E2E setup passed, waiting for upgrade height..."
echo "Waiting for upgrade height..."

OLD_VERSION=$(get_zetacored_version)

Expand Down Expand Up @@ -131,9 +136,9 @@ if [ "$OPTION" == "upgrade" ]; then
# When the upgrade height is greater than 100 for upgrade test, the Bitcoin tests have been run once, therefore the Bitcoin wallet is already set up
# Use light flag to skip advanced tests
if [ "$UPGRADE_HEIGHT" -lt 100 ]; then
zetae2e "$ZETAE2E_CMD" --skip-setup --config deployed.yml --light --skip-header-proof
zetae2e $ZETAE2E_CMD --skip-setup --config deployed.yml --light --skip-header-proof
else
zetae2e "$ZETAE2E_CMD" --skip-setup --config deployed.yml --skip-bitcoin-setup --light --skip-header-proof
zetae2e $ZETAE2E_CMD --skip-setup --config deployed.yml --skip-bitcoin-setup --light --skip-header-proof
fi

ZETAE2E_EXIT_CODE=$?
Expand All @@ -148,10 +153,21 @@ if [ "$OPTION" == "upgrade" ]; then
else

# Run the e2e tests normally
echo "running e2e setup..."

if [[ ! -f deployed.yml ]]; then
zetae2e $ZETAE2E_CMD --setup-only --config-out deployed.yml
if [ $? -ne 0 ]; then
echo "e2e setup failed"
exit 1
fi
else
echo "skipping e2e setup because it has already been completed"
fi

echo "running e2e tests..."

eval "zetae2e $ZETAE2E_CMD"
zetae2e $ZETAE2E_CMD --skip-setup --config deployed.yml
ZETAE2E_EXIT_CODE=$?

# if e2e passed, exit with 0, otherwise exit with 1
Expand Down
55 changes: 39 additions & 16 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56747,21 +56747,31 @@ definitions:
chainsChain:
type: object
properties:
chain_name:
$ref: '#/definitions/chainsChainName'
chain_id:
type: string
format: int64
title: ChainId is the unique identifier of the chain
chain_name:
$ref: '#/definitions/chainsChainName'
title: ChainName is the name of the chain
network:
$ref: '#/definitions/chainsNetwork'
title: Network is the network of the chain
network_type:
$ref: '#/definitions/chainsNetworkType'
description: 'NetworkType is the network type of the chain: mainnet, testnet, etc..'
vm:
$ref: '#/definitions/chainsVm'
title: Vm is the virtual machine used in the chain
consensus:
$ref: '#/definitions/chainsConsensus'
title: Consensus is the underlying consensus algorithm used by the chain
is_external:
type: boolean
title: IsExternal describe if the chain is ZetaChain or external
title: |-
Chain represents static data about a blockchain network
it is identified by a unique chain ID
chainsChainName:
type: string
enum:
Expand All @@ -56773,15 +56783,17 @@ definitions:
- bsc_mainnet
- goerli_testnet
- mumbai_testnet
- ganache_testnet
- baobab_testnet
- bsc_testnet
- zeta_testnet
- btc_testnet
- sepolia_testnet
- goerli_localnet
- btc_regtest
- amoy_testnet
- optimism_mainnet
- optimism_sepolia
- base_mainnet
- base_sepolia
default: empty
title: ChainName represents the name of the chain
chainsConsensus:
Expand All @@ -56790,8 +56802,12 @@ definitions:
- ethereum
- tendermint
- bitcoin
- op_stack
default: ethereum
title: Consensus represents the consensus algorithm used by the chain
title: |-
Consensus represents the consensus algorithm used by the chain
this can represent the consensus of a L1
this can also represent the solution of a L2
chainsNetwork:
type: string
enum:
Expand All @@ -56800,8 +56816,13 @@ definitions:
- btc
- polygon
- bsc
- optimism
- base
default: eth
title: Network represents the network type of the chain
title: |-
Network represents the network of the chain
there is a single instance of the network on mainnet
then the network can have eventual testnets or devnets
chainsNetworkType:
type: string
enum:
Expand All @@ -56810,15 +56831,21 @@ definitions:
- privnet
- devnet
default: mainnet
title: NetworkType represents the network type of the chain
title: |-
NetworkType represents the network type of the chain
Mainnet, Testnet, Privnet, Devnet
chainsReceiveStatus:
type: string
enum:
- created
- success
- failed
default: created
title: '- created: some observer sees inbound tx'
description: '- created: Created is used for inbounds'
title: |-
ReceiveStatus represents the status of an outbound
TODO: Rename and move
https://github.com/zeta-chain/node/issues/2257
chainsVm:
type: string
enum:
Expand Down Expand Up @@ -57395,16 +57422,18 @@ definitions:
type: string
systemContract:
type: string
fungibleMsgPauseZRC20Response:
type: object
fungibleMsgRemoveForeignCoinResponse:
type: object
fungibleMsgUnpauseZRC20Response:
type: object
fungibleMsgUpdateContractBytecodeResponse:
type: object
fungibleMsgUpdateSystemContractResponse:
type: object
fungibleMsgUpdateZRC20LiquidityCapResponse:
type: object
fungibleMsgUpdateZRC20PausedStatusResponse:
type: object
fungibleMsgUpdateZRC20WithdrawFeeResponse:
type: object
fungibleQueryAllForeignCoinsResponse:
Expand Down Expand Up @@ -57459,12 +57488,6 @@ definitions:
type: string
connector_zevm:
type: string
fungibleUpdatePausedStatusAction:
type: string
enum:
- PAUSE
- UNPAUSE
default: PAUSE
googlerpcStatus:
type: object
properties:
Expand Down
4 changes: 4 additions & 0 deletions docs/releases/v17_breaking_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@
* `/zeta-chain/crosschain/inTxHashToCctxData/{hash}` endpoint is now `/zeta-chain/crosschain/inboundHashToCctxData/{hash}`
* `InTxHashToCctxAll` has been renamed to `InboundHashToCctxAll`
* `/zeta-chain/crosschain/inTxHashToCctx` endpoint is now `/zeta-chain/crosschain/inboundHashToCctx`

* `MsgUpdateZRC20` has been removed, and replaced with `MsgPauseZRC20` and `MsgUnpauseZRC20` messages.
* `MsgPauseZRC20` message pauses a ZRC20 token and can be triggered via `PolicyType_groupEmergency`
* `MsgUnpauseZRC20` message unpauses a ZRC20 token and can be triggered via `PolicyType_groupOperational`
35 changes: 22 additions & 13 deletions docs/spec/fungible/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,32 +102,41 @@ message MsgUpdateZRC20WithdrawFee {
}
```

## MsgUpdateZRC20PausedStatus
## MsgUpdateZRC20LiquidityCap

UpdateZRC20PausedStatus updates the paused status of a ZRC20
The list of ZRC20s are either paused or unpaused
UpdateZRC20LiquidityCap updates the liquidity cap for a ZRC20 token.

Authorized: admin policy group 1 (pausing), group 2 (pausing & unpausing)
Authorized: admin policy group 2.

```proto
message MsgUpdateZRC20PausedStatus {
message MsgUpdateZRC20LiquidityCap {
string creator = 1;
string zrc20_addresses = 2;
UpdatePausedStatusAction action = 3;
string zrc20_address = 2;
string liquidity_cap = 3;
}
```

## MsgUpdateZRC20LiquidityCap
## MsgPauseZRC20

UpdateZRC20LiquidityCap updates the liquidity cap for a ZRC20 token.
PauseZRC20 pauses a list of ZRC20 tokens
Authorized: admin policy group groupEmergency.

Authorized: admin policy group 2.
```proto
message MsgPauseZRC20 {
string creator = 1;
string zrc20_addresses = 2;
}
```

## MsgUnpauseZRC20

UnpauseZRC20 unpauses the ZRC20 token
Authorized: admin policy group groupOperational.

```proto
message MsgUpdateZRC20LiquidityCap {
message MsgUnpauseZRC20 {
string creator = 1;
string zrc20_address = 2;
string liquidity_cap = 3;
string zrc20_addresses = 2;
}
```

1 change: 1 addition & 0 deletions e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type EVM struct {
ConnectorEthAddr string `yaml:"connector_eth"`
CustodyAddr string `yaml:"custody"`
ERC20 string `yaml:"erc20"`
TestDappAddr string `yaml:"test_dapp"`
}

// ZEVM contains the addresses of predeployed contracts on the zEVM chain
Expand Down
Loading

0 comments on commit 100491f

Please sign in to comment.