From e9011617179c32c351369cf93666e355a0f3a76a Mon Sep 17 00:00:00 2001 From: Francisco de Borja Aranda Castillejo Date: Fri, 4 Oct 2024 13:06:16 +0200 Subject: [PATCH] reviews suggestions --- e2e/e2etests/test_eth_deposit_call.go | 2 +- e2e/e2etests/test_solana_deposit_refund.go | 2 +- proto/zetachain/zetacore/crosschain/cross_chain_tx.proto | 4 ++-- x/crosschain/keeper/cctx_gateway_zevm.go | 6 +++++- x/crosschain/keeper/cctx_orchestrator_validate_outbound.go | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/e2e/e2etests/test_eth_deposit_call.go b/e2e/e2etests/test_eth_deposit_call.go index 72e6bd1016..46805f9f81 100644 --- a/e2e/e2etests/test_eth_deposit_call.go +++ b/e2e/e2etests/test_eth_deposit_call.go @@ -88,5 +88,5 @@ func TestEtherDepositAndCall(r *runner.E2ERunner, args []string) { r.Logger.Info("Cross-chain call to reverter reverted") // Check the error carries the revert executed. - require.Contains(r, cctx.CctxStatus.ErrorMessage, "Revert executed") + require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed") } diff --git a/e2e/e2etests/test_solana_deposit_refund.go b/e2e/e2etests/test_solana_deposit_refund.go index 8fa49a0d6f..3176edee78 100644 --- a/e2e/e2etests/test_solana_deposit_refund.go +++ b/e2e/e2etests/test_solana_deposit_refund.go @@ -32,5 +32,5 @@ func TestSolanaDepositAndCallRefund(r *runner.E2ERunner, args []string) { utils.RequireCCTXStatus(r, cctx, crosschaintypes.CctxStatus_Reverted) // Check the error carries the revert executed. - require.Contains(r, cctx.CctxStatus.ErrorMessage, "Revert executed") + require.Contains(r, cctx.CctxStatus.ErrorMessage, "revert executed") } diff --git a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto index 36fd0c1b50..9b634a6378 100644 --- a/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto +++ b/proto/zetachain/zetacore/crosschain/cross_chain_tx.proto @@ -94,8 +94,8 @@ message OutboundParams { message Status { CctxStatus status = 1; - // status_message carries information about the status transitions - // specifying the old status and new status + // status_message carries information about the status transitions: + // why they were triggered, old and new status. string status_message = 2; // error_message carries information about the error that caused the tx // to be PendingRevert, Reverted or Aborted. diff --git a/x/crosschain/keeper/cctx_gateway_zevm.go b/x/crosschain/keeper/cctx_gateway_zevm.go index f734c60751..67caae51e3 100644 --- a/x/crosschain/keeper/cctx_gateway_zevm.go +++ b/x/crosschain/keeper/cctx_gateway_zevm.go @@ -1,6 +1,8 @@ package keeper import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/zeta-chain/node/x/crosschain/types" @@ -28,7 +30,9 @@ func (c CCTXGatewayZEVM) InitiateOutbound( if err != nil && !isContractReverted { // exceptional case; internal error; should abort CCTX - config.CCTX.SetAbort("error during deposit that is not smart contract revert", err.Error()) + config.CCTX.SetAbort( + "aborted because of an error during deposit that is not smart contract revert", + fmt.Sprintf("deposit error: %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 d9278ffdd1..4ef8d0d7fa 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -227,7 +227,7 @@ func (k Keeper) processSuccessfulOutbound( oldStatus := cctx.CctxStatus.Status switch oldStatus { case types.CctxStatus_PendingRevert: - cctx.SetReverted("Reverted as part of a successful outbound", "Revert executed") + cctx.SetReverted("", "revert executed") case types.CctxStatus_PendingOutbound: cctx.SetOutboundMined("") default: @@ -292,7 +292,7 @@ func (k Keeper) processFailedZETAOutboundOnZEVM(ctx sdk.Context, cctx *types.Cro return fmt.Errorf("failed ZETARevertAndCallContract: %s", err.Error()) } - cctx.SetReverted("", "Outbound failed") + cctx.SetReverted("", "outbound failed") if len(ctx.TxBytes()) > 0 { // add event for tendermint transaction hash format hash := tmbytes.HexBytes(tmtypes.Tx(ctx.TxBytes()).Hash()) @@ -356,7 +356,7 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT } // tx is reverted - cctx.SetReverted("", "Outbound failed") + cctx.SetReverted("", "outbound failed") // add event for tendermint transaction hash format if len(ctx.TxBytes()) > 0 {