Skip to content
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

remove gum dependency on jaeger #2106

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions polkadot/node/core/pvf/execute-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ license.workspace = true

[dependencies]
cpu-time = "1.0.0"
futures = "0.3.21"
gum = { package = "tracing-gum", path = "../../../gum" }
rayon = "1.5.1"

parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] }

polkadot-node-core-pvf-common = { path = "../common" }
polkadot-parachain-primitives = { path = "../../../../parachain" }
polkadot-primitives = { path = "../../../../primitives" }

sp-core = { path = "../../../../../substrate/primitives/core" }
sp-maybe-compressed-blob = { path = "../../../../../substrate/primitives/maybe-compressed-blob" }
sp-tracing = { path = "../../../../../substrate/primitives/tracing" }

[features]
builder = []
6 changes: 0 additions & 6 deletions polkadot/node/core/pvf/prepare-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ license.workspace = true

[dependencies]
cfg-if = "1.0"
futures = "0.3.21"
gum = { package = "tracing-gum", path = "../../../gum" }
libc = "0.2.139"
rayon = "1.5.1"
Expand All @@ -17,15 +16,10 @@ tikv-jemalloc-ctl = { version = "0.5.0", optional = true }
parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] }

polkadot-node-core-pvf-common = { path = "../common" }
polkadot-parachain-primitives = { path = "../../../../parachain" }
polkadot-primitives = { path = "../../../../primitives" }

sc-executor = { path = "../../../../../substrate/client/executor" }
sc-executor-common = { path = "../../../../../substrate/client/executor/common" }
sc-executor-wasmtime = { path = "../../../../../substrate/client/executor/wasmtime" }
sp-io = { path = "../../../../../substrate/primitives/io" }
sp-maybe-compressed-blob = { path = "../../../../../substrate/primitives/maybe-compressed-blob" }
sp-tracing = { path = "../../../../../substrate/primitives/tracing" }

[target.'cfg(target_os = "linux")'.dependencies]
tikv-jemalloc-ctl = "0.5.0"
Expand Down
3 changes: 1 addition & 2 deletions polkadot/node/gum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ description = "Stick logs together with the TraceID as provided by tempo"
[dependencies]
coarsetime = "0.1.22"
tracing = "0.1.35"
jaeger = { package = "polkadot-node-jaeger" , path = "../jaeger" }
gum-proc-macro = { package = "tracing-gum-proc-macro" , path = "proc-macro" }
gum-proc-macro = { package = "tracing-gum-proc-macro", path = "proc-macro" }
polkadot-primitives = { path = "../../primitives", features = ["std"] }
19 changes: 17 additions & 2 deletions polkadot/node/gum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,23 @@

pub use tracing::{enabled, event, Level};

#[doc(hidden)]
pub use jaeger::hash_to_trace_identifier;
// jaeger dependency

/// Alias for the 16 byte unique identifier used with jaeger.
pub(crate) type TraceIdentifier = u128;

/// A helper to convert the hash to the fixed size representation
/// needed for jaeger.
#[inline]
pub fn hash_to_trace_identifier(hash: Hash) -> TraceIdentifier {
let mut buf = [0u8; 16];
buf.copy_from_slice(&hash.as_ref()[0..16]);
// The slice bytes are copied in reading order, so if interpreted
// in string form by a human, that means lower indices have higher
// values and hence corresponds to BIG endian ordering of the individual
// bytes.
u128::from_be_bytes(buf) as TraceIdentifier
}

#[doc(hidden)]
pub use polkadot_primitives::{CandidateHash, Hash};
Expand Down
Loading