-
Notifications
You must be signed in to change notification settings - Fork 149
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
add provider and consumer logging #628
Conversation
6b7952f
to
442f2e3
Compare
f9c3578
to
dfb052e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locations of logging look great, thanks for this! I've added some comments on the strings being logged
@@ -499,7 +499,7 @@ gas_multiplier = 1.1 | |||
grpc_addr = "%s" | |||
id = "%s" | |||
key_name = "%s" | |||
max_gas = 2000000 | |||
max_gas = 20000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change have to do with logging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason integration tests were failing after I added logging on my local machine, this seemed to have fixed it.
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
Co-authored-by: Shawn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM1
@@ -102,6 +115,8 @@ func (k Keeper) QueueVSCMaturedPackets(ctx sdk.Context) { | |||
|
|||
k.DeletePacketMaturityTimes(ctx, maturityTime.VscId, maturityTime.MaturityTime) | |||
|
|||
k.Logger(ctx).Info("VSCMaturedPacket enqueued", "vscID", vscPacket.ValsetUpdateId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k.Logger(ctx).Info("VSCMaturedPacket enqueued", "vscID", vscPacket.ValsetUpdateId) | |
k.Logger(ctx).Debug("VSCMaturedPacket enqueued", "vscID", vscPacket.ValsetUpdateId) |
(Packet enqueue is implementation detail, the info parts are when you send a packet IMO)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sending the packet is logged by the IBC module. Queueing the packet is important as that should result in an IBC send. Also, it's the only place where we can log the data without having to unmarshal it in SendPackets
k.Logger(ctx).Debug("unbonding operation matured on consumer", "chainID", chainID, "opID", unbondingOp.Id) | ||
|
||
// If unbonding op is completely unbonded from all relevant consumer chains | ||
if len(unbondingOp.UnbondingConsumerChains) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps only log the case when len(unbondingOp.UnbondingConsumerChains) == 0
, it might be too noisy otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's debug, it's okay to be noisy :)
Co-authored-by: Daniel T <[email protected]>
Co-authored-by: Daniel T <[email protected]>
…ty into 576-add-logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry if these comments seem nitpicky :), there's just been a lot of times I've said to myself, damn I wish I logged that better
|
||
k.Logger(ctx).Info("sent block rewards to provider", | ||
"fee pool", fpTokens.String(), | ||
"sent", remainingTokens.String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the sent
field here similar to remaining tokens in fee pool
? If so the latter is prob more descriptive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sent
is the amount actually transferred. I've replaced remainingTokens
with tstProviderTokens
.
@@ -85,6 +85,11 @@ func (k Keeper) DistributeToProviderValidatorSet(ctx sdk.Context) error { | |||
return err | |||
} | |||
} | |||
|
|||
k.Logger(ctx).Info("sent block rewards to provider", | |||
"fee pool", fpTokens.String(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this field is fee pool before being decremented
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Replaced with "total fee pool"
x/ccv/provider/keeper/relay.go
Outdated
@@ -127,12 +147,14 @@ func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Pac | |||
func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error { | |||
chainID, found := k.GetChannelToChain(ctx, packet.SourceChannel) | |||
if !found { | |||
k.Logger(ctx).Error("packet timeout, unknown channel:", "channel", packet.SourceChannel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -250,10 +281,20 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d | |||
if !found { | |||
// SlashPacket packet was sent on a channel different than any of the established CCV channels; | |||
// this should never happen | |||
k.Logger(ctx).Error("SlashPacket received on unknown channel", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, could log src channel ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
make test passes on my machine |
Description
Add logging to provider and consumer.
This is a continuation of efforts in #577.
Linked issues
Closes: #576
Type of change
Feature
: Changes and/or adds code behavior, irrelevant to bug fixes