From 515234748966afade5d80a1495729b0edb58f98b Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Thu, 23 May 2024 09:10:11 +0900 Subject: [PATCH 1/6] improve logging at SendMsgs and GetMsgResult Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/log.go | 14 +++++ pkg/relay/ethereum/tx.go | 106 +++++++++++++++++++++++++++++++++----- 2 files changed, 106 insertions(+), 14 deletions(-) create mode 100644 pkg/relay/ethereum/log.go diff --git a/pkg/relay/ethereum/log.go b/pkg/relay/ethereum/log.go new file mode 100644 index 0000000..df397b0 --- /dev/null +++ b/pkg/relay/ethereum/log.go @@ -0,0 +1,14 @@ +package ethereum + +const ( + logAttrMsgIndex = "msg_index" + logAttrRevertReason = "revert_reason" + logAttrRawErrorData = "raw_error_data" + logAttrRawTxData = "raw_tx_data" + logAttrTxHash = "tx_hash" + logAttrBlockHash = "block_hash" + logAttrBlockNumber = "block_number" + logAttrTxIndex = "tx_index" + logAttrEstimatedGas = "estimated_gas" + logAttrMaxGasLimit = "max_gas_limit" +) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index 0e67ceb..1639033 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -48,49 +48,121 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { opts.NoSend = true tx, err = c.SendTx(opts, msg, skipUpdateClientCommitment) if err != nil { - logger.Error("failed to send msg / NoSend: true", err, "msg_index", i) + logger.Error("failed to build tx for gas estimation", err, logAttrMsgIndex, i) return nil, err } + var rawTxData string + if bz, err := tx.MarshalBinary(); err != nil { + logger.Error("failed to encode tx", err, logAttrMsgIndex, i) + } else { + rawTxData = hex.EncodeToString(bz) + } estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx) if err != nil { - revertReason, rawErrorData, err2 := c.getRevertReasonFromEstimateGas(err) - if err2 != nil { - logger.Error("failed to get revert reason", err2, "msg_index", i) + var revertReason, rawErrorData string + if reason, data, err := c.getRevertReasonFromEstimateGas(err); err != nil { + logger.Error("failed to get revert reason", err, + logAttrMsgIndex, i, + logAttrRawTxData, rawTxData, + ) + } else { + revertReason = reason + rawErrorData = hex.EncodeToString(data) } - logger.Error("failed to estimate gas", err, "revert_reason", revertReason, "raw_error_data", hex.EncodeToString(rawErrorData), "msg_index", i) + logger.Error("failed to estimate gas", err, + logAttrRevertReason, revertReason, + logAttrRawErrorData, rawErrorData, + logAttrMsgIndex, i, + logAttrRawTxData, rawTxData, + ) return nil, err } txGasLimit := estimatedGas * c.Config().GasEstimateRate.Numerator / c.Config().GasEstimateRate.Denominator if txGasLimit > c.Config().MaxGasLimit { - logger.Warn("estimated gas exceeds max gas limit", "estimated_gas", txGasLimit, "max_gas_limit", c.Config().MaxGasLimit, "msg_index", i) + logger.Warn("estimated gas exceeds max gas limit", + logAttrEstimatedGas, txGasLimit, + logAttrMaxGasLimit, c.Config().MaxGasLimit, + logAttrMsgIndex, i, + logAttrRawTxData, rawTxData, + ) txGasLimit = c.Config().MaxGasLimit } opts.GasLimit = txGasLimit opts.NoSend = false tx, err = c.SendTx(opts, msg, skipUpdateClientCommitment) + if bz, err := tx.MarshalBinary(); err != nil { + logger.Error("failed to encode tx", err, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + ) + } else { + rawTxData = hex.EncodeToString(bz) + } if err != nil { - logger.Error("failed to send msg / NoSend: false", err, "msg_index", i) + logger.Error("failed to send msg", err, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + ) return nil, err } receipt, err := c.client.WaitForReceiptAndGet(ctx, tx.Hash()) if err != nil { - logger.Error("failed to get receipt", err, "msg_index", i, "tx_hash", tx.Hash()) + logger.Error("failed to get receipt", err, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + ) return nil, err } if receipt.Status == gethtypes.ReceiptStatusFailed { - revertReason, rawErrorData, err2 := c.getRevertReasonFromReceipt(ctx, receipt) - if err2 != nil { - logger.Error("failed to get revert reason", err2, "msg_index", i, "tx_hash", tx.Hash()) + var revertReason, rawErrorData string + if reason, data, err := c.getRevertReasonFromReceipt(ctx, receipt); err != nil { + logger.Error("failed to get revert reason", err, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + logAttrBlockHash, receipt.BlockHash.Hex(), + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) + } else { + revertReason = reason + rawErrorData = hex.EncodeToString(data) } err := fmt.Errorf("tx execution reverted: revertReason=%s, rawErrorData=%x, msgIndex=%d, txHash=%s", revertReason, rawErrorData, i, tx.Hash()) - logger.Error("tx execution reverted", err, "revert_reason", revertReason, "raw_error_data", hex.EncodeToString(rawErrorData), "msg_index", i, "tx_hash", tx.Hash()) + logger.Error("tx execution reverted", err, + logAttrRevertReason, revertReason, + logAttrRawErrorData, rawErrorData, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + logAttrBlockHash, receipt.BlockHash.Hex(), + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) return nil, err } + logger.Info("successfully sent tx", + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + logAttrBlockHash, receipt.BlockHash.Hex(), + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) if c.msgEventListener != nil { if err := c.msgEventListener.OnSentMsg([]sdk.Msg{msg}); err != nil { - logger.Error("failed to OnSendMsg call", err, "msg_index", i, "tx_hash", tx.Hash()) + logger.Error("failed to OnSendMsg call", err, + logAttrMsgIndex, i, + logAttrTxHash, tx.Hash(), + logAttrRawTxData, rawTxData, + logAttrBlockHash, receipt.BlockHash.Hex(), + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) } } msgIDs = append(msgIDs, NewMsgID(tx.Hash())) @@ -116,7 +188,13 @@ func (c *Chain) GetMsgResult(id core.MsgID) (core.MsgResult, error) { } revertReason, rawErrorData, err := c.getRevertReasonFromReceipt(ctx, receipt) if err != nil { - logger.Error("failed to get revert reason", err, "raw_error_data", hex.EncodeToString(rawErrorData), "tx_hash", msgID.TxHashHex) + logger.Error("failed to get revert reason", err, + logAttrRawErrorData, hex.EncodeToString(rawErrorData), + logAttrTxHash, msgID.TxHashHex, + logAttrBlockHash, receipt.BlockHash.Hex(), + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) } return c.makeMsgResultFromReceipt(&receipt.Receipt, revertReason) } From f0ac44f10c48971e21a63b10ecfa2e02ea2f268a Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Thu, 23 May 2024 11:24:04 +0900 Subject: [PATCH 2/6] output raw error data in error logs even if revert reason isn't available Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/tx.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index 1639033..b443a2c 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -61,7 +61,10 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { if err != nil { var revertReason, rawErrorData string if reason, data, err := c.getRevertReasonFromEstimateGas(err); err != nil { + // Raw error data may be available even if revert reason isn't available. + rawErrorData = hex.EncodeToString(data) logger.Error("failed to get revert reason", err, + logAttrRawErrorData, rawErrorData, logAttrMsgIndex, i, logAttrRawTxData, rawTxData, ) @@ -119,7 +122,10 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { if receipt.Status == gethtypes.ReceiptStatusFailed { var revertReason, rawErrorData string if reason, data, err := c.getRevertReasonFromReceipt(ctx, receipt); err != nil { + // Raw error data may be available even if revert reason isn't available. + rawErrorData = hex.EncodeToString(data) logger.Error("failed to get revert reason", err, + logAttrRawErrorData, rawErrorData, logAttrMsgIndex, i, logAttrTxHash, tx.Hash(), logAttrRawTxData, rawTxData, From 5178fa5a702cbd011e83c4f56bda378cd71db8c7 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Thu, 23 May 2024 14:01:51 +0900 Subject: [PATCH 3/6] marshal tx for logging only when SendTx succeeds Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/tx.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index b443a2c..955529a 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -94,6 +94,10 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { opts.GasLimit = txGasLimit opts.NoSend = false tx, err = c.SendTx(opts, msg, skipUpdateClientCommitment) + if err != nil { + logger.Error("failed to send msg", err, logAttrMsgIndex, i) + return nil, err + } if bz, err := tx.MarshalBinary(); err != nil { logger.Error("failed to encode tx", err, logAttrMsgIndex, i, @@ -102,14 +106,6 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { } else { rawTxData = hex.EncodeToString(bz) } - if err != nil { - logger.Error("failed to send msg", err, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - ) - return nil, err - } receipt, err := c.client.WaitForReceiptAndGet(ctx, tx.Hash()) if err != nil { logger.Error("failed to get receipt", err, From 744dcb99351a6143a8644c88e626ba755f321f08 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Fri, 24 May 2024 13:53:30 +0900 Subject: [PATCH 4/6] use slog.Logger.With for cleaning up logging code in SendMsgs Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/tx.go | 155 +++++++++++++++++---------------------- 1 file changed, 67 insertions(+), 88 deletions(-) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index 955529a..f9b4ea6 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -36,85 +36,90 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { logger := c.GetChainLogger() var msgIDs []core.MsgID for i, msg := range msgs { - var ( - tx *gethtypes.Transaction - err error - ) + logger := &log.RelayLogger{Logger: logger.With(logAttrMsgIndex, i)} + opts, err := c.TxOpts(ctx) if err != nil { return nil, err } - opts.GasLimit = math.MaxUint64 - opts.NoSend = true - tx, err = c.SendTx(opts, msg, skipUpdateClientCommitment) - if err != nil { - logger.Error("failed to build tx for gas estimation", err, logAttrMsgIndex, i) - return nil, err - } - var rawTxData string - if bz, err := tx.MarshalBinary(); err != nil { - logger.Error("failed to encode tx", err, logAttrMsgIndex, i) - } else { - rawTxData = hex.EncodeToString(bz) - } - estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx) - if err != nil { - var revertReason, rawErrorData string - if reason, data, err := c.getRevertReasonFromEstimateGas(err); err != nil { - // Raw error data may be available even if revert reason isn't available. - rawErrorData = hex.EncodeToString(data) - logger.Error("failed to get revert reason", err, + + // gas estimation + { + logger := &log.RelayLogger{Logger: logger.Logger} + + opts.GasLimit = math.MaxUint64 + opts.NoSend = true + tx, err := c.SendTx(opts, msg, skipUpdateClientCommitment) + if err != nil { + logger.Error("failed to build tx for gas estimation", err) + return nil, err + } + + if rawTxData, err := tx.MarshalBinary(); err != nil { + logger.Error("failed to encode tx", err) + } else { + logger.Logger = logger.With(logAttrRawTxData, hex.EncodeToString(rawTxData)) + } + + estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx) + if err != nil { + var revertReason, rawErrorData string + if reason, data, err := c.getRevertReasonFromEstimateGas(err); err != nil { + // Raw error data may be available even if revert reason isn't available. + rawErrorData = hex.EncodeToString(data) + logger.Error("failed to get revert reason", err, + logAttrRawErrorData, rawErrorData, + ) + } else { + revertReason = reason + rawErrorData = hex.EncodeToString(data) + } + + logger.Error("failed to estimate gas", err, + logAttrRevertReason, revertReason, logAttrRawErrorData, rawErrorData, - logAttrMsgIndex, i, - logAttrRawTxData, rawTxData, ) - } else { - revertReason = reason - rawErrorData = hex.EncodeToString(data) + return nil, err } - logger.Error("failed to estimate gas", err, - logAttrRevertReason, revertReason, - logAttrRawErrorData, rawErrorData, - logAttrMsgIndex, i, - logAttrRawTxData, rawTxData, - ) - return nil, err - } - txGasLimit := estimatedGas * c.Config().GasEstimateRate.Numerator / c.Config().GasEstimateRate.Denominator - if txGasLimit > c.Config().MaxGasLimit { - logger.Warn("estimated gas exceeds max gas limit", - logAttrEstimatedGas, txGasLimit, - logAttrMaxGasLimit, c.Config().MaxGasLimit, - logAttrMsgIndex, i, - logAttrRawTxData, rawTxData, - ) - txGasLimit = c.Config().MaxGasLimit + txGasLimit := estimatedGas * c.Config().GasEstimateRate.Numerator / c.Config().GasEstimateRate.Denominator + if txGasLimit > c.Config().MaxGasLimit { + logger.Warn("estimated gas exceeds max gas limit", + logAttrEstimatedGas, txGasLimit, + logAttrMaxGasLimit, c.Config().MaxGasLimit, + ) + txGasLimit = c.Config().MaxGasLimit + } + opts.GasLimit = txGasLimit } - opts.GasLimit = txGasLimit + opts.NoSend = false - tx, err = c.SendTx(opts, msg, skipUpdateClientCommitment) + tx, err := c.SendTx(opts, msg, skipUpdateClientCommitment) if err != nil { - logger.Error("failed to send msg", err, logAttrMsgIndex, i) + logger.Error("failed to send msg", err) return nil, err + } else { + logger.Logger = logger.With(logAttrTxHash, tx.Hash()) } - if bz, err := tx.MarshalBinary(); err != nil { - logger.Error("failed to encode tx", err, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - ) + + if rawTxData, err := tx.MarshalBinary(); err != nil { + logger.Error("failed to encode tx", err) } else { - rawTxData = hex.EncodeToString(bz) + logger.Logger = logger.With(logAttrRawTxData, hex.EncodeToString(rawTxData)) } + receipt, err := c.client.WaitForReceiptAndGet(ctx, tx.Hash()) if err != nil { - logger.Error("failed to get receipt", err, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - ) + logger.Error("failed to get receipt", err) return nil, err + } else { + logger.Logger = logger.With( + logAttrBlockHash, receipt.BlockHash, + logAttrBlockNumber, receipt.BlockNumber.Uint64(), + logAttrTxIndex, receipt.TransactionIndex, + ) } + if receipt.Status == gethtypes.ReceiptStatusFailed { var revertReason, rawErrorData string if reason, data, err := c.getRevertReasonFromReceipt(ctx, receipt); err != nil { @@ -122,12 +127,6 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { rawErrorData = hex.EncodeToString(data) logger.Error("failed to get revert reason", err, logAttrRawErrorData, rawErrorData, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - logAttrBlockHash, receipt.BlockHash.Hex(), - logAttrBlockNumber, receipt.BlockNumber.Uint64(), - logAttrTxIndex, receipt.TransactionIndex, ) } else { revertReason = reason @@ -138,33 +137,13 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { logger.Error("tx execution reverted", err, logAttrRevertReason, revertReason, logAttrRawErrorData, rawErrorData, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - logAttrBlockHash, receipt.BlockHash.Hex(), - logAttrBlockNumber, receipt.BlockNumber.Uint64(), - logAttrTxIndex, receipt.TransactionIndex, ) return nil, err } - logger.Info("successfully sent tx", - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - logAttrBlockHash, receipt.BlockHash.Hex(), - logAttrBlockNumber, receipt.BlockNumber.Uint64(), - logAttrTxIndex, receipt.TransactionIndex, - ) + logger.Info("successfully sent tx") if c.msgEventListener != nil { if err := c.msgEventListener.OnSentMsg([]sdk.Msg{msg}); err != nil { - logger.Error("failed to OnSendMsg call", err, - logAttrMsgIndex, i, - logAttrTxHash, tx.Hash(), - logAttrRawTxData, rawTxData, - logAttrBlockHash, receipt.BlockHash.Hex(), - logAttrBlockNumber, receipt.BlockNumber.Uint64(), - logAttrTxIndex, receipt.TransactionIndex, - ) + logger.Error("failed to OnSendMsg call", err) } } msgIDs = append(msgIDs, NewMsgID(tx.Hash())) From a30383b9f1c400d1ce8f94b868f9629564ede621 Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Fri, 24 May 2024 13:56:47 +0900 Subject: [PATCH 5/6] add "msg_type" log attribute in SendMsgs Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/log.go | 1 + pkg/relay/ethereum/tx.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/relay/ethereum/log.go b/pkg/relay/ethereum/log.go index df397b0..48e5bb5 100644 --- a/pkg/relay/ethereum/log.go +++ b/pkg/relay/ethereum/log.go @@ -2,6 +2,7 @@ package ethereum const ( logAttrMsgIndex = "msg_index" + logAttrMsgType = "msg_type" logAttrRevertReason = "revert_reason" logAttrRawErrorData = "raw_error_data" logAttrRawTxData = "raw_tx_data" diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index f9b4ea6..71d935f 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -36,7 +36,10 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { logger := c.GetChainLogger() var msgIDs []core.MsgID for i, msg := range msgs { - logger := &log.RelayLogger{Logger: logger.With(logAttrMsgIndex, i)} + logger := &log.RelayLogger{Logger: logger.With( + logAttrMsgIndex, i, + logAttrMsgType, fmt.Sprintf("%T", msg), + )} opts, err := c.TxOpts(ctx) if err != nil { From 71c6368e40d42d0a9969bb37c2441513710fbbec Mon Sep 17 00:00:00 2001 From: Masanori Yoshida Date: Mon, 27 May 2024 08:17:19 +0900 Subject: [PATCH 6/6] avoid outputing an empty string as "revert_reason" to error logs Signed-off-by: Masanori Yoshida --- pkg/relay/ethereum/tx.go | 42 ++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/pkg/relay/ethereum/tx.go b/pkg/relay/ethereum/tx.go index 71d935f..ffb58e2 100644 --- a/pkg/relay/ethereum/tx.go +++ b/pkg/relay/ethereum/tx.go @@ -66,22 +66,18 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { estimatedGas, err := c.client.EstimateGasFromTx(ctx, tx) if err != nil { - var revertReason, rawErrorData string - if reason, data, err := c.getRevertReasonFromEstimateGas(err); err != nil { + if revertReason, rawErrorData, err := c.getRevertReasonFromEstimateGas(err); err != nil { // Raw error data may be available even if revert reason isn't available. - rawErrorData = hex.EncodeToString(data) - logger.Error("failed to get revert reason", err, - logAttrRawErrorData, rawErrorData, - ) + logger.Logger = logger.With(logAttrRawErrorData, hex.EncodeToString(rawErrorData)) + logger.Error("failed to get revert reason", err) } else { - revertReason = reason - rawErrorData = hex.EncodeToString(data) + logger.Logger = logger.With( + logAttrRawErrorData, hex.EncodeToString(rawErrorData), + logAttrRevertReason, revertReason, + ) } - logger.Error("failed to estimate gas", err, - logAttrRevertReason, revertReason, - logAttrRawErrorData, rawErrorData, - ) + logger.Error("failed to estimate gas", err) return nil, err } @@ -124,23 +120,19 @@ func (c *Chain) SendMsgs(msgs []sdk.Msg) ([]core.MsgID, error) { } if receipt.Status == gethtypes.ReceiptStatusFailed { - var revertReason, rawErrorData string - if reason, data, err := c.getRevertReasonFromReceipt(ctx, receipt); err != nil { + if revertReason, rawErrorData, err := c.getRevertReasonFromReceipt(ctx, receipt); err != nil { // Raw error data may be available even if revert reason isn't available. - rawErrorData = hex.EncodeToString(data) - logger.Error("failed to get revert reason", err, - logAttrRawErrorData, rawErrorData, - ) + logger.Logger = logger.With(logAttrRawErrorData, hex.EncodeToString(rawErrorData)) + logger.Error("failed to get revert reason", err) } else { - revertReason = reason - rawErrorData = hex.EncodeToString(data) + logger.Logger = logger.With( + logAttrRawErrorData, hex.EncodeToString(rawErrorData), + logAttrRevertReason, revertReason, + ) } - err := fmt.Errorf("tx execution reverted: revertReason=%s, rawErrorData=%x, msgIndex=%d, txHash=%s", revertReason, rawErrorData, i, tx.Hash()) - logger.Error("tx execution reverted", err, - logAttrRevertReason, revertReason, - logAttrRawErrorData, rawErrorData, - ) + err := errors.New("tx execution reverted") + logger.Error("tx execution reverted", err) return nil, err } logger.Info("successfully sent tx")