From 15e6ea40fd5930511a162fbcf968bdc9e974c8a7 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Mon, 27 May 2024 19:20:04 -0400 Subject: [PATCH] update comments --- docs/cli/zetacored/zetacored_tx_observer.md | 2 +- ..._tx_observer_update-gas-price-increase-flags.md | 2 +- docs/spec/observer/messages.md | 9 +++++++++ .../cli/tx_update_gas_price_increase_flags.go | 14 +++++++------- x/observer/keeper/msg_server_disable_cctx_flags.go | 6 ++++-- x/observer/keeper/msg_server_enable_cctx_flags.go | 4 +++- .../msg_server_update_gas_price_increase_flags.go | 6 ++++-- 7 files changed, 29 insertions(+), 14 deletions(-) diff --git a/docs/cli/zetacored/zetacored_tx_observer.md b/docs/cli/zetacored/zetacored_tx_observer.md index a08e03fbf6..4cf4042c43 100644 --- a/docs/cli/zetacored/zetacored_tx_observer.md +++ b/docs/cli/zetacored/zetacored_tx_observer.md @@ -34,7 +34,7 @@ zetacored tx observer [flags] * [zetacored tx observer remove-chain-params](zetacored_tx_observer_remove-chain-params.md) - Broadcast message to remove chain params * [zetacored tx observer reset-chain-nonces](zetacored_tx_observer_reset-chain-nonces.md) - Broadcast message to reset chain nonces * [zetacored tx observer update-chain-params](zetacored_tx_observer_update-chain-params.md) - Broadcast message updateChainParams -* [zetacored tx observer update-gas-price-increase-flags](zetacored_tx_observer_update-gas-price-increase-flags.md) - Enable inbound and outbound cross-chain flags +* [zetacored tx observer update-gas-price-increase-flags](zetacored_tx_observer_update-gas-price-increase-flags.md) - Update the gas price increase flags * [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal * [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer * [zetacored tx observer vote-tss](zetacored_tx_observer_vote-tss.md) - Vote for a new TSS creation diff --git a/docs/cli/zetacored/zetacored_tx_observer_update-gas-price-increase-flags.md b/docs/cli/zetacored/zetacored_tx_observer_update-gas-price-increase-flags.md index 138ce1cc40..8268638c44 100644 --- a/docs/cli/zetacored/zetacored_tx_observer_update-gas-price-increase-flags.md +++ b/docs/cli/zetacored/zetacored_tx_observer_update-gas-price-increase-flags.md @@ -1,6 +1,6 @@ # tx observer update-gas-price-increase-flags -Enable inbound and outbound cross-chain flags +Update the gas price increase flags ``` zetacored tx observer update-gas-price-increase-flags [epochLength] [retryInterval] [gasPriceIncreasePercent] [gasPriceIncreaseMax] [maxPendingCctxs] [flags] diff --git a/docs/spec/observer/messages.md b/docs/spec/observer/messages.md index 385f96c0e6..28dfc3d4b6 100644 --- a/docs/spec/observer/messages.md +++ b/docs/spec/observer/messages.md @@ -128,6 +128,9 @@ message MsgVoteTSS { ## MsgEnableCCTXFlags +EnableCCTXFlags enables the IsInboundEnabled and IsOutboundEnabled flags.These flags control the creation of inbounds and outbounds. +The flags are enabled by the policy account with the groupOperational policy type. + ```proto message MsgEnableCCTXFlags { string creator = 1; @@ -138,6 +141,9 @@ message MsgEnableCCTXFlags { ## MsgDisableCCTXFlags +DisableCCTXFlags disables the IsInboundEnabled and IsOutboundEnabled flags. These flags control the creation of inbounds and outbounds. +The flags are disabled by the policy account with the groupEmergency policy type. + ```proto message MsgDisableCCTXFlags { string creator = 1; @@ -148,6 +154,9 @@ message MsgDisableCCTXFlags { ## MsgUpdateGasPriceIncreaseFlags +UpdateGasPriceIncreaseFlags updates the GasPriceIncreaseFlags. These flags control the increase of gas prices. +The flags are updated by the policy account with the groupOperational policy type. + ```proto message MsgUpdateGasPriceIncreaseFlags { string creator = 1; diff --git a/x/observer/client/cli/tx_update_gas_price_increase_flags.go b/x/observer/client/cli/tx_update_gas_price_increase_flags.go index bd3094eb1a..34893a8b03 100644 --- a/x/observer/client/cli/tx_update_gas_price_increase_flags.go +++ b/x/observer/client/cli/tx_update_gas_price_increase_flags.go @@ -15,8 +15,8 @@ import ( func CmdUpdateGasPriceIncreaseFlags() *cobra.Command { cmd := &cobra.Command{ Use: "update-gas-price-increase-flags [epochLength] [retryInterval] [gasPriceIncreasePercent] [gasPriceIncreaseMax] [maxPendingCctxs]", - Short: "Enable inbound and outbound cross-chain flags", - Args: cobra.ExactArgs(2), + Short: "Update the gas price increase flags", + Args: cobra.ExactArgs(5), RunE: func(cmd *cobra.Command, args []string) (err error) { clientCtx, err := client.GetClientTxContext(cmd) @@ -45,11 +45,11 @@ func CmdUpdateGasPriceIncreaseFlags() *cobra.Command { return err } gasPriceIncreaseFlags := types.GasPriceIncreaseFlags{ - epochLength, - time.Duration(retryInterval), - uint32(gasPriceIncreasePercent), - uint32(gasPriceIncreaseMax), - uint32(maxPendingCctxs)} + EpochLength: epochLength, + RetryInterval: time.Duration(retryInterval), + GasPriceIncreasePercent: uint32(gasPriceIncreasePercent), + GasPriceIncreaseMax: uint32(gasPriceIncreaseMax), + MaxPendingCctxs: uint32(maxPendingCctxs)} msg := types.NewMsgUpdateGasPriceIncreaseFlags(clientCtx.GetFromAddress().String(), gasPriceIncreaseFlags) err = msg.ValidateBasic() if err != nil { diff --git a/x/observer/keeper/msg_server_disable_cctx_flags.go b/x/observer/keeper/msg_server_disable_cctx_flags.go index e7c5d966e3..461873edb1 100644 --- a/x/observer/keeper/msg_server_disable_cctx_flags.go +++ b/x/observer/keeper/msg_server_disable_cctx_flags.go @@ -9,6 +9,8 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) +// DisableCCTXFlags disables the IsInboundEnabled and IsOutboundEnabled flags. These flags control the creation of inbounds and outbounds. +// The flags are disabled by the policy account with the groupEmergency policy type. func (k msgServer) DisableCCTXFlags( goCtx context.Context, msg *types.MsgDisableCCTXFlags, @@ -18,7 +20,7 @@ func (k msgServer) DisableCCTXFlags( // check permission if !k.GetAuthorityKeeper().IsAuthorized(ctx, msg.Creator, authoritytypes.PolicyType_groupEmergency) { return &types.MsgDisableCCTXFlagsResponse{}, authoritytypes.ErrUnauthorized.Wrap( - "EnableCCTXFlags can only be executed by the correct policy account", + "DisableCCTXFlags can only be executed by the correct policy account", ) } @@ -46,7 +48,7 @@ func (k msgServer) DisableCCTXFlags( }) if err != nil { - ctx.Logger().Error("Error emitting event EventCrosschainFlagsUpdated :", err) + ctx.Logger().Error("Error emitting event EventCCTXFlagsDisabled :", err) } return &types.MsgDisableCCTXFlagsResponse{}, nil diff --git a/x/observer/keeper/msg_server_enable_cctx_flags.go b/x/observer/keeper/msg_server_enable_cctx_flags.go index ec0531d8f6..535cf6ab5d 100644 --- a/x/observer/keeper/msg_server_enable_cctx_flags.go +++ b/x/observer/keeper/msg_server_enable_cctx_flags.go @@ -9,6 +9,8 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) +// EnableCCTXFlags enables the IsInboundEnabled and IsOutboundEnabled flags.These flags control the creation of inbounds and outbounds. +// The flags are enabled by the policy account with the groupOperational policy type. func (k msgServer) EnableCCTXFlags( goCtx context.Context, msg *types.MsgEnableCCTXFlags, @@ -46,7 +48,7 @@ func (k msgServer) EnableCCTXFlags( }) if err != nil { - ctx.Logger().Error("Error emitting event EventCrosschainFlagsUpdated :", err) + ctx.Logger().Error("Error emitting EventCCTXFlagsEnabled :", err) } return &types.MsgEnableCCTXFlagsResponse{}, nil diff --git a/x/observer/keeper/msg_server_update_gas_price_increase_flags.go b/x/observer/keeper/msg_server_update_gas_price_increase_flags.go index 9495620a1b..7402ab0cc7 100644 --- a/x/observer/keeper/msg_server_update_gas_price_increase_flags.go +++ b/x/observer/keeper/msg_server_update_gas_price_increase_flags.go @@ -9,6 +9,8 @@ import ( "github.com/zeta-chain/zetacore/x/observer/types" ) +// UpdateGasPriceIncreaseFlags updates the GasPriceIncreaseFlags. These flags control the increase of gas prices. +// The flags are updated by the policy account with the groupOperational policy type. func (k msgServer) UpdateGasPriceIncreaseFlags( goCtx context.Context, msg *types.MsgUpdateGasPriceIncreaseFlags, @@ -18,7 +20,7 @@ func (k msgServer) UpdateGasPriceIncreaseFlags( // check permission if !k.GetAuthorityKeeper().IsAuthorized(ctx, msg.Creator, authoritytypes.PolicyType_groupOperational) { return &types.MsgUpdateGasPriceIncreaseFlagsResponse{}, authoritytypes.ErrUnauthorized.Wrap( - "EnableCCTXFlags can only be executed by the correct policy account", + "UpdateGasPriceIncreaseFlags can only be executed by the correct policy account", ) } // check if the value exists, @@ -45,7 +47,7 @@ func (k msgServer) UpdateGasPriceIncreaseFlags( }) if err != nil { - ctx.Logger().Error("Error emitting event EventCrosschainFlagsUpdated :", err) + ctx.Logger().Error("Error emitting EventGasPriceIncreaseFlagsUpdated :", err) } return &types.MsgUpdateGasPriceIncreaseFlagsResponse{}, nil