From 1d3cb9846437c3b8f7d1d9211d1a6e4cf0724773 Mon Sep 17 00:00:00 2001 From: katelyn martin Date: Tue, 12 Mar 2024 13:20:04 -0400 Subject: [PATCH] =?UTF-8?q?refactor(staking):=20=F0=9F=98=8A=20tracing=20t?= =?UTF-8?q?elemetry=20for=20`set=5Fdelegation=5Fchanges`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/component/stake/src/component/stake.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/core/component/stake/src/component/stake.rs b/crates/core/component/stake/src/component/stake.rs index de4d5d97f3..7b9e317e06 100644 --- a/crates/core/component/stake/src/component/stake.rs +++ b/crates/core/component/stake/src/component/stake.rs @@ -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); } }