Skip to content

Commit

Permalink
remove gum dependency on jaeger (#2106)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcin S <marcin@realemail.net>
  • Loading branch information
jpserrat and mrcnski authored Nov 1, 2023
1 parent 00b85c5 commit 2726d5a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 28 deletions.
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

0 comments on commit 2726d5a

Please sign in to comment.