Skip to content

Commit

Permalink
[refactor]: re-arrange telemetry features
Browse files Browse the repository at this point in the history
- remove `tokio_console_address` configuration
- leverage default ENVs for tokio console config
- `iroha_logger/tokio-console` feature fully controls
  whether it is enabled
- refactoring chores

Signed-off-by: Dmitry Balashov <[email protected]>
  • Loading branch information
0x009922 committed Mar 21, 2024
1 parent b749b6a commit fd557a8
Show file tree
Hide file tree
Showing 14 changed files with 360 additions and 234 deletions.
248 changes: 189 additions & 59 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ categories = ["cryptography::cryptocurrencies"]

[workspace.dependencies]
iroha = { path = "cli" }
iroha_dsl = { version = "=2.0.0-pre-rc.20", path = "dsl" }
iroha_torii = { version = "=2.0.0-pre-rc.20", path = "torii" }
iroha_torii_derive = { version = "=2.0.0-pre-rc.20", path = "torii/derive" }
iroha_torii_const = { version = "=2.0.0-pre-rc.20", path = "torii/const" }
Expand Down Expand Up @@ -51,14 +50,10 @@ iroha_wasm_builder = { version = "=2.0.0-pre-rc.20", path = "wasm_builder" }
iroha_smart_contract = { version = "=2.0.0-pre-rc.20", path = "smart_contract" }
iroha_smart_contract_derive = { version = "=2.0.0-pre-rc.20", path = "smart_contract/derive" }
iroha_smart_contract_utils = { version = "=2.0.0-pre-rc.20", path = "smart_contract/utils" }
iroha_executor = { version = "=2.0.0-pre-rc.20", path = "smart_contract/executor" }
iroha_executor_derive = { version = "=2.0.0-pre-rc.20", path = "smart_contract/executor/derive" }
iroha_trigger = { version = "=2.0.0-pre-rc.20", path = "smart_contract/trigger" }
iroha_trigger_derive = { version = "=2.0.0-pre-rc.20", path = "smart_contract/trigger/derive" }

test_network = { version = "=2.0.0-pre-rc.20", path = "core/test_network" }

proc-macro-error = "1.0.4"
proc-macro2 = "1.0.69"
syn = { version = "2.0.38", default-features = false }
quote = "1.0.33"
Expand All @@ -71,8 +66,6 @@ tokio = "1.33.0"
tokio-stream = "0.1.14"
tokio-tungstenite = "0.20.1"
tungstenite = "0.20.1"

crossbeam = "0.8.2"
crossbeam-queue = "0.3.8"
parking_lot = { version = "0.12.1" }

Expand All @@ -98,10 +91,8 @@ owo-colors = "3.5.0"
supports-color = "2.1.0"
inquire = "0.6.2"
spinoff = "0.8.0"
duct = "0.13.6"

criterion = "0.5.1"
proptest = "1.3.1"
expect-test = "1.4.1"

eyre = "0.6.8"
Expand Down Expand Up @@ -138,117 +129,256 @@ toml = "0.8.8"
rustdoc.private_doc_tests = "deny"

rust.anonymous_parameters = "deny"

rust.future_incompatible = "deny"

rust.missing_copy_implementations = "deny"

rust.missing_docs = "deny"

rust.nonstandard_style = "deny"

rust.rust_2018_idioms = "deny"

rust.trivial_casts = "deny"

rust.trivial_numeric_casts = "deny"

rust.unsafe_code = "deny"

rust.unused = "deny"

rust.unused_import_braces = "deny"

rust.variant_size_differences = "deny"

rust.explicit_outlives_requirements = "deny"

rust.non_ascii_idents = "deny"

rust.elided_lifetimes_in_paths = "allow"

rust.unknown_lints = "warn"

rust.single_use_lifetimes = "warn"

rust.unused_lifetimes = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.pedantic = { level = "warn", priority = -1 }
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.match_wildcard_for_single_variants = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.semicolon_if_nothing_returned = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.wildcard_imports = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.manual_let_else = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.enum_glob_use = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.module_name_repetitions = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.must_use_candidate = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.missing_panics_doc = "allow"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# restriction
# pedantic
clippy.dbg_macro = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# nursery
# pedantic
clippy.debug_assert_with_mut_call = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.derive_partial_eq_without_eq = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.empty_line_after_outer_attr = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.fallible_impl_from = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.future_not_send = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.iter_with_drain = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.mutex_integer = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.needless_collect = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.path_buf_push_overwrite = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.suboptimal_flops = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.trailing_empty_array = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.transmute_undefined_repr = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.trivial_regex = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.unused_peekable = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.unused_rounding = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.option_if_let_else = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.or_fun_call = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.redundant_pub_crate = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.string_lit_as_bytes = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.suspicious_operation_groupings = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.useless_let_if_seq = "warn"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

#cargo
# pedantic
clippy.redundant_feature_names = "deny"
# TODO: reenable
# rust.unsafe_op_in_unsafe_fn = "deny"

# pedantic
clippy.wildcard_dependencies = "deny"

[workspace]
resolver = "2"
members = [
"cli",
"client",
"client_cli",
"config",
"config/base",
"core",
"core/test_network",
"crypto",
"data_model",
"genesis",
"primitives",
"primitives/derive",
"primitives/numeric",
"ffi",
"ffi/derive",
"futures",
"futures/derive",
"logger",
"macro",
"macro/derive",
"macro/utils",
"p2p",
"schema",
"schema/derive",
"schema/gen",
"smart_contract",
"smart_contract/derive",
"smart_contract/trigger",
"smart_contract/trigger/derive",
"smart_contract/utils",
"smart_contract/executor",
"smart_contract/executor/derive",
"telemetry",
"tools/kagami",
"tools/kura_inspector",
"tools/parity_scale_decoder",
"tools/swarm",
"tools/wasm_builder_cli",
"tools/wasm_test_runner",
"torii",
"torii/derive",
"torii/const",
"version",
"version/derive",
"wasm_codec",
"wasm_codec/derive",
"wasm_builder",
"cli",
"client",
"client_cli",
"config",
"config/base",
"core",
"core/test_network",
"crypto",
"data_model",
"genesis",
"primitives",
"primitives/derive",
"primitives/numeric",
"ffi",
"ffi/derive",
"futures",
"futures/derive",
"logger",
"macro",
"macro/derive",
"macro/utils",
"p2p",
"schema",
"schema/derive",
"schema/gen",
"smart_contract",
"smart_contract/derive",
"smart_contract/trigger",
"smart_contract/trigger/derive",
"smart_contract/utils",
"smart_contract/executor",
"smart_contract/executor/derive",
"telemetry",
"tools/kagami",
"tools/kura_inspector",
"tools/parity_scale_decoder",
"tools/swarm",
"tools/wasm_builder_cli",
"tools/wasm_test_runner",
"torii",
"torii/derive",
"torii/const",
"version",
"version/derive",
"wasm_codec",
"wasm_codec/derive",
"wasm_builder",
]

[profile.deploy]
Expand Down
10 changes: 6 additions & 4 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ default = ["telemetry", "schema-endpoint"]
telemetry = ["iroha_telemetry", "iroha_core/telemetry", "iroha_torii/telemetry"]
# Support developer-specific telemetry.
# Should not be enabled on production builds.
dev-telemetry = ["iroha_core/dev-telemetry", "iroha_telemetry"]
# Tokio Console is configured via ENV:
# https://docs.rs/console-subscriber/0.2.0/console_subscriber/struct.Builder.html#method.with_default_env
dev-telemetry = ["telemetry", "iroha_telemetry/dev-telemetry", "iroha_logger/tokio-console"]
# Support schema generation from the `schema` endpoint in the local binary.
# Useful for debugging issues with decoding in SDKs.
schema-endpoint = ["iroha_torii/schema"]
Expand Down Expand Up @@ -79,8 +81,8 @@ vergen = { workspace = true, features = ["cargo"] }

[package.metadata.cargo-all-features]
denylist = [
"schema-endpoint",
"telemetry",
"test-network",
"schema-endpoint",
"telemetry",
"test-network",
]
skip_optional_dependencies = true
Loading

0 comments on commit fd557a8

Please sign in to comment.