From 227a13f2d26e3d868ab31fe6ea16dc4ad2f8c052 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Tue, 28 Jul 2020 18:28:51 -0600 Subject: [PATCH] Fill out missing RPC request received debug logging --- core/src/rpc.rs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 002cb0ec41..d4026562b9 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -1220,6 +1220,7 @@ impl RpcSol for RpcSolImpl { } fn get_cluster_nodes(&self, meta: Self::Metadata) -> Result> { + debug!("get_cluster_nodes rpc request received"); let cluster_info = &meta.cluster_info; fn valid_address_or_none(addr: &SocketAddr) -> Option { if ContactInfo::is_valid_address(addr) { @@ -1257,6 +1258,7 @@ impl RpcSol for RpcSolImpl { meta: Self::Metadata, commitment: Option, ) -> Result { + debug!("get_epoch_info rpc request received"); let bank = meta.bank(commitment)?; let epoch_schedule = bank.epoch_schedule(); @@ -1277,6 +1279,7 @@ impl RpcSol for RpcSolImpl { meta: Self::Metadata, block: Slot, ) -> Result> { + debug!("get_block_commitment rpc request received"); Ok(meta.get_block_commitment(block)) } @@ -1295,6 +1298,8 @@ impl RpcSol for RpcSolImpl { let slot = slot.unwrap_or_else(|| bank.slot()); let epoch = bank.epoch_schedule().get_epoch(slot); + debug!("get_leader_schedule rpc request received: {:?}", slot); + Ok( solana_ledger::leader_schedule_utils::leader_schedule(epoch, &bank).map( |leader_schedule| { @@ -1367,6 +1372,10 @@ impl RpcSol for RpcSolImpl { signature_str: String, commitment: Option, ) -> Result>> { + debug!( + "get_signature_status rpc request received: {:?}", + signature_str + ); let signature = verify_signature(&signature_str)?; Ok(meta.get_signature_status(signature, commitment)) } @@ -1377,6 +1386,10 @@ impl RpcSol for RpcSolImpl { signature_strs: Vec, config: Option, ) -> RpcResponse>> { + debug!( + "get_signature_statuses rpc request received: {:?}", + signature_strs.len() + ); if signature_strs.len() > MAX_GET_SIGNATURE_STATUSES_QUERY_ITEMS { return Err(Error::invalid_params(format!( "Too many inputs provided; max {}", @@ -1391,6 +1404,7 @@ impl RpcSol for RpcSolImpl { } fn get_slot(&self, meta: Self::Metadata, commitment: Option) -> Result { + debug!("get_slot rpc request received"); meta.get_slot(commitment) } @@ -1437,6 +1451,7 @@ impl RpcSol for RpcSolImpl { lamports: u64, commitment: Option, ) -> Result { + debug!("request_airdrop rpc request received"); trace!( "request_airdrop id={} lamports={} commitment: {:?}", pubkey_str, @@ -1481,6 +1496,7 @@ impl RpcSol for RpcSolImpl { data: String, config: Option, ) -> Result { + debug!("send_transaction rpc request received"); let config = config.unwrap_or_default(); let (wire_transaction, transaction) = deserialize_bs58_transaction(data)?; let signature = transaction.signatures[0]; @@ -1528,6 +1544,7 @@ impl RpcSol for RpcSolImpl { data: String, config: Option, ) -> RpcResponse { + debug!("simulate_transaction rpc request received"); let (_, transaction) = deserialize_bs58_transaction(data)?; let config = config.unwrap_or_default(); @@ -1560,10 +1577,12 @@ impl RpcSol for RpcSolImpl { meta: Self::Metadata, commitment: Option, ) -> Result { + debug!("get_slot_leader rpc request received"); meta.get_slot_leader(commitment) } fn minimum_ledger_slot(&self, meta: Self::Metadata) -> Result { + debug!("minimum_ledger_slot rpc request received"); meta.minimum_ledger_slot() } @@ -1572,6 +1591,7 @@ impl RpcSol for RpcSolImpl { meta: Self::Metadata, commitment: Option, ) -> Result { + debug!("get_vote_accounts rpc request received"); meta.get_vote_accounts(commitment) } @@ -1600,22 +1620,26 @@ impl RpcSol for RpcSolImpl { } fn validator_exit(&self, meta: Self::Metadata) -> Result { + debug!("validator_exit rpc request received"); meta.validator_exit() } fn get_identity(&self, meta: Self::Metadata) -> Result { + debug!("get_identity rpc request received"); Ok(RpcIdentity { identity: meta.config.identity_pubkey.to_string(), }) } fn get_version(&self, _: Self::Metadata) -> Result { + debug!("get_version rpc request received"); Ok(RpcVersionInfo { solana_core: solana_version::Version::default().to_string(), }) } fn set_log_filter(&self, meta: Self::Metadata, filter: String) -> Result<()> { + debug!("set_log_filter rpc request received"); meta.set_log_filter(filter) } @@ -1625,6 +1649,7 @@ impl RpcSol for RpcSolImpl { slot: Slot, encoding: Option, ) -> Result> { + debug!("get_confirmed_block rpc request received: {:?}", slot); meta.get_confirmed_block(slot, encoding) } @@ -1634,6 +1659,10 @@ impl RpcSol for RpcSolImpl { start_slot: Slot, end_slot: Option, ) -> Result> { + debug!( + "get_confirmed_blocks rpc request received: {:?}-{:?}", + start_slot, end_slot + ); meta.get_confirmed_blocks(start_slot, end_slot) } @@ -1647,6 +1676,10 @@ impl RpcSol for RpcSolImpl { signature_str: String, encoding: Option, ) -> Result> { + debug!( + "get_confirmed_transaction rpc request received: {:?}", + signature_str + ); let signature = verify_signature(&signature_str)?; meta.get_confirmed_transaction(signature, encoding) } @@ -1658,6 +1691,10 @@ impl RpcSol for RpcSolImpl { start_slot: Slot, end_slot: Slot, ) -> Result> { + debug!( + "get_confirmed_signatures_for_address rpc request received: {:?} {:?}-{:?}", + pubkey_str, start_slot, end_slot + ); let pubkey = verify_pubkey(pubkey_str)?; if end_slot < start_slot { return Err(Error::invalid_params(format!( @@ -1681,6 +1718,7 @@ impl RpcSol for RpcSolImpl { } fn get_first_available_block(&self, meta: Self::Metadata) -> Result { + debug!("get_first_available_block rpc request received"); meta.get_first_available_block() }