Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 committed Sep 14, 2023
1 parent eac83cf commit 6bf8451
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 1,188 deletions.
1 change: 0 additions & 1 deletion common/ethereum/ethereum.pb.go

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

3 changes: 0 additions & 3 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50339,8 +50339,6 @@ definitions:
type: object
crosschainMsgNonceVoterResponse:
type: object
crosschainMsgProveOutboundTxResponse:
type: object
crosschainMsgRemoveFromOutTxTrackerResponse:
type: object
crosschainMsgUpdateTssAddressResponse:
Expand Down Expand Up @@ -50649,7 +50647,6 @@ definitions:
items:
type: string
format: byte
title: map<string,bytes> proof = 1;
values:
type: array
items:
Expand Down
54 changes: 0 additions & 54 deletions docs/spec/crosschain/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,57 +231,3 @@ message MsgUpdateTssAddress {
}
```

## MsgProveOutboundTx

Casts a vote on an outbound transaction observed on a connected chain (after
it has been broadcasted to and finalized on a connected chain). If this is
the first vote, a new ballot is created. When a threshold of votes is
reached, the ballot is finalized. When a ballot is finalized, the outbound
transaction is processed.

If the observation is successful, the difference between zeta burned
and minted is minted by the bank module and deposited into the module
account.

If the observation is unsuccessful, the logic depends on the previous
status.

If the previous status was `PendingOutbound`, a new revert transaction is
created. To cover the revert transaction fee, the required amount of tokens
submitted with the CCTX are swapped using a Uniswap V2 contract instance on
ZetaChain for the ZRC20 of the gas token of the receiver chain. The ZRC20
tokens are then
burned. The nonce is updated. If everything is successful, the CCTX status is
changed to `PendingRevert`.

If the previous status was `PendingRevert`, the CCTX is aborted.

```mermaid
stateDiagram-v2
state observation <<choice>>
state success_old_status <<choice>>
state fail_old_status <<choice>>
PendingOutbound --> observation: Finalize outbound
observation --> success_old_status: Observation succeeded
success_old_status --> Reverted: Old status is PendingRevert
success_old_status --> OutboundMined: Old status is PendingOutbound
observation --> fail_old_status: Observation failed
fail_old_status --> PendingRevert: Old status is PendingOutbound
fail_old_status --> Aborted: Old status is PendingRevert
PendingOutbound --> Aborted: Finalize outbound error
```

Only observer validators are authorized to broadcast this message.

```proto
message MsgProveOutboundTx {
string creator = 1;
ethereum.Proof txProof = 2;
ethereum.Proof receiptProof = 3;
string block_hash = 4;
int64 tx_index = 5;
}
```

12 changes: 1 addition & 11 deletions proto/crosschain/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ service Msg {
rpc VoteOnObservedInboundTx(MsgVoteOnObservedInboundTx) returns (MsgVoteOnObservedInboundTxResponse);
rpc WhitelistERC20(MsgWhitelistERC20) returns (MsgWhitelistERC20Response);
rpc UpdateTssAddress(MsgUpdateTssAddress) returns (MsgUpdateTssAddressResponse);
rpc ProveOutboundTx(MsgProveOutboundTx) returns (MsgProveOutboundTxResponse);
// rpc ProveOutboundTx(MsgProveOutboundTx) returns (MsgProveOutboundTxResponse);
}

message MsgUpdateTssAddress {
Expand Down Expand Up @@ -86,16 +86,6 @@ message MsgNonceVoter {

message MsgNonceVoterResponse {}

message MsgProveOutboundTx {
string creator = 1;
ethereum.Proof txProof = 2;
ethereum.Proof receiptProof = 3;
string block_hash = 4;
int64 tx_index = 5;
}

message MsgProveOutboundTxResponse {}

message MsgVoteOnObservedOutboundTx {
string creator = 1;
string cctx_hash = 2;
Expand Down
195 changes: 0 additions & 195 deletions x/crosschain/keeper/keeper_cross_chain_tx_prove_outbound_tx.go

This file was deleted.

1 change: 0 additions & 1 deletion x/crosschain/types/cctx_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ func GetAllAuthzZetaclientTxTypes() []string {
sdk.MsgTypeURL(&MsgSetNodeKeys{}),
sdk.MsgTypeURL(&types.MsgAddBlameVote{}),
sdk.MsgTypeURL(&types.MsgAddBlockHeader{}),
sdk.MsgTypeURL(&MsgProveOutboundTx{}),
}
}
53 changes: 0 additions & 53 deletions x/crosschain/types/message_prove_outbound_tx.go

This file was deleted.

Loading

0 comments on commit 6bf8451

Please sign in to comment.