Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Facilitate debugging #132

Merged
merged 4 commits into from
Aug 20, 2018
Merged

Facilitate debugging #132

merged 4 commits into from
Aug 20, 2018

Conversation

nhynes
Copy link
Contributor

@nhynes nhynes commented Aug 19, 2018

fixes #94

@nhynes nhynes requested a review from peterjgilbert August 19, 2018 20:03
@@ -37,14 +37,14 @@ jsonrpc_client!(pub struct Web3Client {
// scenarios
fn eth_blockNumber(client: &mut Web3Client<HttpHandle>) {
let res = client.eth_blockNumber().call();
debug!("result: {:?}", res);
info!("result: {:?}", res);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be debug

}

fn eth_getBlockByNumber(client: &mut Web3Client<HttpHandle>) {
let res = client
.eth_getBlockByNumber("latest".to_string(), true)
.call();
debug!("result: {:?}", res);
info!("result: {:?}", res);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should stay debug

@@ -64,7 +64,7 @@ fn run_scenario(
threads: usize,
number: usize,
) {
info!("Starting {} benchmark...", name);
debug!("Starting {} benchmark...", name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be info

@@ -89,7 +89,7 @@ fn run_scenario(
let end = Instant::now();
let total = counter.load(Ordering::SeqCst);
let duration = end - start;
info!(
debug!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be info

@@ -32,6 +32,8 @@ use jsonrpc_core::futures::future;
use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_macros::Trailing;

use log;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -575,7 +577,11 @@ impl Eth for EthClient {
fn send_raw_transaction(&self, raw: Bytes) -> Result<RpcH256> {
measure_counter_inc!("sendRawTransaction");
measure_histogram_timer!("sendRawTransaction_time");
info!("eth_sendRawTransaction(data: {:?})", raw);
if log_enabled!(log::Level::Trace) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to keep dumping the payload at debug level for now (this will be the level we run in prod testnet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just increase the verbosity of the prod testnet gateway using the -vvvv flag? the point of this change is to have ultra-verbose print-the-entire-100kb-contract-bytes at a different level than the lighter messages

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that we get a lot of unwanted stuff from a number other libraries at trace level. I would prefer to use debug rather than explicitly filtering out all of those libraries.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, then how about we make this debug and make everything else info?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works!

.get_matches();

// reset max log level to Info after default_app macro sets it to Trace
log::set_max_level(LevelFilter::Info);
log::set_max_level(match args.occurrences_of("v") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure that a corresponding change goes in to https://github.com/oasislabs/private-ops/blob/master/k8s/ekiden/templates/gateway.yaml to set the level to debug for testnet deployments.

@nhynes nhynes merged commit a2cf74f into master Aug 20, 2018
@nhynes nhynes deleted the debug++ branch August 20, 2018 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

consider exposing debugging sendRawTransaction w3 call
2 participants