diff --git a/crates/astria-sequencer/src/accounts/action.rs b/crates/astria-sequencer/src/accounts/action.rs index c4b7c036c..a36e9f2c5 100644 --- a/crates/astria-sequencer/src/accounts/action.rs +++ b/crates/astria-sequencer/src/accounts/action.rs @@ -105,13 +105,7 @@ impl ActionHandler for TransferAction { .context("stateful transfer check failed") } - #[instrument( - skip_all, - fields( - to = self.to.to_string(), - amount = self.amount, - ) - )] + #[instrument(skip_all)] async fn execute(&self, state: &mut S, from: Address) -> Result<()> { let fee = state .get_transfer_base_fee() diff --git a/crates/astria-sequencer/src/accounts/component.rs b/crates/astria-sequencer/src/accounts/component.rs index e52e81aab..870a5a381 100644 --- a/crates/astria-sequencer/src/accounts/component.rs +++ b/crates/astria-sequencer/src/accounts/component.rs @@ -23,7 +23,7 @@ pub(crate) struct AccountsComponent; impl Component for AccountsComponent { type AppState = astria_core::sequencer::GenesisState; - #[instrument(name = "AccountsComponent::init_chain", skip(state))] + #[instrument(name = "AccountsComponent::init_chain", skip_all)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> { let native_asset = get_native_asset(); for account in app_state.accounts() { @@ -38,7 +38,7 @@ impl Component for AccountsComponent { Ok(()) } - #[instrument(name = "AccountsComponent::begin_block", skip(_state))] + #[instrument(name = "AccountsComponent::begin_block", skip_all)] async fn begin_block( _state: &mut Arc, _begin_block: &BeginBlock, @@ -46,7 +46,7 @@ impl Component for AccountsComponent { Ok(()) } - #[instrument(name = "AccountsComponent::end_block", skip(_state))] + #[instrument(name = "AccountsComponent::end_block", skip_all)] async fn end_block( _state: &mut Arc, _end_block: &EndBlock, diff --git a/crates/astria-sequencer/src/accounts/state_ext.rs b/crates/astria-sequencer/src/accounts/state_ext.rs index bee8646ee..34fc7edad 100644 --- a/crates/astria-sequencer/src/accounts/state_ext.rs +++ b/crates/astria-sequencer/src/accounts/state_ext.rs @@ -65,7 +65,7 @@ fn nonce_storage_key(address: Address) -> String { #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip_all, fields(address=%address))] + #[instrument(skip_all)] async fn get_account_balances(&self, address: Address) -> Result> { use crate::asset::state_ext::StateReadExt as _; @@ -117,7 +117,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(balances) } - #[instrument(skip_all, fields(address=%address, %asset))] + #[instrument(skip_all)] async fn get_account_balance<'a, TAsset>(&self, address: Address, asset: TAsset) -> Result where TAsset: Into + std::fmt::Display + Send, @@ -133,7 +133,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(balance) } - #[instrument(skip_all, fields(address=%address))] + #[instrument(skip_all)] async fn get_account_nonce(&self, address: Address) -> Result { let bytes = self .get_raw(&nonce_storage_key(address)) @@ -167,7 +167,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] fn put_account_balance( &mut self, address: Address, @@ -182,14 +182,14 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_account_nonce(&mut self, address: Address, nonce: u32) -> Result<()> { let bytes = borsh::to_vec(&Nonce(nonce)).context("failed to serialize nonce")?; self.put_raw(nonce_storage_key(address), bytes); Ok(()) } - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] async fn increase_balance( &mut self, address: Address, @@ -215,7 +215,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] async fn decrease_balance( &mut self, address: Address, @@ -241,7 +241,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_transfer_base_fee(&mut self, fee: u128) -> Result<()> { let bytes = borsh::to_vec(&Fee(fee)).context("failed to serialize fee")?; self.put_raw(TRANSFER_BASE_FEE_STORAGE_KEY.to_string(), bytes); diff --git a/crates/astria-sequencer/src/address/state_ext.rs b/crates/astria-sequencer/src/address/state_ext.rs index 69c8efc8c..917e6ce42 100644 --- a/crates/astria-sequencer/src/address/state_ext.rs +++ b/crates/astria-sequencer/src/address/state_ext.rs @@ -16,7 +16,7 @@ fn base_prefix_key() -> &'static str { #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_base_prefix(&self) -> Result { let Some(bytes) = self .get_raw(base_prefix_key()) @@ -33,7 +33,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_base_prefix(&mut self, prefix: &str) { self.put_raw(base_prefix_key().into(), prefix.into()); } diff --git a/crates/astria-sequencer/src/app/mod.rs b/crates/astria-sequencer/src/app/mod.rs index 5ce65cd86..3946032df 100644 --- a/crates/astria-sequencer/src/app/mod.rs +++ b/crates/astria-sequencer/src/app/mod.rs @@ -59,6 +59,7 @@ use tracing::{ debug, info, instrument, + Instrument as _, }; use crate::{ @@ -984,21 +985,21 @@ impl App { } /// Executes a signed transaction. - #[instrument(name = "App::execute_transaction", skip_all, fields( - signed_transaction_hash = %telemetry::display::base64(&signed_tx.sha256_of_proto_encoding()), - sender_address_bytes = %telemetry::display::base64(&signed_tx.address_bytes()), - ))] + #[instrument(name = "App::execute_transaction", skip_all)] pub(crate) async fn execute_transaction( &mut self, signed_tx: Arc, ) -> anyhow::Result> { let signed_tx_2 = signed_tx.clone(); - let stateless = - tokio::spawn(async move { transaction::check_stateless(&signed_tx_2).await }); + let stateless = tokio::spawn( + async move { transaction::check_stateless(&signed_tx_2).await }.in_current_span(), + ); let signed_tx_2 = signed_tx.clone(); let state2 = self.state.clone(); - let stateful = - tokio::spawn(async move { transaction::check_stateful(&signed_tx_2, &state2).await }); + let stateful = tokio::spawn( + async move { transaction::check_stateful(&signed_tx_2, &state2).await } + .in_current_span(), + ); stateless .await diff --git a/crates/astria-sequencer/src/asset/state_ext.rs b/crates/astria-sequencer/src/asset/state_ext.rs index 4a40d1c29..84a0e3760 100644 --- a/crates/astria-sequencer/src/asset/state_ext.rs +++ b/crates/astria-sequencer/src/asset/state_ext.rs @@ -27,7 +27,7 @@ fn asset_storage_key>(asset: TAsset) -> String #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] async fn has_ibc_asset(&self, asset: TAsset) -> Result where TAsset: Into + std::fmt::Display + Send, @@ -39,7 +39,7 @@ pub(crate) trait StateReadExt: StateRead { .is_some()) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn map_ibc_to_trace_prefixed_asset( &self, asset: asset::IbcPrefixed, @@ -65,7 +65,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_ibc_asset(&mut self, asset: &denom::TracePrefixed) -> Result<()> { let bytes = borsh::to_vec(&DenominationTrace(asset.to_string())) .context("failed to serialize asset")?; diff --git a/crates/astria-sequencer/src/authority/component.rs b/crates/astria-sequencer/src/authority/component.rs index c3557fe28..0d1aa6eb0 100644 --- a/crates/astria-sequencer/src/authority/component.rs +++ b/crates/astria-sequencer/src/authority/component.rs @@ -34,7 +34,7 @@ pub(crate) struct AuthorityComponentAppState { impl Component for AuthorityComponent { type AppState = AuthorityComponentAppState; - #[instrument(name = "AuthorityComponent::init_chain", skip(state))] + #[instrument(name = "AuthorityComponent::init_chain", skip_all)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> { // set sudo key and initial validator set state @@ -47,7 +47,7 @@ impl Component for AuthorityComponent { Ok(()) } - #[instrument(name = "AuthorityComponent::begin_block", skip(state))] + #[instrument(name = "AuthorityComponent::begin_block", skip_all)] async fn begin_block( state: &mut Arc, begin_block: &BeginBlock, @@ -69,7 +69,7 @@ impl Component for AuthorityComponent { Ok(()) } - #[instrument(name = "AuthorityComponent::end_block", skip(state))] + #[instrument(name = "AuthorityComponent::end_block", skip_all)] async fn end_block( state: &mut Arc, _end_block: &EndBlock, diff --git a/crates/astria-sequencer/src/authority/state_ext.rs b/crates/astria-sequencer/src/authority/state_ext.rs index ccfee70bc..34adde273 100644 --- a/crates/astria-sequencer/src/authority/state_ext.rs +++ b/crates/astria-sequencer/src/authority/state_ext.rs @@ -107,7 +107,7 @@ const VALIDATOR_UPDATES_KEY: &[u8] = b"valupdates"; #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_sudo_address(&self) -> Result
{ let Some(bytes) = self .get_raw(SUDO_STORAGE_KEY) @@ -122,7 +122,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(crate::address::base_prefixed(address_bytes)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_validator_set(&self) -> Result { let Some(bytes) = self .get_raw(VALIDATOR_SET_STORAGE_KEY) @@ -138,7 +138,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(ValidatorSet(validator_set)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_validator_updates(&self) -> Result { let Some(bytes) = self .nonverifiable_get_raw(VALIDATOR_UPDATES_KEY) @@ -159,7 +159,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_sudo_address(&mut self, address: Address) -> Result<()> { self.put_raw( SUDO_STORAGE_KEY.to_string(), @@ -169,7 +169,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_validator_set(&mut self, validator_set: ValidatorSet) -> Result<()> { self.put_raw( VALIDATOR_SET_STORAGE_KEY.to_string(), @@ -178,7 +178,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_validator_updates(&mut self, validator_updates: ValidatorSet) -> Result<()> { self.nonverifiable_put_raw( VALIDATOR_UPDATES_KEY.to_vec(), @@ -188,7 +188,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn clear_validator_updates(&mut self) { self.nonverifiable_delete(VALIDATOR_UPDATES_KEY.to_vec()); } diff --git a/crates/astria-sequencer/src/bridge/component.rs b/crates/astria-sequencer/src/bridge/component.rs index e719d666a..cdc8f9b98 100644 --- a/crates/astria-sequencer/src/bridge/component.rs +++ b/crates/astria-sequencer/src/bridge/component.rs @@ -17,7 +17,7 @@ pub(crate) struct BridgeComponent; impl Component for BridgeComponent { type AppState = astria_core::sequencer::GenesisState; - #[instrument(name = "BridgeComponent::init_chain", skip(state))] + #[instrument(name = "BridgeComponent::init_chain", skip_all)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> { state.put_init_bridge_account_base_fee(app_state.fees().init_bridge_account_base_fee); state.put_bridge_lock_byte_cost_multiplier( @@ -27,7 +27,7 @@ impl Component for BridgeComponent { Ok(()) } - #[instrument(name = "BridgeComponent::begin_block", skip(_state))] + #[instrument(name = "BridgeComponent::begin_block", skip_all)] async fn begin_block( _state: &mut Arc, _begin_block: &BeginBlock, @@ -35,7 +35,7 @@ impl Component for BridgeComponent { Ok(()) } - #[instrument(name = "BridgeComponent::end_block", skip(_state))] + #[instrument(name = "BridgeComponent::end_block", skip_all)] async fn end_block( _state: &mut Arc, _end_block: &EndBlock, diff --git a/crates/astria-sequencer/src/bridge/state_ext.rs b/crates/astria-sequencer/src/bridge/state_ext.rs index ebd9f3132..a4ad85d2c 100644 --- a/crates/astria-sequencer/src/bridge/state_ext.rs +++ b/crates/astria-sequencer/src/bridge/state_ext.rs @@ -140,7 +140,7 @@ fn last_transaction_hash_for_bridge_account_storage_key(address: &Address) -> Ve #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_account_rollup_id(&self, address: &Address) -> Result> { let Some(rollup_id_bytes) = self .get_raw(&rollup_id_storage_key(address)) @@ -156,7 +156,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(Some(rollup_id)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_account_ibc_asset(&self, address: &Address) -> Result { let bytes = self .get_raw(&asset_id_storage_key(address)) @@ -168,7 +168,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(asset::IbcPrefixed::new(id.0)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_account_sudo_address( &self, bridge_address: &Address, @@ -187,7 +187,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(Some(sudo_address)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_account_withdrawer_address( &self, bridge_address: &Address, @@ -208,7 +208,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(Some(withdrawer_address)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_deposit_nonce(&self, rollup_id: &RollupId) -> Result { let bytes = self .nonverifiable_get_raw(&deposit_nonce_storage_key(rollup_id)) @@ -226,7 +226,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(nonce) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_deposit_rollup_ids(&self) -> Result> { let mut stream = std::pin::pin!(self.nonverifiable_prefix_raw(DEPOSIT_PREFIX.as_bytes())); let mut rollup_ids = HashSet::new(); @@ -247,7 +247,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(rollup_ids) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_deposit_events(&self, rollup_id: &RollupId) -> Result> { let mut stream = std::pin::pin!( self.nonverifiable_prefix_raw(deposit_storage_key_prefix(rollup_id).as_bytes()) @@ -261,7 +261,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(deposits) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_block_deposits(&self) -> Result>> { let deposit_rollup_ids = self .get_deposit_rollup_ids() @@ -278,7 +278,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(deposit_events) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_init_bridge_account_base_fee(&self) -> Result { let bytes = self .get_raw(INIT_BRIDGE_ACCOUNT_BASE_FEE_STORAGE_KEY) @@ -289,7 +289,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(fee) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_lock_byte_cost_multiplier(&self) -> Result { let bytes = self .get_raw(BRIDGE_LOCK_BYTE_COST_MULTIPLIER_STORAGE_KEY) @@ -300,7 +300,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(fee) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_bridge_sudo_change_base_fee(&self) -> Result { let bytes = self .get_raw(BRIDGE_SUDO_CHANGE_FEE_STORAGE_KEY) @@ -311,7 +311,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(fee) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_last_transaction_hash_for_bridge_account( &self, address: &Address, @@ -337,12 +337,12 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_bridge_account_rollup_id(&mut self, address: &Address, rollup_id: &RollupId) { self.put_raw(rollup_id_storage_key(address), rollup_id.to_vec()); } - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] fn put_bridge_account_ibc_asset( &mut self, address: &Address, @@ -359,7 +359,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_bridge_account_sudo_address( &mut self, bridge_address: &Address, @@ -371,7 +371,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_bridge_account_withdrawer_address( &mut self, bridge_address: &Address, @@ -386,7 +386,7 @@ pub(crate) trait StateWriteExt: StateWrite { // the deposit "nonce" for a given rollup ID during a given block. // this is only used to generate storage keys for each of the deposits within a block, // and is reset to 0 at the beginning of each block. - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_deposit_nonce(&mut self, rollup_id: &RollupId, nonce: u32) { self.nonverifiable_put_raw( deposit_nonce_storage_key(rollup_id), @@ -394,7 +394,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn put_deposit_event(&mut self, deposit: Deposit) -> Result<()> { let nonce = self.get_deposit_nonce(deposit.rollup_id()).await?; self.put_deposit_nonce( @@ -408,7 +408,7 @@ pub(crate) trait StateWriteExt: StateWrite { } // clears the deposit nonce and all deposits for for a given rollup ID. - #[instrument(skip(self))] + #[instrument(skip_all)] async fn clear_deposit_info(&mut self, rollup_id: &RollupId) { self.nonverifiable_delete(deposit_nonce_storage_key(rollup_id)); let mut stream = std::pin::pin!( @@ -419,7 +419,7 @@ pub(crate) trait StateWriteExt: StateWrite { } } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn clear_block_deposits(&mut self) -> Result<()> { let deposit_rollup_ids = self .get_deposit_rollup_ids() @@ -431,7 +431,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_init_bridge_account_base_fee(&mut self, fee: u128) { self.put_raw( INIT_BRIDGE_ACCOUNT_BASE_FEE_STORAGE_KEY.to_string(), @@ -439,7 +439,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_bridge_lock_byte_cost_multiplier(&mut self, fee: u128) { self.put_raw( BRIDGE_LOCK_BYTE_COST_MULTIPLIER_STORAGE_KEY.to_string(), @@ -447,7 +447,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_bridge_sudo_change_base_fee(&mut self, fee: u128) { self.put_raw( BRIDGE_SUDO_CHANGE_FEE_STORAGE_KEY.to_string(), @@ -455,7 +455,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_last_transaction_hash_for_bridge_account( &mut self, address: &Address, diff --git a/crates/astria-sequencer/src/grpc/sequencer.rs b/crates/astria-sequencer/src/grpc/sequencer.rs index f8fb17e0c..24fc09680 100644 --- a/crates/astria-sequencer/src/grpc/sequencer.rs +++ b/crates/astria-sequencer/src/grpc/sequencer.rs @@ -47,7 +47,7 @@ impl SequencerServer { #[async_trait::async_trait] impl SequencerService for SequencerServer { /// Given a block height, returns the sequencer block at that height. - #[instrument(skip_all, fields(height = request.get_ref().height))] + #[instrument(skip_all)] async fn get_sequencer_block( self: Arc, request: Request, @@ -77,7 +77,7 @@ impl SequencerService for SequencerServer { /// Given a block height and set of rollup ids, returns a SequencerBlock which /// is filtered to contain only the transactions that are relevant to the given rollup. - #[instrument(skip_all, fields(height = request.get_ref().height))] + #[instrument(skip_all)] async fn get_filtered_sequencer_block( self: Arc, request: Request, diff --git a/crates/astria-sequencer/src/ibc/component.rs b/crates/astria-sequencer/src/ibc/component.rs index 19aa1fcab..3a44b6865 100644 --- a/crates/astria-sequencer/src/ibc/component.rs +++ b/crates/astria-sequencer/src/ibc/component.rs @@ -29,7 +29,7 @@ pub(crate) struct IbcComponent; impl Component for IbcComponent { type AppState = astria_core::sequencer::GenesisState; - #[instrument(name = "IbcComponent::init_chain", skip(state))] + #[instrument(name = "IbcComponent::init_chain", skip_all)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> { Ibc::init_chain( &mut state, @@ -53,7 +53,7 @@ impl Component for IbcComponent { Ok(()) } - #[instrument(name = "IbcComponent::begin_block", skip(state))] + #[instrument(name = "IbcComponent::begin_block", skip_all)] async fn begin_block( state: &mut Arc, begin_block: &BeginBlock, @@ -62,7 +62,7 @@ impl Component for IbcComponent { Ok(()) } - #[instrument(name = "IbcComponent::end_block", skip(state))] + #[instrument(name = "IbcComponent::end_block", skip_all)] async fn end_block( state: &mut Arc, end_block: &EndBlock, diff --git a/crates/astria-sequencer/src/ibc/ics20_withdrawal.rs b/crates/astria-sequencer/src/ibc/ics20_withdrawal.rs index 93c76ba6e..e2677cdff 100644 --- a/crates/astria-sequencer/src/ibc/ics20_withdrawal.rs +++ b/crates/astria-sequencer/src/ibc/ics20_withdrawal.rs @@ -98,7 +98,7 @@ async fn ics20_withdrawal_check_stateful_bridge_account Result<()> { ensure!(self.timeout_time() != 0, "timeout time must be non-zero",); @@ -116,7 +116,7 @@ impl ActionHandler for action::Ics20Withdrawal { Ok(()) } - #[instrument(skip(self, state))] + #[instrument(skip_all)] async fn check_stateful( &self, state: &S, @@ -175,7 +175,7 @@ impl ActionHandler for action::Ics20Withdrawal { Ok(()) } - #[instrument(skip(self, state))] + #[instrument(skip_all)] async fn execute(&self, state: &mut S, from: Address) -> Result<()> { let fee = state .get_ics20_withdrawal_base_fee() diff --git a/crates/astria-sequencer/src/ibc/state_ext.rs b/crates/astria-sequencer/src/ibc/state_ext.rs index adda68485..3e979972c 100644 --- a/crates/astria-sequencer/src/ibc/state_ext.rs +++ b/crates/astria-sequencer/src/ibc/state_ext.rs @@ -67,7 +67,7 @@ fn ibc_relayer_key(address: &Address) -> String { #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] async fn get_ibc_channel_balance( &self, channel: &ChannelId, @@ -88,7 +88,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(balance) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_ibc_sudo_address(&self) -> Result
{ let Some(bytes) = self .get_raw(IBC_SUDO_STORAGE_KEY) @@ -103,7 +103,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(crate::address::base_prefixed(address_bytes)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn is_ibc_relayer(&self, address: &Address) -> Result { Ok(self .get_raw(&ibc_relayer_key(address)) @@ -112,7 +112,7 @@ pub(crate) trait StateReadExt: StateRead { .is_some()) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_ics20_withdrawal_base_fee(&self) -> Result { let Some(bytes) = self .get_raw(ICS20_WITHDRAWAL_BASE_FEE_STORAGE_KEY) @@ -130,7 +130,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self, asset), fields(%asset))] + #[instrument(skip_all)] fn put_ibc_channel_balance( &mut self, channel: &ChannelId, @@ -145,7 +145,7 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_ibc_sudo_address(&mut self, address: Address) -> Result<()> { self.put_raw( IBC_SUDO_STORAGE_KEY.to_string(), @@ -155,17 +155,17 @@ pub(crate) trait StateWriteExt: StateWrite { Ok(()) } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_ibc_relayer_address(&mut self, address: &Address) { self.put_raw(ibc_relayer_key(address), vec![]); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn delete_ibc_relayer_address(&mut self, address: &Address) { self.delete(ibc_relayer_key(address)); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_ics20_withdrawal_base_fee(&mut self, fee: u128) -> Result<()> { self.put_raw( ICS20_WITHDRAWAL_BASE_FEE_STORAGE_KEY.to_string(), diff --git a/crates/astria-sequencer/src/mempool/mod.rs b/crates/astria-sequencer/src/mempool/mod.rs index dcce7c3fc..ad76dd25d 100644 --- a/crates/astria-sequencer/src/mempool/mod.rs +++ b/crates/astria-sequencer/src/mempool/mod.rs @@ -35,7 +35,10 @@ use tokio::{ Instant, }, }; -use tracing::debug; +use tracing::{ + debug, + instrument, +}; type MempoolQueue = PriorityQueue; @@ -223,6 +226,7 @@ impl Mempool { /// returns the number of transactions in the mempool #[must_use] + #[instrument(skip_all)] pub(crate) async fn len(&self) -> usize { self.queue.read().await.len() } @@ -230,6 +234,7 @@ impl Mempool { /// inserts a transaction into the mempool /// /// note: the oldest timestamp from found priorities is maintained. + #[instrument(skip_all)] pub(crate) async fn insert( &self, tx: SignedTransaction, @@ -245,6 +250,7 @@ impl Mempool { /// inserts all the given transactions into the mempool /// /// note: the oldest timestamp from found priorities for an `EnqueuedTransaction` is maintained. + #[instrument(skip_all)] pub(crate) async fn insert_all(&self, txs: Vec<(EnqueuedTransaction, TransactionPriority)>) { let mut queue = self.queue.write().await; @@ -287,11 +293,13 @@ impl Mempool { /// pops the transaction with the highest priority from the mempool #[must_use] + #[instrument(skip_all)] pub(crate) async fn pop(&self) -> Option<(EnqueuedTransaction, TransactionPriority)> { self.queue.write().await.pop() } /// removes a transaction from the mempool + #[instrument(skip_all)] pub(crate) async fn remove(&self, tx_hash: [u8; 32]) { let (signed_tx, address) = dummy_signed_tx(); let enqueued_tx = EnqueuedTransaction { @@ -303,6 +311,7 @@ impl Mempool { } /// signal that the transaction should be removed from the `CometBFT` mempool + #[instrument(skip_all)] pub(crate) async fn track_removal_comet_bft(&self, tx_hash: [u8; 32], reason: RemovalReason) { self.comet_bft_removal_cache .write() @@ -312,6 +321,7 @@ impl Mempool { /// checks if a transaction was flagged to be removed from the `CometBFT` mempool /// and removes entry + #[instrument(skip_all)] pub(crate) async fn check_removed_comet_bft(&self, tx_hash: [u8; 32]) -> Option { self.comet_bft_removal_cache.write().await.remove(tx_hash) } @@ -321,6 +331,7 @@ impl Mempool { /// /// *NOTE*: this function locks the mempool until every tx has been checked. This could /// potentially stall consensus from moving to the next round if the mempool is large. + #[instrument(skip_all)] pub(crate) async fn run_maintenance( &self, current_account_nonce_getter: F, @@ -378,6 +389,7 @@ impl Mempool { /// returns the pending nonce for the given address, /// if it exists in the mempool. + #[instrument(skip_all)] pub(crate) async fn pending_nonce(&self, address: &Address) -> Option { let inner = self.queue.read().await; let mut nonce = None; diff --git a/crates/astria-sequencer/src/sequence/action.rs b/crates/astria-sequencer/src/sequence/action.rs index 31347d1e0..3b4353445 100644 --- a/crates/astria-sequencer/src/sequence/action.rs +++ b/crates/astria-sequencer/src/sequence/action.rs @@ -55,12 +55,7 @@ impl ActionHandler for SequenceAction { Ok(()) } - #[instrument( - skip_all, - fields( - from = from.to_string(), - ) - )] + #[instrument(skip_all)] async fn execute(&self, state: &mut S, from: Address) -> Result<()> { let fee = calculate_fee_from_state(&self.data, state) .await diff --git a/crates/astria-sequencer/src/sequence/component.rs b/crates/astria-sequencer/src/sequence/component.rs index 2a7c710dc..84265321a 100644 --- a/crates/astria-sequencer/src/sequence/component.rs +++ b/crates/astria-sequencer/src/sequence/component.rs @@ -17,7 +17,7 @@ pub(crate) struct SequenceComponent; impl Component for SequenceComponent { type AppState = astria_core::sequencer::GenesisState; - #[instrument(name = "SequenceComponent::init_chain", skip(state))] + #[instrument(name = "SequenceComponent::init_chain", skip_all)] async fn init_chain(mut state: S, app_state: &Self::AppState) -> Result<()> { state.put_sequence_action_base_fee(app_state.fees().sequence_base_fee); state.put_sequence_action_byte_cost_multiplier( @@ -26,7 +26,7 @@ impl Component for SequenceComponent { Ok(()) } - #[instrument(name = "SequenceComponent::begin_block", skip(_state))] + #[instrument(name = "SequenceComponent::begin_block", skip_all)] async fn begin_block( _state: &mut Arc, _begin_block: &BeginBlock, @@ -34,7 +34,7 @@ impl Component for SequenceComponent { Ok(()) } - #[instrument(name = "SequenceComponent::end_block", skip(_state))] + #[instrument(name = "SequenceComponent::end_block", skip_all)] async fn end_block( _state: &mut Arc, _end_block: &EndBlock, diff --git a/crates/astria-sequencer/src/sequence/state_ext.rs b/crates/astria-sequencer/src/sequence/state_ext.rs index 50345e42e..ad17e4ef7 100644 --- a/crates/astria-sequencer/src/sequence/state_ext.rs +++ b/crates/astria-sequencer/src/sequence/state_ext.rs @@ -23,7 +23,7 @@ struct Fee(u128); #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_sequence_action_base_fee(&self) -> Result { let bytes = self .get_raw(SEQUENCE_ACTION_BASE_FEE_STORAGE_KEY) @@ -34,7 +34,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(fee) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_sequence_action_byte_cost_multiplier(&self) -> Result { let bytes = self .get_raw(SEQUENCE_ACTION_BYTE_COST_MULTIPLIER_STORAGE_KEY) @@ -50,7 +50,7 @@ impl StateReadExt for T {} #[async_trait] pub(crate) trait StateWriteExt: StateWrite { - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_sequence_action_base_fee(&mut self, fee: u128) { self.put_raw( SEQUENCE_ACTION_BASE_FEE_STORAGE_KEY.to_string(), @@ -58,7 +58,7 @@ pub(crate) trait StateWriteExt: StateWrite { ); } - #[instrument(skip(self))] + #[instrument(skip_all)] fn put_sequence_action_byte_cost_multiplier(&mut self, fee: u128) { self.put_raw( SEQUENCE_ACTION_BYTE_COST_MULTIPLIER_STORAGE_KEY.to_string(), diff --git a/crates/astria-sequencer/src/service/consensus.rs b/crates/astria-sequencer/src/service/consensus.rs index acb92a0a8..7e8a6e824 100644 --- a/crates/astria-sequencer/src/service/consensus.rs +++ b/crates/astria-sequencer/src/service/consensus.rs @@ -115,11 +115,7 @@ impl Consensus { }) } - #[instrument(skip_all, fields( - chain_id = init_chain.chain_id, - time = %init_chain.time, - init_height = %init_chain.initial_height - ))] + #[instrument(skip_all)] async fn init_chain( &mut self, init_chain: request::InitChain, @@ -159,11 +155,7 @@ impl Consensus { }) } - #[instrument(skip_all, fields( - height = %prepare_proposal.height, - tx_count = prepare_proposal.txs.len(), - time = %prepare_proposal.time - ))] + #[instrument(skip_all)] async fn handle_prepare_proposal( &mut self, prepare_proposal: request::PrepareProposal, @@ -173,14 +165,7 @@ impl Consensus { .await } - #[instrument(skip_all, fields( - height = %process_proposal.height, - time = %process_proposal.time, - tx_count = process_proposal.txs.len(), - proposer = %process_proposal.proposer_address, - hash = %telemetry::display::base64(&process_proposal.hash), - next_validators_hash = %telemetry::display::base64(&process_proposal.next_validators_hash), - ))] + #[instrument(skip_all)] async fn handle_process_proposal( &mut self, process_proposal: request::ProcessProposal, @@ -192,12 +177,7 @@ impl Consensus { Ok(()) } - #[instrument(skip_all, fields( - hash = %finalize_block.hash, - height = %finalize_block.height, - time = %finalize_block.time, - proposer = %finalize_block.proposer_address - ))] + #[instrument(skip_all)] async fn finalize_block( &mut self, finalize_block: request::FinalizeBlock, diff --git a/crates/astria-sequencer/src/service/info/mod.rs b/crates/astria-sequencer/src/service/info/mod.rs index 873383e71..121e85f4b 100644 --- a/crates/astria-sequencer/src/service/info/mod.rs +++ b/crates/astria-sequencer/src/service/info/mod.rs @@ -88,7 +88,7 @@ impl Info { }) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn handle_info_request(self, request: InfoRequest) -> Result { match request { InfoRequest::Info(_) => { diff --git a/crates/astria-sequencer/src/service/mempool.rs b/crates/astria-sequencer/src/service/mempool.rs index dc93c3e99..7f48d2058 100644 --- a/crates/astria-sequencer/src/service/mempool.rs +++ b/crates/astria-sequencer/src/service/mempool.rs @@ -28,7 +28,10 @@ use tendermint::v0_38::abci::{ }; use tower::Service; use tower_abci::BoxError; -use tracing::Instrument as _; +use tracing::{ + instrument, + Instrument as _, +}; use crate::{ accounts::state_ext::StateReadExt, @@ -98,6 +101,7 @@ impl Service for Mempool { /// /// If the tx passes all checks, status code 0 is returned. #[allow(clippy::too_many_lines)] +#[instrument(skip_all)] async fn handle_check_tx( req: request::CheckTx, state: S, diff --git a/crates/astria-sequencer/src/state_ext.rs b/crates/astria-sequencer/src/state_ext.rs index f8d4d7795..ec6daf580 100644 --- a/crates/astria-sequencer/src/state_ext.rs +++ b/crates/astria-sequencer/src/state_ext.rs @@ -38,7 +38,7 @@ fn fee_asset_key>(asset: TAsset) -> String { #[async_trait] pub(crate) trait StateReadExt: StateRead { - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_chain_id(&self) -> Result { let Some(bytes) = self .get_raw("chain_id") @@ -54,7 +54,7 @@ pub(crate) trait StateReadExt: StateRead { .expect("only valid chain ids should be stored in the state")) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_revision_number(&self) -> Result { let Some(bytes) = self .get_raw(REVISION_NUMBER_KEY) @@ -74,7 +74,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(u64::from_be_bytes(bytes)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_block_height(&self) -> Result { let Some(bytes) = self .get_raw("block_height") @@ -89,7 +89,7 @@ pub(crate) trait StateReadExt: StateRead { Ok(u64::from_be_bytes(bytes)) } - #[instrument(skip(self))] + #[instrument(skip_all)] async fn get_block_timestamp(&self) -> Result