-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] State Tracing #92
Conversation
- raise_fd_limit in polkadot-archive - wait on insert of blocks before continuing to index blocks
…ve into state-tracing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some nitpicks. I have a hard time seeing where this is heading and I could use a better description; it seems like this PR doesn't doesn't store the traces anywhere?
I am also a little concerned about having to fork polkadot for this – what do we need from upstream to reach a stable point? After all our end goal here is to provide a production quality state tracing tool so it's critical that we have a good maintenance story and a stable situation upstream. Can you elaborate a bit on what the plan is?
tempfile = "3.1.0" | ||
async-executor = "0.1.2" | ||
arc-swap = "0.4.7" | ||
sp-database = { git = "https://github.com/paritytech/substrate", package="sp-database" , rev = "35fe3cd1bc4b64cadb0bc6196ae40173db65bb28" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rev 35fe3cd1bc4b64cadb0bc6196ae40173db65bb28
is rather old (Aug 26) – what is stopping us from using master
or 2.0
, i.e. what motivated the change?
pub KsmExec, | ||
ksm_rt::api::dispatch, | ||
ksm_rt::native_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funny whitespace
v => { | ||
if v? == 0 { | ||
smol::Timer::new(std::time::Duration::from_millis(3600)).await; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can do something like
Ok(v) if v == 0 => { … … },
Ok(_) => {} // but maybe we want to log something here?
Err(FailedLoadingJob) => { … … }
Not sure if it's better, but sometimes explicit is good.
use sc_tracing::{SpanDatum, TraceEvent, TraceHandler, ProfilingSubscriber}; | ||
use xtra::prelude::*; | ||
|
||
const TRACE_TARGETS: &str = "assets,atomic-swap,aura,authority-discovery,authorship, \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we obtain this list? Can we do anything smart here? Can we stick them in a toml file at least? Ideally we should have an RPC to ask the node about the supported targets.
log::info!("Got message"); | ||
println!("Outside"); | ||
if let Some(a) = self.addr.as_ref() { | ||
println!("Inside"); | ||
let _ = a.do_send(SpanMessage(sd)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funny whitespace and spurious println
?
let sub = ProfilingSubscriber::new_with_handler(Box::new(self.clone()), TRACE_TARGETS); | ||
let addr = ctx.address().expect("Actor just started"); | ||
self.addr = Some(addr); | ||
tracing::subscriber::set_global_default(sub).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use expect
@@ -125,8 +132,8 @@ fn execution_strategies() -> ExecutionStrategies { | |||
ExecutionStrategies { | |||
syncing: ExecutionStrategy::NativeElseWasm, | |||
importing: ExecutionStrategy::NativeElseWasm, | |||
block_construction: ExecutionStrategy::NativeElseWasm, | |||
offchain_worker: ExecutionStrategy::NativeWhenPossible, | |||
block_construction: ExecutionStrategy::NativeWhenPossible, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dumb q: how is NativeWhenPossible
different from NativeElseWasm
?
Closing in favor of #134 |
Preliminary state tracing support for native runtimes
related:
paritytech/substrate#6916
paritytech/substrate#5826
paritytech/substrate#6672