Skip to content

Commit

Permalink
session: simplify debug logging
Browse files Browse the repository at this point in the history
These loglines were for helping debug #37. Now that it's closed, they
can be removed as they are quite noisy.
  • Loading branch information
tony-iqlusion committed Oct 22, 2020
1 parent 421cdc1 commit 58c412c
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,9 @@ impl Session {
request.validate()?;
self.check_max_height(&mut request)?;

debug!(
"[{}@{}] acquiring chain registry",
&self.config.chain_id, &self.config.addr
);

let registry = chain::REGISTRY.get();

debug!(
"[{}@{}] acquiring read-only shared lock on chain",
&self.config.chain_id, &self.config.addr
);

let chain = registry
.get_chain(&self.config.chain_id)
.unwrap_or_else(|| {
Expand All @@ -164,11 +155,6 @@ impl Session {
let mut to_sign = vec![];
request.sign_bytes(self.config.chain_id, &mut to_sign)?;

debug!(
"[{}@{}] performing signature",
&self.config.chain_id, &self.config.addr
);

let started_at = Instant::now();

// TODO(ismail): figure out which key to use here instead of taking the only key
Expand Down Expand Up @@ -214,18 +200,8 @@ impl Session {
{
let (msg_type, request_state) = parse_request(request)?;

debug!(
"[{}@{}] acquiring read-write exclusive lock on chain",
&self.config.chain_id, &self.config.addr
);

let mut chain_state = chain.state.lock().unwrap();

debug!(
"[{}@{}] updating consensus state to: {:?}",
&self.config.chain_id, &self.config.addr, &request_state
);

match chain_state.update_consensus_state(request_state.clone()) {
Ok(()) => Ok(None),
Err(e) if e.kind() == StateErrorKind::DoubleSign => {
Expand All @@ -251,18 +227,8 @@ impl Session {

/// Get the public key for (the only) public key in the keyring
fn get_public_key(&mut self, _request: &PubKeyRequest) -> Result<Response, Error> {
debug!(
"[{}@{}] acquiring chain registry (for public key)",
&self.config.chain_id, &self.config.addr
);

let registry = chain::REGISTRY.get();

debug!(
"[{}@{}] acquiring read-only shared lock on chain",
&self.config.chain_id, &self.config.addr
);

let chain = registry
.get_chain(&self.config.chain_id)
.unwrap_or_else(|| {
Expand Down

0 comments on commit 58c412c

Please sign in to comment.