From d4eca52d616148d5a168cb0786131dab579edadc Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Mon, 1 Jul 2024 13:07:00 -0700 Subject: [PATCH] rm accidental file --- packages/relayer/processor/retry_single.go | 81 ---------------------- 1 file changed, 81 deletions(-) delete mode 100644 packages/relayer/processor/retry_single.go diff --git a/packages/relayer/processor/retry_single.go b/packages/relayer/processor/retry_single.go deleted file mode 100644 index 1a4d0ba52f..0000000000 --- a/packages/relayer/processor/retry_single.go +++ /dev/null @@ -1,81 +0,0 @@ -package processor - -import ( - "context" - "encoding/hex" - "log/slog" - "strings" - - "github.com/ethereum-optimism/optimism/op-service/txmgr" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - - "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/bindings/bridge" - "github.com/taikoxyz/taiko-mono/packages/relayer/pkg/encoding" -) - -// retrySingle is used to retry a single message, when we are -// targeting a specific message via config flag -func (p *Processor) retrySingle(ctx context.Context) error { - slog.Info("retrying single", "txHash", common.Hash(*p.targetTxHash).Hex()) - - bridgeAbi, err := abi.JSON(strings.NewReader(bridge.BridgeABI)) - if err != nil { - return err - } - - receipt, err := p.srcEthClient.TransactionReceipt(ctx, *p.targetTxHash) - if err != nil { - return err - } - - for _, log := range receipt.Logs { - topic := log.Topics[0] - - if topic == bridgeAbi.Events["MessageSent"].ID { - event, err := p.destBridge.ParseMessageSent(*log) - if err != nil { - return err - } - - data, err := encoding.BridgeABI.Pack("retryMessage", event.Message, false) - if err != nil { - return err - } - - gasLimit := uint64(float64(event.Message.GasLimit) * 3) - - candidate := txmgr.TxCandidate{ - TxData: data, - Blobs: nil, - To: &p.cfg.DestBridgeAddress, - GasLimit: gasLimit, - } - - receipt, err := p.txmgr.Send(ctx, candidate) - if err != nil { - slog.Warn("Failed to send ProcessMessage transaction", "error", err.Error()) - return err - } - - slog.Info("Mined tx", - "txHash", hex.EncodeToString(receipt.TxHash.Bytes()), - "srcTxHash", event.Raw.TxHash.Hex(), - ) - - if receipt.Status != types.ReceiptStatusSuccessful { - relayer.MessageSentEventsProcessedReverted.Inc() - slog.Warn("Transaction reverted", "txHash", hex.EncodeToString(receipt.TxHash.Bytes()), - "srcTxHash", event.Raw.TxHash.Hex(), - "status", receipt.Status) - - return errTxReverted - } - - } - } - - return nil -}