Skip to content

Commit

Permalink
Merge branch 'develop' into e2e-connector-update
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Apr 16, 2024
2 parents 9297e26 + 418c7e8 commit c011ba0
Show file tree
Hide file tree
Showing 28 changed files with 287 additions and 282 deletions.
2 changes: 1 addition & 1 deletion app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func IsSystemTx(tx sdk.Tx, isAuthorizedSigner func(string) bool) bool {
}
}
switch innerMsg.(type) {
case *cctxtypes.MsgGasPriceVoter,
case *cctxtypes.MsgVoteGasPrice,
*cctxtypes.MsgVoteOnObservedInboundTx,
*cctxtypes.MsgVoteOnObservedOutboundTx,
*cctxtypes.MsgAddToOutTxTracker,
Expand Down
2 changes: 1 addition & 1 deletion app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (mah *MockAnteHandler) AnteHandle(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.C

func TestIsSystemTx(t *testing.T) {
// system tx types:
// *cctxtypes.MsgGasPriceVoter,
// *cctxtypes.MsgVoteGasPrice,
// *cctxtypes.MsgVoteOnObservedInboundTx,
// *cctxtypes.MsgVoteOnObservedOutboundTx,
// *cctxtypes.MsgAddToOutTxTracker,
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
* `MsgCreateTSSVoter` message in the `crosschain` module has been moved to the `observer` module and renamed to `MsgVoteTSS`.
* The structure of the message remains the same.

* `MsgGasPriceVoter` message in the `crosschain` module has been renamed to `MsgVoteGasPrice`.
* The structure of the message remains the same.

### Refactor

* [1511](https://github.com/zeta-chain/node/pull/1511) - move ballot voting logic from `crosschain` to `observer`
Expand All @@ -26,6 +29,7 @@
* [1936](https://github.com/zeta-chain/node/pull/1936) - refactor common package into subpackages and rename to pkg
* [1966](https://github.com/zeta-chain/node/pull/1966) - move TSS vote message from crosschain to observer
* [1853](https://github.com/zeta-chain/node/pull/1853) - refactor vote inbound tx and vote outbound tx
* [2013](https://github.com/zeta-chain/node/pull/2013) - rename `GasPriceVoter` message to `VoteGasPrice`

### Features

Expand All @@ -36,6 +40,7 @@
* [1942](https://github.com/zeta-chain/node/pull/1982) - support Bitcoin P2TR, P2WSH, P2SH, P2PKH addresses
* [1935](https://github.com/zeta-chain/node/pull/1935) - add an operational authority group
* [1954](https://github.com/zeta-chain/node/pull/1954) - add metric for concurrent keysigns
* [2006](https://github.com/zeta-chain/node/pull/2006) - add Amoy testnet static chain information

### Tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
"grantee": "zeta1syavy2npfyt9tcncdtsdzf7kny9lh777heefxk",
"authorization": {
"@type": "/cosmos.authz.v1beta1.GenericAuthorization",
"msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter"
"msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice"
},
"expiration": null
},
Expand Down Expand Up @@ -738,7 +738,7 @@
"grantee": "zeta1l7hypmqk2yc334vc6vmdwzp5sdefygj2w5yj50",
"authorization": {
"@type": "/cosmos.authz.v1beta1.GenericAuthorization",
"msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter"
"msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice"
},
"expiration": null
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
"grantee": "zeta1syavy2npfyt9tcncdtsdzf7kny9lh777heefxk",
"authorization": {
"@type": "/cosmos.authz.v1beta1.GenericAuthorization",
"msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter"
"msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice"
},
"expiration": null
},
Expand Down Expand Up @@ -738,7 +738,7 @@
"grantee": "zeta1l7hypmqk2yc334vc6vmdwzp5sdefygj2w5yj50",
"authorization": {
"@type": "/cosmos.authz.v1beta1.GenericAuthorization",
"msg": "/zetachain.zetacore.crosschain.MsgGasPriceVoter"
"msg": "/zetachain.zetacore.crosschain.MsgVoteGasPrice"
},
"expiration": null
},
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/zetacored/zetacored_tx_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ zetacored tx crosschain [flags]
* [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
* [zetacored tx crosschain gas-price-voter](zetacored_tx_crosschain_gas-price-voter.md) - Broadcast message gasPriceVoter
* [zetacored tx crosschain inbound-voter](zetacored_tx_crosschain_inbound-voter.md) - Broadcast message sendVoter
* [zetacored tx crosschain migrate-tss-funds](zetacored_tx_crosschain_migrate-tss-funds.md) - Migrate TSS funds to the latest TSS address
* [zetacored tx crosschain outbound-voter](zetacored_tx_crosschain_outbound-voter.md) - Broadcast message receiveConfirmation
* [zetacored tx crosschain refund-aborted](zetacored_tx_crosschain_refund-aborted.md) - Refund an aborted tx , the refund address is optional, if not provided, the refund will be sent to the sender/tx origin of the cctx.
* [zetacored tx crosschain remove-from-out-tx-tracker](zetacored_tx_crosschain_remove-from-out-tx-tracker.md) - Remove a out-tx-tracker
* [zetacored tx crosschain update-tss-address](zetacored_tx_crosschain_update-tss-address.md) - Create a new TSSVoter
* [zetacored tx crosschain vote-gas-price](zetacored_tx_crosschain_vote-gas-price.md) - Broadcast message to vote gas price
* [zetacored tx crosschain whitelist-erc20](zetacored_tx_crosschain_whitelist-erc20.md) - Add a new erc20 token to whitelist

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# tx crosschain gas-price-voter
# tx crosschain vote-gas-price

Broadcast message gasPriceVoter
Broadcast message to vote gas price

```
zetacored tx crosschain gas-price-voter [chain] [price] [supply] [blockNumber] [flags]
zetacored tx crosschain vote-gas-price [chain] [price] [supply] [blockNumber] [flags]
```

### Options
Expand All @@ -21,7 +21,7 @@ zetacored tx crosschain gas-price-voter [chain] [price] [supply] [blockNumber] [
--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 gas-price-voter
-h, --help help for vote-gas-price
--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
Expand Down
11 changes: 3 additions & 8 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53519,13 +53519,8 @@ definitions:
- sepolia_testnet
- goerli_localnet
- btc_regtest
- amoy_testnet
default: empty
title: |-
- goerli_testnet: Testnet
- goerli_localnet: LocalNet
zeta_localnet = 13;
- btc_regtest: Athens
zeta_athensnet=15;
chainsReceiveStatus:
type: string
enum:
Expand Down Expand Up @@ -53686,8 +53681,6 @@ definitions:
is_removed:
type: boolean
title: if the tx was removed from the tracker due to no pending cctx
crosschainMsgGasPriceVoterResponse:
type: object
crosschainMsgMigrateTssFundsResponse:
type: object
crosschainMsgRefundAbortedCCTXResponse:
Expand All @@ -53696,6 +53689,8 @@ definitions:
type: object
crosschainMsgUpdateTssAddressResponse:
type: object
crosschainMsgVoteGasPriceResponse:
type: object
crosschainMsgVoteOnObservedInboundTxResponse:
type: object
crosschainMsgVoteOnObservedOutboundTxResponse:
Expand Down
6 changes: 3 additions & 3 deletions docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ message MsgRemoveFromOutTxTracker {
}
```

## MsgGasPriceVoter
## MsgVoteGasPrice

GasPriceVoter submits information about the connected chain's gas price at a specific block
VoteGasPrice submits information about the connected chain's gas price at a specific block
height. Gas price submitted by each validator is recorded separately and a
median index is updated.

Only observer validators are authorized to broadcast this message.

```proto
message MsgGasPriceVoter {
message MsgVoteGasPrice {
string creator = 1;
int64 chain_id = 2;
uint64 price = 3;
Expand Down
1 change: 1 addition & 0 deletions pkg/chains/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func IsZetaChain(chainID int64) bool {
// https://github.com/zeta-chain/node-private/issues/63
func IsEVMChain(chainID int64) bool {
return chainID == 5 || // Goerli
chainID == AmoyChain().ChainId ||
chainID == SepoliaChain().ChainId || // Sepolia
chainID == 80001 || // Polygon mumbai
chainID == 97 || // BSC testnet
Expand Down
10 changes: 10 additions & 0 deletions pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ func MumbaiChain() Chain {
}
}

func AmoyChain() Chain {
return Chain{
ChainName: ChainName_amoy_testnet,
ChainId: 80002,
}
}

// Privnet chains

func BtcRegtestChain() Chain {
Expand Down Expand Up @@ -127,6 +134,7 @@ func DefaultChainsList() []*Chain {
EthChain(),
BtcTestNetChain(),
MumbaiChain(),
AmoyChain(),
BscTestnetChain(),
GoerliChain(),
SepoliaChain(),
Expand Down Expand Up @@ -155,6 +163,7 @@ func TestnetChainList() []*Chain {
ZetaTestnetChain(),
BtcTestNetChain(),
MumbaiChain(),
AmoyChain(),
BscTestnetChain(),
GoerliChain(),
SepoliaChain(),
Expand All @@ -178,6 +187,7 @@ func ExternalChainList() []*Chain {
EthChain(),
BtcTestNetChain(),
MumbaiChain(),
AmoyChain(),
BscTestnetChain(),
GoerliChain(),
SepoliaChain(),
Expand Down
58 changes: 29 additions & 29 deletions pkg/chains/chains.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions pkg/chains/chains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func TestChainRetrievalFunctions(t *testing.T) {
{"BscTestnetChain", BscTestnetChain, Chain{ChainName: ChainName_bsc_testnet, ChainId: 97}},
{"BtcTestNetChain", BtcTestNetChain, Chain{ChainName: ChainName_btc_testnet, ChainId: 18332}},
{"MumbaiChain", MumbaiChain, Chain{ChainName: ChainName_mumbai_testnet, ChainId: 80001}},
{"AmoyChain", AmoyChain, Chain{ChainName: ChainName_amoy_testnet, ChainId: 80002}},
{"BtcRegtestChain", BtcRegtestChain, Chain{ChainName: ChainName_btc_regtest, ChainId: 18444}},
{"GoerliLocalnetChain", GoerliLocalnetChain, Chain{ChainName: ChainName_goerli_localnet, ChainId: 1337}},
}
Expand All @@ -43,11 +44,11 @@ func TestChainListFunctions(t *testing.T) {
function func() []*Chain
expected []Chain
}{
{"DefaultChainsList", DefaultChainsList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain(), ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}},
{"DefaultChainsList", DefaultChainsList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain(), ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}},
{"MainnetChainList", MainnetChainList, []Chain{ZetaChainMainnet(), BtcMainnetChain(), BscMainnetChain(), EthChain()}},
{"TestnetChainList", TestnetChainList, []Chain{ZetaTestnetChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain()}},
{"TestnetChainList", TestnetChainList, []Chain{ZetaTestnetChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain()}},
{"PrivnetChainList", PrivnetChainList, []Chain{ZetaPrivnetChain(), BtcRegtestChain(), GoerliLocalnetChain()}},
{"ExternalChainList", ExternalChainList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain()}},
{"ExternalChainList", ExternalChainList, []Chain{BtcMainnetChain(), BscMainnetChain(), EthChain(), BtcTestNetChain(), MumbaiChain(), AmoyChain(), BscTestnetChain(), GoerliChain(), SepoliaChain(), BtcRegtestChain(), GoerliLocalnetChain()}},
{"ZetaChainList", ZetaChainList, []Chain{ZetaChainMainnet(), ZetaTestnetChain(), ZetaMocknetChain(), ZetaPrivnetChain()}},
}

Expand Down
6 changes: 3 additions & 3 deletions proto/crosschain/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ service Msg {
rpc AddToInTxTracker(MsgAddToInTxTracker) returns (MsgAddToInTxTrackerResponse);
rpc RemoveFromOutTxTracker(MsgRemoveFromOutTxTracker) returns (MsgRemoveFromOutTxTrackerResponse);

rpc GasPriceVoter(MsgGasPriceVoter) returns (MsgGasPriceVoterResponse);
rpc VoteGasPrice(MsgVoteGasPrice) returns (MsgVoteGasPriceResponse);
rpc VoteOnObservedOutboundTx(MsgVoteOnObservedOutboundTx) returns (MsgVoteOnObservedOutboundTxResponse);
rpc VoteOnObservedInboundTx(MsgVoteOnObservedInboundTx) returns (MsgVoteOnObservedInboundTxResponse);
rpc WhitelistERC20(MsgWhitelistERC20) returns (MsgWhitelistERC20Response);
Expand Down Expand Up @@ -91,15 +91,15 @@ message MsgRemoveFromOutTxTracker {

message MsgRemoveFromOutTxTrackerResponse {}

message MsgGasPriceVoter {
message MsgVoteGasPrice {
string creator = 1;
int64 chain_id = 2;
uint64 price = 3;
uint64 block_number = 4;
string supply = 5;
}

message MsgGasPriceVoterResponse {}
message MsgVoteGasPriceResponse {}

message MsgVoteOnObservedOutboundTx {
string creator = 1;
Expand Down
6 changes: 1 addition & 5 deletions proto/pkg/chains/chains.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ enum ChainName {
btc_mainnet = 3;
polygon_mainnet = 4;
bsc_mainnet = 5;
// Testnet
goerli_testnet = 6;
mumbai_testnet = 7;
ganache_testnet = 8;
Expand All @@ -30,12 +29,9 @@ enum ChainName {
zeta_testnet = 11;
btc_testnet = 12;
sepolia_testnet = 13;
// LocalNet
// zeta_localnet = 13;
goerli_localnet = 14;
btc_regtest = 15;
// Athens
// zeta_athensnet=15;
amoy_testnet = 16;
}

message Chain {
Expand Down
Loading

0 comments on commit c011ba0

Please sign in to comment.