Skip to content

Commit

Permalink
imp: improve Logger performance (#1160)
Browse files Browse the repository at this point in the history
* fix: Logger marshal errors

* changelog

* update

(cherry picked from commit ffa9896)

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
fedekunze authored and mergify[bot] committed May 16, 2022
1 parent 98cfc7a commit 2281949
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,32 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Dependencies

<<<<<<< HEAD
* [\#1268](https://github.com/cosmos/ibc-go/pull/1268) Bump SDK version to v0.44.8 and Tendermint to version 0.34.19
=======
### API Breaking

### State Machine Breaking

### Improvements

* (modules/core/04-channel) [\#1160](https://github.com/cosmos/ibc-go/pull/1160) Improve `uint64 -> string` performance in `Logger`.

### Features

### Bug Fixes

* (modules/core/04-channel) [\#1130](https://github.com/cosmos/ibc-go/pull/1130) Call `packet.GetSequence()` rather than passing func in `WriteAcknowledgement` log output

## [v3.0.0](https://github.com/cosmos/ibc-go/releases/tag/v3.0.0) - 2022-03-15

### Dependencies

* [\#404](https://github.com/cosmos/ibc-go/pull/404) Bump Go version to 1.17
* [\#851](https://github.com/cosmos/ibc-go/pull/851) Bump SDK version to v0.45.1
* [\#948](https://github.com/cosmos/ibc-go/pull/948) Bump ics23/go to v0.7
* (core) [\#709](https://github.com/cosmos/ibc-go/pull/709) Replace github.com/pkg/errors with stdlib errors
>>>>>>> ffa9896 (imp: improve Logger performance (#1160))
### API Breaking

Expand Down
7 changes: 4 additions & 3 deletions modules/core/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"bytes"
"strconv"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -128,7 +129,7 @@ func (k Keeper) SendPacket(

k.Logger(ctx).Info(
"packet sent",
"sequence", packet.GetSequence(),
"sequence", strconv.FormatUint(packet.GetSequence(), 10),
"src_port", packet.GetSourcePort(),
"src_channel", packet.GetSourceChannel(),
"dst_port", packet.GetDestPort(),
Expand Down Expand Up @@ -283,7 +284,7 @@ func (k Keeper) RecvPacket(
// log that a packet has been received & executed
k.Logger(ctx).Info(
"packet received",
"sequence", packet.GetSequence(),
"sequence", strconv.FormatUint(packet.GetSequence(), 10),
"src_port", packet.GetSourcePort(),
"src_channel", packet.GetSourceChannel(),
"dst_port", packet.GetDestPort(),
Expand Down Expand Up @@ -488,7 +489,7 @@ func (k Keeper) AcknowledgePacket(
// log that a packet has been acknowledged
k.Logger(ctx).Info(
"packet acknowledged",
"sequence", packet.GetSequence(),
"sequence", strconv.FormatUint(packet.GetSequence(), 10),
"src_port", packet.GetSourcePort(),
"src_channel", packet.GetSourceChannel(),
"dst_port", packet.GetDestPort(),
Expand Down
3 changes: 2 additions & 1 deletion modules/core/04-channel/keeper/timeout.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package keeper

import (
"bytes"
"strconv"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -158,7 +159,7 @@ func (k Keeper) TimeoutExecuted(

k.Logger(ctx).Info(
"packet timed-out",
"sequence", packet.GetSequence(),
"sequence", strconv.FormatUint(packet.GetSequence(), 10),
"src_port", packet.GetSourcePort(),
"src_channel", packet.GetSourceChannel(),
"dst_port", packet.GetDestPort(),
Expand Down

0 comments on commit 2281949

Please sign in to comment.