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

Facilitate debugging#132

Merged
nhynes merged 4 commits intomasterfrom
debug++
Aug 20, 2018
Merged

Facilitate debugging#132
nhynes merged 4 commits intomasterfrom
debug++

Conversation

@nhynes
Copy link
Copy Markdown
Contributor

@nhynes nhynes commented Aug 19, 2018

fixes #94

@nhynes nhynes requested a review from peterjgilbert August 19, 2018 20:03
fn eth_blockNumber(client: &mut Web3Client<HttpHandle>) {
let res = client.eth_blockNumber().call();
debug!("result: {:?}", res);
info!("result: {:?}", res);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be debug

.eth_getBlockByNumber("latest".to_string(), true)
.call();
debug!("result: {:?}", res);
info!("result: {:?}", res);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also should stay debug

number: usize,
) {
info!("Starting {} benchmark...", name);
debug!("Starting {} benchmark...", name);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should be info

let total = counter.load(Ordering::SeqCst);
let duration = end - start;
info!(
debug!(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should be info

use jsonrpc_core::{BoxFuture, Result};
use jsonrpc_macros::Trailing;

use log;
Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes

measure_counter_inc!("sendRawTransaction");
measure_histogram_timer!("sendRawTransaction_time");
info!("eth_sendRawTransaction(data: {:?})", raw);
if log_enabled!(log::Level::Trace) {
Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That works!


// 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
Copy Markdown
Collaborator

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