diff --git a/docs/zetacore/status_message.md b/docs/zetacore/status_message.md index d356cab558..029c5b639d 100644 --- a/docs/zetacore/status_message.md +++ b/docs/zetacore/status_message.md @@ -48,10 +48,10 @@ A cctx can have a maximum of two outbound params. We can refer to the first outb - `outbound failed` : The outbound failed, The protocol would try to create a revert either in the same block or schedule one to be picked up by zetaclient - `outbound failed for non-ZETA cctx` : Special case of outbound failed where we do not try to revert the cctx - `outbound failed for admin tx` : The outbound failed for an admin transaction, in this case we do not revert the cctx -- `outbound failed deposit to ZEVM failed but contract call did not revert` : Special case of outbound failed The outbound/deposit failed, but the contract did not revert, +- `outbound failed but the universal contract did not revert` : Special case of outbound failed The outbound/deposit failed, but the contract did not revert, this is most likely caused by an internal error in the protocol.The CCTX is this case is aborted. Users can try connecting with the zetachain team to get a refund - `outbound pre-processing failed` : The outbound failed during the pre-processing step. This means the outbound is never created. In this case the cctx is aborted -- `cctx aborted with admin cmd` : The cctx was aborted manually by an admin command +- `cctx aborted through MsgAbortStuckCCTX` : The cctx was aborted manually by an admin command ### Example values for ErrorMessage and ErrorMessageRevert fields and how to interpret them @@ -65,6 +65,6 @@ A cctx can have a maximum of two outbound params. We can refer to the first outb - revertReason: Revert reason from the smart contract ``` -- `outbound failed to external chain ,start revert` : withdraw failed to an external chain, and the protocol is starting the revert process back to ZEVM. +- `outbound failed to connected chain ,start revert` : withdraw failed to an external chain, and the protocol is starting the revert process back to ZEVM. - `coin type [CoinType] not supported for revert when source chain is Zetachain` : The coin type is not supported for revert when the source chain is Zetachain. - `error from EVMDeposit: [Error_String]` : Error returned by the protocol when trying to deposit tokens( and optionally call a contract) on ZEVM. The error string should explain the cause diff --git a/x/crosschain/keeper/cctx_gateway_zevm.go b/x/crosschain/keeper/cctx_gateway_zevm.go index 083f74bf39..89a5dba387 100644 --- a/x/crosschain/keeper/cctx_gateway_zevm.go +++ b/x/crosschain/keeper/cctx_gateway_zevm.go @@ -31,7 +31,7 @@ func (c CCTXGatewayZEVM) InitiateOutbound( if err != nil && !isContractReverted { // exceptional case; internal error; should abort CCTX config.CCTX.SetAbort(types.StatusMessages{ - StatusMessage: "outbound failed deposit to ZEVM failed but contract call did not revert", + StatusMessage: "outbound failed but the universal contract did not revert", ErrorMessageOutbound: fmt.Sprintf("error from EVMDeposit: %s", err.Error()), }) return types.CctxStatus_Aborted, err diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index f335ee1331..2b7ff56a18 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -45,14 +45,14 @@ func (k Keeper) ValidateOutboundZEVM( if depositErr != nil && isContractReverted { tmpCtxRevert, commitRevert := ctx.CacheContext() // contract call reverted; should refund via a revert tx - reverErr := k.processFailedOutboundOnExternalChain( + revertErr := k.processFailedOutboundOnExternalChain( tmpCtxRevert, cctx, types.CctxStatus_PendingOutbound, depositErr.Error(), cctx.InboundParams.Amount, ) - if reverErr != nil { + if revertErr != nil { // Error here would mean the outbound tx failed and we also failed to create a revert tx. // This is the only case where we set outbound and revert messages, // as both the outbound and the revert failed in the same block @@ -60,7 +60,7 @@ func (k Keeper) ValidateOutboundZEVM( types.StatusMessages{ StatusMessage: fmt.Sprintf("revert failed"), ErrorMessageOutbound: depositErr.Error(), - ErrorMessageRevert: reverErr.Error(), + ErrorMessageRevert: revertErr.Error(), }) return types.CctxStatus_Aborted } @@ -148,7 +148,7 @@ func (k Keeper) processFailedOutboundObservers(ctx sdk.Context, cctx *types.Cros cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed cctx.SetAbort(types.StatusMessages{ StatusMessage: "outbound failed for non-ZETA cctx", - ErrorMessageOutbound: fmt.Sprintf("coin type %s not supported for revert when source chain is Zetachain", cctx.InboundParams.CoinType), + ErrorMessageOutbound: fmt.Sprintf("revert on ZetaChain is not supported for cctx v1 with coin type %s", cctx.InboundParams.CoinType), }) } } @@ -290,7 +290,7 @@ func (k Keeper) processFailedZETAOutboundOnZEVM(ctx sdk.Context, cctx *types.Cro // The outbound failed due to majority of observer voting failure.We do not have the exact reason for the failure available on chain. cctx.SetPendingRevert(types.StatusMessages{ StatusMessage: "outbound failed", - ErrorMessageOutbound: "outbound failed to external chain ,start revert", + ErrorMessageOutbound: "outbound failed to connected chain ,start revert", }) data, err := base64.StdEncoding.DecodeString(cctx.RelayedMessage) if err != nil { @@ -375,7 +375,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT // update status cctx.SetPendingRevert(types.StatusMessages{ StatusMessage: "outbound failed", - ErrorMessageOutbound: "outbound failed to external chain ,start revert", + ErrorMessageOutbound: "outbound failed to connected chain ,start revert", }) // process the revert on ZEVM diff --git a/x/crosschain/keeper/msg_server_abort_stuck_cctx.go b/x/crosschain/keeper/msg_server_abort_stuck_cctx.go index 9fdb7bf713..6983dcdc21 100644 --- a/x/crosschain/keeper/msg_server_abort_stuck_cctx.go +++ b/x/crosschain/keeper/msg_server_abort_stuck_cctx.go @@ -12,7 +12,7 @@ import ( const ( // AbortMessage is the message to abort a stuck CCTX - AbortMessage = "cctx aborted with admin cmd" + AbortMessage = "cctx aborted through MsgAbortStuckCCTX" ) // AbortStuckCCTX aborts a stuck CCTX diff --git a/x/crosschain/types/cctx.go b/x/crosschain/types/cctx.go index 6e2aec5024..9385eebf85 100644 --- a/x/crosschain/types/cctx.go +++ b/x/crosschain/types/cctx.go @@ -147,6 +147,7 @@ func (m *CrossChainTx) AddRevertOutbound(gasLimit uint64) error { TssPubkey: m.GetCurrentOutboundParam().TssPubkey, } + // TODO : Refactor to move CoinType field to the CCTX object directly : https://github.com/zeta-chain/node/issues/1943 if m.InboundParams != nil { revertTxParams.CoinType = m.InboundParams.CoinType }