Skip to content

Commit

Permalink
Merge branch 'develop' into simplified-evm-IsSendOutTxProcessed
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Apr 16, 2024
2 parents 6c1685b + 58a1b23 commit f9cb534
Show file tree
Hide file tree
Showing 32 changed files with 1,521 additions and 239 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 @@ -27,6 +30,7 @@
* [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
* [1989](https://github.com/zeta-chain/node/pull/1989) - simplify `IsSendOutTxProcessed` method and add unit tests
* [2013](https://github.com/zeta-chain/node/pull/2013) - rename `GasPriceVoter` message to `VoteGasPrice`

### Features

Expand Down Expand Up @@ -61,6 +65,7 @@
* [1941](https://github.com/zeta-chain/node/pull/1941) - add unit tests for zetabridge package
* [1985](https://github.com/zeta-chain/node/pull/1985) - improve fungible module coverage
* [1992](https://github.com/zeta-chain/node/pull/1992) - remove setupKeeper from crosschain module
* [2008](https://github.com/zeta-chain/node/pull/2008) - add test for connector bytecode update

### Fixes

Expand Down
3 changes: 2 additions & 1 deletion cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
if testAdmin {
eg.Go(adminTestRoutine(conf, deployerRunner, verbose,
e2etests.TestPauseZRC20Name,
e2etests.TestUpdateBytecodeName,
e2etests.TestUpdateBytecodeZRC20Name,
e2etests.TestUpdateBytecodeConnectorName,
e2etests.TestDepositEtherLiquidityCapName,

// TestMigrateChainSupportName tests EVM chain migration. Currently this test doesn't work with Anvil because pre-EIP1559 txs are not supported
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
4 changes: 2 additions & 2 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53681,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 @@ -53691,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
202 changes: 202 additions & 0 deletions e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "wzeta_",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "FailedZetaSent",
"type": "error"
},
{
"inputs": [],
"name": "OnlyFungibleModule",
"type": "error"
},
{
"inputs": [],
"name": "OnlyWZETA",
"type": "error"
},
{
"inputs": [],
"name": "WZETATransferFailed",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "wzeta_",
"type": "address"
}
],
"name": "SetWZETA",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "sourceTxOriginAddress",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "zetaTxSenderAddress",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "destinationChainId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes",
"name": "destinationAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint256",
"name": "zetaValueAndGas",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "destinationGasLimit",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bytes",
"name": "message",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "zetaParams",
"type": "bytes"
}
],
"name": "ZetaSent",
"type": "event"
},
{
"inputs": [],
"name": "FUNGIBLE_MODULE_ADDRESS",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "foo",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "uint256",
"name": "destinationChainId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "destinationAddress",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "destinationGasLimit",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "message",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "zetaValueAndGas",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "zetaParams",
"type": "bytes"
}
],
"internalType": "struct ZetaInterfaces.SendInput",
"name": "input",
"type": "tuple"
}
],
"name": "send",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "wzeta_",
"type": "address"
}
],
"name": "setWzetaAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "wzeta",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
]
1 change: 1 addition & 0 deletions e2e/contracts/testconnectorzevm/TestZetaConnectorZEVM.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b50604051610b56380380610b56833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a3f806101176000396000f3fe60806040526004361061004d5760003560e01c8062173d46146100de5780633ce4a5bc14610109578063c298557814610134578063eb3bacbd1461015f578063ec02690114610188576100d9565b366100d95760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100d7576040517f6e6b6de700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b3480156100ea57600080fd5b506100f36101b1565b604051610100919061061b565b60405180910390f35b34801561011557600080fd5b5061011e6101d5565b60405161012b919061061b565b60405180910390f35b34801561014057600080fd5b506101496101ed565b60405161015691906106c6565b60405180910390f35b34801561016b57600080fd5b506101866004803603810190610181919061071e565b61022a565b005b34801561019457600080fd5b506101af60048036038101906101aa919061076f565b61031d565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b73735b14bb79463307aacbed86daf3322b1e6226ab81565b60606040518060400160405280600381526020017f666f6f0000000000000000000000000000000000000000000000000000000000815250905090565b73735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102a3576040517fea02b3f300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7325870b05f8f3412c318a35fc6a74feca51ea15811ec7a257676ca4db9d417681604051610312919061061b565b60405180910390a150565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333084608001356040518463ffffffff1660e01b815260040161037e939291906107d1565b6020604051808303816000875af115801561039d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c19190610840565b6103f7576040517fa8c6fd4a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d82608001356040518263ffffffff1660e01b8152600401610454919061086d565b600060405180830381600087803b15801561046e57600080fd5b505af1158015610482573d6000803e3d6000fd5b50505050600073735b14bb79463307aacbed86daf3322b1e6226ab73ffffffffffffffffffffffffffffffffffffffff1682608001356040516104c4906108b9565b60006040518083038185875af1925050503d8060008114610501576040519150601f19603f3d011682016040523d82523d6000602084013e610506565b606091505b5050905080610541576040517fc7ffc47b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81600001353373ffffffffffffffffffffffffffffffffffffffff167f7ec1c94701e09b1652f3e1d307e60c4b9ebf99aff8c2079fd1d8c585e031c4e43285806020019061058f91906108dd565b876080013588604001358980606001906105a991906108dd565b8b8060a001906105b991906108dd565b6040516105ce9998979695949392919061098d565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610605826105da565b9050919050565b610615816105fa565b82525050565b6000602082019050610630600083018461060c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610670578082015181840152602081019050610655565b60008484015250505050565b6000601f19601f8301169050919050565b600061069882610636565b6106a28185610641565b93506106b2818560208601610652565b6106bb8161067c565b840191505092915050565b600060208201905081810360008301526106e0818461068d565b905092915050565b600080fd5b600080fd5b6106fb816105fa565b811461070657600080fd5b50565b600081359050610718816106f2565b92915050565b600060208284031215610734576107336106e8565b5b600061074284828501610709565b91505092915050565b600080fd5b600060c082840312156107665761076561074b565b5b81905092915050565b600060208284031215610785576107846106e8565b5b600082013567ffffffffffffffff8111156107a3576107a26106ed565b5b6107af84828501610750565b91505092915050565b6000819050919050565b6107cb816107b8565b82525050565b60006060820190506107e6600083018661060c565b6107f3602083018561060c565b61080060408301846107c2565b949350505050565b60008115159050919050565b61081d81610808565b811461082857600080fd5b50565b60008151905061083a81610814565b92915050565b600060208284031215610856576108556106e8565b5b60006108648482850161082b565b91505092915050565b600060208201905061088260008301846107c2565b92915050565b600081905092915050565b50565b60006108a3600083610888565b91506108ae82610893565b600082019050919050565b60006108c482610896565b9150819050919050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126108fa576108f96108ce565b5b80840192508235915067ffffffffffffffff82111561091c5761091b6108d3565b5b602083019250600182023603831315610938576109376108d8565b5b509250929050565b600082825260208201905092915050565b82818337600083830152505050565b600061096c8385610940565b9350610979838584610951565b6109828361067c565b840190509392505050565b600060c0820190506109a2600083018c61060c565b81810360208301526109b5818a8c610960565b90506109c460408301896107c2565b6109d160608301886107c2565b81810360808301526109e4818688610960565b905081810360a08301526109f9818486610960565b90509a995050505050505050505056fea26469706673582212206647922040def2c6972690c7b621d67ba2619c6888ae0b5c33ce88c440cebffa64736f6c63430008170033
Loading

0 comments on commit f9cb534

Please sign in to comment.