From fb85b096b8ee169053e9d4e06caf49e41f8d86f9 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Wed, 8 Jan 2025 17:41:26 -0600 Subject: [PATCH 01/16] created a channel for managing sending tx to chain instead of relying on mutex's to ensure only one process calls sendTx at a time --- daemons/reporter/client/broadcast_message.go | 111 +++++++++++-------- daemons/reporter/client/client.go | 15 ++- daemons/reporter/client/reporter_monitors.go | 3 +- daemons/reporter/client/tx_handler.go | 8 +- 4 files changed, 86 insertions(+), 51 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index 2ad2096e3..787608241 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -42,52 +42,13 @@ func (c *Client) GenerateDepositMessages(ctx context.Context) error { return nil } - msg := oracletypes.MsgSubmitValue{ + msg := &oracletypes.MsgSubmitValue{ Creator: c.accAddr.String(), QueryData: depositQuerydata, Value: value, } - // Add retry logic for transaction sending - maxRetries := 5 - for attempt := 1; attempt <= maxRetries; attempt++ { - resp, err := c.sendTx(ctx, &msg) - if err != nil { - c.logger.Error("submitting deposit report transaction", - "error", err, - "attempt", attempt, - "queryId", queryId) - - if attempt == maxRetries { - // Don't mark as reported if all retries failed - return fmt.Errorf("failed to submit deposit after %d attempts: %w", maxRetries, err) - } - - // Wait before retry with exponential backoff - time.Sleep(time.Second * time.Duration(2^attempt)) - continue - } - - // Check transaction success - if resp.TxResult.Code != 0 { - c.logger.Error("deposit report transaction failed", - "code", resp.TxResult.Code, - "queryId", queryId) - return fmt.Errorf("transaction failed with code %d", resp.TxResult.Code) - } - - // Remove oldest deposit report from cache - c.TokenDepositsCache.RemoveOldestReport() - - // Only mark as reported if transaction was successful - mutex.Lock() - depositReportMap[queryId] = true - mutex.Unlock() - - c.logger.Info(fmt.Sprintf("Response from bridge tx report: %v", resp.TxResult)) - - return nil - } + c.txChan <- TxChannelInfo{Msg: msg, isBridge: true, NumRetries: 5} return nil } @@ -131,11 +92,8 @@ func (c *Client) GenerateAndBroadcastSpotPriceReport(ctx context.Context, qd []b Value: value, } - resp, err := c.sendTx(ctx, msg) - if err != nil { - return fmt.Errorf("error sending tx: %w", err) - } - fmt.Println("response after submit message", resp.TxResult.Code) + c.txChan <- TxChannelInfo{Msg: msg, isBridge: false} + mutex.Lock() commitedIds[querymeta.Id] = true mutex.Unlock() @@ -144,3 +102,64 @@ func (c *Client) GenerateAndBroadcastSpotPriceReport(ctx context.Context, qd []b return nil } + +func (c *Client) HandleBridgeDepositTxInChannel(ctx context.Context, data TxChannelInfo) { + resp, err := c.sendTx(ctx, data.Msg) + if err != nil { + c.logger.Error("submitting deposit report transaction", + "error", err, + "attemptsLeft", data.NumRetries) + + if data.NumRetries == 0 { + // Don't mark as reported if all retries failed + c.logger.Error(fmt.Sprintf("failed to submit deposit after all allotted attempts attempts: %v", err)) + return + } + + data.NumRetries-- + c.txChan <- data + } + + queryId := utils.QueryIDFromData(data.Msg.GetQueryData()) + + // Check transaction success + if resp.TxResult.Code != 0 { + c.logger.Error("deposit report transaction failed", + "code", resp.TxResult.Code, + "queryId", queryId) + return + } + + // Remove oldest deposit report from cache + c.TokenDepositsCache.RemoveOldestReport() + + // Only mark as reported if transaction was successful + mutex.Lock() + depositReportMap[hex.EncodeToString(queryId)] = true + mutex.Unlock() + + c.logger.Info(fmt.Sprintf("Response from bridge tx report: %v", resp.TxResult)) +} + +func (c *Client) BroadcastTxMsgToChain() { + for obj := range c.txChan { + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + done := make(chan struct{}) + go func() { + defer close(done) + if !obj.isBridge { + c.sendTx(ctx, obj.Msg) + } else { + c.HandleBridgeDepositTxInChannel(ctx, obj) + } + }() + + select { + case <-done: + cancel() + case <-ctx.Done(): + c.logger.Error("broadcasting tx timed out") + cancel() + } + } +} diff --git a/daemons/reporter/client/client.go b/daemons/reporter/client/client.go index 4800cf5ec..0b522d4ca 100644 --- a/daemons/reporter/client/client.go +++ b/daemons/reporter/client/client.go @@ -34,6 +34,12 @@ var ( var mutex = &sync.RWMutex{} +type TxChannelInfo struct { + Msg *oracletypes.MsgSubmitValue + isBridge bool + NumRetries uint8 +} + type Client struct { // reporter account name AccountName string @@ -52,17 +58,19 @@ type Client struct { accAddr sdk.AccAddress minGasFee string // logger is the logger for the daemon. - logger log.Logger - txMutex sync.Mutex + logger log.Logger + txChan chan TxChannelInfo } func NewClient(clctx client.Context, logger log.Logger, accountName, valGasMin string) *Client { logger = logger.With("module", "reporter-client") + txChan := make(chan TxChannelInfo) return &Client{ AccountName: accountName, cosmosCtx: clctx, logger: logger, minGasFee: valGasMin, + txChan: txChan, } } @@ -174,6 +182,9 @@ func StartReporterDaemonTaskLoop( var wg sync.WaitGroup + wg.Add(1) + go client.BroadcastTxMsgToChain() + wg.Add(1) go client.MonitorCyclelistQuery(ctx, &wg) diff --git a/daemons/reporter/client/reporter_monitors.go b/daemons/reporter/client/reporter_monitors.go index 86fbdb2c0..1ca09d3ec 100644 --- a/daemons/reporter/client/reporter_monitors.go +++ b/daemons/reporter/client/reporter_monitors.go @@ -50,6 +50,7 @@ func (c *Client) MonitorCyclelistQuery(ctx context.Context, wg *sync.WaitGroup) txCtx, cancel := context.WithTimeout(ctx, defaultTxTimeout) done := make(chan struct{}) + c.logger.Info(fmt.Sprintf("starting to generate spot price report at %d", time.Now().Unix())) go func() { defer close(done) err := c.GenerateAndBroadcastSpotPriceReport(txCtx, querydata, querymeta) @@ -62,7 +63,7 @@ func (c *Client) MonitorCyclelistQuery(ctx context.Context, wg *sync.WaitGroup) case <-done: cancel() case <-txCtx.Done(): - c.logger.Error("report generation timed out") + c.logger.Error(fmt.Sprintf("report generation timed out at %d", time.Now().Unix())) cancel() } diff --git a/daemons/reporter/client/tx_handler.go b/daemons/reporter/client/tx_handler.go index db1f829a3..d7630783d 100644 --- a/daemons/reporter/client/tx_handler.go +++ b/daemons/reporter/client/tx_handler.go @@ -49,10 +49,15 @@ func (c *Client) WaitForTx(ctx context.Context, hash string) (*cmttypes.ResultTx if err != nil { return nil, fmt.Errorf("unable to decode tx hash '%s'; err: %w", hash, err) } + + startTimestamp := time.Now().UnixMilli() for waiting { resp, err := c.cosmosCtx.Client.Tx(ctx, bz, false) if err != nil { if strings.Contains(err.Error(), "not found") { + if time.Now().UnixMilli()-startTimestamp > 2500 { + return nil, fmt.Errorf("fetching tx '%s'; err: No transaction found within the allotted time", hash) + } continue // Tx not found, wait for next block and try again @@ -115,8 +120,6 @@ func (c *Client) WaitForBlockHeight(ctx context.Context, h int64) error { } func (c *Client) sendTx(ctx context.Context, msg ...sdk.Msg) (*cmttypes.ResultTx, error) { - c.txMutex.Lock() - defer c.txMutex.Unlock() block, err := c.cosmosCtx.Client.Block(ctx, nil) if err != nil { return nil, fmt.Errorf("error getting block: %w", err) @@ -159,6 +162,7 @@ func (c *Client) sendTx(ctx context.Context, msg ...sdk.Msg) (*cmttypes.ResultTx } c.logger.Info("TxResult", "result", txnResponse.TxResult) fmt.Println("transaction hash ", res.TxHash) + fmt.Println("response after submit message", txnResponse.TxResult.Code) return txnResponse, nil } From 5e4a75fa926616959c341af5857dd4c9921656b1 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Wed, 8 Jan 2025 17:57:19 -0600 Subject: [PATCH 02/16] added log --- daemons/reporter/client/broadcast_message.go | 1 + daemons/reporter/client/tx_handler.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index 787608241..c1df45963 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -92,6 +92,7 @@ func (c *Client) GenerateAndBroadcastSpotPriceReport(ctx context.Context, qd []b Value: value, } + c.logger.Info("sent msg to channel") c.txChan <- TxChannelInfo{Msg: msg, isBridge: false} mutex.Lock() diff --git a/daemons/reporter/client/tx_handler.go b/daemons/reporter/client/tx_handler.go index d7630783d..9a3b80a83 100644 --- a/daemons/reporter/client/tx_handler.go +++ b/daemons/reporter/client/tx_handler.go @@ -161,8 +161,8 @@ func (c *Client) sendTx(ctx context.Context, msg ...sdk.Msg) (*cmttypes.ResultTx return nil, fmt.Errorf("error waiting for transaction: %w", err) } c.logger.Info("TxResult", "result", txnResponse.TxResult) - fmt.Println("transaction hash ", res.TxHash) - fmt.Println("response after submit message", txnResponse.TxResult.Code) + c.logger.Info(fmt.Sprintf("transaction hash: %s", res.TxHash)) + c.logger.Info(fmt.Sprintf("response after submit message: %d", txnResponse.TxResult.Code)) return txnResponse, nil } From 46f29a4dfa74cd99ec77fd24b302c8156c07f1f1 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Wed, 15 Jan 2025 10:12:14 -0600 Subject: [PATCH 03/16] updated spam reports script --- scripts/spam-reports.go | 201 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 scripts/spam-reports.go diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go new file mode 100644 index 000000000..bd3974a2a --- /dev/null +++ b/scripts/spam-reports.go @@ -0,0 +1,201 @@ +package main + +import ( + "fmt" + "log" + "os/exec" + "strconv" + "strings" + "sync" + "time" + + oracletypes "github.com/tellor-io/layer/x/oracle/types" +) + +var COMMAND_PATH = "/Users/caleb/layer/layerd" +var LAYER_PATH = "/Users/caleb/.layer" +var FAUCET_ADDRESS = "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp" +var VALIDATOR_ADDRESS = "tellorvaloper1ta78rra3a9sjr6n9ve7wjxft5n862ug73p75cg" // this can be any + +var NUM_OF_REPORTERS = 200 + +func main() { + reportersMap, err := CreateNewAccountsAndFundReporters(NUM_OF_REPORTERS) + if err != nil { + fmt.Println("Error creating accounts: ", err) + return + } + + prevQueryData := "" + + for { + + querydata, err := GetCurrentQueryInCyclelist() + if err != nil { + // log error + fmt.Println("error getting current query: ", err) + return + } + if strings.EqualFold(querydata, prevQueryData) { + time.Sleep(100 * time.Millisecond) + continue + } + // call spam function + fmt.Println("Calling spam reports") + go SpamReportsWithReportersMap(reportersMap, querydata) + prevQueryData = querydata + } + +} + +type CyclelistQueryResponse struct { + Query_data []byte `json:"query_data"` + Query_meta oracletypes.QueryMeta `json:"query_meta"` +} + +func GetCurrentQueryInCyclelist() (string, error) { + cmd := exec.Command(COMMAND_PATH, "query", "oracle", "current-cyclelist-query", "--node", "http://54.234.103.186:26657") + output, err := cmd.CombinedOutput() + if err != nil { + fmt.Println("ERROR getting current cyclelist query: ", err) + return "", nil + } + + queryDataField := strings.Split(string(output), "query_meta")[0] + query_data := strings.TrimPrefix(queryDataField, "query_data: ") + qdBytes := []byte(query_data) + qd := string(qdBytes[:len(qdBytes)-1]) + + return qd, nil +} + +func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string) { + maxGoroutines := 50 + ticket := make(chan struct{}, maxGoroutines) + + value := "0000000000000000000000000000000000000000000000000000000004a5ba50" + + var wg sync.WaitGroup + + for reporter_name, info := range reportersMap { + wg.Add(1) + ticket <- struct{}{} // would block if guard channel is already filled + key_path := fmt.Sprintf("%s/%s", LAYER_PATH, reporter_name) + go func(reporter_info *ReporterInfo, path string) { + defer wg.Done() + cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") + output, err := cmd.CombinedOutput() + if err != nil { + fmt.Println("ERROR submitting value: ", err) + } + reporter_info.SequenceNum++ + fmt.Println(string(output)) + <-ticket + }(&info, key_path) + } + + wg.Wait() +} + +type ReporterInfo struct { + Address string + SequenceNum int +} + +func CreateNewAccountsAndFundReporters(numOfReporters int) (map[string]ReporterInfo, error) { + reporterMap := make(map[string]ReporterInfo, numOfReporters) + for i := 1; i <= numOfReporters; i++ { + key_name := fmt.Sprintf("test_reporter%d", i) + //key_path := fmt.Sprintf("%s/%s", LAYER_PATH, key_name) + + // Create account for reporter + // fmt.Println("Create keys") + // cmd := exec.Command(COMMAND_PATH, "keys", "add", key_name, "--keyring-backend", "test", "--home", key_path) + // output, err := cmd.CombinedOutput() + // if err != nil { + // fmt.Println(string(output)) + // log.Fatalf("creating key failed for %s: %v\r", key_name, err) + // } + // fmt.Println(string(output)) + + // send tokens to reporter from faucet + fmt.Println("fund account from faucet") + key_address := GetAddressFromKeyName(key_name) + // cmd := exec.Command(COMMAND_PATH, "tx", "bank", "send", "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp", key_address, "9000000loya", "--from", "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp", "--chain-id", "layertest-2", "--keyring-dir", "/Users/caleb/.layer", "--keyring-backend", "test", "--home", "/Users/caleb/.layer", "--fees", "15loya", "--node", "http://54.234.103.186:26657", "--yes") + // output, err := cmd.CombinedOutput() + // if err != nil { + // fmt.Println(string(output)) + // log.Fatalf("sending loya to %s failed: %v\r", key_name, err) + // } + // fmt.Println(string(output)) + // fmt.Printf("Val address: %s, Key address: %s, Key path: %s\r", VALIDATOR_ADDRESS, key_address, key_path) + // time.Sleep(2 * time.Second) + + // delegate to validator + seqNumStr := GetSequenceNumberForAccount(key_address) + if strings.EqualFold(seqNumStr, "") { + continue + } + seqNumStr = strings.Trim(seqNumStr, "\n") + seqNumStr = strings.Trim(seqNumStr, "\"") + + fmt.Println("Sequence number for account: ", seqNumStr) + seqNum, err := strconv.Atoi(seqNumStr) + if err != nil { + panic(err) + } + + // fmt.Println("delegate to validator") + // cmd = exec.Command(COMMAND_PATH, "tx", "staking", "delegate", VALIDATOR_ADDRESS, "150000000loya", "--from", key_address, "--chain-id", "layertest-2", "--keyring-dir", fmt.Sprintf("%s/%s", LAYER_PATH, key_name), "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name), "--fees", "15loya", "--node", "http://54.234.103.186:26657", "--yes") + // output, err = cmd.CombinedOutput() + // if err != nil { + // fmt.Println(string(output)) + // log.Fatalf("error delegating to validator with %s: %v\r", key_name, err) + // } + // fmt.Println(string(output)) + // time.Sleep(5 * time.Second) + + // create reporter + // fmt.Println("create reporter ") + // cmd = exec.Command(COMMAND_PATH, "tx", "reporter", "create-reporter", "20000", "1000000", "--from", key_address, "--chain-id", "layertest-2", "--keyring-dir", key_path, "--keyring-backend", "test", "--sequence", "1", "--home", key_path, "--fees", "15loya", "--sequence", "1", "--node", "http://54.234.103.186:26657", "--yes") + // output, err = cmd.CombinedOutput() + // if err != nil { + // fmt.Println(string(output)) + // log.Fatalf("error creating reporter for %s: %v\r", key_name, err) + // } + // fmt.Println(string(output)) + // time.Sleep(2 * time.Second) + + // add to map + reporterMap[key_name] = ReporterInfo{Address: key_address, SequenceNum: seqNum} + + } + return reporterMap, nil +} + +func GetAddressFromKeyName(key_name string) string { + cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) + output, err := cmd.CombinedOutput() + if err != nil { + log.Fatalf("cmd.Run() failed: %v\n", err) + } + + return string(output[:len(output)-1]) +} + +func GetSequenceNumberForAccount(address string) string { + cmd := exec.Command(COMMAND_PATH, "query", "auth", "account-info", address, "--node", "http://54.234.103.186:26657") + output, err := cmd.CombinedOutput() + if err != nil { + fmt.Println("Error getting account info: ", err) + panic(err) + } + response := string(output) + fmt.Println(response) + resArr := strings.Split(response, "sequence: ") + if len(resArr) < 2 { + return "" + } + fmt.Println("Account number: ", resArr[1]) + return resArr[1] +} From f4274355ba217a8d9b7878881262004736d9a09c Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Thu, 16 Jan 2025 14:04:49 -0600 Subject: [PATCH 04/16] changed channel to take any kind sdk.Msg type. Added the auto withdrawal of rewards monitor to branch --- daemons/reporter/client/broadcast_message.go | 14 +++++++-- daemons/reporter/client/client.go | 2 +- daemons/reporter/client/reporter_monitors.go | 31 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index c1df45963..f814a593f 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -7,6 +7,7 @@ import ( "time" "github.com/tellor-io/layer/utils" + "github.com/tellor-io/layer/x/oracle/types" oracletypes "github.com/tellor-io/layer/x/oracle/types" ) @@ -93,7 +94,7 @@ func (c *Client) GenerateAndBroadcastSpotPriceReport(ctx context.Context, qd []b } c.logger.Info("sent msg to channel") - c.txChan <- TxChannelInfo{Msg: msg, isBridge: false} + c.txChan <- TxChannelInfo{Msg: msg, isBridge: false, NumRetries: 0} mutex.Lock() commitedIds[querymeta.Id] = true @@ -121,7 +122,16 @@ func (c *Client) HandleBridgeDepositTxInChannel(ctx context.Context, data TxChan c.txChan <- data } - queryId := utils.QueryIDFromData(data.Msg.GetQueryData()) + var bridgeDepositMsg *types.MsgSubmitValue + var queryId []byte + if msg, ok := data.Msg.(*types.MsgSubmitValue); ok { + bridgeDepositMsg = msg + } else { + c.logger.Error("Could not go from sdk.Msg to types.MsgSubmitValue") + return + } + + queryId = utils.QueryIDFromData(bridgeDepositMsg.GetQueryData()) // Check transaction success if resp.TxResult.Code != 0 { diff --git a/daemons/reporter/client/client.go b/daemons/reporter/client/client.go index 0b522d4ca..45196804d 100644 --- a/daemons/reporter/client/client.go +++ b/daemons/reporter/client/client.go @@ -35,7 +35,7 @@ var ( var mutex = &sync.RWMutex{} type TxChannelInfo struct { - Msg *oracletypes.MsgSubmitValue + Msg sdk.Msg isBridge bool NumRetries uint8 } diff --git a/daemons/reporter/client/reporter_monitors.go b/daemons/reporter/client/reporter_monitors.go index 1ca09d3ec..43cf0e6c9 100644 --- a/daemons/reporter/client/reporter_monitors.go +++ b/daemons/reporter/client/reporter_monitors.go @@ -6,12 +6,14 @@ import ( "fmt" "os" "runtime" + "strconv" "strings" "sync" "time" "github.com/shirou/gopsutil/v3/process" oracletypes "github.com/tellor-io/layer/x/oracle/types" + reportertypes "github.com/tellor-io/layer/x/reporter/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -164,6 +166,35 @@ func (c *Client) MonitorForTippedQueries(ctx context.Context, wg *sync.WaitGroup } } +func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context) { + freqVar := os.Getenv("WITHDRAW_FREQUENCY") + if freqVar == "" { + freqVar = "43200" // default to being 12 hours or 43200 seconds + } + frequency, err := strconv.Atoi(freqVar) + if err != nil { + c.logger.Error("Could not start auto rewards withdrawal process due to incorrect parameter. Please enter the number of seconds to wait in between claiming rewards") + return + } + + for { + valAddr := os.Getenv("REPORTERS_VALIDATOR_ADDRESS") + if valAddr == "" { + fmt.Println("Returning from Withdraw Monitor due to no validator address env variable was found") + time.Sleep(time.Duration(frequency) * time.Second) + continue + } + + withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ + SelectorAddress: c.accAddr.String(), + ValidatorAddress: valAddr, + } + c.txChan <- TxChannelInfo{Msg: withdrawMsg, isBridge: false, NumRetries: 0} + + time.Sleep(time.Duration(frequency) * time.Second) + } +} + func (c *Client) LogProcessStats() { count := runtime.NumGoroutine() c.logger.Info(fmt.Sprintf("Number of Goroutines: %d\n", count)) From 6dd14c8e619aad54da18ec5a01694b81f97075cc Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Thu, 16 Jan 2025 14:52:00 -0600 Subject: [PATCH 05/16] removed duplicate import --- daemons/reporter/client/broadcast_message.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index f814a593f..e833f1741 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -7,7 +7,6 @@ import ( "time" "github.com/tellor-io/layer/utils" - "github.com/tellor-io/layer/x/oracle/types" oracletypes "github.com/tellor-io/layer/x/oracle/types" ) @@ -122,9 +121,9 @@ func (c *Client) HandleBridgeDepositTxInChannel(ctx context.Context, data TxChan c.txChan <- data } - var bridgeDepositMsg *types.MsgSubmitValue + var bridgeDepositMsg *oracletypes.MsgSubmitValue var queryId []byte - if msg, ok := data.Msg.(*types.MsgSubmitValue); ok { + if msg, ok := data.Msg.(*oracletypes.MsgSubmitValue); ok { bridgeDepositMsg = msg } else { c.logger.Error("Could not go from sdk.Msg to types.MsgSubmitValue") From 6c99cd880a4a4bed9826aeec8e341148bd310199 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Thu, 16 Jan 2025 15:23:25 -0600 Subject: [PATCH 06/16] commented out withdraw functions because it won't be valid until we make the changes to distributing rewards in end blocker --- daemons/reporter/client/broadcast_message.go | 1 - daemons/reporter/client/client.go | 3 + daemons/reporter/client/reporter_monitors.go | 58 ++++++++++---------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index e833f1741..d3e1f922a 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -92,7 +92,6 @@ func (c *Client) GenerateAndBroadcastSpotPriceReport(ctx context.Context, qd []b Value: value, } - c.logger.Info("sent msg to channel") c.txChan <- TxChannelInfo{Msg: msg, isBridge: false, NumRetries: 0} mutex.Lock() diff --git a/daemons/reporter/client/client.go b/daemons/reporter/client/client.go index 45196804d..0670e36e7 100644 --- a/daemons/reporter/client/client.go +++ b/daemons/reporter/client/client.go @@ -194,6 +194,9 @@ func StartReporterDaemonTaskLoop( wg.Add(1) go client.MonitorForTippedQueries(ctx, &wg) + // wg.Add(1) + // go client.WithdrawAndStakeEarnedRewardsPeriodically(ctx, &wg) + wg.Wait() } diff --git a/daemons/reporter/client/reporter_monitors.go b/daemons/reporter/client/reporter_monitors.go index 43cf0e6c9..723727c53 100644 --- a/daemons/reporter/client/reporter_monitors.go +++ b/daemons/reporter/client/reporter_monitors.go @@ -6,14 +6,12 @@ import ( "fmt" "os" "runtime" - "strconv" "strings" "sync" "time" "github.com/shirou/gopsutil/v3/process" oracletypes "github.com/tellor-io/layer/x/oracle/types" - reportertypes "github.com/tellor-io/layer/x/reporter/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -166,34 +164,34 @@ func (c *Client) MonitorForTippedQueries(ctx context.Context, wg *sync.WaitGroup } } -func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context) { - freqVar := os.Getenv("WITHDRAW_FREQUENCY") - if freqVar == "" { - freqVar = "43200" // default to being 12 hours or 43200 seconds - } - frequency, err := strconv.Atoi(freqVar) - if err != nil { - c.logger.Error("Could not start auto rewards withdrawal process due to incorrect parameter. Please enter the number of seconds to wait in between claiming rewards") - return - } - - for { - valAddr := os.Getenv("REPORTERS_VALIDATOR_ADDRESS") - if valAddr == "" { - fmt.Println("Returning from Withdraw Monitor due to no validator address env variable was found") - time.Sleep(time.Duration(frequency) * time.Second) - continue - } - - withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ - SelectorAddress: c.accAddr.String(), - ValidatorAddress: valAddr, - } - c.txChan <- TxChannelInfo{Msg: withdrawMsg, isBridge: false, NumRetries: 0} - - time.Sleep(time.Duration(frequency) * time.Second) - } -} +// func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context, wg *sync.WaitGroup) { +// freqVar := os.Getenv("WITHDRAW_FREQUENCY") +// if freqVar == "" { +// freqVar = "43200" // default to being 12 hours or 43200 seconds +// } +// frequency, err := strconv.Atoi(freqVar) +// if err != nil { +// c.logger.Error("Could not start auto rewards withdrawal process due to incorrect parameter. Please enter the number of seconds to wait in between claiming rewards") +// return +// } + +// for { +// valAddr := os.Getenv("REPORTERS_VALIDATOR_ADDRESS") +// if valAddr == "" { +// fmt.Println("Returning from Withdraw Monitor due to no validator address env variable was found") +// time.Sleep(time.Duration(frequency) * time.Second) +// continue +// } + +// withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ +// SelectorAddress: c.accAddr.String(), +// ValidatorAddress: valAddr, +// } +// c.txChan <- TxChannelInfo{Msg: withdrawMsg, isBridge: false, NumRetries: 0} + +// time.Sleep(time.Duration(frequency) * time.Second) +// } +// } func (c *Client) LogProcessStats() { count := runtime.NumGoroutine() From ab44844806ca775f8010589977adfb93b79b1ab8 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Thu, 16 Jan 2025 15:33:40 -0600 Subject: [PATCH 07/16] withdraw works as is so uncommenting and going to let it be --- daemons/reporter/client/client.go | 4 +- daemons/reporter/client/reporter_monitors.go | 58 ++++++++++---------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/daemons/reporter/client/client.go b/daemons/reporter/client/client.go index 0670e36e7..22928e747 100644 --- a/daemons/reporter/client/client.go +++ b/daemons/reporter/client/client.go @@ -194,8 +194,8 @@ func StartReporterDaemonTaskLoop( wg.Add(1) go client.MonitorForTippedQueries(ctx, &wg) - // wg.Add(1) - // go client.WithdrawAndStakeEarnedRewardsPeriodically(ctx, &wg) + wg.Add(1) + go client.WithdrawAndStakeEarnedRewardsPeriodically(ctx, &wg) wg.Wait() } diff --git a/daemons/reporter/client/reporter_monitors.go b/daemons/reporter/client/reporter_monitors.go index 723727c53..1d7aaac3f 100644 --- a/daemons/reporter/client/reporter_monitors.go +++ b/daemons/reporter/client/reporter_monitors.go @@ -6,12 +6,14 @@ import ( "fmt" "os" "runtime" + "strconv" "strings" "sync" "time" "github.com/shirou/gopsutil/v3/process" oracletypes "github.com/tellor-io/layer/x/oracle/types" + reportertypes "github.com/tellor-io/layer/x/reporter/types" "github.com/cosmos/cosmos-sdk/types/query" ) @@ -164,34 +166,34 @@ func (c *Client) MonitorForTippedQueries(ctx context.Context, wg *sync.WaitGroup } } -// func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context, wg *sync.WaitGroup) { -// freqVar := os.Getenv("WITHDRAW_FREQUENCY") -// if freqVar == "" { -// freqVar = "43200" // default to being 12 hours or 43200 seconds -// } -// frequency, err := strconv.Atoi(freqVar) -// if err != nil { -// c.logger.Error("Could not start auto rewards withdrawal process due to incorrect parameter. Please enter the number of seconds to wait in between claiming rewards") -// return -// } - -// for { -// valAddr := os.Getenv("REPORTERS_VALIDATOR_ADDRESS") -// if valAddr == "" { -// fmt.Println("Returning from Withdraw Monitor due to no validator address env variable was found") -// time.Sleep(time.Duration(frequency) * time.Second) -// continue -// } - -// withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ -// SelectorAddress: c.accAddr.String(), -// ValidatorAddress: valAddr, -// } -// c.txChan <- TxChannelInfo{Msg: withdrawMsg, isBridge: false, NumRetries: 0} - -// time.Sleep(time.Duration(frequency) * time.Second) -// } -// } +func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context, wg *sync.WaitGroup) { + freqVar := os.Getenv("WITHDRAW_FREQUENCY") + if freqVar == "" { + freqVar = "43200" // default to being 12 hours or 43200 seconds + } + frequency, err := strconv.Atoi(freqVar) + if err != nil { + c.logger.Error("Could not start auto rewards withdrawal process due to incorrect parameter. Please enter the number of seconds to wait in between claiming rewards") + return + } + + for { + valAddr := os.Getenv("REPORTERS_VALIDATOR_ADDRESS") + if valAddr == "" { + fmt.Println("Returning from Withdraw Monitor due to no validator address env variable was found") + time.Sleep(time.Duration(frequency) * time.Second) + continue + } + + withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ + SelectorAddress: c.accAddr.String(), + ValidatorAddress: valAddr, + } + c.txChan <- TxChannelInfo{Msg: withdrawMsg, isBridge: false, NumRetries: 0} + + time.Sleep(time.Duration(frequency) * time.Second) + } +} func (c *Client) LogProcessStats() { count := runtime.NumGoroutine() From bff93b9eea7f041766242c99356f6220304887f5 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Fri, 17 Jan 2025 10:02:45 -0600 Subject: [PATCH 08/16] addressed some of the linting issues --- daemons/reporter/client/broadcast_message.go | 5 ++++- scripts/spam-reports.go | 16 +++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/daemons/reporter/client/broadcast_message.go b/daemons/reporter/client/broadcast_message.go index d3e1f922a..b65efe763 100644 --- a/daemons/reporter/client/broadcast_message.go +++ b/daemons/reporter/client/broadcast_message.go @@ -157,7 +157,10 @@ func (c *Client) BroadcastTxMsgToChain() { go func() { defer close(done) if !obj.isBridge { - c.sendTx(ctx, obj.Msg) + _, err := c.sendTx(ctx, obj.Msg) + if err != nil { + c.logger.Error(fmt.Sprintf("Error sending tx: %v", err)) + } } else { c.HandleBridgeDepositTxInChannel(ctx, obj) } diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index bd3974a2a..660fa079f 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -12,10 +12,12 @@ import ( oracletypes "github.com/tellor-io/layer/x/oracle/types" ) -var COMMAND_PATH = "/Users/caleb/layer/layerd" -var LAYER_PATH = "/Users/caleb/.layer" -var FAUCET_ADDRESS = "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp" -var VALIDATOR_ADDRESS = "tellorvaloper1ta78rra3a9sjr6n9ve7wjxft5n862ug73p75cg" // this can be any +var ( + COMMAND_PATH = "/Users/caleb/layer/layerd" + LAYER_PATH = "/Users/caleb/.layer" + FAUCET_ADDRESS = "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp" + VALIDATOR_ADDRESS = "tellorvaloper1ta78rra3a9sjr6n9ve7wjxft5n862ug73p75cg" // this can be any +) var NUM_OF_REPORTERS = 200 @@ -45,7 +47,6 @@ func main() { go SpamReportsWithReportersMap(reportersMap, querydata) prevQueryData = querydata } - } type CyclelistQueryResponse struct { @@ -78,6 +79,7 @@ func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string var wg sync.WaitGroup for reporter_name, info := range reportersMap { + reporterInfo := info wg.Add(1) ticket <- struct{}{} // would block if guard channel is already filled key_path := fmt.Sprintf("%s/%s", LAYER_PATH, reporter_name) @@ -91,7 +93,7 @@ func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string reporter_info.SequenceNum++ fmt.Println(string(output)) <-ticket - }(&info, key_path) + }(&reporterInfo, key_path) } wg.Wait() @@ -106,7 +108,7 @@ func CreateNewAccountsAndFundReporters(numOfReporters int) (map[string]ReporterI reporterMap := make(map[string]ReporterInfo, numOfReporters) for i := 1; i <= numOfReporters; i++ { key_name := fmt.Sprintf("test_reporter%d", i) - //key_path := fmt.Sprintf("%s/%s", LAYER_PATH, key_name) + // key_path := fmt.Sprintf("%s/%s", LAYER_PATH, key_name) // Create account for reporter // fmt.Println("Create keys") From f5dc6a514f245d65b5a843aec8b82baed727234e Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:52:57 -0600 Subject: [PATCH 09/16] Update spam-reports.go --- scripts/spam-reports.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index 660fa079f..df824073d 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -1,3 +1,5 @@ +//nolint:gosec + package main import ( From 0f0a1720e6e4cce719f9200aa3ab760ad3948291 Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:06:28 -0600 Subject: [PATCH 10/16] Update spam-reports.go --- scripts/spam-reports.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index df824073d..83d9b5846 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -1,4 +1,4 @@ -//nolint:gosec +//nolint package main From e72b6bb9308996bdbf67fa87bbe07decd293dfbd Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:13:36 -0600 Subject: [PATCH 11/16] Update spam-reports.go --- scripts/spam-reports.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index 83d9b5846..42ddfb218 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -1,4 +1,4 @@ -//nolint +//nolint:all package main From cb0f16c210cf750f212df9489c09ecc67e48462f Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:31:18 -0600 Subject: [PATCH 12/16] Update spam-reports.go --- scripts/spam-reports.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index 42ddfb218..e3972cbb0 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -1,5 +1,3 @@ -//nolint:all - package main import ( @@ -87,7 +85,7 @@ func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string key_path := fmt.Sprintf("%s/%s", LAYER_PATH, reporter_name) go func(reporter_info *ReporterInfo, path string) { defer wg.Done() - cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") + cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") //nolint:gosec output, err := cmd.CombinedOutput() if err != nil { fmt.Println("ERROR submitting value: ", err) @@ -178,7 +176,7 @@ func CreateNewAccountsAndFundReporters(numOfReporters int) (map[string]ReporterI } func GetAddressFromKeyName(key_name string) string { - cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) + cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) //nolint:gosec output, err := cmd.CombinedOutput() if err != nil { log.Fatalf("cmd.Run() failed: %v\n", err) From a180dd033fff540cb8794f9271a17e133c4b1580 Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:38:39 -0600 Subject: [PATCH 13/16] Update spam-reports.go --- scripts/spam-reports.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index e3972cbb0..bdaba1b71 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -85,7 +85,7 @@ func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string key_path := fmt.Sprintf("%s/%s", LAYER_PATH, reporter_name) go func(reporter_info *ReporterInfo, path string) { defer wg.Done() - cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") //nolint:gosec + cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") //nolint:gosec // this function has been tested manually output, err := cmd.CombinedOutput() if err != nil { fmt.Println("ERROR submitting value: ", err) @@ -176,7 +176,7 @@ func CreateNewAccountsAndFundReporters(numOfReporters int) (map[string]ReporterI } func GetAddressFromKeyName(key_name string) string { - cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) //nolint:gosec + cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) //nolint:gosec // has been tested manually output, err := cmd.CombinedOutput() if err != nil { log.Fatalf("cmd.Run() failed: %v\n", err) From 574f882431e385079d127a293121f10e11e341a5 Mon Sep 17 00:00:00 2001 From: CJPotter10 <91627020+CJPotter10@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:50:06 -0600 Subject: [PATCH 14/16] Update spam-reports.go --- scripts/spam-reports.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index bdaba1b71..355aade60 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -12,7 +12,8 @@ import ( oracletypes "github.com/tellor-io/layer/x/oracle/types" ) -var ( +// variables that describe your environment +const ( COMMAND_PATH = "/Users/caleb/layer/layerd" LAYER_PATH = "/Users/caleb/.layer" FAUCET_ADDRESS = "tellor19d90wqftqx34khmln36zjdswm9p2aqawq2t3vp" @@ -85,7 +86,7 @@ func SpamReportsWithReportersMap(reportersMap map[string]ReporterInfo, qd string key_path := fmt.Sprintf("%s/%s", LAYER_PATH, reporter_name) go func(reporter_info *ReporterInfo, path string) { defer wg.Done() - cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") //nolint:gosec // this function has been tested manually + cmd := exec.Command(COMMAND_PATH, "tx", "oracle", "submit-value", reporter_info.Address, qd, value, "--from", reporter_info.Address, "--chain-id", "layertest-2", "--fees", "10loya", "--keyring-backend", "test", "--keyring-dir", path, "--sequence", strconv.Itoa(reporter_info.SequenceNum), "--home", path, "--node", "http://54.234.103.186:26657", "--yes") //nolint:all // this function has been tested manually output, err := cmd.CombinedOutput() if err != nil { fmt.Println("ERROR submitting value: ", err) @@ -176,7 +177,7 @@ func CreateNewAccountsAndFundReporters(numOfReporters int) (map[string]ReporterI } func GetAddressFromKeyName(key_name string) string { - cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) //nolint:gosec // has been tested manually + cmd := exec.Command(COMMAND_PATH, "keys", "show", key_name, "-a", "--keyring-backend", "test", "--home", fmt.Sprintf("%s/%s", LAYER_PATH, key_name)) //nolint:all // has been tested manually output, err := cmd.CombinedOutput() if err != nil { log.Fatalf("cmd.Run() failed: %v\n", err) From c117bd2461427bde0b13fa6aa6a1c2a35a58a4d3 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Fri, 24 Jan 2025 13:00:34 -0600 Subject: [PATCH 15/16] last lint fix hopefully --- scripts/spam-reports.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spam-reports.go b/scripts/spam-reports.go index 355aade60..49e842dce 100644 --- a/scripts/spam-reports.go +++ b/scripts/spam-reports.go @@ -12,7 +12,7 @@ import ( oracletypes "github.com/tellor-io/layer/x/oracle/types" ) -// variables that describe your environment +// variables that describe your environment const ( COMMAND_PATH = "/Users/caleb/layer/layerd" LAYER_PATH = "/Users/caleb/.layer" From cb67af632f6706703b9b2fd66c46671a131ee0d5 Mon Sep 17 00:00:00 2001 From: Cjpotter10 Date: Tue, 28 Jan 2025 12:54:48 -0600 Subject: [PATCH 16/16] removed use of MsgWithdrawTipLegacy --- daemons/reporter/client/reporter_monitors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemons/reporter/client/reporter_monitors.go b/daemons/reporter/client/reporter_monitors.go index e874d6510..794591735 100644 --- a/daemons/reporter/client/reporter_monitors.go +++ b/daemons/reporter/client/reporter_monitors.go @@ -199,7 +199,7 @@ func (c *Client) WithdrawAndStakeEarnedRewardsPeriodically(ctx context.Context, continue } - withdrawMsg := &reportertypes.MsgWithdrawTipLegacy{ + withdrawMsg := &reportertypes.MsgWithdrawTip{ SelectorAddress: c.accAddr.String(), ValidatorAddress: valAddr, }