Skip to content

Commit

Permalink
refactor(staking): 😊 tracing telemetry for set_delegation_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cratelyn committed Mar 12, 2024
1 parent 013e315 commit 1d3cb98
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/core/component/stake/src/component/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,19 @@ pub trait RateDataWrite: StateWrite {
);
}

#[tracing::instrument(
level = "trace",
skip_all,
fields(
%height,
delegations = ?changes.delegations,
undelegations = ?changes.undelegations,
)
)]
async fn set_delegation_changes(&mut self, height: block::Height, changes: DelegationChanges) {
self.put(
state_key::chain::delegation_changes::by_height(height.value()),
changes,
);
let key = state_key::chain::delegation_changes::by_height(height.value());
tracing::trace!(%key, "setting delegation changes");
self.put(key, changes);
}
}

Expand Down

0 comments on commit 1d3cb98

Please sign in to comment.