Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include transfer ID in deposit logs #1220

Merged
merged 9 commits into from
Jan 18, 2022
Merged

fix: include transfer ID in deposit logs #1220

merged 9 commits into from
Jan 18, 2022

Conversation

milapsheth
Copy link
Member

Description

Todos

  • Unit tests
  • Manual tests
  • Documentation
  • Connect epics/issues
  • Tag type of change

Steps to Test

Expected Behaviour

Other Notes

@haiyizxx haiyizxx self-requested a review January 16, 2022 03:30
@@ -1459,7 +1462,7 @@ func (s msgServer) SignCommands(c context.Context, req *types.SignCommandsReques

commandList := types.CommandIDsToStrings(commandBatch.GetCommandIDs())
for _, commandID := range commandList {
s.Logger(ctx).Debug("signing command batch", "commandBatchID", batchedCommandsIDHex, "commandID", commandID)
s.Logger(ctx).Debug("signing command %s in batch %s", commandID, batchedCommandsIDHex)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why take out from attribute?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For almost everything else we put the info in the log message so it's easy to search it. e.g. put a command batch hex in search query, and all corresponding logs show up. Makes it much easier to debug instead of searching by message in some places and by attributes in others. Also, easy to glance at the logs whereas you have to open each one to see the attribute.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can search use facet though?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like using attributes should be the way to go, perhaps gradually, but feel free to ignore if you disagree. Getting used to using attributes, we may find it easier to work with cosmos sdk's logging when needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree we should be using facets but given that we pay per new line character is there a downside to including information in the message content? It makes cross-referencing IDs between services much easier.

But data like this should always at minimum be in the attributes, not exclusively in the message content.

Using facets effectively requires us to have

  1. comprehensive set of query templates including the facet names (no one can remember them all)
  2. consistent attribute keys (facet names)

We don't have either at this stage - we need to do a log audit imo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, logs should be reworked properly at some point, so we have consistency for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haiyizxx
Copy link
Contributor

haiyizxx commented Jan 16, 2022

request change because I approved earlier 😄

@haiyizxx
Copy link
Contributor

and edit the pr title pls

Co-authored-by: haiyizxx <haiyi@axelar.network>
@milapsheth milapsheth changed the title fix: include transfer ID in event fix: include transfer ID in deposit logs Jan 18, 2022
@milapsheth
Copy link
Member Author

  • Logging every missed block is unnecessary and will cost us on datadog (we already log why validators are excluded from snapshots)
  • Logging arbitrary bytes as string is not nice
  • Debug logging causes panic due to tendermint, so I promoted deposit confirmation logs to Info for dashboard integration (otherwise the node will panic often as while trying to rely on parsing logs)

@milapsheth milapsheth merged commit 2e760fe into main Jan 18, 2022
@milapsheth milapsheth deleted the transfer-id branch January 18, 2022 10:03
@@ -348,7 +347,7 @@ func (k Keeper) GetAvailableOperators(ctx sdk.Context, keyIDs ...exported.KeyID)
}

if !k.operatorHasKeys(ctx, address, keyIDs...) {
k.Logger(ctx).Debug(fmt.Sprintf("excluding validator %s due absent keys", validator))
k.Logger(ctx).Debug(fmt.Sprintf("excluding validator %s due to absent keys", validator))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't want to make this info level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info/Debug is not particularly useful rn unless we need to show on dashboard. Logging needs to be revisited in general.

fish-sammy pushed a commit that referenced this pull request Jan 18, 2022
* fix: include transfer ID in event

* add command id to deposit confirmation

* add comment

* revert bug fix to make log changes consenssus compatible

* fix issue

* update more logs

* Update x/evm/keeper/msg_server.go

Co-authored-by: haiyizxx <haiyi@axelar.network>

* fixed some logs and made some info level

Co-authored-by: haiyizxx <haiyi@axelar.network>
fish-sammy added a commit that referenced this pull request Jan 18, 2022
* fix: include transfer ID in event

* add command id to deposit confirmation

* add comment

* revert bug fix to make log changes consenssus compatible

* fix issue

* update more logs

* Update x/evm/keeper/msg_server.go

Co-authored-by: haiyizxx <haiyi@axelar.network>

* fixed some logs and made some info level

Co-authored-by: haiyizxx <haiyi@axelar.network>

Co-authored-by: Milap Sheth <milap@axelar.network>
Co-authored-by: haiyizxx <haiyi@axelar.network>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants